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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)