• Resolved johncoppedge

    (@johncoppedge)


    Excellent plugin. Seriously rocks.

    Just noticed something though- not sure if it is a glitch or intended.

    When I save a table, it appears to cache the results of the shortcodes used within the table. E.g.

    I use [child-pages] within a table to display the child pages of the current page.

    Parent
    -a
    -b

    I then change the order to:
    Parent
    -b
    -a

    The shortcode used outside of a table will display the update. The shortcode inside of the table will show the first version.

    If I update the table (just save, don’t make any changes), it appears to update.

    I’d prefer it not cache anything… is this expected?

    http://wordpress.org/extend/plugins/tablepress/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    You are right, TablePress (intentionally) caches the output of its Shortcodes (for 24 hours). This is no problem at all, except if tables contains “dynamic” content — like that from another Shortcode.
    For tables that contain other Shortcodes, it’s therefore a wise idea to turn off caching of that table. To that, just extend the Shortcode of that table with the cache_table_output parameter, i.e.

    [table id=213 cache_table_output=false /]

    Regards,
    Tobias

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    another thing: It is possible to turn off caching for all TablePress Shortcodes with a small piece of code (see below), but I don’t really recommend that. Turning it off individually via the Shortcode parameter is much better.

    To turn caching of for all tables, you could add the following code your theme’s “functions.php” file or into a small new plugin:

    add_filter( 'tablepress_table_render_options', 'tablepress_turn_off_table_caching', 10, 2 );
    function tablepress_turn_off_table_caching( $render_options, $table ) {
      $render_options['cache_table_output'] = false;
      return $render_options;
    }

    Regards,
    Tobias

    Thread Starter johncoppedge

    (@johncoppedge)

    Excellent, that answers the question. Thanks Tobias! And excellent plugin!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    sure, no problem! You are very welcome!

    Great to hear that you like the plugin so much!
    In case you haven’t, please rate it here in the plugin directory then. Thanks!

    Best wishes,
    Tobias

    Thread Starter johncoppedge

    (@johncoppedge)

    Already did 🙂 Thanks again!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    ah, thanks! 🙂 I really appreciate it!

    Best wishes,
    Tobias

    thanks ThobiasBg. It really helped me alot 🙂

    Plugin Author TobiasBg

    (@tobiasbg)

    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!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘cached shortcodes’ is closed to new replies.