Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author wpexplorer

    (@wpexplorer)

    Hi,

    You can use the WordPress is_page function to check multiple pages. For example:

    add_filter( 'easy_notification_bar_is_enabled', function( $check ) {
    	$blacklist = [
    		'page-slug-1',
    		'page-slug-2',
    		'page-slug-3',
    	];
    	if ( is_front_page() || is_page( $blacklist ) ) {
    		return false;
    	}
    	return $check;
    } );

    Depending what youa re doing exactly you could do other sorts of checks, for example if the pages you want to exclude are all child pages of a parent page you could check for the parent page using:

    get_post()->post_parent

    If you let me know what you want to do exactly I can help you come up with the ideal code ??

    • AJ
    Thread Starter babylon324

    (@babylon324)

    Great! Works perfect. Thank you

    Plugin Author wpexplorer

    (@wpexplorer)

    No problem!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can I disable the bar from showing on selected pages? II’ is closed to new replies.