Make WordPress Core


Ignore:
Timestamp:
09/27/2022 03:21:48 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Users: Correctly pass the context property for persisted preferences.

The user meta context property in wp_register_persisted_preferences_meta() was incorrectly configured. It should be part of the schema array, not the show_in_rest array.

Follow-up to [54182].

Props talldanwp, dd32.
Fixes #56665. See #56467.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/user/wpRegisterPersistedPreferencesMeta.php

    r54182 r54329  
    3737                'auth_callback'     => '__return_true',
    3838                'show_in_rest'      => array(
    39                     'name'    => 'persisted_preferences',
    40                     'type'    => 'object',
    41                     'context' => array( 'edit' ),
    42                     'schema'  => array(
     39                    'name'   => 'persisted_preferences',
     40                    'type'   => 'object',
     41                    'schema' => array(
    4342                        'type'                 => 'object',
     43                        'context'              => array( 'edit' ),
    4444                        'properties'           => array(
    4545                            '_modified' => array(
Note: See TracChangeset for help on using the changeset viewer.