1

I managed to add a button to TinyMCE with this code:

 wp_editor( get_option('piedino_plugin_var_testo'), 'piedino_plugin_var_testo_id', array(
 'wpautop'       => false,
 'media_buttons' => false,
 'textarea_name' => 'piedino_plugin_var_testo',
 'textarea_rows' => 10,
 'quicktags'=>false
) );     

I get the content of the wp_editor() with this:

get_option('piedino_plugin_var_testo');

If I use a shortcode in this wp_editor(), when I display the content in the front end, the shortcode doesn’t work; I see [shortcode] instead the result of the shortcode

Any suggestions?

1 Answer 1

0

WordPress applies various filters to the content before it is output. The filter do_shortcode is the one that processes shortcodes. You can apply all of the same filters to the output of your editor by using the following code:

echo apply_filters( 'the_content', get_option( 'piedino_plugin_var_testo' ) );

Here is the list of all of the filters applied to the_content:

add_filter( 'the_content', 'capital_P_dangit', 11 );
add_filter( 'the_content', 'wptexturize'                       );
add_filter( 'the_content', 'convert_smilies',               20 );
add_filter( 'the_content', 'wpautop'                           );
add_filter( 'the_content', 'shortcode_unautop'                 );
add_filter( 'the_content', 'prepend_attachment'                );
add_filter( 'the_content', 'wp_make_content_images_responsive' );
add_filter( 'the_content', 'do_shortcode', 11 ); // AFTER wpautop()
1
  • I don't find the accept button, sorry. Dec 4, 2016 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.