Make WordPress Core


Ignore:
Timestamp:
06/10/2020 06:21:10 PM (5 years ago)
Author:
desrosj
Message:

General: Backport several commits for release.

  • Embeds: Ensure that the title attribute is set correctly on embeds.
  • Editor: Prevent HTML decoding on by setting the proper editor context.
  • Formatting: Ensure that wp_validate_redirect() sanitizes a wider variety of characters.
  • Themes: Ensure a broken theme name is returned properly.
  • Administration: Add a new filter to extend set-screen-option.

Merges [47947-47951] to the 5.0 branch.
Props xknown, sstoqnov, vortfu, SergeyBiryukov, whyisjake.

Location:
branches/5.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0

  • branches/5.0/src/wp-admin/includes/misc.php

    r43939 r47964  
    621621                break;
    622622            default:
     623                if ( '_page' === substr( $option, -5 ) || 'layout_columns' === $option ) {
     624                    /**
     625                     * Filters a screen option value before it is set.
     626                     *
     627                     * The filter can also be used to modify non-standard [items]_per_page
     628                     * settings. See the parent function for a full list of standard options.
     629                     *
     630                     * Returning false to the filter will skip saving the current option.
     631                     *
     632                     * @since 2.8.0
     633                     * @since 5.4.2 Only applied to options ending with '_page',
     634                     *              or the 'layout_columns' option.
     635                     *
     636                     * @see set_screen_options()
     637                     *
     638                     * @param bool   $keep   Whether to save or skip saving the screen option value.
     639                     *                       Default false.
     640                     * @param string $option The option name.
     641                     * @param int    $value  The number of rows to use.
     642                     */
     643                    $value = apply_filters( 'set-screen-option', false, $option, $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     644                }
    623645
    624646                /**
    625647                 * Filters a screen option value before it is set.
    626648                 *
    627                  * The filter can also be used to modify non-standard [items]_per_page
    628                  * settings. See the parent function for a full list of standard options.
     649                 * The dynamic portion of the hook, `$option`, refers to the option name.
    629650                 *
    630651                 * Returning false to the filter will skip saving the current option.
    631652                 *
    632                  * @since 2.8.0
     653                 * @since 5.4.2
    633654                 *
    634655                 * @see set_screen_options()
    635656                 *
    636                  * @param bool|int $value  Screen option value. Default false to skip.
    637                  * @param string   $option The option name.
    638                  * @param int      $value  The number of rows to use.
     657                 * @param bool   $keep   Whether to save or skip saving the screen option value.
     658                 *                       Default false.
     659                 * @param string $option The option name.
     660                 * @param int    $value  The number of rows to use.
    639661                 */
    640                 $value = apply_filters( 'set-screen-option', false, $option, $value );
     662                $value = apply_filters( "set_screen_option_{$option}", false, $option, $value );
    641663
    642664                if ( false === $value )
Note: See TracChangeset for help on using the changeset viewer.