_transition_post_status [ WordPress Function ]
_transition_post_status ( $new_status, $old_status, $post )
| Access: |
|
| Parameters: |
|
| Uses: |
|
| Defined at: |
|
Soorgelijke functies: wp_transition_post_status, wp_transition_comment_status, register_post_status, _update_term_count_on_transition_post_status, get_post_status
Hook for managing future post transitions to published.
Source
<?php
function _transition_post_status($new_status, $old_status, $post) {
global $wpdb;
if ( $old_status != 'publish' && $new_status == 'publish' ) {
// Reset GUID if transitioning to publish and it is empty
if ( '' == get_the_guid($post->ID) )
$wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) );
do_action('private_to_published', $post->ID); // Deprecated, use private_to_publish
}
// If published posts changed clear the lastpostmodified cache
if ( 'publish' == $new_status || 'publish' == $old_status) {
foreach ( array( 'server', 'gmt', 'blog' ) as $timezone ) {
wp_cache_delete( "lastpostmodified:$timezone", 'timeinfo' );
wp_cache_delete( "lastpostdate:$timezone", 'timeinfo' );
}
}
// Always clears the hook in case the post status bounced from future to draft.
wp_clear_scheduled_hook('publish_future_post', array( $post->ID ) );
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Function Reference/ transition post status « WordPress Codex
Description. Hook for managing future post transitions to published. Usage. <? php _transition_post_status( $new_status, $old_status, $post ) ?> Parameters ...
codex.wordpress.org - _transition_post_status (WordPress Function) - WPSeek.com
WordPress lookup for _transition_post_status, a WordPress Function. wpseek. com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - wp_transition_post_status (WordPress Function) - WPSeek.com
Similar Functions: _transition_post_status, wp_transition_comment_status, _update_term_count_on_transition_post_status, wp_set_post_cats, ...
wpseek.com - transition_post_status Wordpress hook details -- Adam Brown, BYU ...
We find related hooks using word stems. transition_post_status has 3 significant word stem(s): transition , post , status . Note that some of the hooks below may ...
adambrown.info