Question on postprocessing argument #8
Labels
No Label
FAQ
bug
enhancement
needsInfo
notReproduced
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: glen/tablepress-pods#8
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello,
I dont know if I should have posted this here but I dont know where else to ask.
It says on the wiki:
Can you provide an example of how this can be used?
I have the following table (attached) for managing procurements and I need to remove the link for rows that dont have "НЭЭЛТТЭЙ" on the 3rd column.
Or can I use this to show the rows that have "НЭЭЛТТЭЙ" to the top with this?
Thanks.
Asking here is totally fine! Happy to help. Are you able to share the Tablepress table contents that is producing this table (Both images attached to the issue looked the same to me, but a screen shot of the Tablepress view could be really helpful.)
In any case, are you trying to filter the rows that are produced, reorder them, or modify the data in the rows exactly as they are shown now (without filtering or reordering them)?
In case of reordering, I believe Tablepress has some options that allow you to reorder the table rows in the view, and I would recommend using those.
In case of filtering, there is a pod_where argument to the [table] short code that allows you to specify a filter condition on the rows that will be displayed; it is documented in the code in tablepress-pods.php.
In case of modifying the generated data, that is where the optional custom postprocessing argument in the magic code in the table can help. It is just the name of a PHP function defined in your Wordpress installation (so easiest place to put it is functions.php of your theme). The function will be called with one argument, the value the magic code is going to produce, and it should return whatever you want to replace that value. (Note that depending on the exact magic code, that value might be a string or a list.)
Feel free to post if you need further help? I will leave this issue open with an "FAQ" tag so that others who have similar questions can find it easily. Thanks!