block_core_calendar_update_has_published_post_on_transition_post_status() – Handler for updating the has published posts flag when a post status changes.

You appear to be a bot. Output may be restricted

Description

Handler for updating the has published posts flag when a post status changes.

Usage

block_core_calendar_update_has_published_post_on_transition_post_status( $new_status, $old_status, $post );

Parameters

$new_status
( string ) required – The status the post is changing to.
$old_status
( string ) required – The status the post is changing from.
$post
( WP_Post ) required – Post object.

Returns

void

Source

File name: wordpress/wp-includes/blocks/calendar.php


Lines:

1 to 16 of 16
  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();
  }
 

 View on GitHub View on Trac