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:
- How do I create a custom role capability?
- Is it ever okay to include inline CSS in plugins?
- 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?
- What do you think about custom designed plugin/theme options UIs?
- Where to put third party PHP library?
- 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?
- 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
- 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?
- WordPress multisite apply different options over each site from same plugin
- Custom theme sufficient or custom plugin neccessary for this feature set?
- 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 password reset – why post rp_key?
- Delete a specific item menu when I deactivate my plugin
- Multisite plugin development and wp_enqueue_script
- Plugin Uninstall and Deactivate via Options Menu
- Sharing a common set of image files for media library, across all sites within multisite
- Get the password key when using the wp_new_user_notification_email filter
- How to create a Tools menu on the Network Admin dashboard from a plugin
- Order properties should not be accessed directly
- How to deal with equal & similar arguments for a function?
- Override the default Add/Edit site forms of the Network Panel in custom plugin
- How to set “Site Address (URL)” programmatically on WP multisite?
- Executing a function upon webhook calling wordpress
- Customizer: widget-synced triggers twice
- how to use hook deleted_user into custom function to delete user from custom table
- Disable The Events Calendar plugin from loading its scripts
- Where to store the name of a custom table?
- WordPress is automatically linking plain text email addresses
- Is Using WordPress Supplied WYSIWYG Advisable?
- 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?
- Custom Taxonomy to dropdown box on adminside wordpress
- Adding (blog-specific) links to “My Sites” admin page
- How to modify the comments to be displayed in a post?
- Selectively update themes in WordPress multisite
- Problem with context in multisite – getting main site data in every blog (get_pages())
- Redirect to another page using contact form 7? [closed]
- How to modify files inside wp-includes directory in wordpress
- register_activation_hook on multisite
- How to set a cookie for logged in users to md5($user->ID . “my_secret”)?
- Show message from backend
- Create Widget or Enable Shortcodes in Sidebar
- WordPress multisite,use same cookies across all website?
- Add the site’s name as prefix when adding new users? Multisite
- how to save wp_editor html content in options table
- How to use a WP_Customize_Control outside of the Customizer?
- How can I save a password securely as a settings field
- How to remove/replace current page template?
- How to share user data across multiple WordPress websites?
- Using password protection to load different page elements?
- How to determine which capability to use?
- Custom Endpoint – Does it possible to use PUT method with WP API Rest?
- Why won’t this submenu page show? – My First WordPress Plugin
- 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?
- Custom Plugin activation error in Multisite
- Hiding class namespace from plugin’s extensions
- WordPress Reset password Strength set to medium
- 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
- Testing Plugins for Multisite
- Making adding info to an overlay bio easy for average user?
- Implementing Select2 plugin into WordPress
- Associating special meaning with user id 0
- Can I access WordPress API’s from within plugin scripts?
- Theming Custom Plugin Page
- 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
- How do I store a custom dataset in WordPress to best take advantage of API?
- Developing Themes on WordPress, Looking for Excellent Tutorials [closed]
- How to Implement SAM Broadcaster with WordPress? [closed]
- Force remove parent theme CSS/JS and call them from Child theme
- Custom plugin not appearing
- Extend WP_List_Table class – Edit wp_usermeta – WPPB.me Boilerplate – Action error
- Developing an IP lookup function using an API