It is a sign that you are “doing it wrong”. you should not assume the existance or initialization of anything before the init
action was fired, or even better to wait for wp_loaded
Related Posts:
- remove_action on after_setup_theme not working from child theme
- Remove Actions/Filters added via Anonymous Functions
- How to load scripts/styles specific for a page
- Is there any global functions.php file which works for any theme?
- Child theme – Overriding ‘require_once’ in functions.php
- Trying to use add_action and do_action with parameters
- Check if post is being published for the first time, or is an already published post being updated
- Display random categories on the front page (Finding and Editing Theme Functions)
- How to use the do_action () with parameter
- Perform an action when post is updated/published
- WordPress Theme Update Action?
- Extract image from content and set it as the featured image
- Do WordPress’ cron’s clean up expired transients?
- Issue with get_theme_mod returning a blank value instead of the saved value
- add_action in a function, is it possible?
- Using a private method as an action callback from within a class
- Refresh page after form action
- How to restrict actions and filters “properly” by conditions
- How to count number of functions attached to an action hook?
- Add action hook conditionally – only when home.php in use
- Using add_filter() in Widgets
- Hourly Routine Not Firing ( wp_schedule_event() )
- How can I tell if I’m on a login page? [duplicate]
- which is the function that removes accented vowels?
- Change meta tags programatically
- Convert hyphen to underscore in permalinks
- Using get_terms for custom taxonomy in functions.php
- Fatal error: Call to undefined function add_action() – an untouched problem
- How to hook into the quick edit action?
- Theme Demo in live Site
- Reuse variable in hook callback
- Customising widget titles/headings in WP 5.8
- Call to undefined add_action() in theme’s functions.php
- Child Theme Not Overriding Parent Theme
- WooCommerce add_action hook results in 500 error
- Automatically Add Specified Value to Attachment Metadata upon Upload
- Where does function_exists() look to decide whether a function exists? [closed]
- Can’t Update function.php after writing short code
- Theme-Config tab in admin Pannel?
- How to update feed only 2-3 times a week (for Feedburner email)?
- How would go about if I just want a temporary function?
- Passing arguments to my function with do_action and add_action is not working
- Is It wrong to use oop approach on functions.php?
- Pass parameters to function through an action
- PHP files included in functions.php don’t seem to work
- Accepted arguments value in hook functions
- How to select a page within admin?
- How to manage arrays from custom functions stored in functions.php?
- How to remove howdy dropdown menu content
- How do I pass arguments for multiple functions hooked to a single action?
- Which action hook to use for function?
- Hook specific functions if on a specific admin page
- Custom HTML in specific category single page and its descendant categories
- How can I change the do_action function in footer (copyright area)
- Modify a function without editing template
- functions.php mistakenly deleted
- Echo tags used to describe the theme
- Don’t delete a page if it holds users
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- changing behaviour of get_search_form
- Child Theme files – what is needed?
- How do I add Bootstrap and LESS to my migrated WordPress site?
- How to load jQuery in the footer – nothing works for me
- Problem only while using require_once() within functions.php
- Translation of theme using child theme
- Which action does wp_update_user triggers?
- How to stop twenty fifteen theme from cropping featured images?
- Theme functions.php file auto delete everyday [closed]
- How can I get my Script to work on the Login page?
- Trigger a custom function when option are saved in admin area
- How to remove style attribute in WordPress RSS output?
- WordPress website Rs changed to currency symbol
- create filter in functions.php
- Add Custom Background Properties to Customizer
- Functions in custom theme
- Parse error after modifying the template menu [closed]
- Reuse variable in hook callback
- Wait a result before enqueue
- Redirect to another page if the user is logged in when pressing again the login button on menu bar
- Multiple Loops Meta Data
- WordPress PHP Conflicting User Sessions
- Function added using `add_action()` not being called
- Difference b/w Simple function call & do_action call
- jQuery does not work
- Function that outputs second theme url
- Override the WordPress core function wp_referer_field
- Set Taxonomy based on post status
- Two functions with different arguments and add_actions, but identical code
- add_action template_redirect not working for home page
- I can’t seem to install Font Awesome locally [closed]
- AMP – Change rel=”canonical” from functions.php [closed]
- Not all CSS elements transferring via parent to child?
- unnecessary request call for js and css after calling wp_dequeue_script
- Scripts not loading when using the wp_enqueue_scripts action
- Is there a way to prevent a function/method from being called outside a specific hook?
- Some questions about how proper add 2 CSS file in a WordPress theme?
- Turn get_posts as string into an array for use in theme admin options
- Auto-Tweet if Type is ‘Status’ using OAuth
- Missing argument for the function
- problem loading stylesheets to wp_head dynamically