• Resolved easinewe

    (@easinewe)


    I would like to grab values from single cells within my table to be used as global variables for a javascript application within WordPress.

    I have downloaded the Single Cell Content Shortcode. I see that this can print single values in your posts.

    Can I use this short code in combination with tablepress_get_table( $query ) to grab the value of a cell but not print it? I could then assign the value to a variable.

    Thanks for creating this great plugin.

    https://wordpress.org/plugins/tablepress/

Viewing 1 replies (of 1 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I would not use tablepress_get_table( $query ) here, as that will always create a HTML table (even if it’s just 1×1 cells), instead of just delivering the desired value.

    Instead, you could take a look at the code of the Single Cell Content Extension and use that approach to query a single value for a JS variable.

    Regards,
    Tobias

Viewing 1 replies (of 1 total)

The topic ‘single cell content from tablepress_get_table( $query )’ is closed to new replies.