WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] How to get last_modified in description? (4 posts)

  1. ahlemann
    Member
    Posted 1 month ago #

    Hi Tobias,

    great job. Using your plugin for our Baseball-Club Holm Westend 69ers (69ers.de)
    I would like to have the last modification date in the table's description.

    Using your [table-info]-shortcode oviously won't work, last_modified and description are both meta fields.

    Is there a way?

    Thanks for the help.

    Oliver

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

  2. TobiasBg
    Member
    Plugin Author

    Posted 1 month ago #

    Hi Oliver,

    thanks for your question, and sorry for the trouble.

    To make that work, we'll just have to tell TablePress that it should also evaluate Shortcode in the description. For that, just add this to your theme's "functions.php":

    add_filter( 'tablepress_table_render_data', 'tp_evaluate_shortcodes_in_description', 10, 3 );
    function tp_evaluate_shortcodes_in_description( $table, $orig_table, $render_options ) {
      $table['description'] = do_shortcode( $table['description'] );
      return $table;
    }

    Regards,
    Tobias

  3. ahlemann
    Member
    Posted 1 month ago #

    You are the man!

    Works just fine.

    thx

    O.

  4. TobiasBg
    Member
    Plugin Author

    Posted 1 month ago #

    Hi,

    no problem, you are very welcome! :-) Good to hear that this helped!

    Best wishes,
    Tobias

    P.S.: In case you haven't, please rate TablePress here in the plugin directory. Thanks!

Reply

You must log in to post.

About this Plugin

About this Topic