diff --git a/src/wp-admin/css/login.css b/src/wp-admin/css/login.css index 1f89db216eda0..64d39b3bf9cd2 100644 --- a/src/wp-admin/css/login.css +++ b/src/wp-admin/css/login.css @@ -125,6 +125,19 @@ p { position: relative; } +.js.login .has-password-toggle { + display: flex; +} + +.js.login .has-password-toggle .password-input { + padding-right: 0.3125rem; +} + +.js.login .has-password-toggle .button.wp-hide-pw { + border-color: inherit; + position: static; +} + .no-js .hide-if-no-js { display: none; } diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index f79c95428d056..0e6370d17fdd3 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -1069,7 +1069,7 @@ function update_meta( $meta_id, $meta_key, $meta_value ) { // /** - * Replaces hrefs of attachment anchors with up-to-date permalinks. + * Replace hrefs of attachment anchors with up-to-date permalinks. * * @since 2.3.0 * @access private @@ -1361,7 +1361,6 @@ function postbox_classes( $box_id, $screen_id ) { * @param string[] $classes An array of postbox classes. */ $classes = apply_filters( "postbox_classes_{$screen_id}_{$box_id}", $classes ); - return implode( ' ', $classes ); } @@ -2337,12 +2336,12 @@ function the_block_editor_meta_boxes() { } } - /* + /** * Sadly we probably cannot add this data directly into editor settings. * - * Some meta boxes need `admin_head` to fire for meta box registry. - * `admin_head` fires after `admin_enqueue_scripts`, which is where we create - * our editor instance. + * Some meta boxes need admin_head to fire for meta box registry. + * admin_head fires after admin_enqueue_scripts, which is where we create our + * editor instance. */ $script = 'window._wpLoadBlockEditor.then( function() { wp.data.dispatch( \'core/edit-post\' ).setAvailableMetaBoxesPerLocation( ' . wp_json_encode( $meta_boxes_per_location ) . ' ); @@ -2350,21 +2349,19 @@ function the_block_editor_meta_boxes() { wp_add_inline_script( 'wp-edit-post', $script ); - /* - * When `wp-edit-post` is output in the ``, the inline script needs to be manually printed. - * Otherwise, meta boxes will not display because inline scripts for `wp-edit-post` - * will not be printed again after this point. + /** + * When `wp-edit-post` is output in the ``, the inline script needs to be manually printed. Otherwise, + * meta boxes will not display because inline scripts for `wp-edit-post` will not be printed again after this point. */ if ( wp_script_is( 'wp-edit-post', 'done' ) ) { printf( "\n", trim( $script ) ); } - /* - * If the 'postcustom' meta box is enabled, then we need to perform - * some extra initialization on it. + /** + * If the 'postcustom' meta box is enabled, then we need to perform some + * extra initialization on it. */ $enable_custom_fields = (bool) get_user_meta( get_current_user_id(), 'enable_custom_fields', true ); - if ( $enable_custom_fields ) { $script = "( function( $ ) { if ( $('#postcustom').length ) { @@ -2408,9 +2405,8 @@ function the_block_editor_meta_box_post_form_hidden_fields( $post ) { wp_nonce_field( $nonce_action ); /* - * Some meta boxes hook into these actions to add hidden input fields in the classic post form. - * For backward compatibility, we can capture the output from these actions, - * and extract the hidden input fields. + * Some meta boxes hook into these actions to add hidden input fields in the classic post form. For backwards + * compatibility, we can capture the output from these actions, and extract the hidden input fields. */ ob_start(); /** This filter is documented in wp-admin/edit-form-advanced.php */ diff --git a/src/wp-includes/class-wp-customize-manager.php b/src/wp-includes/class-wp-customize-manager.php index 816665fa2d5aa..aaeb9d081db7f 100644 --- a/src/wp-includes/class-wp-customize-manager.php +++ b/src/wp-includes/class-wp-customize-manager.php @@ -5750,7 +5750,7 @@ public function has_published_pages() { } } } - return 0 !== count( get_pages( array( 'number' => 1 ) ) ); + return 0 !== count( get_pages() ); } /** diff --git a/src/wp-includes/class-wp-post-type.php b/src/wp-includes/class-wp-post-type.php index b5e4caa14cbd3..ef40f4ec9090f 100644 --- a/src/wp-includes/class-wp-post-type.php +++ b/src/wp-includes/class-wp-post-type.php @@ -44,14 +44,6 @@ final class WP_Post_Type { */ public $labels; - /** - * Default labels. - * - * @since 6.0.0 - * @var (string|null)[][] $default_labels - */ - protected static $default_labels = array(); - /** * A short descriptive summary of what the post type is. * @@ -793,69 +785,4 @@ public function get_rest_controller() { return $this->rest_controller; } - - /** - * Returns the default labels for post types. - * - * @since 6.0.0 - * - * @return (string|null)[][] The default labels for post types. - */ - public static function get_default_labels() { - if ( ! empty( self::$default_labels ) ) { - return self::$default_labels; - } - - self::$default_labels = array( - 'name' => array( _x( 'Posts', 'post type general name' ), _x( 'Pages', 'post type general name' ) ), - 'singular_name' => array( _x( 'Post', 'post type singular name' ), _x( 'Page', 'post type singular name' ) ), - 'add_new' => array( _x( 'Add New', 'post' ), _x( 'Add New', 'page' ) ), - 'add_new_item' => array( __( 'Add New Post' ), __( 'Add New Page' ) ), - 'edit_item' => array( __( 'Edit Post' ), __( 'Edit Page' ) ), - 'new_item' => array( __( 'New Post' ), __( 'New Page' ) ), - 'view_item' => array( __( 'View Post' ), __( 'View Page' ) ), - 'view_items' => array( __( 'View Posts' ), __( 'View Pages' ) ), - 'search_items' => array( __( 'Search Posts' ), __( 'Search Pages' ) ), - 'not_found' => array( __( 'No posts found.' ), __( 'No pages found.' ) ), - 'not_found_in_trash' => array( __( 'No posts found in Trash.' ), __( 'No pages found in Trash.' ) ), - 'parent_item_colon' => array( null, __( 'Parent Page:' ) ), - 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ), - 'archives' => array( __( 'Post Archives' ), __( 'Page Archives' ) ), - 'attributes' => array( __( 'Post Attributes' ), __( 'Page Attributes' ) ), - 'insert_into_item' => array( __( 'Insert into post' ), __( 'Insert into page' ) ), - 'uploaded_to_this_item' => array( __( 'Uploaded to this post' ), __( 'Uploaded to this page' ) ), - 'featured_image' => array( _x( 'Featured image', 'post' ), _x( 'Featured image', 'page' ) ), - 'set_featured_image' => array( _x( 'Set featured image', 'post' ), _x( 'Set featured image', 'page' ) ), - 'remove_featured_image' => array( _x( 'Remove featured image', 'post' ), _x( 'Remove featured image', 'page' ) ), - 'use_featured_image' => array( _x( 'Use as featured image', 'post' ), _x( 'Use as featured image', 'page' ) ), - 'filter_items_list' => array( __( 'Filter posts list' ), __( 'Filter pages list' ) ), - 'filter_by_date' => array( __( 'Filter by date' ), __( 'Filter by date' ) ), - 'items_list_navigation' => array( __( 'Posts list navigation' ), __( 'Pages list navigation' ) ), - 'items_list' => array( __( 'Posts list' ), __( 'Pages list' ) ), - 'item_published' => array( __( 'Post published.' ), __( 'Page published.' ) ), - 'item_published_privately' => array( __( 'Post published privately.' ), __( 'Page published privately.' ) ), - 'item_reverted_to_draft' => array( __( 'Post reverted to draft.' ), __( 'Page reverted to draft.' ) ), - 'item_scheduled' => array( __( 'Post scheduled.' ), __( 'Page scheduled.' ) ), - 'item_updated' => array( __( 'Post updated.' ), __( 'Page updated.' ) ), - 'item_link' => array( - _x( 'Post Link', 'navigation link block title' ), - _x( 'Page Link', 'navigation link block title' ), - ), - 'item_link_description' => array( - _x( 'A link to a post.', 'navigation link block description' ), - _x( 'A link to a page.', 'navigation link block description' ), - ), - ); - - return self::$default_labels; - } - - /** - * Resets the cache for the default labels. - * - * @since 6.0.0 - */ - public static function reset_default_labels() { - self::$default_labels = array(); - } } diff --git a/src/wp-includes/class-wp-taxonomy.php b/src/wp-includes/class-wp-taxonomy.php index 27b04d952bf60..81dc0bd40787a 100644 --- a/src/wp-includes/class-wp-taxonomy.php +++ b/src/wp-includes/class-wp-taxonomy.php @@ -42,14 +42,6 @@ final class WP_Taxonomy { */ public $labels; - /** - * Default labels. - * - * @since 6.0.0 - * @var (string|null)[][] $default_labels - */ - protected static $default_labels = array(); - /** * A short descriptive summary of what the taxonomy is for. * @@ -570,71 +562,4 @@ public function get_rest_controller() { return $this->rest_controller; } - - /** - * Returns the default labels for taxonomies. - * - * @since 6.0.0 - * - * @return (string|null)[][] The default labels for taxonomies. - */ - public static function get_default_labels() { - if ( ! empty( self::$default_labels ) ) { - return self::$default_labels; - } - - $name_field_description = __( 'The name is how it appears on your site.' ); - $slug_field_description = __( 'The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ); - $parent_field_description = __( 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.' ); - $desc_field_description = __( 'The description is not prominent by default; however, some themes may show it.' ); - - self::$default_labels = array( - 'name' => array( _x( 'Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ), - 'singular_name' => array( _x( 'Tag', 'taxonomy singular name' ), _x( 'Category', 'taxonomy singular name' ) ), - 'search_items' => array( __( 'Search Tags' ), __( 'Search Categories' ) ), - 'popular_items' => array( __( 'Popular Tags' ), null ), - 'all_items' => array( __( 'All Tags' ), __( 'All Categories' ) ), - 'parent_item' => array( null, __( 'Parent Category' ) ), - 'parent_item_colon' => array( null, __( 'Parent Category:' ) ), - 'name_field_description' => array( $name_field_description, $name_field_description ), - 'slug_field_description' => array( $slug_field_description, $slug_field_description ), - 'parent_field_description' => array( null, $parent_field_description ), - 'desc_field_description' => array( $desc_field_description, $desc_field_description ), - 'edit_item' => array( __( 'Edit Tag' ), __( 'Edit Category' ) ), - 'view_item' => array( __( 'View Tag' ), __( 'View Category' ) ), - 'update_item' => array( __( 'Update Tag' ), __( 'Update Category' ) ), - 'add_new_item' => array( __( 'Add New Tag' ), __( 'Add New Category' ) ), - 'new_item_name' => array( __( 'New Tag Name' ), __( 'New Category Name' ) ), - 'separate_items_with_commas' => array( __( 'Separate tags with commas' ), null ), - 'add_or_remove_items' => array( __( 'Add or remove tags' ), null ), - 'choose_from_most_used' => array( __( 'Choose from the most used tags' ), null ), - 'not_found' => array( __( 'No tags found.' ), __( 'No categories found.' ) ), - 'no_terms' => array( __( 'No tags' ), __( 'No categories' ) ), - 'filter_by_item' => array( null, __( 'Filter by category' ) ), - 'items_list_navigation' => array( __( 'Tags list navigation' ), __( 'Categories list navigation' ) ), - 'items_list' => array( __( 'Tags list' ), __( 'Categories list' ) ), - /* translators: Tab heading when selecting from the most used terms. */ - 'most_used' => array( _x( 'Most Used', 'tags' ), _x( 'Most Used', 'categories' ) ), - 'back_to_items' => array( __( '← Go to Tags' ), __( '← Go to Categories' ) ), - 'item_link' => array( - _x( 'Tag Link', 'navigation link block title' ), - _x( 'Category Link', 'navigation link block title' ), - ), - 'item_link_description' => array( - _x( 'A link to a tag.', 'navigation link block description' ), - _x( 'A link to a category.', 'navigation link block description' ), - ), - ); - - return self::$default_labels; - } - - /** - * Resets the cache for the default labels. - * - * @since 6.0.0 - */ - public static function reset_default_labels() { - self::$default_labels = array(); - } } diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 67704e9fd7549..182031cf99ced 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -18,8 +18,6 @@ * @since 2.9.0 */ function create_initial_post_types() { - WP_Post_Type::reset_default_labels(); - register_post_type( 'post', array( @@ -1957,7 +1955,46 @@ function _post_type_meta_capabilities( $capabilities = null ) { * @return object Object with all the labels as member variables. */ function get_post_type_labels( $post_type_object ) { - $nohier_vs_hier_defaults = WP_Post_Type::get_default_labels(); + $nohier_vs_hier_defaults = array( + 'name' => array( _x( 'Posts', 'post type general name' ), _x( 'Pages', 'post type general name' ) ), + 'singular_name' => array( _x( 'Post', 'post type singular name' ), _x( 'Page', 'post type singular name' ) ), + 'add_new' => array( _x( 'Add New', 'post' ), _x( 'Add New', 'page' ) ), + 'add_new_item' => array( __( 'Add New Post' ), __( 'Add New Page' ) ), + 'edit_item' => array( __( 'Edit Post' ), __( 'Edit Page' ) ), + 'new_item' => array( __( 'New Post' ), __( 'New Page' ) ), + 'view_item' => array( __( 'View Post' ), __( 'View Page' ) ), + 'view_items' => array( __( 'View Posts' ), __( 'View Pages' ) ), + 'search_items' => array( __( 'Search Posts' ), __( 'Search Pages' ) ), + 'not_found' => array( __( 'No posts found.' ), __( 'No pages found.' ) ), + 'not_found_in_trash' => array( __( 'No posts found in Trash.' ), __( 'No pages found in Trash.' ) ), + 'parent_item_colon' => array( null, __( 'Parent Page:' ) ), + 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ), + 'archives' => array( __( 'Post Archives' ), __( 'Page Archives' ) ), + 'attributes' => array( __( 'Post Attributes' ), __( 'Page Attributes' ) ), + 'insert_into_item' => array( __( 'Insert into post' ), __( 'Insert into page' ) ), + 'uploaded_to_this_item' => array( __( 'Uploaded to this post' ), __( 'Uploaded to this page' ) ), + 'featured_image' => array( _x( 'Featured image', 'post' ), _x( 'Featured image', 'page' ) ), + 'set_featured_image' => array( _x( 'Set featured image', 'post' ), _x( 'Set featured image', 'page' ) ), + 'remove_featured_image' => array( _x( 'Remove featured image', 'post' ), _x( 'Remove featured image', 'page' ) ), + 'use_featured_image' => array( _x( 'Use as featured image', 'post' ), _x( 'Use as featured image', 'page' ) ), + 'filter_items_list' => array( __( 'Filter posts list' ), __( 'Filter pages list' ) ), + 'filter_by_date' => array( __( 'Filter by date' ), __( 'Filter by date' ) ), + 'items_list_navigation' => array( __( 'Posts list navigation' ), __( 'Pages list navigation' ) ), + 'items_list' => array( __( 'Posts list' ), __( 'Pages list' ) ), + 'item_published' => array( __( 'Post published.' ), __( 'Page published.' ) ), + 'item_published_privately' => array( __( 'Post published privately.' ), __( 'Page published privately.' ) ), + 'item_reverted_to_draft' => array( __( 'Post reverted to draft.' ), __( 'Page reverted to draft.' ) ), + 'item_scheduled' => array( __( 'Post scheduled.' ), __( 'Page scheduled.' ) ), + 'item_updated' => array( __( 'Post updated.' ), __( 'Page updated.' ) ), + 'item_link' => array( + _x( 'Post Link', 'navigation link block title' ), + _x( 'Page Link', 'navigation link block title' ), + ), + 'item_link_description' => array( + _x( 'A link to a post.', 'navigation link block description' ), + _x( 'A link to a page.', 'navigation link block description' ), + ), + ); $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index 2f3298e1426d2..663c9bfe25de9 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -25,8 +25,6 @@ function create_initial_taxonomies() { global $wp_rewrite; - WP_Taxonomy::reset_default_labels(); - if ( ! did_action( 'init' ) ) { $rewrite = array( 'category' => false, @@ -661,7 +659,48 @@ function get_taxonomy_labels( $tax ) { $tax->labels['not_found'] = $tax->no_tagcloud; } - $nohier_vs_hier_defaults = WP_Taxonomy::get_default_labels(); + $name_field_description = __( 'The name is how it appears on your site.' ); + $slug_field_description = __( 'The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ); + $parent_field_description = __( 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.' ); + $desc_field_description = __( 'The description is not prominent by default; however, some themes may show it.' ); + + $nohier_vs_hier_defaults = array( + 'name' => array( _x( 'Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ), + 'singular_name' => array( _x( 'Tag', 'taxonomy singular name' ), _x( 'Category', 'taxonomy singular name' ) ), + 'search_items' => array( __( 'Search Tags' ), __( 'Search Categories' ) ), + 'popular_items' => array( __( 'Popular Tags' ), null ), + 'all_items' => array( __( 'All Tags' ), __( 'All Categories' ) ), + 'parent_item' => array( null, __( 'Parent Category' ) ), + 'parent_item_colon' => array( null, __( 'Parent Category:' ) ), + 'name_field_description' => array( $name_field_description, $name_field_description ), + 'slug_field_description' => array( $slug_field_description, $slug_field_description ), + 'parent_field_description' => array( null, $parent_field_description ), + 'desc_field_description' => array( $desc_field_description, $desc_field_description ), + 'edit_item' => array( __( 'Edit Tag' ), __( 'Edit Category' ) ), + 'view_item' => array( __( 'View Tag' ), __( 'View Category' ) ), + 'update_item' => array( __( 'Update Tag' ), __( 'Update Category' ) ), + 'add_new_item' => array( __( 'Add New Tag' ), __( 'Add New Category' ) ), + 'new_item_name' => array( __( 'New Tag Name' ), __( 'New Category Name' ) ), + 'separate_items_with_commas' => array( __( 'Separate tags with commas' ), null ), + 'add_or_remove_items' => array( __( 'Add or remove tags' ), null ), + 'choose_from_most_used' => array( __( 'Choose from the most used tags' ), null ), + 'not_found' => array( __( 'No tags found.' ), __( 'No categories found.' ) ), + 'no_terms' => array( __( 'No tags' ), __( 'No categories' ) ), + 'filter_by_item' => array( null, __( 'Filter by category' ) ), + 'items_list_navigation' => array( __( 'Tags list navigation' ), __( 'Categories list navigation' ) ), + 'items_list' => array( __( 'Tags list' ), __( 'Categories list' ) ), + /* translators: Tab heading when selecting from the most used terms. */ + 'most_used' => array( _x( 'Most Used', 'tags' ), _x( 'Most Used', 'categories' ) ), + 'back_to_items' => array( __( '← Go to Tags' ), __( '← Go to Categories' ) ), + 'item_link' => array( + _x( 'Tag Link', 'navigation link block title' ), + _x( 'Category Link', 'navigation link block title' ), + ), + 'item_link_description' => array( + _x( 'A link to a tag.', 'navigation link block description' ), + _x( 'A link to a category.', 'navigation link block description' ), + ), + ); $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; diff --git a/src/wp-login.php b/src/wp-login.php index 45c207d81a679..1b64b0c8c9039 100644 --- a/src/wp-login.php +++ b/src/wp-login.php @@ -941,11 +941,13 @@ function wp_login_viewport_meta() {

- +
+ - + +
@@ -1392,7 +1394,7 @@ function wp_login_viewport_meta() {
-
+
class="input password-input" value="" size="20" autocomplete="current-password" />