• I have role manager and I have a role where users can create new posts.

    I’m wondering if anyone can give me advice on how to remove meta boxes (categories, slugs, custom fields, etc) from the administration interface without hacking the core post-new.php file?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I am also looking for a solution like this.

    hello
    has any one found a solution or workaround to this?

    i have a solution now. this plugin should work

    <?php
    /*
    Plugin Name: removeMetaBoxes
    Plugin URI: https://rathercurious.net
    Description: Allows core meta boxes to be removed
    Author: Justin Adie
    Version: 1.0
    Author URI: https://rathercurious.net
    */
    
    class removeMetas{
    	public function __construct(){
    		add_action('do_meta_boxes', array($this, 'removeMetaBoxes'), 10, 3);
    	}
    
    	public function removeMetaBoxes($type, $context, $post){
    		/**
    		 * usages
    		 * remove_meta_box($id, $page, $context)
    		 * add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default')
    		 */
    		$boxes = array(	'slugdiv', 'postexcerpt', 'passworddiv', 'categorydiv',
    						'tagsdiv', 'trackbacksdiv', 'commentstatusdiv', 'commentsdiv',
    						'authordiv', 'revisionsdiv', 'postcustom');
    
    		foreach ($boxes as $box){
    			foreach (array('link', 'post', 'page') as $page){
    				foreach (array('normal', 'advanced', 'side') as $context){
    					remove_meta_box($box, $type, $context);
    				}
    			}
    		}
    	}
    }
    
    $removeMetas = new removeMetas();
    ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Removing meta boxes from post-new.php’ is closed to new replies.