Skip to content

Commit 2b3bf40

Browse files
Comments: Revert unintended changes from [48822].
See #51044. git-svn-id: https://develop.svn.wordpress.org/trunk@48823 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 5f86129 commit 2b3bf40

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

src/wp-admin/includes/misc.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,8 @@ function set_screen_options() {
688688
}
689689
break;
690690
default:
691+
$screen_option = false;
692+
691693
if ( '_page' === substr( $option, -5 ) || 'layout_columns' === $option ) {
692694
/**
693695
* Filters a screen option value before it is set.
@@ -708,29 +710,27 @@ function set_screen_options() {
708710
* @param string $option The option name.
709711
* @param int $value The option value.
710712
*/
711-
$value = apply_filters( 'set-screen-option', false, $option, $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
712-
} else {
713-
/**
714-
* Filters a screen option value before it is set.
715-
*
716-
* The dynamic portion of the hook, `$option`, refers to the option name.
717-
*
718-
* Returning false from the filter will skip saving the current option.
719-
*
720-
* @since 5.4.2
721-
* @since 5.4.3 Only applied to options not ending with '_page',
722-
* and not the 'layout_columns' option.
723-
*
724-
* @see set_screen_options()
725-
*
726-
* @param mixed $screen_option The value to save instead of the option value.
727-
* Default false (to skip saving the current option).
728-
* @param string $option The option name.
729-
* @param int $value The option value.
730-
*/
731-
$value = apply_filters( "set_screen_option_{$option}", false, $option, $value );
713+
$screen_option = apply_filters( 'set-screen-option', $screen_option, $option, $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
732714
}
733715

716+
/**
717+
* Filters a screen option value before it is set.
718+
*
719+
* The dynamic portion of the hook, `$option`, refers to the option name.
720+
*
721+
* Returning false from the filter will skip saving the current option.
722+
*
723+
* @since 5.4.2
724+
*
725+
* @see set_screen_options()
726+
*
727+
* @param mixed $screen_option The value to save instead of the option value.
728+
* Default false (to skip saving the current option).
729+
* @param string $option The option name.
730+
* @param int $value The option value.
731+
*/
732+
$value = apply_filters( "set_screen_option_{$option}", $screen_option, $option, $value );
733+
734734
if ( false === $value ) {
735735
return;
736736
}

0 commit comments

Comments
 (0)