Skip to content

Commit 0c6c00f

Browse files
committed
Administration: Support compact button shorthand.
Add `compact` to the type shorthands expanded by `get_submit_button()`, so passing `compact` now yields the `button-compact` class. This matches the existing `primary`, `small`, and `large` shorthands. Developed in: WordPress/wordpress-develop#11305 Props motylanogha, niravsherasiya7707, wildworks. Fixes #64892. Built from https://develop.svn.wordpress.org/trunk@62756 git-svn-id: http://core.svn.wordpress.org/trunk@62040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent 59c6709 commit 0c6c00f

9 files changed

Lines changed: 13 additions & 13 deletions

‎wp-admin/customize.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
<?php if ( $compatible_wp && $compatible_php ) : ?>
199199
<?php $save_text = $wp_customize->is_theme_active() ? __( 'Publish' ) : __( 'Activate &amp; Publish' ); ?>
200200
<div id="customize-save-button-wrapper" class="customize-save-button-wrapper" >
201-
<?php submit_button( $save_text, 'primary button-compact save', 'save', false ); ?>
201+
<?php submit_button( $save_text, 'primary compact save', 'save', false ); ?>
202202
<button id="publish-settings" class="publish-settings button-primary button-compact button dashicons dashicons-admin-generic" aria-label="<?php esc_attr_e( 'Publish Settings' ); ?>" aria-expanded="false" disabled></button>
203203
</div>
204204
<?php else : ?>

‎wp-admin/includes/class-wp-comments-list-table.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ protected function extra_tablenav( $which ) {
442442

443443
if ( ! empty( $output ) && $this->has_items() ) {
444444
echo $output;
445-
submit_button( __( 'Filter' ), 'button-compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
445+
submit_button( __( 'Filter' ), 'compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
446446
}
447447
}
448448

‎wp-admin/includes/class-wp-links-list-table.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ protected function extra_tablenav( $which ) {
123123

124124
wp_dropdown_categories( $dropdown_options );
125125

126-
submit_button( __( 'Filter' ), 'button-compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
126+
submit_button( __( 'Filter' ), 'compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
127127
?>
128128
</div>
129129
<?php

‎wp-admin/includes/class-wp-list-table.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ public function search_box( $text, $input_id ) {
416416
<p class="search-box">
417417
<label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label>
418418
<input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>" />
419-
<?php submit_button( $text, 'button-compact', '', false, array( 'id' => 'search-submit' ) ); ?>
419+
<?php submit_button( $text, 'compact', '', false, array( 'id' => 'search-submit' ) ); ?>
420420
</p>
421421
<?php
422422
}
@@ -632,7 +632,7 @@ protected function bulk_actions( $which = '' ) {
632632

633633
echo "</select>\n";
634634

635-
submit_button( __( 'Apply' ), 'action button-compact', 'bulk_action', false, array( 'id' => "doaction$two" ) );
635+
submit_button( __( 'Apply' ), 'action compact', 'bulk_action', false, array( 'id' => "doaction$two" ) );
636636
echo "\n";
637637
}
638638

‎wp-admin/includes/class-wp-media-list-table.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,12 +242,12 @@ protected function extra_tablenav( $which ) {
242242
/** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
243243
do_action( 'restrict_manage_posts', $this->screen->post_type, $which );
244244

245-
submit_button( __( 'Filter' ), 'button-compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
245+
submit_button( __( 'Filter' ), 'compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
246246

247247
if ( $this->is_trash && $this->has_items()
248248
&& current_user_can( 'edit_others_posts' )
249249
) {
250-
submit_button( __( 'Empty Trash' ), 'apply button-compact', 'delete_all', false );
250+
submit_button( __( 'Empty Trash' ), 'apply compact', 'delete_all', false );
251251
}
252252
?>
253253
</div>

‎wp-admin/includes/class-wp-posts-list-table.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ protected function extra_tablenav( $which ) {
596596

597597
if ( ! empty( $output ) ) {
598598
echo $output;
599-
submit_button( __( 'Filter' ), 'button-compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
599+
submit_button( __( 'Filter' ), 'compact', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
600600
}
601601
}
602602

‎wp-admin/includes/media.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2905,7 +2905,7 @@ function media_upload_library_form( $errors ) {
29052905
</select>
29062906
<?php } ?>
29072907

2908-
<?php submit_button( __( 'Filter &#187;' ), 'button-compact', 'post-query-submit', false ); ?>
2908+
<?php submit_button( __( 'Filter &#187;' ), 'compact', 'post-query-submit', false ); ?>
29092909

29102910
</div>
29112911

‎wp-admin/includes/template.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2562,7 +2562,7 @@ function compression_test() {
25622562
*
25632563
* @param string $text Optional. The text of the button. Defaults to 'Save Changes'.
25642564
* @param string $type Optional. The type and CSS class(es) of the button. Core values
2565-
* include 'primary', 'small', and 'large'. Default 'primary'.
2565+
* include 'primary', 'small', 'compact' and 'large'. Default 'primary'.
25662566
* @param string $name Optional. The HTML name of the submit button. If no `id` attribute
25672567
* is given in the `$other_attributes` parameter, `$name` will be used
25682568
* as the button's `id`. Default 'submit'.
@@ -2586,7 +2586,7 @@ function submit_button( $text = '', $type = 'primary', $name = 'submit', $wrap =
25862586
*
25872587
* @param string $text Optional. The text of the button. Defaults to 'Save Changes'.
25882588
* @param string $type Optional. The type and CSS class(es) of the button. Core values
2589-
* include 'primary', 'small', and 'large'. Default 'primary large'.
2589+
* include 'primary', 'small', 'compact' and 'large'. Default 'primary large'.
25902590
* @param string $name Optional. The HTML name of the submit button. If no `id` attribute
25912591
* is given in the `$other_attributes` parameter, `$name` will be used
25922592
* as the button's `id`. Default 'submit'.
@@ -2605,7 +2605,7 @@ function get_submit_button( $text = '', $type = 'primary large', $name = 'submit
26052605
$type = explode( ' ', $type );
26062606
}
26072607

2608-
$button_shorthand = array( 'primary', 'small', 'large' );
2608+
$button_shorthand = array( 'primary', 'small', 'large', 'compact' );
26092609
$classes = array( 'button' );
26102610

26112611
foreach ( $type as $t ) {

‎wp-includes/version.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @global string $wp_version
1818
*/
19-
$wp_version = '7.1-alpha-62755';
19+
$wp_version = '7.1-alpha-62756';
2020

2121
/**
2222
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 commit comments

Comments
 (0)