List of all inbuilt WordPress shortcodes

You can actually list all of the available shortcodes for your WordPress installation by using the following code: <?php global $shortcode_tags; echo ‘<pre>’; print_r($shortcode_tags); echo ‘</pre>’; ?> It will show the main WordPress shortcodes plus any shortcodes for installed plugins which can be handy too!

Shortcode output appears before post body [duplicate]

I have had this problem before: shortcodes shouldn’t display any content (using print or echo), instead return the content to be outputted. If it’s too much trouble converting all of your output statements, or you need to use a function that will always display the output, you can use output buffering. A buffer will ‘catch’ … Read more

How to Output HTML tags in do_shortcode?

Yes it is possible. There are two ways that I can think of at this moment. First follow what the codex says Shortcodes. Basically you just wrap your html in ob_start(); this will return the html as a string so you can echo it. function my_shortcode() { ob_start(); ?> <HTML> <here> … <?php return ob_get_clean(); … Read more

Change behavior of “Insert into Post” based on attachment metadata

In case it’s helpful to anyone else, here’s what my code looked like to achieve this. I didn’t end up saving the attachment data at all, per tbuteler’s suggestion, but rather than using $_REQUEST I found I could use the $attachment array directly: function my_attachment_fields_to_edit( $form_fields, $post ) { $supported_exts = supported_types(); // array of … Read more

Tinymce – How to hook before or after live shortcodes rendering?

Well, yes, you can do that: //replace live edited content to display html editor.on(‘BeforeSetcontent’, function(event){ event.content = tinymce_to_html( event.content ); }); //Transform your html content to raw content editor.on(‘GetContent’, function(event){ event.content = html_to_tinymce( event.content ); }); Let’s explain that: Under the hood, tinymce use a plain-text editor to store content, use in forms, etc etc. … Read more

All shortcodes not working on custom theme

So I finally found a solution!!! After many weeks of searching and trying different solutions, it was just a matter of removing “get_” from a reference of “the_content” in my page.php I changed this <?php function sup($text){ $true = preg_replace(‘#(\d+)(st|th|nd|rd)#’, ‘$1<sup class=”super”>$2</sup>’, $text); return $true; } echo sup(get_the_content()); ?> To this <?php function sup($text){ $true … Read more