I have a custom post type created called 'missions'. When developing the site on my Dedicated Virtual, I had no problems. But I moved the site to a shared hosting grid server (mt) and now receive this error through out the admin.
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'add_mission' was given in /nfs/c08/h02/mnt/125591/domains/mydomain.org/html/wp-includes/plugin.php on line 395
The only place that 'add_mission' is used in my theme code is in the functions when setting up the post type. Here is the code I have for that.
add_action( 'init', 'create_mission' );
function create_mission() {
register_post_type( 'missions',
array(
'labels' => array(
'name' => __( 'Missions' ),
'singular_name' => __( 'Mission' ),
'add_new' => __( 'Add New' ),
'add_new_item' => __( 'Add New Mission' ),
'edit' => __( 'Edit' ),
'edit_item' => __( 'Edit Mission' ),
'new_item' => __( 'New Mission' ),
'view' => __( 'View Mission' ),
'view_item' => __( 'View Mission' ),
'search_items' => __( 'Search Missions' ),
'not_found' => __( 'No missions found' ),
'not_found_in_trash' => __( 'No missions found in Trash' ),
'parent' => __( 'Parent Mission' ),
),
'public' => true,
'menu_position' => 4,
'show_ui' => true,
'capability_type' => 'post',
'_edit_link' => 'post.php?post=%d',
'hierarchical' => true,
'rewrite' => array( 'slug' => 'missions', 'with_front' => true ),
'supports' => array(
'title',
'editor',
'author',
'thumbnail',
'excerpt',
'trackbacks',
'custom-fields',
'comments' ,
'page-attributes',
'templates' ),
'menu_icon' => get_stylesheet_directory_uri() . '/assets/imgs/icon_posttype.png',
'register_meta_box_cb' => 'add_mission_metaboxes'
)
);
}
add_action('admin_init', 'add_mission');
More Info
I know that the issue is with my theme, as switching to the twentyten theme removes the error.
PHP Version 5.2.14
WordPress 3.1.2
Question
Is this a server issue? Or can I fix this through my code?
I've searched google and have been unable to find an instance of this error being thrown from a custom post type in wordpress.