Skip to content
Permalink
Browse files

* Checks for existence of parent settings menu before overwriting it

* * TSP Plugins menu page may be duplicated when additional plugins added
Ticket #FP-3
  • Loading branch information...
sharrondenice committed Jul 15, 2013
1 parent cca1a7c commit 68750d8b2fc15a199afdc7ae899cf1bbad56717c
Showing with 13 additions and 3 deletions.
  1. +1 −1 README.txt
  2. +12 −2 includes/settings.inc.php
@@ -4,7 +4,7 @@ Donate link: http://www.thesoftwarepeople.com/software/plugins/wordpress/feature
Tags: featured posts display gallery slider jquery moving boxes the software people
Requires at least: 3.5.1
Tested up to: 3.5.2
Stable tag: 1.0.0
Stable tag: 1.0.1
License: Apache v2.0
License URI: http://www.apache.org/licenses/LICENSE-2.0

@@ -342,8 +342,18 @@ function fn_tspfp_register_settings() {
function fn_tspfp_add_admin_menu()
{
add_menu_page( 'TSP Plugins', 'TSP Plugins', 'manage_options', 'tsp_plugins', 'fn_tsp_plugins_add_menu_render', WP_CONTENT_URL."/plugins/tsp-featured-posts/images/tsp_icon_16.png", 2617638);
add_submenu_page('tsp_plugins', __( 'Featured Posts', 'tsp-featured-posts' ), __( 'Featured Posts', 'tsp-featured-posts' ), 'manage_options', "tsp-featured-posts.php", 'fn_tspfp_settings_page');
$parent_slug = 'tsp_plugins';
$child_slug = 'tsp-featured-posts.php';
if ( !menu_page_url( $parent_slug, false ) )
{
add_menu_page( 'TSP Plugins', 'TSP Plugins', 'manage_options', $parent_slug, 'fn_tsp_plugins_add_menu_render', WP_CONTENT_URL."/plugins/tsp-featured-posts/images/tsp_icon_16.png", 2617638);
}//endif
if ( !menu_page_url( $menu_slug, false ) )
{
add_submenu_page($parent_slug, __( 'Featured Posts', 'tsp-featured-posts' ), __( 'Featured Posts', 'tsp-featured-posts' ), 'manage_options', $child_slug, 'fn_tspfp_settings_page');
}//endif
//call register settings function
add_action( 'admin_init', 'fn_tspfp_register_settings' );

0 comments on commit 68750d8

Please sign in to comment.
You can’t perform that action at this time.