حل تمرین مینی پروژه این جلسه :
/*
Plugin Name: Persian-Filtering
Plugin URI: https://www.google.com/
Description: This is the first useful plugin created by Ali Rezayi
Version: 1.0.0
Author: Ali Rezayi
Author URI: https://www.google.com/
Text Domain: PersianFilter
*/
function Correct1($linkcontent)
{
$word1 ='غیلبت';
$link = 'تبلیغ';
$linkcontent = preg_replace("/{$word1}/",$link,$linkcontent);
return $linkcontent;
}
function Correct2($clearcontent)
{
$word2 ='یسایس';
$clearcontent = preg_replace("/{$word2}/",'',$clearcontent);
return $clearcontent;
}
function Correct3($filtercontent)
{
$word3 = 'ازسان';
$wordlenth = mb_strlen($word3);
$filtercontent = preg_replace("/{$word3}/",str_repeat('#',$wordlenth),$filtercontent);
return $filtercontent;
}
add_filter('the_content','Correct1');
add_filter('the_content','Correct2');
add_filter('the_content','Correct3');
?>