Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have this function below that is called with the admin_init Action

function my_flush_rewrites() {
    global $wp_rewrite;
    $wp_rewrite->flush_rules();
}

Like this

add_action('admin_init', 'my_flush_rewrites');

I am curious, when is this called? Is this called on every page load? Hopefully not

share|improve this question

1 Answer

up vote 1 down vote accepted

From the Codex:

admin_init is triggered before any other hook when a user access the admin area. This hook doesn't provide any parameters, so it can only be used to callback a specified function.

So yes, it's run on every admin page load.

share|improve this answer
Yeah I had read that but I wasn't sure, so basically my average user won't be hammering this over and over, that is all I was afraid of, thanks for the quick response! – jasondavis Apr 19 '12 at 4:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.