PBS కనిపించకుండా ఎలా ఆపాలి
మీరు pbs_is_editable_by_user ఫిల్టర్ని ఉపయోగించి ఫ్రంట్-ఎండ్లో PB Sandwich కనిపించకుండా నిరోధించవచ్చు.
ఉదాహరణకు, slider స్లగ్తో గుర్తించబడే కస్టమ్ పోస్ట్ టైప్లో PB Sandwich కనిపించకుండా ఆపడానికి, మీరు మీ functions.phpలో ఈ కోడ్ భాగాన్ని జోడించవచ్చు
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;
}
నిర్దిష్ట పేజీ/పోస్ట్ కోసం PB Sandwichని ఆపడానికి, మీరు తనిఖీ చేయడానికి పోస్ట్ IDని ఉపయోగించవచ్చు:
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;
}