| 6130 | |
| 6131 | /** |
| 6132 | * Return uniform "anonymous" data by type. |
| 6133 | * |
| 6134 | * @since 5.0.0 |
| 6135 | * |
| 6136 | * @param string $type Optional The type of data to be anonymized. |
| 6137 | * @return string The anonymous data for the requested type. |
| 6138 | */ |
| 6139 | function wp_privacy_anonymize_data( $type = 'text' ) { |
| 6140 | |
| 6141 | switch ( $type ) { |
| 6142 | case 'email': |
| 6143 | $anonymous = 'deleted@example.test'; |
| 6144 | break; |
| 6145 | case 'url': |
| 6146 | $anonymous = 'http://example.test'; |
| 6147 | break; |
| 6148 | case 'ip': |
| 6149 | $anonymous = '0.0.0.0'; |
| 6150 | break; |
| 6151 | case 'date': |
| 6152 | $anonymous = 0; |
| 6153 | break; |
| 6154 | case 'text': |
| 6155 | /* translators: deletd text */ |
| 6156 | $anonymous = __( '[deleted]' ); |
| 6157 | break; |
| 6158 | case 'longtext': |
| 6159 | /* translators: deleted long text */ |
| 6160 | $anonymous = __( 'This content was deleted by the author.' ); |
| 6161 | break; |
| 6162 | default: |
| 6163 | $anonymous = ''; |
| 6164 | } |
| 6165 | |
| 6166 | /** |
| 6167 | * Filters the anonymous data for each type. |
| 6168 | * |
| 6169 | * @since 5.0.0 |
| 6170 | * |
| 6171 | * @param string $anonymous Anonymous data. |
| 6172 | * @param string $type Type of the data. |
| 6173 | */ |
| 6174 | return apply_filters( 'wp_privacy_anonymize_data', $anonymous, $type ); |
| 6175 | } |