/** * Set initial protection. * * @since 1.0.0 */ public function protect_admin_content() { parent::protect_admin_content(); /* * Find out which menu items are allowed. */ $this->add_filter('custom_menu_order', 'prepare_protection', 1); /* * Remove menu items that are not allowed. */ $this->add_filter('custom_menu_order', 'protect_menus', 10); }
/** * Set initial protection. * * @since 1.0.0 */ public function protect_admin_content() { parent::protect_admin_content(); $this->add_filter('user_has_cap', 'prepare_caps', 1, 4); $this->add_filter('user_has_cap', 'modify_caps', 10, 4); }