WordPress.org

Ready to get started?Download WordPress

Forums

Adminimize
[resolved] Hide Particular categories (5 posts)

  1. vir27
    Member
    Posted 2 years ago #

    Is there possible hide some of the categories for contributor?

    http://wordpress.org/extend/plugins/adminimize/

  2. Frank
    Member
    Plugin Author

    Posted 2 years ago #

    no, not with this plugin.
    But you can create an custom plugin for filter the categories.

    example:

    function fb_list_terms_exclusions($args) {
    	global $pagenow, $post_type;
    
    	$where = '';
    
    	// filter only for frontend
    	if ( !is_admin() ) {
    		$where = " AND t.slug  NOT IN ('uncategorized', 'category-2')"; // slug of categories
    	}
    
    	// backend, only on post-type post
    	if (
    		'post' == $post_type &&
    		is_admin() &&
    		!current_user_can('manage_categories')
    	) {
    		$where = " AND t.slug  NOT IN ('slider')"; // slug of category
    	}
    
    	return $where;
    }
    add_filter( 'list_terms_exclusions', 'fb_list_terms_exclusions' );
  3. vir27
    Member
    Posted 2 years ago #

    thanks a lot frank, bt i have done this with using Adminimize plugin only......ex. i have four categories cat-1, cat-2, cat-3 & cat-4 and i want to hide cat-1, cat-2, i got categories ids using firebug and put it in ...."Your own post options ID or class" adminimize plugin field
    like #category-1, #category-2 and checked that value in column...then updated options....this worked for me...

  4. Frank
    Member
    Plugin Author

    Posted 2 years ago #

    yes, this also possible; but it hide it only via CSS.
    Its not an filter for hide hard with PHP.
    But its fine, that you use this enhancement of my plugin.

  5. vir27
    Member
    Posted 2 years ago #

    yes, it's thru css, bt very good functionality. gr8 plugin. thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags