Get shortcode name from within it’s callback function? [duplicate]

The shortcode’s name is referred to as the tag. The tag is actually the 3rd (and last) parameter passed to the shortcode’s callback function. So your callback should look something like this: function print_shortcode($atts, $content, $tag) { // $atts – array of attributes passed from shortcode // $content – content between shortcodes that have enclosing … Read more

How to add multiple buttons to TinyMCE?

First add your additional buttons inside the buttons callback.. function register_button($buttons) { array_push($buttons, “quote”,”wpse-rules”); return $buttons; } Then add additional buttons function inside the plugin javascript.. init : function(ed, url) { ed.addButton(‘quote’, { title : ‘Add a Quote’, image : url+’/image.png’, onclick : function() { ed.selection.setContent(‘[quote]’ + ed.selection.getContent() + ‘[/quote]’); } }); ed.addButton(‘wpse-rules’, { title … Read more

WordPress removing tags?

This is pretty much what Foxsk8 mentioned in a comment, so credit should go to him, but these additional instructions will be useful. The WordPress plugin called TinyMCE Advanced will solve your problem. This plugin comes with an option inside Settings > TinyMCE Advanced that will fix your disappearing <p> tags. Mark the checkbox labeled … Read more

How to get URL param to shortcode?

If I understand your question correctly, you want to be able to get the parameter from the url, add it to the shortcode so you can add the parameter to the content. See if this works: add_shortcode(‘name’, ‘get_name’); function get_name() { return $_GET[‘name’]; } In the wordpress backend editor you would have something like: Hello … Read more

Why are you using add_action for shortcode?

If you take a look at the Codex page about add_shortcode() you won’t see anything about the need of an add_action() before you can use add_shortcode(). So, you can just put your add_shortcode() directly into your functions.php. This is what I do too. See this article – WordPress Shortcodes: A Complete Guide about the use … Read more

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