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 നിർത്താൻ, പരിശോധിക്കുന്നതിനായി നിങ്ങൾക്ക് പോസ്റ്റ് ഐഡി ഉപയോഗിക്കാം:
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;
}