Support » Plugin: Easy Notification Bar » More explanations, please

  • Resolved Li-An

    (@li-an)


    Hello, your plugin seems interesting but it lacks some documentation. How to use properly easy_notification_bar_is_enabled and easy_notification_bar_settings. This is not obvious – for me.

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

    (@wpexplorer)

    Hi,

    Sorry for the delayed reply. I wasn’t getting the email notifications it seems from WordPress πŸ™

    These filters “easy_notification_bar_is_enabled” and “easy_notification_bar_settings” are specifically added for developers. So if you aren’t a developer you don’t have to worry about them. These are added so that developers can add custom code into their child theme’s to modify the way the notification works.

    For example if you wanted to enable the notification for the homepage only you can add code like this to your child theme:

    add_filter( 'easy_notification_bar_is_enabled', function( $enabled ) {
    	if ( ! is_front_page() ) {
    		$enabled = false;
    	}
    	return $enabled;
    } );

    These are standard filters so there really isn’t a need for an explanation as any developer that knows WordPress would know how to use them.

    Make sense?

    No, does not work, because the plugin inits on the ‘init’ function, where the wordpress ‘is_front_page’ has yet to be defined…

    Plugin Author wpexplorer

    (@wpexplorer)

    Hey,

    I’m actually going to push out a small update right now to fix this issue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘More explanations, please’ is closed to new replies.