• <?php
    
    /*
      Plugin Name: options menu
      Plugin URI:
      Description: Companion to recipe 'Implementing the plugin menu'
      Author: adrian
      Version: 1.0
      Author URI: https://www.xymalf.com
    
     */
    
    add_action( 'admin_menu', 'boj_menuexample_create_menu' );
    
    function boj_menuexample_create_menu() {
    
    add_menu_page( 'My Plugin Settings Page', 'Menu Example Settings','manage_options', _FILE_, 'boj_menuexample_settings_page', plugins_url( '/images/wp-icon.png', _FILE__));
    
    add_submenu_page( _FILE_, 'About My Plugin', 'About', 'manage_options',_FILE_.'_about', boj_menuexample_about_page);
    add_submenu_page( _FILE_,'Uninstall My Plugin', 'uninstall', 'manage_options',
    _FILE_.'_uninstall', boj_menuexample_uninstall_page);
    
    }
    
    ?>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    If I run the above plugin WAMP is screaming as it can’t find my boj_menuexample_about_page

    I have all my files in www\WPDev\wp-content\plugins running on as local machine WAMP using port 8080

Viewing 3 replies - 1 through 3 (of 3 total)
  • What is the actual error message that’s coming from WAMP?

    But if that’s all the code that you’ve done so far it’s pretty easy to see the error. You have registered a callback function of boj_menuexample_about_page but you havn’t actually defined that function yet. You have to define every callback function that you register otherwise you will get errors just like that one.

    Thread Starter xymalf

    (@xymalf)

    How do I define the function for the callbacks please.

    By creating the function.

    function boj_menuexample_about_page ($args = array, $content = "") {
        // do what ever you need to in here.
    
        return $html;
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Where should I put my files’ is closed to new replies.