Plugin Directory

Sitewide Tag Suggestion

Creates "choose from most popular sitewide tags" function on post edit screen

This plugin is only compatible with WPMU 2.8+! Donncha's Sitewide Tags plugin is required as well.

  1. Drop the plugin file (sitewide-tag-suggestion.php) into mu-plugins/
  2. Open wp-admin/admin-ajax.php. (Back it up first! You're hacking the core!) Find the line that says case 'add-comment' : Add the following stuff, making sure to change the number following 'blog_id' => to the numerical blog id of your Sitewide Tags blog.

    // Additions for sitewide tag suggestions begin here
    
    case 'get-tagcloud2' :
    if ( !current_user_can( 'edit_posts' ) )
        die('-1');
    
    if ( isset($_POST['tax']) )
        $taxonomy = sanitize_title($_POST['tax']);
    else
        die('0');
    
    $tags = get_terms_custom( $taxonomy, array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC', 'blog_id' => 28 ) );
    
    if ( empty( $tags ) )
        die( __('No tags found!') );
    
    if ( is_wp_error($tags) )
        die($tags->get_error_message());
    
    foreach ( $tags as $key => $tag ) {
        $tags[ $key ]->link = '#';
        $tags[ $key ]->id = $tag->term_id;
    }
    
    // We need raw tag names here, so don't filter the output
    $return = wp_generate_tag_cloud( $tags, array('filter' => 0) );
    
    if ( empty($return) )
        die('0');
    
    echo $return;
    
    exit;
    break;
    
    // End additions
    
  3. Open wp-admin/edit-form-advanced.php. (Have you backed it up yet?) Find the line that says

">

First, if you'd like to change this line's text to more clearly distinguish between the current blog's tags and the sitewide tags, you might consider replacing that line with the following:

">

After that line, add the following markup, which creates a link for your sitewide tags. You'll want to change my link text ("...all Commons blogs") to reflect your own site:

">

*/

Requires: WPMU 2.8 or higher
Compatible up to: WPMU 2.8.4a
Last Updated: 2009-9-16
Downloads: 435

Average Rating

3 stars
(1 ratings)

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.