It errors because class method is not a function. It’s not uniquely identified by its name alone. You need to provide instance of the object (or name of the class for static methods).
In your context it would be:
add_action( 'init', [ $this, 'newsletterSuscriber' ] );
Related Posts:
- WordPress Plugin Boilerplate – add_action hook in static “activate” function
- Basic function call on init failing
- How can I see all the actions attached to an “add_action” hook?
- Where is the best place to use add_filter
- When can you get current page ID and initialize hooks right after?
- What is the ‘admin_action_’ . $_REQUEST[‘action’] hook used for?
- WordPress admin notice in plugin function
- Using the ‘draft_to_publish’ hook (post status transition)
- Which hook callback has priority if both plugin and theme use the same hook?
- Good tools for locating hooks in a wordpress page/admin interface/blog post?
- Use external link in the add sub menu
- delay function on publish?
- Very stubborn wp_register_script / add_action vs remove
- Can a plugin add to header/footer/body content?
- Is there an action that is called when a post is restored from the trash?
- Is it possible to remove this action? (as it’s added just before it’s called)
- How to call bind function in wordpress actions or hooks
- Set cookie then immediantly refresh the page
- Popup Cookie WordPress select language and section (Elementor)
- Can I use a method from an existing plugin as an action hook?
- Detect when any plugin is activated or deactivated
- add action for displaying posts using a shortcode
- ‘wp_login’ action hook not working with wp-login.php file
- Overwrite or Replace code in WP_Footer
- How to Use Parameters with a Do_Action Function Within PHP Tags
- Why is my staging subdomain not sending wordpress_logged_in cookies?
- WordPress filter that hook after each action/filter hook
- How to stop or remove an action being called inside a function of an extended class
- Any hook for pre-plugin-update -either bulk or single plugin update
- Insert new user with form submit ‘init’ hook
- When to load auto-login code?
- How to save generated JWT token to cookies on login?
- How to check current user before all actions and filters?
- User Session and Stored Cookies not get removed
- CampaignMonitor for WooCommerce – Move subscribe button [closed]
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- add_action in static class [closed]
- WordPress user account activation
- Init plugin again after ajax call finish
- How to handle cookies from a WordPress plugin on a cached page?
- Login cookies set as wrong domain
- How to get post ID with hooks publish_post, new_to_publish, etc
- What is @Action in WordPress?
- Problem with removing plugin action
- edit_user_profile and show_user_profile are not firing inside a class
- Add action to fire when a published post is updated
- get gravity form ID from backend/wordpress admin
- How to pass variables to a function argument using add_action [duplicate]
- Run a plugin just ‘once’ per page reload
- Using add_action before add_filter on a plugin?
- Submit Form data to another page via Ajax (WordPress Way)
- Why do plugins often ask to add in to templates?
- Create a post builder skin in a plugin
- remove_action not removing add_action from constructor
- How to get menu location in wp_update_nav_menu hook
- How do I add some javascript validation to the admin interface form’s onsubmit?
- Hook for page Request?
- How to remove a class function from a plugin by using remove_action()?
- Trying to add_action in a loop
- How to remove products-links after the product title using remove_action
- Blurry images when loading the page first time
- Action on WordPress Install
- wp_ajax action responds with 0
- Custom CSS not being added by plugin
- Retrieve options set through a plugin
- How to use add_action for multiple instances of the same class
- What hook can I use to modify custom post data before it is displayed on the page?
- Running a function with args in add_action()
- I cannot include a file in my plugin settings page
- Edit post image attributes on fly?
- Displaying page content from plugin, inside exising empty WP page
- Callback hooked to post_updated firing on new posts as well
- Why do actions with class and public method don’t fire __construct()
- Discern a specific plugin’s action hooks
- Block Google tracking on refuse consent of the user with plugin
- How to remove default action from a plugin?
- Get post content inside plugin class method
- Ajax call to php function doesn’t work PHP code
- WordPress delete cookie
- Frontend AJAX Request causes Error: ‘Call to undefined function add_action’
- Creating Admin Submenu Page via Class Method
- Help needed with woocommerce (wc stripe) filter
- What action or filter can I use to change all the html returned from server for a page?
- Cookie set in a plugin visible in admin but not on front
- how to repeat taxonomy in different places on wordpress
- Am I using an action hook correctly?
- plugins_loaded action is not working properly
- AJAX login without a plugin does not work. when add a action to function.php
- Remove action working on functions.php but not in a plugin. Why?
- add_media_page function not creating submenu
- change output location of plugin function using a custom hook
- Removing this filter added by a plugin
- Filter for modifying image on upload
- Which filters or actions involve with index page for plugin?
- WordPress Plugin: Where should I put my cookies for cURL?
- add query string to all pages after user logged in
- How wordpress plugin hooks works? [duplicate]
- Undefined constant error in pluggable.php
- WooCommerce Order Status Displays Twice on Order Page
- How to delete Password Protected posts cookies when a user logged out from the site