The shortcode does not work in the frontend when called from the code.
-
Hi Tobias and thanks for your awesome plugin.
I have a similar problem with this post from @ akshat007 https://ww.wp.xz.cn/support/topic/shortcode-not-working-when-fetching-post-content-via-ajax/Basically I’m trying to populate a custom field on the Woocommerce product page with data from a record from a Tablepress table.
I only need to display some cells, my shortcode is this: [xxx_table_cell id = 123 column = 2 /] [xxx_table_cell id = 123 column = 3 /] […].If I insert the schortcode on the product page in WP (in description or with ACF) the shortcode works perfectly in the frontend, but if I call it from function.php it is displayed as code ([xxx_table_cell id = 123…).
Basically what I’m trying to do is populate the $test variable with the table data and then initialize the custom input field like this:
printf(“<div class=’yyy-custom-field-wrapper’><label for=’yyy-title-field’>%s</label><input type=‘text’ id=’yyy-title-field’ name=’yyy-title-field’ value=’$test’ ></div>”, esc_html( $title ).
But “value” returns the shortcode as code and not the table data.
I hope someone can help me.
Thanks
The topic ‘The shortcode does not work in the frontend when called from the code.’ is closed to new replies.