[wp-hackers] hooks & future posts

scribu scribu at gmail.com
Sat Sep 19 16:57:13 UTC 2009


Make sure that wp_publish_future_post() actually triggers that action.


On Sat, Sep 19, 2009 at 7:42 PM, Ozh <ozh at planetozh.com> wrote:

> >> (or: how can I catch it when a post goes from 'future' to 'publish')
> >
> > Write to a file?
>
> not much more caught...
>
> add_action('future_to_publish', 'do_stuff');
> add_action('publish_post', 'do_stuff');
> function do_stuff( $in ) {
>  $f = fopen( dirname(__FILE__).'/log.log', 'a' );
>  fwrite( $f, print_r($in, true) );
>  fclose( $f );
>  return $in;
> }
>
> File log.log is created normally if I publish a post, but nothing
> happens if I schedule one.
>
> Pulling my hair.
>
>
> --
> http://planetOzh.com ~ Blog and WordPress Stuff
> http://FrenchFragFactory.net ~ Daily Quake News
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
http://scribu.net


More information about the wp-hackers mailing list