Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: private_to_published

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
6196
6197           /**
6198            * Fires when a post's status is transitioned from private to published.
6199            *
6200            * @since 1.5.0
6201            * @deprecated 2.3.0 Use 'private_to_publish' instead.
6202            *
6203            * @param int $post_id Post ID.
6204            */
6205           do_action('private_to_published', $post->ID);
6206      }
6207
6208      // If published posts changed clear the lastpostmodified cache.
6209      if ( 'publish' == $new_status || 'publish' == $old_status) {
6210           foreach ( array( 'server', 'gmt', 'blog' ) as $timezone ) {
6211                wp_cache_delete( "lastpostmodified:$timezone", 'timeinfo' );
6212                wp_cache_delete( "lastpostdate:$timezone", 'timeinfo' );
6213                wp_cache_delete( "lastpostdate:$timezone:{$post->post_type}", 'timeinfo' );
6214           }