Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • This is also affecting one of my sites, any idea when the fix will be released? Are you able to send me the details so that I can apply it manually until then?

    • This reply was modified 9 years, 5 months ago by Luke Towers.
    Thread Starter Luke Towers

    (@luketowers)

    No problem, although given that the repository for the plugin hasn’t been touched by the authors in a while, I’m doubting that they’re going to release an update for the plugin anytime soon.

    Thread Starter Luke Towers

    (@luketowers)

    Whoops! Figured out what I was doing wrong, I had updated the code in the development site and was testing it on the live site, which obviously didn’t work :). Although, I did have to modify the code a bit to remove the featured image meta box as well, the functions that I ended up using are below:

    function remove_meta_boxes() {
    	$user = wp_get_current_user();
    	if (!$user->has_cap( 'remove_users' )) {
    		remove_meta_box('postexcerpt', 'event', 'normal');
    		remove_meta_box('postcustom', 'event', 'normal');
    		remove_meta_box('commentstatusdiv', 'event', 'normal');
    		remove_meta_box('commentsdiv', 'event', 'normal');
    		remove_meta_box('authordiv', 'event', 'normal');
    		remove_meta_box('event-categorydiv', 'event', 'side');
    		remove_meta_box('tagsdiv-event-tag', 'event', 'side');
    	}
    }
    add_action( 'admin_menu', 'remove_meta_boxes');
    
    // Remove the featured image meta box without removing support for it.
    function remove_featured_image_meta_box() {
    	$currentScreen = get_current_screen();
    	if ($currentScreen->id == "event") {
    		$user = wp_get_current_user();
    		if (!$user->has_cap( 'remove_users' )) {
    			remove_meta_box('postimagediv', 'event', 'side');
    		}
    	}
    }
    add_action('do_meta_boxes', 'remove_featured_image_meta_box');
Viewing 3 replies - 1 through 3 (of 3 total)