Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Calling shortcodes in custom text areas

by

Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Calling shortcodes in custom text areas

  • This topic has 1 reply, 2 voices, and was last updated 13 years, 6 months ago by admin.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 9, 2011 at 10:17 pm #4726
    boagworld
    Member

    I have a little PHP teaser I was hoping you could help me with.

    I use a plugin to pull back some HTML content contained in a DB field. Nothing very clever. I pull it back as follows…

    <?php $new_value = get_terms_meta($term->term_id, 'details', true);
    if (function_exists('get_terms_meta')): ?>
    <section id="seasonDetails"><?php echo $new_value; ?></section>
    <?php endif; ?>

    As you can see it is essentially pulling the content from ‘details’ in and then displaying it as an echo.

    The problem I have is that within the details field I would like to include this piece of PHP…

    <?php echo print_eStore_buy_now_button(4); ?>

    Basically I want the displaying of the field to trigger this other command to be run and displayed.

    Of course, running an echo within an echo doesn’t work. Can any of you guys think of a work around.


    Alternatively is there a way to get Shortcodes converted in other fields other than the main content area of wordpress?


    Okay here is a more detailed description.

    Essentially I use a plugin called category_meta to add a field into my season pages that allow me to show more of a description.

    In that field I want to have a buy button to sell a book associated with that season. To do this I use a plugin called eStore.

    eStore allows me two ways to call in buy buttons.

    Shortcodes – [wp_eStore_buy_now:product_id:4:end]

    PHP – <?php echo print_eStore_buy_now_button(4); ?>

    The problem is that neither are processed within the meta field. The shortcode appears as text and the PHP is just not displayed at all.

    Any ideas?

    November 10, 2011 at 3:10 am #38328
    admin
    Keymaster

    You can’t just place a PHP function in the custom fields and expect it to get executed. You need to look at it from a different angle.. for example store the product ID in a custom field and then call a function with the value of that custom field. These posts has examples that should give you ideas:

    Problems adding "Add to Cart" on index.php using Custom Fields

    Call product through a custom field

    https://support.tipsandtricks-hq.com/forums/topic/get-product-name-from-title-attribute-and-price-from-custom-field

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ