[wp-hackers] Handling cookies with wp-plugin and wp-supercache

William Canino william.canino at googlemail.com
Mon Nov 2 15:34:05 UTC 2009


+1 on starting the Super Cache API documentation.

>> You'll be able to add a supercache plugin in the
>> wp-super-cache/plugins folder that uses that hook. You should probably move
>> the plugins folder out of that directory as the next time you update it'll
>> delete your plugin.

Sorry for my language, but this is horrible.

> Instead of modifying wp-cache-phase1.php you can use one of the
> cacheactions

Donncha is referring to wp_cache_served_cache_file. He is right.
Instead of my previous code suggestion, I would have suggested this:

function cookie-setting-code() {
   // do stuff
}
add_cacheaction('wp_cache_served_cache_file', 'cookie-setting-code');

The thing is, I don't know whether to put the code inline in the
plugin, in init, in wp_head or in functions.php.  I haven't gotten
around to trying this and, well, there's no documentation.



2009/11/2 Konrad Karpieszuk <kkarpieszuk at gmail.com>:
>>
>>
>> Instead of modifying wp-cache-phase1.php you can use one of the
>> cacheactions. You'll be able to add a supercache plugin in the
>> wp-super-cache/plugins folder that uses that hook. You should probably move
>> the plugins folder out of that directory as the next time you update it'll
>> delete your plugin.
>>
>> Doing this will make it easier to upgrade the plugin.
>
>
> Donncha, could you describe it (maybe create some small tutorial) somewhere
> how to do this? I think this will help for numerous wordpress plugins
> develeopers :) Your plugin (wp super cache) is really popular and in
> internet many times i saw questions from plugins developers that their
> plugins doesn't work if wp super cache is installed. Most of them finally
> decide to write in FAQ to disable wp super cache (truelly i did it also).
> But this is not good solutions, especially if your plugin is ready to handle
> this problem. Not everybody read source code of your plugin to find solution
> and today i first time see that it is possible to set and read cookie with
> wp super cache enabled :)
>
> If you will decide to write this (even shortly) i promise to help you in
> translating it into polish language.
>
>
> --
> (en) regards / (pl) pozdrawiam
> Konrad Karpieszuk
> http://konradjestwrwandzie.wordpress.com/
> _______________________________________________
> 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