Questions tagged [admin-init]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer

Page is loading after submit before the file is processed

I have built a user import page that imports via csv file upload. The issue I am having is that the page is loading before all of the rows (user information) is finished processing/ inserting users. ...
gray's user avatar
  • 1
0 votes
1 answer

Admin_init not working in submenu page

I've a plugin divided into multiple pages and files based on classes. The base file (linked from plugin main file) contains code for menu and submenu pages and provides wordpress with their ...
Nabeel Khan's user avatar
0 votes
2 answers

How to hook into the subscriber /wp-admin/index.php page?

I want to hook into the subscriber role index.php page (wp-admin/index.php) to add some custom content outside of the widgets. This admin_init works for all admin pages: add_action( 'init', '...
BlueDogRanch's user avatar
4 votes
1 answer

Difference between hooks Plugin_loaded and admin_int?

As per my understanding, functions attached to plugin_loaded and admin_init hooks are called whenever any admin page is loaded. What's the difference between them?
learning_13's user avatar
0 votes
1 answer

Why can't a custom postype be registered with "admin_init" hook?

Why do I need to use the "init" hook instead of the "admin_init" hook? init:fires after the core of the wordpress is loaded but before headers are sent admin init:before any other hook when the user ...
Johnthomas's user avatar
0 votes
1 answer

Get current session in WP admin

Trying to access sessions in the WP admin and access a variable from it. function tasks_admin_sessions() { if(!session_id()) { session_start(); } } add_action( 'admin_init', '...
Gareth Gillman's user avatar
0 votes
0 answers

Hide login page and use wp_login_form on ordinary pages

I would like to hide page but also to use wp_login_form() function where I want. Currently this function doesn't work if I hide login page with this code (it redirects to front ...
Ivan Topić's user avatar
2 votes
2 answers

Which hook for processing plugin page form data?

Which hook should I use for processing form data from my plugin pages. I currently use "admin_init". Is that correct? Was this hook intended to be used this way?
adam's user avatar
  • 23
4 votes
2 answers

Is it save to require plugin.php early to be able to use get_plugin_data() earlier?

I'd like to avoid hard coding my plugin's version at multiple places. To realize this the function get_plugin_data() comes in handy. But here the fun comes to an unpleasant stop. Checking for a plugin ...
wedi's user avatar
  • 141
0 votes
1 answer

How to use hook admin_init for add_action for custom post type column

I'm adding a post thumbnail column to the edit custom post screen. The post thumbnails are showing up fine however I would like to hook it with admin_init to take some load off the website. This is ...
Paul Coppock's user avatar
13 votes
2 answers

Use wp init hook to call other hooks?

I want to know if it is a good practice according to WordPress theme or plugin development. add_action('init','all_my_hooks'); function all_my_hooks(){ // some initialization stuff here and then ...
atinder's user avatar
  • 233
0 votes
1 answer

Editor capabilities - admin_init

I'm having a little difficulties with roles and capabilities. Editors gets a 'Cheatin uh?'-message when they try to update the custom theme-settings. Can anyone explain why - or maybe even have a ...
Jonas Thomsen's user avatar
0 votes
1 answer

wp_redirect and current_user_can issues

Put simply, I'm trying to redirect the user after clicking a 'Save Changes' button. The plugin uses custom capabilities, and so I want to check the current user has the correct capabilities before ...
Matthew Ruddy's user avatar
72 votes
9 answers

How do I Enqueue styles/scripts on Certain /wp-admin Pages?

I have two simple functions that load stuff using wp_enqueue_style() and wp_enqueue_script(), something like these: function admin_custom_css() { wp_enqueue_style( 'stylesheet_name', 'stylesheet.css')...
Wordpressor's user avatar
  • 5,041