[wp-hackers] Re: How to redirect to login when filtered posts are
wordpress at dd32.id.au
Thu Aug 2 01:00:55 GMT 2007
We might be on completely different pages, but heres some code from my
if( isset($wp_query->query_vars['ddeviantart']) )
//Override the template for the current page and replace it with our own.
ie. Conditionally add the 2nd filter only if its needed..
On Thu, 02 Aug 2007 10:50:47 +1000, David Coppit <david at coppit.org> wrote:
> On Thu, 2 Aug 2007, DD32 wrote:
>> On Thu, 02 Aug 2007 05:38:16 +1000, David Coppit <david at coppit.org>
>>> Here's a workable solution:
>>> - In my filter, set a global if the page should be hidden
>>> - Use add_action to hook template_redirect
>>> - In my hook, check to see if the global is set and call
>>> if it is.
>>> I wish there was a better way than setting a global, but I don't see
>> I'm not sure of the code your using, But what i've done was only
>> register the template_redirect hook IF in the filter its realised as
>> needing the hook.
> Let me make sure I understand... In my filter callback I call add_action
> if I need the redirect. The add_action callback unconditionally calls
> auth_redirect. I also need to call remove_action in the action callback,
> David Coppit david at coppit.org
> The College of William and Mary http://coppit.org/
> "When the president does it that means that it is not illegal."
> - Richard Nixon on domestic surveillance, 5/19/1977
> "Do I have the legal authority to do this? And the answer is,
> - George W. Bush on domestic surveillance, 12/19/2005
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
More information about the wp-hackers