wp_privacy_anonymize_data

The timeline below displays how wordpress function wp_privacy_anonymize_data has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Returns uniform "anonymous" data by type.
 *
 * @since 4.9.6
 *
 * @param string $type The type of data to be anonymized.
 * @param string $data Optional. The data to be anonymized. Default empty string.
 * @return string The anonymous data for the requested type.
 */
function wp_privacy_anonymize_data($type, $data = '')
{
    switch ($type) {
        case 'email':
            $anonymous = '[email protected]';
            break;
        case 'url':
            $anonymous = 'https://site.invalid';
            break;
        case 'ip':
            $anonymous = wp_privacy_anonymize_ip($data);
            break;
        case 'date':
            $anonymous = '0000-00-00 00:00:00';
            break;
        case 'text':
            /* translators: Deleted text. */
            $anonymous = __('[deleted]');
            break;
        case 'longtext':
            /* translators: Deleted long text. */
            $anonymous = __('This content was deleted by the author.');
            break;
        default:
            $anonymous = '';
            break;
    }
    /**
     * Filters the anonymous data for each type.
     *
     * @since 4.9.6
     *
     * @param string $anonymous Anonymized data.
     * @param string $type      Type of the data.
     * @param string $data      Original data.
     */
    return apply_filters('wp_privacy_anonymize_data', $anonymous, $type, $data);
}

WordPress Version: 6.1

/**
 * Returns uniform "anonymous" data by type.
 *
 * @since 4.9.6
 *
 * @param string $type The type of data to be anonymized.
 * @param string $data Optional The data to be anonymized.
 * @return string The anonymous data for the requested type.
 */
function wp_privacy_anonymize_data($type, $data = '')
{
    switch ($type) {
        case 'email':
            $anonymous = '[email protected]';
            break;
        case 'url':
            $anonymous = 'https://site.invalid';
            break;
        case 'ip':
            $anonymous = wp_privacy_anonymize_ip($data);
            break;
        case 'date':
            $anonymous = '0000-00-00 00:00:00';
            break;
        case 'text':
            /* translators: Deleted text. */
            $anonymous = __('[deleted]');
            break;
        case 'longtext':
            /* translators: Deleted long text. */
            $anonymous = __('This content was deleted by the author.');
            break;
        default:
            $anonymous = '';
            break;
    }
    /**
     * Filters the anonymous data for each type.
     *
     * @since 4.9.6
     *
     * @param string $anonymous Anonymized data.
     * @param string $type      Type of the data.
     * @param string $data      Original data.
     */
    return apply_filters('wp_privacy_anonymize_data', $anonymous, $type, $data);
}

WordPress Version: 5.5

/**
 * Return uniform "anonymous" data by type.
 *
 * @since 4.9.6
 *
 * @param string $type The type of data to be anonymized.
 * @param string $data Optional The data to be anonymized.
 * @return string The anonymous data for the requested type.
 */
function wp_privacy_anonymize_data($type, $data = '')
{
    switch ($type) {
        case 'email':
            $anonymous = '[email protected]';
            break;
        case 'url':
            $anonymous = 'https://site.invalid';
            break;
        case 'ip':
            $anonymous = wp_privacy_anonymize_ip($data);
            break;
        case 'date':
            $anonymous = '0000-00-00 00:00:00';
            break;
        case 'text':
            /* translators: Deleted text. */
            $anonymous = __('[deleted]');
            break;
        case 'longtext':
            /* translators: Deleted long text. */
            $anonymous = __('This content was deleted by the author.');
            break;
        default:
            $anonymous = '';
            break;
    }
    /**
     * Filters the anonymous data for each type.
     *
     * @since 4.9.6
     *
     * @param string $anonymous Anonymized data.
     * @param string $type      Type of the data.
     * @param string $data      Original data.
     */
    return apply_filters('wp_privacy_anonymize_data', $anonymous, $type, $data);
}

WordPress Version: 5.3

/**
 * Return uniform "anonymous" data by type.
 *
 * @since 4.9.6
 *
 * @param  string $type The type of data to be anonymized.
 * @param  string $data Optional The data to be anonymized.
 * @return string The anonymous data for the requested type.
 */
function wp_privacy_anonymize_data($type, $data = '')
{
    switch ($type) {
        case 'email':
            $anonymous = '[email protected]';
            break;
        case 'url':
            $anonymous = 'https://site.invalid';
            break;
        case 'ip':
            $anonymous = wp_privacy_anonymize_ip($data);
            break;
        case 'date':
            $anonymous = '0000-00-00 00:00:00';
            break;
        case 'text':
            /* translators: Deleted text. */
            $anonymous = __('[deleted]');
            break;
        case 'longtext':
            /* translators: Deleted long text. */
            $anonymous = __('This content was deleted by the author.');
            break;
        default:
            $anonymous = '';
            break;
    }
    /**
     * Filters the anonymous data for each type.
     *
     * @since 4.9.6
     *
     * @param string $anonymous Anonymized data.
     * @param string $type      Type of the data.
     * @param string $data      Original data.
     */
    return apply_filters('wp_privacy_anonymize_data', $anonymous, $type, $data);
}

WordPress Version: .10

/**
 * Return uniform "anonymous" data by type.
 *
 * @since 4.9.6
 *
 * @param  string $type The type of data to be anonymized.
 * @param  string $data Optional The data to be anonymized.
 * @return string The anonymous data for the requested type.
 */
function wp_privacy_anonymize_data($type, $data = '')
{
    switch ($type) {
        case 'email':
            $anonymous = '[email protected]';
            break;
        case 'url':
            $anonymous = 'https://site.invalid';
            break;
        case 'ip':
            $anonymous = wp_privacy_anonymize_ip($data);
            break;
        case 'date':
            $anonymous = '0000-00-00 00:00:00';
            break;
        case 'text':
            /* translators: deleted text */
            $anonymous = __('[deleted]');
            break;
        case 'longtext':
            /* translators: deleted long text */
            $anonymous = __('This content was deleted by the author.');
            break;
        default:
            $anonymous = '';
    }
    /**
     * Filters the anonymous data for each type.
     *
     * @since 4.9.6
     *
     * @param string $anonymous Anonymized data.
     * @param string $type      Type of the data.
     * @param string $data      Original data.
     */
    return apply_filters('wp_privacy_anonymize_data', $anonymous, $type, $data);
}