This issue has plagued me over a couple projects. I used the default Wordpress class-based template provided in the Codex to start, and built outward. The only issue I face is that my custom meta boxes will not show when creating a new post (add post). This is usually in conjunction with custom post types, but as the code from the Wordpress demonstrates, it occurs with just a regular meta box.
What needs to be done to ensure this will display when clicking 'Add New Post'?
<?php
/*
Plugin Name: TestPlug
Description: Blank
Author: No One
Version: 1.0
*/
function call_someClass() {
return new someClass();
}
if ( is_admin() ) add_action( 'load-post.php', 'call_someClass' );
class someClass {
public function __construct()
{
add_action( 'add_meta_boxes', array( &$this, 'add_some_meta_box' ) );
}
public function add_some_meta_box()
{
add_meta_box(
'some_meta_box_name'
,'Some Meta Box Headline'
,array( &$this, 'render_meta_box_content' )
,'post'
,'advanced'
,'high'
);
}
public function render_meta_box_content()
{
echo '<h1>TEST OUTPUT - this gets rendered inside the meta box.</h1>';
}
}
?>