WordPress.org

Make WordPress Core

Ticket #37349: meta.diff

File meta.diff, 1.8 KB (added by mattkeys, 6 years ago)

Adding two new filters to sanitize_meta to allow for filtering of all meta values regardless of meta key

  • meta.php

     
    962962                 * @param string $object_subtype  Object subtype.
    963963                 */
    964964                $meta_value = apply_filters( "sanitize_{$object_type}_{$object_subtype}_meta_{$meta_key}", $meta_value, $meta_key, $object_type, $object_subtype );
     965
     966                /**
     967                 * Filters the sanitization of all meta keys of a specific meta type and subtype.
     968                 *
     969                 * The dynamic portions of the hook name, `$meta_type`, `$meta_subtype`,
     970                 * and `$meta_key`, refer to the metadata object type (comment, post, or user)
     971                 * the object subtype, and the meta key value, respectively.
     972                 *
     973                 * @since 4.6.0
     974                 *
     975                 * @param mixed  $meta_value      Meta value to sanitize.
     976                 * @param string $meta_key        Meta key.
     977                 * @param string $object_type     Object type.
     978                 * @param string $object_subtype  Object subtype.
     979                 */
     980                $meta_value = apply_filters( "sanitize_{$object_type}_{$object_subtype}_meta", $meta_value, $meta_key, $object_type, $object_subtype );
    965981        }
    966982
    967983        /**
     984         * Filters the sanitization of all meta keys of a specific meta type.
     985         *
     986         * The dynamic portions of the hook name, `$meta_type`, and `$meta_key`,
     987         * refer to the metadata object type (comment, post, or user) and the meta
     988         * key value, respectively.
     989         *
     990         * @param mixed  $meta_value      Meta value to sanitize.
     991         * @param string $meta_key        Meta key.
     992         * @param string $object_type     Object type.
     993         * @param string $object_subtype  Object subtype.
     994         */
     995        $meta_value = apply_filters( "sanitize_{$object_type}_meta", $meta_value, $meta_key, $object_type, $object_subtype );
     996
     997        /**
    968998         * Filters the sanitization of a specific meta key of a specific meta type.
    969999         *
    9701000         * The dynamic portions of the hook name, `$meta_type`, and `$meta_key`,