Title: render shortcode in field?
Last modified: February 6, 2017

---

# render shortcode in field?

 *  [cleanteam](https://wordpress.org/support/users/cleanteam/)
 * (@cleanteam)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/render-shortcode-in-field/)
 * Hi Saravana
    first of all – thank you for this excellent plugin! I would like
   to enter a shortcode into a readonly admin field and have it rendered on the 
   product page. Is there a way to do this? I would greatly appreciate your input.
   Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Saravana Kumar K](https://wordpress.org/support/users/mycholan/)
 * (@mycholan)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/render-shortcode-in-field/#post-8747184)
 * Hi,
 * All admin fields are stored as Post Meta only so a simple `get_post_meta();` 
   is enough
 *     ```
       $af_val = get_post_meta( $post_id, "wccaf_" . "your field name", true );
       echo do_shortcode( $af_val );
       ```
   
 * **Note: **
    All admin fields key will have “wccaf_” as prefix.
 * Regards
    Sark
    -  This reply was modified 9 years, 3 months ago by [Saravana Kumar K](https://wordpress.org/support/users/mycholan/).
 *  Thread Starter [cleanteam](https://wordpress.org/support/users/cleanteam/)
 * (@cleanteam)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/render-shortcode-in-field/#post-8794623)
 * thanks Sark
    I think I have not been precise in my question. So what I like to
   do is to enter a shortcode as a predefined value in the admin field and have 
   this shortcode rendered to its output in this same field on the product page.
   I am trying to get a value into the field that is only created on the product
   page (such as e.g. the username).
 * I can use this
 *     ```
       $af_val = get_post_meta( $post->ID, "wccaf_" . "your field name", true );
       echo do_shortcode( $af_val );
       ```
   
 * to render the shortcode somewhere on the page, but that’s not exactly what I 
   am trying to achieve.
    Hope I made myself clear 🙂 thanks

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘render shortcode in field?’ is closed to new replies.

 * ![](https://ps.w.org/wc-fields-factory/assets/icon-128x128.jpg?rev=2738843)
 * [WC Fields Factory](https://wordpress.org/plugins/wc-fields-factory/)
 * [Support Threads](https://wordpress.org/support/plugin/wc-fields-factory/)
 * [Active Topics](https://wordpress.org/support/plugin/wc-fields-factory/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wc-fields-factory/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wc-fields-factory/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [cleanteam](https://wordpress.org/support/users/cleanteam/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/render-shortcode-in-field/#post-8794623)
 * Status: not resolved