You can combine add_action()
and an is_admin()
check:
! is_admin() and add_action( 'init', 'my_custom_callback' );
Now the callback function will run on front-end only.
Related Posts:
- Why can’t a custom postype be registered with “admin_init” hook?
- is_admin() returns true when using admin-ajax.php from front end script
- front end logo upload like happytables
- Is there a hook to put stylesheet and/or JS inside iframes (thickbox or tinyMCE) in admin area
- A similar hook as wp_head for the admin area
- Conditional check for front-end which includes ajax
- How to Remove the “Restore” Link in Quick Edit?
- Use latest jQuery in WordPress (admin interface)
- Adding markup to column text in “Edit Pages” admin page
- Disable HTML (Text) Tab in Post Editor
- Manage users custom column add class “num”
- front end editing using iFrames, best approach?
- Custom Thickbox Broken on Dashboard Page?
- WordPress Frontend Check If Current User Is Administrator
- Where should I hook into admin?
- Problems with WP_List_Table and hooks
- How to disable accessing the custom post types from frontend via a link?
- Remove Permalink From Admin Edit Post
- Show excerpt if no title in admin view
- Seems that admin_post_{action} does not executing
- get_current_screen and the WP_Screen class
- Filter WooCommerce Orders
- Send admin to a different login than users?
- Remove iPhone detection on login page
- How to show WordPress admin dashboard forms on front-end?
- Login to admin by frontend form?
- Can you check if https is enabled on frontend from admin
- ‘Conflict’ with action deleted_post and is_admin()
- Disabling “View” mentions from backend?
- Editing post in admin panel
- Lock Display Name To Nickname
- plugin: ‘init’ hook, check if we’re not in admin
- 500 error for regular users, not for admin
- What are the standard admin CSS id/class tags?
- Admin Ajax is returning 0
- Add custom column to Users admin panel
- wp_verify_nonce vs check_admin_referer
- Add a Separator to the Admin Menu?
- How to determine whether we are in add New page/post/CPT or in edit page/post/CPT in wordpress admin?
- how to know if admin is in edit page or post [duplicate]
- Modal window from within WordPress admin
- Where in WP can I check history or log of updates of plugins etc?
- Which hook should be used to add an action containing a redirect?
- Adding a custom admin page
- How does admin-ajax.php work?
- How to remove entire admin menu?
- How do I remove dashboard access from specific user roles?
- Difference between after_setup_theme and init action hooks?
- How can I speed up my WP admin section?
- Use wp init hook to call other hooks?
- How to pass parameters to admin_notices?
- Changing the “Plugin Activated” Message Default
- Admin: very slow edit page caused by core meta query
- if admin is logged in
- Search posts by ID in admin
- How to Change the Default Home Page for the WordPress Dashboard?
- Setting admin edit panels & metaboxes positions and visibility for ALL users and admins
- Find out which moderator approved comment?
- The website cannot display the page
- How To Remove WordPress Version From The Admin Footer
- Sort pages in loop by admin’s page attributes order field?
- Edit “thank you for creating with WordPress” in version 3.3.1
- Hide other users’ posts in admin panel
- Set Default Admin Colour For All Users
- Editor Styles and Typekit
- WordPress admin stylesheet
- This CSS Stuffing Works, But Is This A Good Practice?
- Is it possible to create a WordPress tour? V3.3.1
- Securing Admin Accounts – Username Discovery
- How to save dismissable notice state in WP 4.2?
- How do I optimize a custom post type admin page with 25,000 posts?
- Settings API – adding setting fields dynamically?
- Disable Media Uploads to non Admin Users
- How do I load a CSS style into WordPress admin area only?
- Allowing admin-ajax.php to receive “application/json” instead of “x-www-form-urlencoded”
- Can an admin check passwords of registered users?
- How can I target WordPress 3.8 new interface MP6 with CSS?
- Notification that the admin is online
- Does wordpress create activity, update logs?
- sort child pages on admin
- How-to make the admin area mobile friendly [closed]
- How to remove list view from media library?
- How to disable the “Your site has updated to WordPress x.y.z” admin email?
- Load plugin scripts and styles only on plugin page
- Plugin to remove Admin menu items based on user role?
- How to obtain the user ID of the current profile being edited in WP-Admin?
- 3.3: How do you hide the new dashboard welcome panel?
- Add my own button next to “Screen options” and “Help” in the admin
- WP List Table custom quick edit box – post meta data missing and columns change on submit
- Settings API – easiest way of validating checkboxes?
- Should I use is_admin() inside ‘admin_init’ hook callback
- Custom admin email for new user registration
- Send Admin Emails to Multiple Email Addresses
- How do I set up the defualt page icon for admin menu?
- Prevent author from changing their posts if admin has modified
- Cannot access admin panel
- Make A WordPress Page Accessible To Admins Only, Redirect Other User Roles
- Disable all https in WordPress
- localhost/wp-admin on my local redirects to production site’s /wp-admin
- How to remove administrator role in settings -> general -> New User Default Role?