Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would remove Tag capability from classic Post type, can I use remove_theme_support( $feature ); and how to do this ?

Thanks in advance

share|improve this question
    
unregister_taxonomy('post_tag') ? –  onetrickpony Apr 4 '12 at 19:41
    
@OneTrickPony Unfortunately not yet... –  m0r7if3r Apr 4 '12 at 19:45

2 Answers 2

up vote 3 down vote accepted

You can do it with something like this:

add_action( 'init', 'wpse48017_remove_tags' );
function wpse48017_remove_tags() {
    global $wp_taxonomies;
    $tax = 'post_tag'; // this may be wrong, I never remember the names on the defaults
    if( taxonomy_exists( $tax ) )
        unset( $wp_taxonomies[$tax] );
}

There was a move to get a function implemented but that hasn't hit yet.

share|improve this answer
    
Thank you @m0r7if3r , this is working fine –  zagriyen Apr 4 '12 at 20:15

@m0r7if3r's answer actually produces an error in the in the 'Right Now' Dashboard widget. Even with errors turned off, the 'Tags' row is displayed with a blank count. I extended that solution to also hide 'Tags' from this Dashboard widget:

add_action( 'init', 'wpse48017_remove_tags' );
function wpse48017_remove_tags(){
    global $wp_taxonomies;
    unset($wp_taxonomies['post_tag']);
    global $pagenow;
    if( $pagenow == 'index.php' ){
        add_action( 'admin_head', 'ob_start', 0, 0 );
        add_action( 'right_now_content_table_end', 'wpse48017_remove_tags_dashboard' );
    }
}
function wpse48017_remove_tags_dashboard(){
    #echo '<pre>'.htmlentities( ob_get_clean(), 0, null, true );die();
    echo preg_replace('#(Categories</a></td></tr>)<tr>([\s\S]*?number_format\(\) expects parameter 1 to be double, object given[\s\S]*?)?<td class="first b b-tags.*?</tr>#','$1',ob_get_clean());
}

There are probably other areas where removing tags produces errors, or breaks hardcoded links. So I thought of making this a community wiki, but that discussion probably belongs on core.trac.wordpress.org.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.