How can I make all gallery images to open in a new window?

(Update 04.05.2012: Include captions) Let’s start with a solution … There is no filter especially for gallery image links. There is also no filter for the gallery shortcode output. So we have to fake one: add_action( ‘after_setup_theme’, ‘wpse_50911_replace_img_shortcodes’ ); /** * Replace the default shortcode handlers. * * @return void */ function wpse_50911_replace_img_shortcodes() { remove_shortcode( … Read more

Changing a function in function.php to a shortcode – for listing categories of only a certain post type

It looks like wp_list_categories($args) will output directly when you call it, which is why the output comes out in a weird place. and ideally what you need is to capture the output and return it, but luckily wp_list_categories allows you to do this with the ‘echo’ parameter. Try: $args[‘echo’] = FALSE; return wp_list_categories($args); Note the … Read more

TinyMCE popup windows using WP functions

The popup of a TinyMCE is outside WordPress. You must include the wp-load.php, same handle like outside the WordPress install. But think about this solution and maybe it is cleaner, that you create your data in a json string and handle this data in the popup. It is helpful to reads this post about the … Read more

Gallery Settings Change available Columns

Short answer Simple as things sometimes are: No this is not possible. The whole part is hard coded. Long answer (not recommended to do so) You could maybe jump into the esc_html and attribute_escape filters and just return empty there *), but as those are pretty generic names and would possibly also interfere with other … Read more

Execute shortcode within shortcode

I haven’t tried this, but you could try pseudo-changing the priority of your shortcode hook. Basically, you force your shortcode to execute before it would normally. That link shows how to execute your shortcode separately – and, more importantly, before – the other shortcodes get implemented. This works by caching and temporarily removing all existing … Read more

using 1 form shortcode (si or cf7) for all multisite sites [closed]

A Must Use plugin could do the work. This is just an outline and has to be fully tested: add_shortcode( ‘global_form’, ‘shortcode_wpse_87634’ ); function shortcode_wpse_87634() { // Main site, ID=1, that has the form switch_to_blog( 1 ); // Do your stuff $my_stuff = something(); // maybe do_shortcode // Back to original site restore_current_blog(); // Return … Read more