init
is too early for conditional tags to work. It marks when core finished loading, but no environment is set up yet.
For admin area only you can hook into admin_init
.
For conditionals on front end earliest hook you can reliable use is template_redirect
.
Related Posts:
- How to Layer 7 Load Balance WordPress Backend and Frontend?
- Are there any action like ‘init_frontend’
- How to remove items from +New admin menu?
- Is there any filter to disable the total fronted in WordPress
- How to show an error message after publishing a post?
- Restrict access to admin but allow admin_post hook
- How to get the password and username of the add new user form (admin back end) in wordpress
- Adding body class to login page?
- WordPress Error establishing a database connection For Admin login only
- How to change how long items are kept in the trash?
- How to use Yoast SEO backend in english even if WPLANG variable is not english?
- Admin first hook that outputs HTML?
- Display $pagenow error notice on all admin pages
- Can I edit the wp_post > post_content right before its inserted/updated?
- Why are my frontend theme styles bleeding into the backend?
- How to check if upload window came from the featured image link?
- How to make the front-end RTL without changing the admin panel language?
- is_admin() not working when updating a post in the admin panel
- Admin menu in front-end
- Can I hook into wp_update_core outside of the admin?
- ‘wp’ hook supposed to trigger when editing a post?
- Restrict access to admin-post.php
- How do I add something to the “Edit Tag” page in wp-admin?
- Add HTML to custom post type edit page
- admin_post_nopriv_{$action} is secure?
- is_admin() conditional statement
- Redirect users based on their roles, is_admin()
- How to prevent a user from updating other users in WordPress?
- Organizing Code in your WordPress Theme's functions.php File?
- How to check if a user is in a specific role?
- Can I rename the wp-admin folder?
- How do I Enqueue styles/scripts on Certain /wp-admin Pages?
- Changing Admin Menu Labels
- Adding custom columns to custom post types
- Adding Fields to the Category, Tag and Custom Taxonomy Edit Screen in the WordPress Admin?
- adding custom stylesheet to wp-admin
- Can’t change language (only “English (United States)”)
- Is there ANY way to remove comments function and section totally?
- How to use “menu_order” field for posts?
- “Too many redirects” ONLY when trying to access wp-admin page
- How to restrict dashboard access to Admins only?
- Which hook should be used to add an action containing a redirect?
- Admin Page Redirect
- Disable dragging of meta boxes?
- Toggle admin metabox based upon chosen page template
- Unable to login and wp-login.php redirects to wp-admin%2F&reauth=1?
- When moving a WP site, why does wp-admin redirect to old site?
- How to disable the “Post Lock/Edit Lock”?
- adding the category to the admin column for a custom post type?
- How can we make managing lots of pages in WordPress Admin better?
- Change page title in admin area
- do_shortcode() within Admin Page
- How can I control the position in the admin menu of items added by plugins?
- Difference between after_setup_theme and init action hooks?
- Changing the ‘wp-admin’ URL to whatever I want
- Use wp init hook to call other hooks?
- Unit testing in the WordPress backend (is_admin() is true)
- Admin ajax request return 0 with die()
- How to prevent access to wp-admin for certain user roles?
- How to remove screen options and help links in the admin area?
- How to remove the core embed blocks in WordPress 5.6?
- How to increase the file size limit for media uploads?
- Create WP tutorial for users with admin pointer using next button for navigation
- I’m getting a 404 message when I try to access wpadmin
- Taxonomy dropdown metabox in the back-end
- wordpress wp-admin css not loading
- Sort admin menu items
- How to order by post meta name in wp admin?
- How set defaults on wpLink()
- Remove dashboard, use Pages tab as default
- How to redirect/rewrite all /wp-login requests
- Show all post tags on post edit screen/sidebox
- How to hook in and modify the new revisions UI (3.6+)?
- How to display a static HTML page while setting up a WordPress site?
- Limit widget to certain sidebar?
- How can I uninstall a language?
- Check if user is admin by user ID
- My wordpress site gets redirected automatically to the old site any known solution for this?
- Best way to present options for home page in admin?
- Use a different domain for SSL
- Remove specific items from Quick Edit menu of a Custom Post Type?
- How to filter by post-format in admin?
- Making Custom Fields Standard in the Admin UI
- Unable to login to my wordpress site. reauth=1 redirection loop
- Add “external” link to admin menu in the backend
- Disable image attachment links
- How can I improve the line break handling in the WYSIWYG editor?
- How to add “Stick this post to the front page” to front end?
- wp_list_tables bulk actions
- Custom column for changing post status via ajax
- How do I fetch the static front page using the REST API?
- How do I change the login logo URL and hover title?
- Custom login redirects to wp-admin on wrong password
- How to remove comments option from wp-admin bar and modify profile icon
- Remove “Time to upgrade” message from dashboard
- Add header and footer to WP backend
- js error on post editing page
- How to search post by ID in wp-admin
- How to influence the information displayed on widget inside wp-admin
- Remove ‘Custom..’ option in tinyMCE colour swatch