Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Hello I am new to WordPress and I am creating a custom plugin called ZeeFields. Now i wanna add a meta box to my custom plugin page. I tried but still i cant get it to work. btw I can add meta box to post or dashboard but not to my plugin. how can i do that ? here's my code

<?php
/*
Plugin Name: Post to exlcel
Plugin URI:
Description: Download posts to CSV...
Version: 0.1
Author: ZeeFields
Author URI: http://ZeeFields.com
License: GPL2
*/

add_action( 'add_meta_boxes', 'cd_meta_box_add' );  
function cd_meta_box_add(){
        add_meta_box( 'my-meta-box-id', 'My First Meta Box', 'metaBox_details',     'custompage', 'normal',  'high'); 

}
function metaBox_details()  
{  
    echo 'What you put here, show\'s up in the meta box';     
}  

//============================================================================================================
add_action( 'admin_menu', 'register_my_custom_menu_page' );
function register_my_custom_menu_page(){
    add_menu_page( 'ZeeFields', 'ZeeFields', 'manage_options', 'custompage',     'my_custom_menu_page',NULL,26 ); 

}
function my_custom_menu_page(){
    echo 'I wanna Meta box showing here';
}
//============================================================================================================
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.