Hi,
thanks for your post, and sorry for the trouble.
The number of rows can be shown via the [table-info]
Shortcode, like
[table-info id=123 field=number_rows format=raw /]
(If you remove the format=raw
, the header and footer row (if any) will also be counted in the total.
Unfortunately, TablePress can not sum several row numbers together 🙁
Regards,
Tobias
Is there is a function that can sum it?
Or a function to show the table rows rather than the shortcode
Or a function that can move from one table id to another
Specially if it starts with a letter
Hi,
no, there’s no direct PHP function for this. For that, I suggest to just have a look at the source code of the shortcode_table_info()
function in the controllers/controller-frontend.php file.
Regards,
Tobias
I see I guess I will sum the whole post type, what is the metadata used for rows number?
Hi,
there’s no meta data for it, it’s calculated directly from the table data array.
Regards,
Tobias
so the number or rows is not stored somewhere in the database?
that would exhaust the database to count all the rows of tablepress post type
can I create a post meta or custom field and use that shortcode on it? however replacing the id with the current tablepress id? as a variable I mean
Hi,
sorry, that’s beyond what I can help with 🙁
You can certainly create your own post meta fields, but you will have to take precautions that they are updated when someone changes the table structure (e.g. adds or removes rows).
Regards,
Tobias
well the only problem right now is how can I replace the talbe ID with a variable that changes with every table, any idea on that?