Make WordPress Core

Ticket #45464: 45464.2.diff

File 45464.2.diff, 6.3 KB (added by kraftbj, 5 years ago)

Original patch + PHPCS fixes for updated lines.

  • src/wp-includes/meta.php

    diff --git src/wp-includes/meta.php src/wp-includes/meta.php
    index 0d4eabe1ad..8c042d4c82 100644
    function is_protected_meta( $meta_key, $meta_type = null ) { 
    10591059 *
    10601060 * @param string $meta_key       Meta key.
    10611061 * @param mixed  $meta_value     Meta value to sanitize.
    1062  * @param string $object_type    Type of object the meta is registered to.
     1062 * @param string $object_type    Type of object this meta is registered to. Accepts any value with an associated meta table.
     1063 *                               (e.g. comment, post, term, user, my_custom_meta)
    10631064 * @param string $object_subtype Optional. The subtype of the object type.
    10641065 *
    10651066 * @return mixed Sanitized $meta_value.
    function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = 
    10781079                 *
    10791080                 * @param mixed  $meta_value     Meta value to sanitize.
    10801081                 * @param string $meta_key       Meta key.
    1081                  * @param string $object_type    Object type.
     1082                 * @param string $object_type    Type of object this meta is registered to. Accepts any value with an associated meta table.
     1083                 *                               (e.g. comment, post, term, user, my_custom_meta)
    10821084                 * @param string $object_subtype Object subtype.
    10831085                 */
    10841086                return apply_filters( "sanitize_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", $meta_value, $meta_key, $object_type, $object_subtype );
    function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = 
    10951097         *
    10961098         * @param mixed  $meta_value      Meta value to sanitize.
    10971099         * @param string $meta_key        Meta key.
    1098          * @param string $object_type     Object type.
     1100         * @param string $object_type     Type of object this meta is registered to. Accepts any value with an associated meta table.
     1101         *                                (e.g. comment, post, term, user, my_custom_meta)
    10991102         */
    11001103        return apply_filters( "sanitize_{$object_type}_meta_{$meta_key}", $meta_value, $meta_key, $object_type );
    11011104}
    function sanitize_meta( $meta_key, $meta_value, $object_type, $object_subtype = 
    11171120 * @since 4.9.8 The `$object_subtype` argument was added to the arguments array.
    11181121 * @since 5.3.0 Valid meta types expanded to include "array" and "object".
    11191122 *
    1120  * @param string $object_type    Type of object this meta is registered to.
     1123 * @param string $object_type    Type of object this meta is registered to. Accepts any value with an associated meta table.
     1124 *                               (e.g. comment, post, term, user, my_custom_meta)
    11211125 * @param string $meta_key       Meta key to register.
    11221126 * @param array  $args {
    11231127 *     Data used to describe the meta key when registered.
    function register_meta( $object_type, $meta_key, $args, $deprecated = null ) { 
    11861190         *
    11871191         * @param array  $args        Array of meta registration arguments.
    11881192         * @param array  $defaults    Array of default arguments.
    1189          * @param string $object_type Object type.
     1193         * @param string $object_type Type of object this meta is registered to. Accepts any value with an associated meta table.
     1194         *                            (e.g. comment, post, term, user, my_custom_meta)
    11901195         * @param string $meta_key    Meta key.
    11911196         */
    11921197        $args = apply_filters( 'register_meta_args', $args, $defaults, $object_type, $meta_key );
    function register_meta( $object_type, $meta_key, $args, $deprecated = null ) { 
    12471252 * @since 4.6.0
    12481253 * @since 4.9.8 The `$object_subtype` parameter was added.
    12491254 *
    1250  * @param string $object_type    The type of object.
     1255 * @param string $object_type    Type of object this meta is registered to. Accepts any value with an associated meta table.
     1256 *                               (e.g. comment, post, term, user, my_custom_meta)
    12511257 * @param string $meta_key       The meta key.
    12521258 * @param string $object_subtype Optional. The subtype of the object type.
    12531259 *
    function registered_meta_key_exists( $object_type, $meta_key, $object_subtype = 
    12661272 * @since 4.6.0
    12671273 * @since 4.9.8 The `$object_subtype` parameter was added.
    12681274 *
    1269  * @param string $object_type    The type of object.
     1275 * @param string $object_type    Type of object this meta is registered to. Accepts any value with an associated meta table.
     1276 *                               (e.g. comment, post, term, user, my_custom_meta)
    12701277 * @param string $meta_key       The meta key.
    12711278 * @param string $object_subtype Optional. The subtype of the object type.
    12721279 * @return bool True if successful. False if the meta key was not registered.
    function unregister_meta_key( $object_type, $meta_key, $object_subtype = '' ) { 
    13151322 * @since 4.6.0
    13161323 * @since 4.9.8 The `$object_subtype` parameter was added.
    13171324 *
    1318  * @param string $object_type    The type of object. Post, comment, user, term.
     1325 * @param string $object_type    Type of object this meta is registered to. Accepts any value with an associated meta table.
     1326 *                               (e.g. comment, post, term, user, my_custom_meta)
    13191327 * @param string $object_subtype Optional. The subtype of the object type.
    13201328 * @return string[] List of registered meta keys.
    13211329 */
    function get_registered_meta_keys( $object_type, $object_subtype = '' ) { 
    13371345 *
    13381346 * @since 4.6.0
    13391347 *
    1340  * @param string $object_type Type of object to request metadata for. (e.g. comment, post, term, user)
     1348 * @param string $object_type Type of object this meta is registered to. Accepts any value with an associated meta table.
     1349 *                            (e.g. comment, post, term, user, my_custom_meta)
    13411350 * @param int    $object_id   ID of the object the metadata is for.
    13421351 * @param string $meta_key    Optional. Registered metadata key. If not specified, retrieve all registered
    13431352 *                            metadata for the specified object.
    function _wp_register_meta_args_whitelist( $args, $default_args ) { 
    13991408 *
    14001409 * @since 4.9.8
    14011410 *
    1402  * @param string $object_type Type of object to request metadata for. (e.g. comment, post, term, user)
     1411 * @param string $object_type Type of object this meta is registered to. Accepts any value with an associated meta table.
     1412 *                            (e.g. comment, post, term, user, my_custom_meta)
    14031413 * @param int    $object_id   ID of the object to retrieve its subtype.
    14041414 * @return string The object subtype or an empty string if unspecified subtype.
    14051415 */