Cách xóa bỏ chữ Bảo vệ, Private, Protected trước tiêu đề bài viết WordPress

Đánh giá post

Zubi Cloud hướng dẫn cách xóa bỏ chữ Bảo vệ, Private, Protected trước tiêu đề bài viết trong WordPress.

How to remove Private, Protected prefix from WordPress post title?

cach xoa bo chu bao ve private protected truoc tieu de bai viet wordpress 83386

If you show private or protected WordPress posts in View, you will see these prefixes in post title. They are injected by WordPress core.
To remove these prefixes, please add this code to file functions.php of your WordPress theme:

// Remove Private, Protected prefix from post Title
add_filter( 'private_title_format', 'cv_disable_title_prefix', 99, 2 );
add_filter( 'protected_title_format', 'cv_disable_title_prefix', 99,2 );
function cv_disable_title_prefix( $format, $post ) {
$format = '%s';
return $format;
}
Đánh giá post


Trả lời