• Resolved dakranii

    (@dakranii)


    I’m playing around (looking to be specific) in the code of the plug-in Bind User to Category. It’s no longer being supported, but I see a number of people are having issues with it in the forums. This part in particular.

    The description of the plus-in says “Restricted users won’t view the category selection panel in edit screens.”

    This, however, is not true, as restricted users can still view the category selection panel.

    I’m no coder, but I’ve looked through the code and found this bit that I think controls this option:

    function butc_removeCategorySelection($page) {
    	return preg_replace('#<fieldset id="categorydiv".*?</fieldset>#sim', '', $page);
    }

    Are any of these functions deprecated now and that’s why it’s not working? Anyone feel like deciphering this? With a quick glance, can anything be changed to make it remove the category selection page?

    It could maybe be controlled by the next bit of code which is the only other reference to removeCategorySelection in the code

    function butc_adminHead($in) {
    	global $user_level;
    	get_currentuserinfo();
    	$cat = butc_getCategory();
    	if ($cat && $user_level < 10) {
    		if(
    			preg_match('#/wp-admin/post\.php#', $_SERVER['REQUEST_URI'])
    			|| preg_match('#/wp-admin/post-new\.php#', $_SERVER['REQUEST_URI'])
    		) {
    			ob_start(butc_removeCategorySelection);
    		}
    	}
    	return $in;
    }

    Maybe I’ve got the wrong bit of code…

    Just wondering. Thank you.

    http://wordpress.org/extend/plugins/bind-user-to-cat/

Viewing 1 replies (of 1 total)
  • Thread Starter dakranii

    (@dakranii)

    I used Adminimize to remove the category option and that works just fine.

    Would still be curious to see a solution to this if anyone happens to know.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Bind user to category] Edit “Bind User to Category” Plug-in’ is closed to new replies.