Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

xymalf on "Sub menu item crashing the plugin."

$
0
0
<?php
/*
Plugin Name: WordPress Menu Examples Plugin
Plugin URI: http://example.com/wordpress-plugins/my-plugin
Description: A plugin to create menus and submenus in WordPress
Version: 1.0
Author: Brad Williams
Author URI: http://wrox.com
License: GPLv2
*/

add_action( 'admin_menu', 'boj_menuexample_create_menu' );

function boj_menuexample_create_menu() {

	//create custom top-level 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__ ) );

	//create submenu items
	add_submenu_page( __FILE__, 'About My Plugin', 'About', 'manage_options', __FILE__.'_about', boj_menuexample_about_page );
	add_submenu_page( __FILE__, 'Help with My Plugin', 'Help', 'manage_options', __FILE__.'_help', boj_menuexample_help_page );
	add_submenu_page( __FILE__, 'Uinstall My Plugin', 'Uninstall', 'manage_options', __FILE__.'_uninstall', boj_menuexample_uninstall_page ); 

}

?>
[/PHP]

[PHP]
/*

  Description:  menuexample_settings_page
  Author: adrian
  Version: 1.0
  Author URI: http://www.xymalf.com
 */

<?php

*/

add_action( 'admin_menu', 'boj_menuexample_create_menu' );

function boj_menuexample_create_menu() {

	//create a submenu under Settings
	add_options_page( 'My Plugin Settings Page', 'Menu Example Settings', 'manage_options', __FILE__, 'boj_menuexample_settings_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.]

the plug in is activating but when I click on the link for the Settings page it crashes. Help please.


Viewing all articles
Browse latest Browse all 8245

Trending Articles