Using the media uploader in a custom plugin

The output code of widget’s form method is added to page once for every instance of the widget (included the “dummy” instance contained in the “Available widgets” panel), so in your case the javascript code that defines the window.send_to_editor function may appear more than once, and the last instance overwrites the previous ones. There are … Read more

dynamic page not indexed

Do you have at least have a link to the query url somewhere on your public pages ? Google does follow query parameters, so that will at least bring it to the crawlers attention. See http://googlewebmastercentral.blogspot.com.au/2011/07/improved-handling-of-urls-with.html (I almost have the opposite with my event/calendar plugin. google is paying almost too much attention to the pages … Read more

How to add a sub menu with AJAX?

As you can’t suppose to get a full working example without any given code, I’ll show you a rough wordpress AJAX setup: Put all this in functions.php: <?php add_action(‘wp_head’, ‘my_action_javascript’); function my_action_javascript() { ?> <script type=”text/javascript” > jQuery(document).ready(function($) { jQuery.ajax( type: ‘POST’, url: <?php echo admin_url(‘admin-ajax.php’); ?>, data: { action : ‘your_AJAX_call’, league : $(‘input#league’).val() … Read more

How to develop a community feature in the dashboard for multiauthor site

What I do for almost every site with multiple authors: Create a separate blog for meta discussions, for example meta.example.com. Use P2 as theme. Install Authenticator to allow access for members only. Install something like Inform about Content, so the members get an email whenever something new was posted. I probably wouldn’t do that for … Read more

What is the correct way to check if WP_Filesystem can write to a directory without aking for username / password?

This is what i ended up using /** * check if the path is writable. To make the check . * * @param string $path * @return boolean */ public static function is_writable( $path ) { global $wp_filesystem; include_once ABSPATH . ‘wp-admin/includes/file.php’; // If for some reason the include doesn’t work as expected just return … Read more

Restrict access and display for categories

Yes :). The following will effect all queries for posts on the front-end including ‘secondary loops’ (e.g. post lists on the side) but it won’t effect custom post types. So this may not be exactly what you’re after, but the principle is the same: add_action(‘pre_get_posts’,’wpse72569_maybe_filter_out_category’); function wpse72569_maybe_filter_out_category( $query ){ //Don’t touch the admin if( is_admin() … Read more