block_core_calendar_update_has_published_post_on_transition_post_status()
Handler for updating the has published posts flag when a post status changes.
Хуков нет.
Возвращает
null. Ничего (null).
Использование
block_core_calendar_update_has_published_post_on_transition_post_status( $new_status, $old_status, $post );
- $new_status(строка) (обязательный)
- The status the post is changing to.
- $old_status(строка) (обязательный)
- The status the post is changing from.
- $post(WP_Post) (обязательный)
- Post object.
Список изменений
| С версии 5.9.0 | Введена. |
Код block_core_calendar_update_has_published_post_on_transition_post_status() block core calendar update has published post on transition post status WP 6.9.4
function block_core_calendar_update_has_published_post_on_transition_post_status( $new_status, $old_status, $post ) {
if ( $new_status === $old_status ) {
return;
}
if ( 'post' !== get_post_type( $post ) ) {
return;
}
if ( 'publish' !== $new_status && 'publish' !== $old_status ) {
return;
}
block_core_calendar_update_has_published_posts();
}