I was using the wrong action hook. Replaced send_headers with init and it works.
Wrong
add_action('send_headers', array($this, 'do_things'));
Right
add_action('init', array($this, 'do_things'));
Related Posts:
- Is it ever okay to include inline CSS in plugins?
- How can I configure Docker for developing and deploying a custom theme?
- No Error Log File, no debug info
- Prevent network activation of plugin
- Uninstall script for a plugin in Multisite
- Is the new WordPress 3.1 admin bar pluggable and how can I extend it?
- Getting a peer review for my new plugin?
- What is wrong with using add_option with Multisite instead of add_blog_option in a plugin
- Using filters and actions for plugin API?
- How to Change the Entire WordPress Admin panel Look and Feel?
- Allowing for multiple template views on the Gallery Settings page when using the Visual Editor
- Using Primary Color in Plugin Block
- Problems after wp_set_password() containing an apostrophe
- Error getting correct blog_id on MU from functions.php
- When is it appropriate to put functions on page template vs. functions.php?
- What are the default WordPress password requirements?
- Filters ‘request’ and ‘parse_query’ not firing in sites.php nor link-manager.php
- Multisite, sharing content by URL
- WordPress Media mime type filter problem 4.0
- How Can I setup WP CLI on Windows development machine running AMPPS?
- WP_LOCALIZE_SCRIPT doesn’t work
- Delete a specific item menu when I deactivate my plugin
- Are we allowed to use the Allman (BSD) indent style when coding WordPress plugins and themes?
- Plugin Uninstall and Deactivate via Options Menu
- how to activate plugin network-wide, and save setting across sites
- What is difference between blog id and site id?
- How to create a Tools menu on the Network Admin dashboard from a plugin
- Order properties should not be accessed directly
- Override the default Add/Edit site forms of the Network Panel in custom plugin
- Executing a function upon webhook calling wordpress
- WordPress not working on localhost
- Adding functions to hooks from within a class
- how to use hook deleted_user into custom function to delete user from custom table
- Where to store the name of a custom table?
- ServerSideRender and Media Object: attributes passing image data object to php renderer even though it’s not set
- WordPress Multisite with Azure B2C redirect_urls after Login
- Clearing caches on plugin uninstall
- How to use a hook to override an update_post_meta call in a plugin?
- Add code inside specific wordpress standard function
- How To Change Post Author Default?
- Adding (blog-specific) links to “My Sites” admin page
- What should happen when a WordPress Plugin is activated across the network (Network Wide Activation)
- How can we display product price $104 on the cart while the credit card payment method is checked?
- Multiple Plugin best practice in Multisite
- Search: how to extend the existing search to include a custom table
- Is there documentation reference for forms in menu and setting pages?
- Selectively update themes in WordPress multisite
- Enqueue script globally
- how to invoke wordpress API from other existing PHP system
- WP Multisite login not working on one subsite. Possibly cookies/ history issue?
- Custom entity search and display
- register_activation_hook on multisite
- How to set a cookie for logged in users to md5($user->ID . “my_secret”)?
- Plugin: database creation
- Loading Modernizr (or other JavaScript libraries) for use in a plugin
- How to get all product in the woo-commerce? [closed]
- WP: Search and replace in DB programmatically
- Logout after clicking URL link results in “headers already sent” error
- How to get current logged-in user details in multisite?
- Converting core modification to a plugin
- add_action wp_ajax_ not loading in plugin file WP Network
- How to use a WP_Customize_Control outside of the Customizer?
- How can I save a password securely as a settings field
- How to replace settings in WordPress plugin from a theme
- Is there anything special required to make a plugin work in a multisite environment?
- Setting a post’s category
- Extract Information from post content (using regex?)
- Serial Number from custom table not appear in woocommerce_email_before_order_table action
- Customise Grouped Product display in Woocommerce with custom column
- How to create a custom post-new.php page for plugin , no wp menu
- Want to know how to reveal a WordPress theme, considering the theme name is hidden?
- Save meta box data from selected dropdown list in bbpress reply form
- Metabox types list
- Where to save Gutenberg plugin data?
- WordPress how do I echo SUM from a column of a MySQL table by user id AND type_operation
- Rate limiting ajax requests in WordPress
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- How to prevent users from deleting their accounts?
- Hiding class namespace from plugin’s extensions
- Replace “content-area” of themes 404 page with plugin?
- Set widget icon in Customizer?
- Create Customization panel for Plugins not for theme
- WordPress delete mysql rows with string
- Add function to Dokan ajax class
- PHP includes with AJAX actions
- Custom Post Type and Functions
- Managing Custom Designed Content
- Theming Custom Plugin Page
- Best practice: What belongs in theme and what in plugin for large eCommerce website
- Adding class to the parent of current-post-ancestor / current-menu-parent / current-post-parent
- Adding Meta box to thrid-party plugin
- How do I store a custom dataset in WordPress to best take advantage of API?
- Change Admin menu placement using hooks
- Client Profiles
- Add custom fields in the new and edit the site forms without touching the WP core
- Is Explicit Versioning a better alternative to Semantic Versioning for wordpress?
- Force remove parent theme CSS/JS and call them from Child theme
- Custom plugin not appearing
- 2 Domains pointing to SIngle WordPress , issues with links
- Custom Gutenberg Block ‘Stylized List’ – Incorrect Rendering and Looping of List Items