You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scot Rumery edited this page Feb 28, 2021
·
2 revisions
Filter tab display value examples
Plugin filter: rum_sst_plugin_display_tab
Conditionally turn off the tab on the homepage
// filter the display_tab value to conditionally turn off the tab on the homepageadd_filter( 'rum_sst_plugin_display_tab', 'rum_sst_display_tab_filter_example_1', 10 , 1 );
functionrum_sst_display_tab_filter_example_1( $display ) {
if ( is_front_page() ) {
$display = false;
}
return$display;
}
Turn tab off on multiple pages
// filter the display_tab value to conditionally turn off the tab on multiple pagesadd_filter( 'rum_sst_plugin_display_tab', 'rum_sst_display_tab_filter_example_2', 10 , 1 );
functionrum_sst_display_tab_filter_example_2( $display ) {
// returns false when the Page displayed is any of the following// post ID = 42// post_name = "sample-page"// post_title = "Privacy Policy"if ( is_page( array( 42, 'sample-page', 'Privacy Policy' ) ) ) {
$display = false;
}
return$display;
}