Make WordPress Core


Ignore:
Timestamp:
10/18/2020 06:55:16 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Formatting: Deprecate wp_slash_strings_only() in favor of wp_slash().

The reason for introducing wp_slash_strings_only() in [46454] was to keep non-string values untouched.

Later, wp_slash() itself was updated in [48433] to prevent changing non-string values.

To avoid confusion, wp_slash_strings_only() is now deprecated.

Props ayeshrajans, ocean90.
Fixes #50635.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php

    r48411 r49188  
    373373        }
    374374
    375         if ( ! update_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash_strings_only( $value ) ) ) {
     375        if ( ! update_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash( $value ) ) ) {
    376376            return new WP_Error(
    377377                'rest_meta_database_error',
Note: See TracChangeset for help on using the changeset viewer.