Make WordPress Core


Ignore:
Timestamp:
06/10/2020 06:50:15 PM (6 years ago)
Author:
whyisjake
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 4.8 branch.

Props xknown, sstoqnov, vortfu, SergeyBiryukov, whyisjake.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.8/src/wp-admin/includes/misc.php

    r38893 r47980  
    437437                                break;
    438438                        default:
     439                                if ( '_page' === substr( $option, -5 ) || 'layout_columns' === $option ) {
     440                                        /**
     441                                         * Filters a screen option value before it is set.
     442                                         *
     443                                         * The filter can also be used to modify non-standard [items]_per_page
     444                                         * settings. See the parent function for a full list of standard options.
     445                                         *
     446                                         * Returning false to the filter will skip saving the current option.
     447                                         *
     448                                         * @since 2.8.0
     449                                         * @since 5.4.2 Only applied to options ending with '_page',
     450                                         *              or the 'layout_columns' option.
     451                                         *
     452                                         * @see set_screen_options()
     453                                         *
     454                                         * @param bool   $keep   Whether to save or skip saving the screen option value.
     455                                         *                       Default false.
     456                                         * @param string $option The option name.
     457                                         * @param int    $value  The number of rows to use.
     458                                         */
     459                                        $value = apply_filters( 'set-screen-option', false, $option, $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     460                                }
    439461
    440462                                /**
    441463                                 * Filters a screen option value before it is set.
    442464                                 *
    443                                  * The filter can also be used to modify non-standard [items]_per_page
    444                                  * settings. See the parent function for a full list of standard options.
     465                                 * The dynamic portion of the hook, `$option`, refers to the option name.
    445466                                 *
    446467                                 * Returning false to the filter will skip saving the current option.
    447468                                 *
    448                                  * @since 2.8.0
     469                                 * @since 5.4.2
    449470                                 *
    450471                                 * @see set_screen_options()
    451472                                 *
    452                                  * @param bool|int $value  Screen option value. Default false to skip.
    453                                  * @param string   $option The option name.
    454                                  * @param int      $value  The number of rows to use.
     473                                 * @param bool   $keep   Whether to save or skip saving the screen option value.
     474                                 *                       Default false.
     475                                 * @param string $option The option name.
     476                                 * @param int    $value  The number of rows to use.
    455477                                 */
    456                                 $value = apply_filters( 'set-screen-option', false, $option, $value );
     478                                $value = apply_filters( "set_screen_option_{$option}", false, $option, $value );
    457479
    458480                                if ( false === $value )
Note: See TracChangeset for help on using the changeset viewer.