• Resolved ratracegrad

    (@ratracegrad)


    I am using the amazon simple admin plugin to create shortcodes to be used in cells of a table created with this plugin. I want columns to show image & name, price and rating. This information is filled in by the shortcode from the amazon simple admin plugin. When I create table and enter the short code I only see the shortcode and not the converted information.

    I have created a page on my website that shows what is happening. The page is here.

    The shortcode for amazon simple admin work on the page with no problem at the top of the page listed above. In the table you will see the short code but not the converted information.

    Looking for how to put the amazon simple admin code into a cell in the table. Thanks.

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

    (@tobiasbg)

    Hi,

    this happens because the Amazon plugin does not use the regular WordPress Shortcode API. By default, only Shortcodes that use that API are recognized in table cells as well.
    However, this can be fixed easily. For the AmazonSimpleAdmin, you just need to paste the following code into your theme’s “functions.php” file, right before the closing PHP bracket ?> at the end.

    global $asa;
    add_filter('wp_table_reloaded_content', array($asa, 'parseContent'), 1);

    Best wishes,
    Tobias

    Thread Starter ratracegrad

    (@ratracegrad)

    Tobias,

    I added the above line and I get the following error code now:

    Warning: Cannot modify header information – headers already sent by (output started at /home/jminge1/public_html/ellipticaltrainersguide.net/wp-content/themes/flexibility3/functions.php:15) in /home/jminge1/public_html/ellipticaltrainersguide.net/wp-includes/pluggable.php on line 897

    Thread Starter ratracegrad

    (@ratracegrad)

    Tobias,

    Scratch above post. I have the code in the functions.php file. When I look at the table now I still see the [asa] shortcode text instead of the converted information.

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    ah, stupid me… Tiny mistake in my code from above. There’s a “cell_” missing. Please try again with

    global $asa;
    add_filter('wp_table_reloaded_cell_content', array($asa, 'parseContent'), 1);

    Regards,
    Tobias

    Thread Starter ratracegrad

    (@ratracegrad)

    Tobias,

    That worked like a champ! I made a donation on your website as a thanks for the assistance.

    Jennifer

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi Jennifer,

    great, thanks for the confirmation!

    And thank you very much for your donation, I really appreciate it!

    Best wishes,
    Tobias

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Using shortcode from other plugin in table’ is closed to new replies.