Advertisements

get_plugin_page_hookname

Definition:
function get_plugin_page_hookname( $plugin_page, $parent_page ) {}

Parameters

  • $plugin_page
  • $parent_page

Source code

function get_plugin_page_hookname( $plugin_page, $parent_page ) {

	global $admin_page_hooks;



	$parent = get_admin_page_parent( $parent_page );



	$page_type = 'admin';

	if ( empty ( $parent_page ) || 'admin.php' == $parent_page || isset( $admin_page_hooks[$plugin_page] ) ) {

		if ( isset( $admin_page_hooks[$plugin_page] ) )

			$page_type = 'toplevel';

		else

			if ( isset( $admin_page_hooks[$parent] ))

				$page_type = $admin_page_hooks[$parent];

	} else if ( isset( $admin_page_hooks[$parent] ) ) {

		$page_type = $admin_page_hooks[$parent];

	}



	$plugin_name = preg_replace( '!\.php!', '', $plugin_page );



	return $page_type . '_page_' . $plugin_name;

}

1564

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: