[wp-hackers] any plan about bufferizing the whole WP output?..

Gaarai gaarai at gaarai.com
Sat Dec 27 16:17:31 GMT 2008


This is an example of code that you can put in your theme's 
functions.php file that will show how you can do a redirection:

    add_action( 'init' , 'my_custom_redirect', -10 );

    function my_custom_redirect() {
        print_r( $_REQUEST['my_custom_redirect'] );
        if ( ! empty( $_REQUEST['my_custom_redirect'] ) ) {
            wp_redirect( $_REQUEST['my_custom_redirect'] );
            exit();
        }
    }

You can see an example of this working on my test site by going here: 
http://new.gaarai.com/?my_custom_redirect=http://google.com.

It's not fancy and will most likely need to be modified to match what 
you are needing, but it should be good enough to get you going in the 
right direction.

Chris Jean
http://gaarai.com/
http://wp-roadmap.com/



dave jaggy wrote:
> That problem was just a trigger of an idea and it's benefits. Anyway,
> do you have some solution for my problem? I mean, let's say you have
> theme that catches form submition and tries to redirect the user to
> the proper page. How would you solve this task? It is quiet possible
> that it is easy also and I just miss the point.
>
> On Sat, Dec 27, 2008 at 6:40 PM, Gaarai <gaarai at gaarai.com> wrote:
>   
>> Sounds like you are going at the problem in the completely wrong direction.
>> Your issue isn't that the output isn't buffered and needs to be; rather,
>> your issue is that you've latched into an action that is after the headers
>> have been sent.
>>
>> Chris Jean
>> http://gaarai.com/
>> http://wp-roadmap.com/
>>
>>
>>
>> dave jaggy wrote:
>>     
>>> The idea came to my mind, just when I had problems with redirection on
>>> my complicated theme. Every time I tried to redirect I got that
>>> 'headers already sent' thing and no redirection. Probably one has to
>>> write some separate redirection plugin to manage this problem on
>>> earlier stage - perhaps somewhere at 'init' level.
>>>
>>> Is the overhead so big to leave this feature alone. Could be handy
>>> sometimes. Imagine - at any time you have all the output, that is
>>> going to be sent to users browser, at your finger tips. We could write
>>> some good management parser functions, that could easily rearrange
>>> things in output. No? :)
>>>
>>> On Sat, Dec 27, 2008 at 4:45 PM, Viper007Bond <viper at viper007bond.com>
>>> wrote:
>>>
>>>       
>>>> +1 to Ew.
>>>>
>>>> And it's super easy to add via a plugin anyway. Just hook in at "init" to
>>>> start it and "shutdown" to output it.
>>>>
>>>> On Fri, Dec 26, 2008 at 11:39 PM, DD32 <wordpress at dd32.id.au> wrote:
>>>>
>>>>
>>>>         
>>>>> Ew.
>>>>>
>>>>> Avoid buffering at all costs.
>>>>>
>>>>> It means that the PHP script needs to finish executing before any of the
>>>>> page is sent to the user, and adds some overhead.
>>>>>
>>>>> However, Some systems automatically buffer to compress the output.
>>>>>
>>>>> Plugins can also call any output buffer functions themselves if they
>>>>> wish
>>>>> to
>>>>> use an output buffer..
>>>>>
>>>>> 2008/12/27 dave jaggy <jayarjo at gmail.com>
>>>>>
>>>>>
>>>>>           
>>>>>> Is there a plan around to bufferize the whole wordpress output, before
>>>>>> it actually gets echoed to a remote client? I think this gotta be
>>>>>> great, if one could fully manage (add/remove/alter) output before it
>>>>>> (headers) gets sent. Is there any API development plan in this
>>>>>> direction?
>>>>>> _______________________________________________
>>>>>> wp-hackers mailing list
>>>>>> wp-hackers at lists.automattic.com
>>>>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>>>>>
>>>>>>
>>>>>>             
>>>>> _______________________________________________
>>>>> wp-hackers mailing list
>>>>> wp-hackers at lists.automattic.com
>>>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>>>>
>>>>>
>>>>>           
>>>> --
>>>> Viper007Bond | http://www.viper007bond.com/ | http://www.finalgear.com/
>>>> _______________________________________________
>>>> wp-hackers mailing list
>>>> wp-hackers at lists.automattic.com
>>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>>>
>>>>
>>>>         
>>> _______________________________________________
>>> wp-hackers mailing list
>>> wp-hackers at lists.automattic.com
>>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>>
>>>
>>>       
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>>     
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
>   


More information about the wp-hackers mailing list