Make WordPress Core


Ignore:
Timestamp:
06/10/2020 06:25:17 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 3.9 branch.
Props xknown, sstoqnov, vortfu, SergeyBiryukov, whyisjake.

Location:
branches/3.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.9

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

    r27379 r47966  
    404404                break;
    405405            default:
     406                if ( '_page' === substr( $option, -5 ) || 'layout_columns' === $option ) {
     407                    /**
     408                     * Filters a screen option value before it is set.
     409                     *
     410                     * The filter can also be used to modify non-standard [items]_per_page
     411                     * settings. See the parent function for a full list of standard options.
     412                     *
     413                     * Returning false to the filter will skip saving the current option.
     414                     *
     415                     * @since 2.8.0
     416                     * @since 5.4.2 Only applied to options ending with '_page',
     417                     *              or the 'layout_columns' option.
     418                     *
     419                     * @see set_screen_options()
     420                     *
     421                     * @param bool   $keep   Whether to save or skip saving the screen option value.
     422                     *                       Default false.
     423                     * @param string $option The option name.
     424                     * @param int    $value  The number of rows to use.
     425                     */
     426                    $value = apply_filters( 'set-screen-option', false, $option, $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     427                }
    406428
    407429                /**
    408430                 * Filter a screen option value before it is set.
    409431                 *
    410                  * The filter can also be used to modify non-standard [items]_per_page
    411                  * settings. See the parent function for a full list of standard options.
     432                 * The dynamic portion of the hook, `$option`, refers to the option name.
    412433                 *
    413434                 * Returning false to the filter will skip saving the current option.
    414435                 *
    415                  * @since 2.8.0
     436                 * @since 5.4.2
    416437                 *
    417438                 * @see set_screen_options()
    418439                 *
    419                  * @param bool|int $value  Screen option value. Default false to skip.
    420                  * @param string   $option The option name.
    421                  * @param int      $value  The number of rows to use.
     440                 * @param bool   $keep   Whether to save or skip saving the screen option value.
     441                 *                       Default false.
     442                 * @param string $option The option name.
     443                 * @param int    $value  The number of rows to use.
    422444                 */
    423                 $value = apply_filters( 'set-screen-option', false, $option, $value );
     445                $value = apply_filters( "set_screen_option_{$option}", false, $option, $value );
    424446
    425447                if ( false === $value )
Note: See TracChangeset for help on using the changeset viewer.