diff --git a/src/js/media/views/button/select-mode-toggle.js b/src/js/media/views/button/select-mode-toggle.js index 2c2335bcd56f6..858c0e16cb2e4 100644 --- a/src/js/media/views/button/select-mode-toggle.js +++ b/src/js/media/views/button/select-mode-toggle.js @@ -40,7 +40,7 @@ SelectModeToggle = Button.extend(/** @lends wp.media.view.SelectModeToggle.proto render: function() { Button.prototype.render.apply( this, arguments ); - this.$el.addClass( 'select-mode-toggle-button' ); + this.$el.addClass( 'select-mode-toggle-button button-compact' ); return this; }, diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css index 63e960b482c00..f48b8048c76e5 100644 --- a/src/wp-admin/css/common.css +++ b/src/wp-admin/css/common.css @@ -1417,6 +1417,17 @@ th.action-links { padding: 0; width: 50%; } + + .wp-filter .search-form input[type="search"] { + min-height: 40px; + padding: 0 12px; + } + + .wp-filter .search-form select, + .wp-filter .filter-items select { + min-height: 40px; + padding: 0 24px 0 12px; + } } @media only screen and (max-width: 320px) { diff --git a/src/wp-admin/css/forms.css b/src/wp-admin/css/forms.css index f2e5f9dcc5b53..c17d038c5d2c6 100644 --- a/src/wp-admin/css/forms.css +++ b/src/wp-admin/css/forms.css @@ -1798,9 +1798,10 @@ table.form-table td .updated p { p.search-box input[type="search"], p.search-box input[type="text"] { min-height: 40px; + padding: 0 12px; } - p.search-box input[type="submit"] { + p.search-box input[type="submit"].button { margin-bottom: 10px; } @@ -1944,6 +1945,7 @@ table.form-table td .updated p { .options-general-php input[type="text"].small-text { max-width: 6.25em; margin: 0; + min-height: 40px; } /* Privacy Policy settings screen */ diff --git a/src/wp-admin/css/list-tables.css b/src/wp-admin/css/list-tables.css index 56d88d6801ddb..4eaa682127cc0 100644 --- a/src/wp-admin/css/list-tables.css +++ b/src/wp-admin/css/list-tables.css @@ -1537,13 +1537,6 @@ div.action-links, margin: 0; /* Override existing margins */ } -/* Use compact size for space-constrained plugin cards */ -.plugin-action-buttons li .button { - min-height: 32px; - line-height: 2.30769231; /* 30px for 32px min-height */ - padding: 0 12px; -} - .plugin-card h3 { margin: 0 12px 16px 0; font-size: 18px; diff --git a/src/wp-admin/css/media.css b/src/wp-admin/css/media.css index 805868a286304..5a169cfde9e01 100644 --- a/src/wp-admin/css/media.css +++ b/src/wp-admin/css/media.css @@ -374,6 +374,10 @@ .find-box-inside { bottom: 57px; } + + #delete_all { + margin-bottom: 0; + } } @media screen and (max-width: 660px) { @@ -1396,7 +1400,6 @@ audio, video { .wp-filter p.search-box { float: none; width: 100%; - margin-bottom: 20px; display: flex; flex-wrap: nowrap; column-gap: 0; @@ -1413,6 +1416,20 @@ audio, video { top: 46px; right: 10px; } + + .media-frame.mode-grid .media-toolbar select { + min-height: 40px; + padding: 0 24px 0 12px; + } + + .media-frame.mode-grid .media-toolbar input[type="search"] { + min-height: 40px; + padding: 0 12px; + } + + .wp-filter p.search-box { + margin-bottom: 0; + } } @media only screen and (max-width: 600px) { diff --git a/src/wp-admin/css/themes.css b/src/wp-admin/css/themes.css index 4a644974c50c4..e7eadd7f6941d 100644 --- a/src/wp-admin/css/themes.css +++ b/src/wp-admin/css/themes.css @@ -119,9 +119,6 @@ body.js .theme-browser.search-loading { .theme-browser .theme .theme-actions .button { float: none; margin-left: 3px; - min-height: 32px; - line-height: 2.30769231; /* 30px for 32px min-height */ - padding: 0 12px; } .theme-browser .theme .theme-actions .button.updated-message::before, @@ -1968,6 +1965,8 @@ body.full-overlay-active { .theme-install-overlay .wp-full-overlay-header .button { float: right; margin: 7px 10px 0 0; /* Vertically center 32px button in 45px header */ + min-height: 32px; + line-height: 2.30769231; /* 30px for 32px height with 13px font */ } .theme-install-overlay .wp-full-overlay-sidebar { diff --git a/src/wp-admin/includes/class-wp-media-list-table.php b/src/wp-admin/includes/class-wp-media-list-table.php index 572dc154de639..152ca94c6800d 100644 --- a/src/wp-admin/includes/class-wp-media-list-table.php +++ b/src/wp-admin/includes/class-wp-media-list-table.php @@ -247,7 +247,7 @@ protected function extra_tablenav( $which ) { if ( $this->is_trash && $this->has_items() && current_user_can( 'edit_others_posts' ) ) { - submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false ); + submit_button( __( 'Empty Trash' ), 'apply button-compact', 'delete_all', false ); } ?> @@ -351,7 +351,7 @@ public function views() { ?> - +
diff --git a/src/wp-admin/includes/plugin-install.php b/src/wp-admin/includes/plugin-install.php index 7607b8823bb99..6b1a615a57ab8 100644 --- a/src/wp-admin/includes/plugin-install.php +++ b/src/wp-admin/includes/plugin-install.php @@ -940,7 +940,7 @@ function wp_get_plugin_action_button( $name, $data, $compatible_php, $compatible if ( $status['url'] ) { if ( $compatible_php && $compatible_wp && $all_plugin_dependencies_installed && ! empty( $data->download_link ) ) { $button = sprintf( - '%s', + '%s', esc_attr( $data->slug ), esc_url( $status['url'] ), /* translators: %s: Plugin name and version. */ @@ -950,7 +950,7 @@ function wp_get_plugin_action_button( $name, $data, $compatible_php, $compatible ); } else { $button = sprintf( - '', + '', _x( 'Install Now', 'plugin' ) ); } @@ -961,7 +961,7 @@ function wp_get_plugin_action_button( $name, $data, $compatible_php, $compatible if ( $status['url'] ) { if ( $compatible_php && $compatible_wp ) { $button = sprintf( - '%s', + '%s', esc_attr( $status['file'] ), esc_attr( $data->slug ), esc_url( $status['url'] ), @@ -972,7 +972,7 @@ function wp_get_plugin_action_button( $name, $data, $compatible_php, $compatible ); } else { $button = sprintf( - '', + '', _x( 'Update Now', 'plugin' ) ); } @@ -983,7 +983,7 @@ function wp_get_plugin_action_button( $name, $data, $compatible_php, $compatible case 'newer_installed': if ( is_plugin_active( $status['file'] ) ) { $button = sprintf( - '', + '', _x( 'Active', 'plugin' ) ); } elseif ( current_user_can( 'activate_plugin', $status['file'] ) ) { @@ -1008,7 +1008,7 @@ function wp_get_plugin_action_button( $name, $data, $compatible_php, $compatible } $button = sprintf( - '%6$s', + '%6$s', esc_url( $activate_url ), esc_attr( $name ), esc_attr( $data->slug ), @@ -1018,13 +1018,13 @@ function wp_get_plugin_action_button( $name, $data, $compatible_php, $compatible ); } else { $button = sprintf( - '', + '', is_network_admin() ? _x( 'Network Activate', 'plugin' ) : _x( 'Activate', 'plugin' ) ); } } else { $button = sprintf( - '', + '', _x( 'Installed', 'plugin' ) ); } diff --git a/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php index 5723f8e6244cc..fc24334abff85 100644 --- a/src/wp-admin/theme-install.php +++ b/src/wp-admin/theme-install.php @@ -408,21 +408,21 @@ ?> <# if ( data.activate_url ) { #> <# if ( ! data.active ) { #> - + <# } else { #> - + <# } #> <# } #> <# if ( data.customize_url ) { #> <# if ( ! data.active ) { #> <# if ( ! data.block_theme ) { #> - + <# } #> <# } else { #> - + <# } #> <# } else { #> - + <# } #> <# } else { #> <# if ( data.activate_url ) { #> - + <# } #> <# if ( data.customize_url ) { #> - + <# } else { #> - + <# } #> <# } #> <# } else { #> @@ -444,15 +444,15 @@ /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Install %s', 'theme' ), '{{ data.name }}' ); ?> - - + + <# } else { #> - - + + <# } #> <# } #> @@ -487,18 +487,18 @@ $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); ?> <# if ( ! data.active ) { #> - + <# } else { #> - + <# } #> <# } else { #> - + <# } #> <# } else { #> <# if ( data.compatible_wp && data.compatible_php ) { #> - + <# } else { #> - + <# } #> <# } #> diff --git a/src/wp-admin/themes.php b/src/wp-admin/themes.php index ca9f52b2a164f..a9f24765ce742 100644 --- a/src/wp-admin/themes.php +++ b/src/wp-admin/themes.php @@ -381,18 +381,18 @@ $menu_hook = get_plugin_page_hook( $submenu[ $item[2] ][0][2], $item[2] ); if ( file_exists( WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}" ) || ! empty( $menu_hook ) ) { - $current_theme_actions[] = "{$item[0]}"; + $current_theme_actions[] = "{$item[0]}"; } else { - $current_theme_actions[] = "{$item[0]}"; + $current_theme_actions[] = "{$item[0]}"; } } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { $menu_file = $item[2]; if ( current_user_can( 'customize' ) ) { if ( 'custom-header' === $menu_file ) { - $current_theme_actions[] = "{$item[0]}"; + $current_theme_actions[] = "{$item[0]}"; } elseif ( 'custom-background' === $menu_file ) { - $current_theme_actions[] = "{$item[0]}"; + $current_theme_actions[] = "{$item[0]}"; } } @@ -402,9 +402,9 @@ } if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) { - $current_theme_actions[] = "{$item[0]}"; + $current_theme_actions[] = "{$item[0]}"; } else { - $current_theme_actions[] = "{$item[0]}"; + $current_theme_actions[] = "{$item[0]}"; } } } @@ -609,7 +609,7 @@ /* translators: %s: Theme name. */ $customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), $theme['name'] ); ?> - @@ -619,7 +619,7 @@ /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); ?> - @@ -630,7 +630,7 @@ /* translators: %s: Theme name. */ $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); ?> - @@ -640,7 +640,7 @@ /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' ); ?> - @@ -649,7 +649,7 @@ /* translators: %s: Theme name. */ $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); ?> - @@ -1001,7 +1001,7 @@ function wp_theme_auto_update_setting_template() { /* translators: %s: Theme name. */ $customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), '{{ data.name }}' ); ?> - @@ -1012,7 +1012,7 @@ function wp_theme_auto_update_setting_template() { /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' ); ?> - @@ -1021,7 +1021,7 @@ function wp_theme_auto_update_setting_template() { /* translators: %s: Theme name. */ $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); ?> - @@ -1030,7 +1030,7 @@ function wp_theme_auto_update_setting_template() { /* translators: %s: Theme name. */ $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' ); ?> - @@ -1038,7 +1038,7 @@ function wp_theme_auto_update_setting_template() { /* translators: %s: Theme name. */ $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' ); ?> - <# } #> @@ -1251,7 +1251,7 @@ function wp_theme_auto_update_setting_template() {test source value
', ), + 'list item block' => array( + 'content', + << +Hello WordPress!
'; + $elements_class_names = array(); + $count = 2; + for ( $i = 0; $i < $count; $i++ ) { + $rendered_block = wp_render_elements_class_name( $block_markup, wp_render_elements_support_styles( $block ) ); + + $processor = new WP_HTML_Tag_Processor( $rendered_block ); + $this->assertTrue( $processor->next_tag( 'P' ), "Expected paragraph in block #$i." ); + $elements_class_name = array_first( + array_filter( + iterator_to_array( $processor->class_list() ), + fn( string $class_name ) => (bool) preg_match( '/^wp-elements-\d+$/', $class_name ) + ) + ); + $this->assertIsString( $elements_class_name, "Expected wp-elements class in block #$i." ); + $elements_class_names[] = $elements_class_name; + } + + $this->assertSame( $count, count( array_unique( $elements_class_names ) ), 'Expected each rendered block to have a unique wp-elements class name.' ); + } + /** * Data provider. * @@ -238,7 +302,7 @@ public function data_elements_block_support_class() { 'button' => array( 'color' => $color_styles ), ), 'block_markup' => 'Hello WordPress!
', - 'expected_markup' => '/^Hello WordPress<\/a>!<\/p>$/',
+ 'expected_markup' => '/^ Hello WordPress<\/a>!<\/p>$/',
),
'link element styles apply class to wrapper' => array(
'color_settings' => array( 'link' => true ),
@@ -246,7 +310,7 @@ public function data_elements_block_support_class() {
'link' => array( 'color' => $color_styles ),
),
'block_markup' => ' Hello WordPress! Hello WordPress<\/a>!<\/p>$/',
+ 'expected_markup' => '/^ Hello WordPress<\/a>!<\/p>$/',
),
'heading element styles apply class to wrapper' => array(
'color_settings' => array( 'heading' => true ),
@@ -254,7 +318,7 @@ public function data_elements_block_support_class() {
'heading' => array( 'color' => $color_styles ),
),
'block_markup' => ' Hello WordPress! Hello WordPress<\/a>!<\/p>$/',
+ 'expected_markup' => '/^ Hello WordPress<\/a>!<\/p>$/',
),
'element styles apply class to wrapper when it has other classes' => array(
'color_settings' => array( 'link' => true ),
@@ -262,7 +326,7 @@ public function data_elements_block_support_class() {
'link' => array( 'color' => $color_styles ),
),
'block_markup' => ' Hello WordPress! Hello WordPress<\/a>!<\/p>$/',
+ 'expected_markup' => '/^ Hello WordPress<\/a>!<\/p>$/',
),
'element styles apply class to wrapper when it has other attributes' => array(
'color_settings' => array( 'link' => true ),
@@ -270,7 +334,7 @@ public function data_elements_block_support_class() {
'link' => array( 'color' => $color_styles ),
),
'block_markup' => ' Hello WordPress!