• MikeCotchin

    (@mikecotchin)


    Hi there,

    I’ve created hundreds of tables using this plugin but I now no longer want the table name displayed on the post. Is there a database I can edit to accomplish this quickly?

    Regards
    Mike

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    thanks for your post, and sorry for the trouble.

    Changing this setting on many tables at once is not possible, unfortunately.

    Instead, I suggest that you use a plugin filter hook, to set these globally: You could use a hook to override the state of that checkbox when a table is shown. This could look like this:

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

    This would hide the table name for all tables, regardless of what the checkbox on the table’s “Edit” screen is set to, for all TablePress tables on the site. (This would also mean that you can not (easily) have tables with the table name shown anymore, it’s a global change.)

    To use this code, just paste it into your theme’s “functions.php”, or create a small plugin for it.

    Regards,
    Tobias

    Thread Starter MikeCotchin

    (@mikecotchin)

    Hi Tobias,

    Thank you for your help, that is so great! However, I’m finding that the whole site disappears and I’m left with a blank page when I insert that into the functions.php and I don’t know enough to understand why that would happen. Does it work for you?

    Mike

    Hi Mike,

    I’m not sure why something like that would happen. Please make sure to really only copy the exact code from above, without any styling around it.
    If that’s still not working, please set the WP_DEBUG constant to true in the wp-config.php file. That should give you an error message instead of a white screen.

    Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘TablePress – How to uncheck 'Show table name' on many tables quickly’ is closed to new replies.