Forums

[resolved] Exclude plugin output from Admin section. (2 posts)

  1. mutube
    Member
    Posted 5 years ago #

    Hi folks,

    I'm working on another plugin, which needs to output direct headers to the browser (for the purpose of redirecting). To do this it needs to be called before anything is sent, and I'm currently using the init action hook to do this.

    However, this also affects the admin area too - meaning when redirecting is enabled it can lock the admin user out.

    Is there a function check the plugin can use to find out where it's being called from? Or is there an alternate hook that is early enough to send headers, but specific to content pages?

    Thanks,

  2. mutube
    Member
    Posted 5 years ago #

    Ah. Its's is_admin() that checks for that. Doesn't appear to be documented anywhere, but works.

Topic Closed

This topic has been closed to new replies.

About this Topic