Passing HTML in WordPress Shortcode arguments

You have used the same quotation characters in 2 different contexts. You should write the shortcode in the following way: [example text=”<a href=”http://example.com”>lorem</a> ipsum”]Lets roll[/example] Then, “unescape” HTML entities on the shortcode output: $return_string = ‘<div class=”some-class”>’. html_entity_decode($text) . $content .'</div>’;

Extending Shortcode attributes

Without seeing your code it is difficult to give you an exact answer. There is the shortcode_atts_{$shortcode} filter that was introduced in WordPress 3.6. All attributes is run through this filter. It has to be noted that the $shortcode parameter needs to be set in shortcode_atts. I haven’t seen shortcodes yet that has this parameter … Read more

Problem with email_exists in shortcode

This is a basic version of your code above which seperates the registration logic (handled on init) from the form output done by the shortcode. It will basically work, but is missing any validation so just to show the concept. $wpse_email_exists = null; function registration_form_shortcode() { global $wpse_email_exists; $output=”<form name=”registration” action=”” . esc_url($_SERVER[‘REQUEST_URI’]) . ‘” … Read more

How disable checkbox when listbox value changes in tinymce

Looking though the existing plugins, the standard tinymce way to do this is to save the popup window in a win variable: { text: ‘Vídeos’, onclick: function() { var win = editor.windowManager.open({ //etc And then use win.find(‘#name’) to target the control, eg: {type: ‘listbox’, name: ‘video_site’, onselect: function( ) { var autoplay = win.find(‘#video_autoplay’); if … Read more

Shortcodes not working in an AJAX call

I believe the problem is you are not calling do_shortcode() in the output buffer. You don’t need to be running the loop within the output buffer since I can assume get_content_template() simply returns HTML with embedded shortcodes. Save that to a string variable, then run that through the do_shortcode() and save the echoed output to … Read more

has_shortcode for content added after the content

For this, you’ll actually want to utilize the wp_enqueue_scripts action instead of wp_head. wp_enqueue_scripts is technically the proper way to add scripts and styles to your site. This action allows us to both register scripts and styles for later use (which is what we want here) and allows us to output scripts and styles to … Read more