Forums

capture shortcode output for use in admin? (2 posts)

  1. MACscr
    Member
    Posted 2 years ago #

    I need to capture the output of a shortcode that is basically all the informatoin for a product from a shopping cart plugin im using. I want to do this in the backend area though as i want to gather the information for other uses.

    I have tried adding the following code to my themes function.php:
    echo do_shortcode("[product id='1']");

    but that simply just prints [product id='1']. Though when i add that shortcode to a post, it works perfectly. Am i missing something? Is shortcode access somehow disabled from the admin interface?

    Any help would be sincerely appreciated.

  2. MACscr
    Member
    Posted 2 years ago #

    note, i found out it works within single.php. So now i just have to figure out why i cant use it within functions.php for use anywhere on the site, let alone the admin area where i need it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.