😆Lọc nội dung sử dụng the_content (ok)
function upperworld ($content){
$string = array(
'dứt điểm',
'triệt để',
'tận gốc',
'hoàn toàn',
'khỏi bệnh',
'đảm bảo',
'điều trị',
'chữa'
);
$string1 = array(
'***',
'***',
'***',
'***',
'***',
'***',
'hỗ trợ điều trị',
'hỗ trợ chữa trị'
);
foreach ($string1 as $key => $canthay) {
$thay = $string[$key];
$content = str_replace($thay, $canthay, $content);
}
return $content;
}
add_filter( 'the_content', 'upperworld' );
PreviousSử dụng strip_tags để cắt chuỗi string, the_excerp, the_content giữ lại thẻ và không full (ok)NextAdding Custom Post Types to the Main Blog Page (ok)
Last updated
Was this helpful?