diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css index ea7211dbaa..5f03d8a381 100644 --- a/src/wp-admin/css/common.css +++ b/src/wp-admin/css/common.css @@ -1629,6 +1629,11 @@ form.upgrade .hint { margin-top: 10px; } +.metabox-prefs .submit { + margin-top: 1em; + padding: 0; +} + /*------------------------------------------------------------------------------ 6.2 - Help Menu ------------------------------------------------------------------------------*/ diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php index 311bdd0b54..100fa132ed 100644 --- a/src/wp-admin/includes/class-wp-screen.php +++ b/src/wp-admin/includes/class-wp-screen.php @@ -993,6 +993,21 @@ final class WP_Screen { $this->render_per_page_options(); echo $this->_screen_settings; + /** + * Filter whether to show the Screen Options submit button. + * + * @since 4.4.0 + * + * @param bool $show_button Whether to show Screen Options submit button. + * Default false. + * @param WP_Screen $this Current WP_Screen instance. + */ + $show_button = apply_filters( 'screen_options_show_submit', false, $this ); + + if ( $show_button ) { + submit_button( __( 'Apply' ), 'primary', 'screen-options-apply', true ); + } + echo $form_end . $wrapper_end; } @@ -1155,6 +1170,9 @@ final class WP_Screen { $per_page = apply_filters( 'edit_posts_per_page', $per_page, $this->post_type ); } + // This needs a submit button + add_filter( 'screen_options_show_submit', '__return_true' ); + ?>
@@ -1163,10 +1181,8 @@ final class WP_Screen { - - + +