functions – how can I add filter in specfic field in my website?

Question

I want to replace any saudian phone in specfic field in my theme “my-listings” in description and this my script in functions.php:

function cudjex($text){
    $text = preg_replace('/(009665|9665|+9665|05|5)(5|0|3|6|4|9|1|8|7)([0-9]{7})/', '********', $text);
    return $text;
}
add_filter('comment_text', 'cudjex');

it works good in comments ,but I want it works in another field called description in my theme ,how?

0
mohammed khalafallah 8 months 2021-12-26T04:27:55-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse