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:
- Objective Best Practices for Plugin Development? [closed]
- How do I create a custom role capability?
- How do i best handle custom plugin page actions?
- How to create an API for my plugin?
- Is it ever okay to include inline CSS in plugins?
- Plugins in symlinked directories?
- In Which Contexts are Plugins Responsible for Data Validation/Sanitization?
- Plugin Form Submission Best Practice
- Best way to abort plugin in case of insufficient PHP version?
- How can I configure Docker for developing and deploying a custom theme?
- What do you think about custom designed plugin/theme options UIs?
- No Error Log File, no debug info
- Prevent network activation of plugin
- Where to put third party PHP library?
- Uninstall script for a plugin in Multisite
- Is the new WordPress 3.1 admin bar pluggable and how can I extend it?
- How to use PanelColorSettings in custom Gutenberg block?
- Getting a peer review for my new plugin?
- Optimize shortcode callbacks
- Changing Plugin Load Order
- What is wrong with using add_option with Multisite instead of add_blog_option in a plugin
- How to integrate a PHP webmail script into the backend of WordPress?
- Using filters and actions for plugin API?
- Is There A Hook To Process The Content Of The Text Widget?
- How to Change the Entire WordPress Admin panel Look and Feel?
- How to log plugin errors to plugin error_log file
- How to Get a List of Sub Blogs without Using get_blog_list()?
- Which to use to execute code during the saving of a plugin settings page?
- Allowing for multiple template views on the Gallery Settings page when using the Visual Editor
- Cron firing my function everytime wp-admin is visited
- Using Primary Color in Plugin Block
- Problems after wp_set_password() containing an apostrophe
- Error getting correct blog_id on MU from functions.php
- How do I make specific plugin functionality apply to different sites in a network?
- When is it appropriate to put functions on page template vs. functions.php?
- What are the default WordPress password requirements?
- WordPress multisite apply different options over each site from same plugin
- Custom theme sufficient or custom plugin neccessary for this feature set?
- When to check if a function exists
- Filters ‘request’ and ‘parse_query’ not firing in sites.php nor link-manager.php
- How to create custom home page via plugin?
- Adding callback function for wp_ajax_ has no effect
- Sessions not creating correctly in custom function
- Multisite, sharing content by URL
- Only allow plugin to be activated on root site of multisite
- Featured Image not showing in admin
- WordPress network: set themes and plugins for new blog
- WordPress Media mime type filter problem 4.0
- How Can I setup WP CLI on Windows development machine running AMPPS?
- How do I ensure I can loop through every enqueued script and CSS?
- Does hooking into a plugin action / filter override the plugin’s function for that hook?
- How to prevent users from deleting their accounts?
- Custom Plugin activation error in Multisite
- Hiding class namespace from plugin’s extensions
- Replace “content-area” of themes 404 page with plugin?
- Set widget icon in Customizer?
- WordPress Reset password Strength set to medium
- Create Customization panel for Plugins not for theme
- Multisite and the JSON REST API: How to?
- Use content filter on the post that is password-protected
- Determine if the current page, is being edited
- WordPress delete mysql rows with string
- external Integration with wordpress timeout error
- Add function to Dokan ajax class
- PHP includes with AJAX actions
- Testing Plugins for Multisite
- Making adding info to an overlay bio easy for average user?
- Implementing Select2 plugin into WordPress
- Same header/footer in Admin, across all network sites in multisite
- Custom Post Type and Functions
- Associating special meaning with user id 0
- Managing Custom Designed Content
- Can I access WordPress API’s from within plugin scripts?
- Theming Custom Plugin Page
- Best practice: What belongs in theme and what in plugin for large eCommerce website
- Link to a admin submenu item using a custom link
- Adding class to the parent of current-post-ancestor / current-menu-parent / current-post-parent
- Change the search results header from plugin
- Dynamic banner for use on external sites
- 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
- WordPress multiple user roles accessing on their information on one site?
- Add custom fields in the new and edit the site forms without touching the WP core
- Developing Themes on WordPress, Looking for Excellent Tutorials [closed]
- How to Implement SAM Broadcaster with WordPress? [closed]
- 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
- Send retrieve password notification email with custom HTML email template
- Extend WP_List_Table class – Edit wp_usermeta – WPPB.me Boilerplate – Action error
- Is there any other ways to replicating changes on live from staging without pushing from git
- Can I log the searches that are returning 404 in the DB?
- Developing an IP lookup function using an API
- Custom fields in the billing address section woocommerce
- 2 Domains pointing to SIngle WordPress , issues with links
- Add File field in WooCommerce Box office plugin
- Sticky bar with filter button and product count
- Custom Gutenberg Block ‘Stylized List’ – Incorrect Rendering and Looping of List Items