• Resolved hupe13

    (@hupe13)


    I have custom functions which are called with add_action. add_action('init', ...) is processed with every call when “late init” is clicked. How do I achieve this for add_action('the_post', ...)? Is this possible?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter hupe13

    (@hupe13)

    Or asked differently: in which hook or action can I use is_404()?
    My function does not alter the (cached) content of the post/page.

    Plugin Author pyronaur (a11n)

    (@pyronaur)

    Hi,
    Cached pages aren’t going to run any hooks. The late init option is an exception – it allows you to run actions on init but should be used very carefully because it may impact the performance of your site.

    However, 404 pages are not cached, so you can use is_404() as you normally would and if a page turns out to be a 404, that function is going to return true and the result wont be cached.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘add_action the_post’ is closed to new replies.