Maybe it is too late to hook on init. Try set_current_user or some earlier hook. List is here: https://codex.wordpress.org/Plugin_API/Action_Reference
Related Posts:
- Issues with title-tag and document_title_parts
- Which WP functions do you need to use esc_html() or esc_url() on?
- Import WordPress XML File from Within Functions.php
- Define custom Page Template without its own .php file
- Does hooking into the same action multiple times drain memory?
- How to influence the information displayed on widget inside wp-admin
- Extract image from content and set it as the featured image
- Is there a hook or function I can use to display all theme files being used on a current page?
- Issue with get_theme_mod returning a blank value instead of the saved value
- Add action hook conditionally – only when home.php in use
- Show modified time if post is actually modified
- why doesnt is_home() work in functions.php
- Masking logout URL
- How to manually activate user in dashboard only by admin
- How to create thumbnails for PDF uploads?
- Implementing DNS Prefetching with WordPress
- Help me to understand wp_header() and wp_footer() functions
- How can I tell if I’m on a login page? [duplicate]
- In WooCommerce I need to modify the thankyou.php page [closed]
- How can I add an extra WooCommerce hook
- Why get_header() or get_footer() does not run twice if called in the same php file?
- Remove Page Title from Static Frontpage
- How to override WordPress registration and insert an auto-generated username?
- Set default options for inserting media
- Change parent theme file function in child themes functions.php
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- How to hook into the quick edit action?
- gform_after_submission content appears immediately after , not in post body [closed]
- How do I change parameters without changing the core
- Is it possible to be more page/post specific with admin_enqueue_script?
- How to add another user to this remove_menu function?
- WooCommerce add_action hook results in 500 error
- Issue adding text after short description on product pages Woocommerce [closed]
- Customize “the_posts_pagination” and put list instead div
- Restricting access to content
- WordPress Content Security Policy and Subresource Integrity
- password protected post policy
- Increment price for Woocommerce Minicart [closed]
- how to change link of some wordpress pages
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- what is best way to keep track of changes made in wordpress website? [closed]
- WordPress wraps span tags into p tags
- Changing where my author box is printed
- Is it possible to use add_filter in an included file in the child theme’s functions.php?
- Where to store credentials used in a function? [duplicate]
- Insert Content Before div#main from the functions.php File
- Add Adsense code between job listings – wp job manager plugin
- update_post_meta is Updating with two page id
- Replace admin header logo with an image
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- User meta and public function security
- is_home() not working in functions.php file
- How to conditionally add a widget via a hook in functions.php
- How to place a div inside a function that creates a div
- Changing the text of Upload/Insert on Posts and Pages Screen
- Filter for replacing the WP_query object for a given category
- How to add or delete default value theme options while activate and deactivate theme
- WordPress comment processing . Default unapproved comments detection before posting
- Warning at top of website & top menu gone
- Login cookies blocked after customizing hashing method
- Does hook have an effect on increasing the page load?
- Save_post – Warning: Cannot modify header information
- What is the earliest Hook a Script can use?
- Populate acf-field, depending on block name
- How to use WP conditional tag in a functions.php with OCEANWP Theme?
- custom error message for empty username and password using authenticate filter not working
- How Do I Unhook This Parent Theme Function?
- Security when outputing wp_oembed_get code
- Get post_author email for Zapier Integration
- How to show only specific category post by user role without plugin and restrict all other cats
- Calling hooks in functions
- DISABLE wordpress upgrade page
- How to add custom column into custom post, when field is select
- How can I stop the hook from breaking the login/logout function?
- True email confirmation for registration (keeping unvalidated users from user table)
- WordPress hooks to call a function inside a construct
- WordPress undefined function error on using add_action() in functions.php
- How to echo the translated custom field?
- Using wp_localize_script in template file – is it secure?
- Function the_content
- save_post hook – headers already sent?
- Init hook for header send
- Add custom fields after post/page title
- Force resize for all video content
- Unhook the comment form in Buddypress
- Why wp_ajax hooks doesn’t work?
- How can I append and prepend something to all post hyperlinks without using ::before or ::after? PHP hook solution?
- Will my WordPress site become vulnerable after adding this functions which allows more HTML tags for subscribers?
- Why functions metaboxes is causing White Screen in Admin [closed]
- How do I add functionality to images?
- How to hook wp_mail to add a custom email as BCC for each sent email?
- image_size with respect to aspect ratios
- delete_term is not working properly with add_action()
- Get category of post inside save_post hook
- Create section wit form
- Log in and out using custom pages, no logout confirmation and redirects for logging in and out 2023
- Copy and Modified WooCommerce function is_coupon_valid [closed]
- Function attached to cron job not running but will run if called manually
- How can I able to exclude ‘Category’ and ‘Tag’ slug from the URL in WordPress without reloading to new site?
- Redirecting after login except for a specific page