• I know that i can easily create my own post/page screen but is anyone aware of a hook that allows the customisation of the _standard_ post/page screen? both edit and new.

    essentially i want to remove a number of the boxes.

    thanks
    Justin

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

    (@jpadie)

    solution found.

    <?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 1 replies (of 1 total)
  • The topic ‘Customise the standard add post/page screen’ is closed to new replies.