You can use the fourth parameter of add_menu_page()
, the my_unique_slug
, to check if the page exists:
1 2 3 4 5 6 7 8 | if ( empty ( $GLOBALS['admin_page_hooks']['my_unique_slug'] ) ) add_menu_page( 'Page Title', 'Top Menu Title', 'manage_options', 'my_unique_slug', 'my_magic_function' ); |
$GLOBALS['admin_page_hooks']
is the list of registered pages.
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.