Cara Mencegah PBS Muncul
Anda dapat mencegah PB Sandwich muncul di front-end menggunakan filter pbs_is_editable_by_user.
Misalnya, untuk menghentikan PB Sandwich agar tidak muncul pada Custom Post Type yang diidentifikasi dengan slug slider, Anda dapat menambahkan potongan kode ini di functions.php Anda
add_filter( 'pbs_is_editable_by_user', 'stop_pbs_in_sliders' );
function stop_pbs_in_sliders( $editable ) {
if ( is_singular( 'slider' ) ) {
return false;
}
return $editable;
}
Untuk menghentikan PB Sandwich pada halaman/pos tertentu, Anda dapat menggunakan ID pos untuk memeriksa:
add_filter( 'pbs_is_editable_by_user', 'stop_pbs_for_123' );
function stop_pbs_for_123( $editable ) {
global $post;
if ( is_singular() && ! empty( $post ) ) {
if ( '123' === $post->ID ) {
return false;
}
}
return $editable;
}