• Hi,
    I use wp-table-reloaded plugin and I love it.

    I use the “data” parameter to the ‘table’ shortcode to populate auto-generated tables like thus:
    global $activity_table;
    do_shortcode(“[table id=2 data=’activity_table’/]”);
    Recently I upgraded to wordpress 3.2.1 and to your version 1.9.2.
    All my tables are shown empty!
    Is the support for the ‘data’ field discontinued? I don’t see it described in your documentation anymore.

    What is the alternative?
    Thanks,
    – Sai.

    http://ww.wp.xz.cn/extend/plugins/shortcodes/

Viewing 1 replies (of 1 total)
  • Thread Starter sai.susarla

    (@saisusarla)

    Oops! I just realized that I had added that ‘data’ label support myself to the vanilla wp-table-reloaded plugin.

    So my request is, could you please add the following support to wp-table-reloaded (modifying it as appropriate to suit your style)?

    I wanted to add the ability to set the table data to the contents of an array supplied at runtime. To do so, I did the following:

    Created a custom directory called wp-table-reloaded-custom under plugins.

    Created a file called my-functions.php with the following content:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Made the following three modifications to controllers/controller-frontend.php:

    Around line 15 (after “require_once(… base controller class …):

    $custom_functions = WP_TABLE_RELOADED_ABSPATH .
        '../wp-table-reloaded-custom/my-functions.php';
    if (file_exists($custom_functions)) {
        include_once($custom_functions);
    }

    Around line 209, after

    $table = $this->load_table( $table_id );
    Added the following line:
            $table['data'] = apply_filters( 'wp_table_reloaded_fetch_data', $table['data'], $atts );

    That’s it.
    It really helps if we generate table content dynamically but still want to use the power of wp-table-reloaded with all its beautiful way of rendering tables.

    I’d really appreciate it if this type of functionality is added to a future version of this awesome plugin.
    – Sai.

    [Please post code snippets between backticks or use the code button.]

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: shortcodes] 'data' attribute to the table shortcode stopped working’ is closed to new replies.