Created
March 27, 2013 12:17
-
-
Save johnpbloch/5253759 to your computer and use it in GitHub Desktop.
Get the hook suffix without an object or class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace JPB\Some_Plugin; | |
function get_hook_suffix() { | |
return apply_filters( 'jpb.some_plugin.get_hook_suffix', '' ); | |
} | |
function register_page() { | |
$hook_suffix = add_submenu_page( /* Arguments */ ); | |
add_filter( 'jpb.some_plugin.get_hook_suffix', function() use ( $hook_suffix ) { | |
return $hook_suffix; | |
} ); | |
} | |
add_filter( 'admin_menu', '\JPB\Some_Plugin\register_page' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment