mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-30 18:24:31 +00:00
Escape/texturize Admin menu titles. Fixes page titles such as "Foo & Bar" not being entity encoded. Also includes some basic whitespace/standards cleanup to a related function. Fixes #12039
git-svn-id: https://develop.svn.wordpress.org/trunk@14127 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -818,22 +818,20 @@ function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $func
|
||||
|
||||
$hookname = get_plugin_page_hookname( $menu_slug, '' );
|
||||
|
||||
if (!empty ( $function ) && !empty ( $hookname ) && current_user_can( $capability ) )
|
||||
if ( !empty( $function ) && !empty( $hookname ) && current_user_can( $capability ) )
|
||||
add_action( $hookname, $function );
|
||||
|
||||
if ( empty($icon_url) ) {
|
||||
if ( empty($icon_url) )
|
||||
$icon_url = esc_url( admin_url( 'images/generic.png' ) );
|
||||
} elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') ) {
|
||||
elseif ( is_ssl() && 0 === strpos($icon_url, 'http://') )
|
||||
$icon_url = 'https://' . substr($icon_url, 7);
|
||||
}
|
||||
|
||||
$new_menu = array ( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
|
||||
$new_menu = array( $menu_title, $capability, $menu_slug, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
|
||||
|
||||
if ( NULL === $position ) {
|
||||
if ( null === $position )
|
||||
$menu[] = $new_menu;
|
||||
} else {
|
||||
else
|
||||
$menu[$position] = $new_menu;
|
||||
}
|
||||
|
||||
$_registered_pages[$hookname] = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user