diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index e4018d7a13..1c328f363c 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -1060,7 +1060,9 @@ function uninstall_plugin($plugin) { * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. * @param string $menu_title The text to be used for the menu. * @param string $capability The capability required for this menu to be displayed to the user. - * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). + * @param string $menu_slug The slug name to refer to this menu by. Should be unique for this menu page and only + * include lowercase alphanumeric, dashes, and underscores characters to be compatible + * with sanitize_key(). * @param callable $function The function to be called to output the content for this page. * @param string $icon_url The URL to the icon to be used for this menu. * * Pass a base64-encoded SVG using a data URI, which will be colored to match @@ -1126,11 +1128,15 @@ function add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $func * @global array $_registered_pages * @global array $_parent_pages * - * @param string $parent_slug The slug name for the parent menu (or the file name of a standard WordPress admin page). - * @param string $page_title The text to be displayed in the title tags of the page when the menu is selected. + * @param string $parent_slug The slug name for the parent menu (or the file name of a standard + * WordPress admin page). + * @param string $page_title The text to be displayed in the title tags of the page when the menu + * is selected. * @param string $menu_title The text to be used for the menu. * @param string $capability The capability required for this menu to be displayed to the user. - * @param string $menu_slug The slug name to refer to this menu by (should be unique for this menu). + * @param string $menu_slug The slug name to refer to this menu by. Should be unique for this menu + * and only include lowercase alphanumeric, dashes, and underscores characters + * to be compatible with sanitize_key(). * @param callable $function The function to be called to output the content for this page. * @return false|string The resulting page's hook_suffix, or false if the user does not have the capability required. */ diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 87236d4846..32cdc0214e 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -892,7 +892,10 @@ function wp_import_upload_form( $action ) { * @param string|array|WP_Screen $screen Optional. The screen or screens on which to show the box * (such as a post type, 'link', or 'comment'). Accepts a single * screen ID, WP_Screen object, or array of screen IDs. Default - * is the current screen. + * is the current screen. If you have used add_menu_page() or + * add_submenu_page() to create a new screen (and hence screen_id), + * make sure your menu slug conforms to the limits of sanitize_key() + * otherwise the 'screen' menu may not correctly render on your page. * @param string $context Optional. The context within the screen where the boxes * should display. Available contexts vary from screen to * screen. Post edit screen contexts include 'normal', 'side', @@ -987,7 +990,11 @@ function add_meta_box( $id, $title, $callback, $screen = null, $context = 'advan * @global array $wp_meta_boxes * * @staticvar bool $already_sorted - * @param string|WP_Screen $screen Screen identifier + * + * @param string|WP_Screen $screen Screen identifier. If you have used add_menu_page() or + * add_submenu_page() to create a new screen (and hence screen_id) + * make sure your menu slug conforms to the limits of sanitize_key() + * otherwise the 'screen' menu may not correctly render on your page. * @param string $context box context * @param mixed $object gets passed to the box callback function as first parameter * @return int number of meta_boxes diff --git a/wp-includes/version.php b/wp-includes/version.php index 5c65195920..37594021a3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-40966'; +$wp_version = '4.9-alpha-40967'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.