Shortcode or placeholder for theme options page?

I am using shortcodes. But you need to work differently with this and make it easier for the client. On the theme options page you should have inputs with type=”checkbox” where the client chooses what share buttons to appear. In the template you should get the option with get_option(‘registered_option’) and display those buttons for which … Read more

Shortcodes: Return different based on atts

All you need is some very simple IF logic. The $author variable is set to be empty here “author” => ” unless an author name is used in your shortcode. So now that you know the default value of $author you can use IF logic to check if it is empty or not. Two logic … Read more

WP_Editor Shortcode Issue

You can display shortcodes in WP editor by removing do_shortcode filter from the_content filter as shown in the following code but beware that it will also display shortcodes tags when you use the_content() function in the theme anywhere else in that case before the_content() function add do_shortcode filter again like this add_filter(‘the_content’, ‘do_shortcode’,15 ); function … Read more

How to add a nested shortcode into editor?

You can do it developing a TinyMCE plugin and load it using mce_external_plugins hook. The key is in the javascript file of the TinyMCE plugin which will be responsible to pass the nested shortcodes into the editor textarea. You can take a look to this article (about the middle they shows an example of how … Read more