0

i.e. instead of this code:

include_once(...'/wp-load.php');

add_action('init', 'my');
function my(){
  if(current_user_can('manage_options')){
   .....
  }
}

we can simply use:

include_once(...'/wp-load.php');
if(current_user_can('manage_options')){
   .....
}

and to my surprise, this function works. How it works? what state is there right after the line include(wp-load) ? Seems init already happened?

  • where are you writing this? do you know if include_once is even doing anything? – Joel M Feb 24 '18 at 6:34
  • @JoelM that is just example. concept is that after including wp-load. – T.Todua Feb 24 '18 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.