WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/10/2020 05:58:07 PM (17 months 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 [47948-47951] to the 5.3 branch.
Props xknown, sstoqnov, vortfu, SergeyBiryukov, whyisjake.

Location:
branches/5.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.3

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

    r45932 r47959  
    680680                break;
    681681            default:
     682                if ( '_page' === substr( $option, -5 ) || 'layout_columns' === $option ) {
     683                    /**
     684                     * Filters a screen option value before it is set.
     685                     *
     686                     * The filter can also be used to modify non-standard [items]_per_page
     687                     * settings. See the parent function for a full list of standard options.
     688                     *
     689                     * Returning false to the filter will skip saving the current option.
     690                     *
     691                     * @since 2.8.0
     692                     * @since 5.4.2 Only applied to options ending with '_page',
     693                     *              or the 'layout_columns' option.
     694                     *
     695                     * @see set_screen_options()
     696                     *
     697                     * @param bool   $keep   Whether to save or skip saving the screen option value.
     698                     *                       Default false.
     699                     * @param string $option The option name.
     700                     * @param int    $value  The number of rows to use.
     701                     */
     702                    $value = apply_filters( 'set-screen-option', false, $option, $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     703                }
     704
    682705                /**
    683706                 * Filters a screen option value before it is set.
    684707                 *
    685                  * The filter can also be used to modify non-standard [items]_per_page
    686                  * settings. See the parent function for a full list of standard options.
     708                 * The dynamic portion of the hook, `$option`, refers to the option name.
    687709                 *
    688710                 * Returning false to the filter will skip saving the current option.
    689711                 *
    690                  * @since 2.8.0
     712                 * @since 5.4.2
    691713                 *
    692714                 * @see set_screen_options()
    693715                 *
    694                  * @param bool     $keep   Whether to save or skip saving the screen option value. Default false.
    695                  * @param string   $option The option name.
    696                  * @param int      $value  The number of rows to use.
     716                 * @param bool   $keep   Whether to save or skip saving the screen option value.
     717                 *                       Default false.
     718                 * @param string $option The option name.
     719                 * @param int    $value  The number of rows to use.
    697720                 */
    698                 $value = apply_filters( 'set-screen-option', false, $option, $value );  // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
     721                $value = apply_filters( "set_screen_option_{$option}", false, $option, $value );
    699722
    700723                if ( false === $value ) {
Note: See TracChangeset for help on using the changeset viewer.