is_page() function doesnt working

The init hook is too early — WordPress hasn’t yet identified the queried object (post, category, etc.); hence the is_page() doesn’t work there: add_action(‘init’, ‘register_script’); So for conditional tags/functions like is_page(), is_single(), etc. to work (i.e. return the proper result), you should use wp or a later hook: add_action(‘wp’, ‘whatever_function’); But for registering/enqueueing scripts and … Read more

admin_notices not displaying in plugin

Try this. I cleaned up your arg array and placed everything in a function. Also, why are you using the getInstance method when your efpd_admin_notice is public? See the code below for accessing this method properly. function plugin_update(){ $plugin_update = Efpdd::efpd_admin_notice(array( ‘type’ => ‘update’, ‘message’ => ‘The plugin has just been updated.’, ‘button’ => ‘Click … Read more

If a function requires add_action(‘init’) how can I run it only once on plugin activation?

I don’t think there is a need to add the items to the init hook from the activation function. I think you can call them directly: private static function single_activate() { self::add_partner_terms(); //$this->add_partner_terms(); self::add_geo_terms(); //$this->add_geo_terms(); } I’m not really sure if it should be self:: or $this-> because I’m a little bit fuzzy about OOP, … Read more