Home » , » Fatal error : Call to undefined function add_menu_page()

Fatal error : Call to undefined function add_menu_page()

Written By Unknown on Senin, 23 September 2013 | 23.58

Fatal error : Call to undefined function add_menu_page()

If you want to add menu to admin section of wordpress through custom plugin and you got
"Fatal error : Call to undefined function add_menu_page() " error.

Then reason for error might be there is no add_action function found in plugin

Try this code to solve this error in your plugin file.

<?php

/*
Plugin Name: Myplugin

Description:
Version: 2.5.324
Author: Amit kumar


*/
add_action('admin_menu', 'test');

function test(){
    add_menu_page(__('My Menu Page'), __('My Menu'), 'edit_themes', 'my_new_menu', 'my_test_function', '', 7);
}

function my_test_function(){
    echo "hello world .. !!";
}
Share this article :

Posting Komentar

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Kumpulan Kata Broadcast Blackberry - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger