Created
November 9, 2015 19:57
-
-
Save tripflex/cbae88850e3c6503bb06 to your computer and use it in GitHub Desktop.
How to execute shortcode when used in a field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// You should only use this code below if the field is an "admin only" field. | |
// Using a field that is not admin only will allow any user to execute shortcodes from your site, and can cause security issues | |
$list_related_products = get_custom_field( 'list_related_products' ); | |
echo do_shortcode( $list_related_products ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment