Make WordPress Core


Ignore:
Timestamp:
11/15/2021 12:47:22 PM (23 months ago)
Author:
noisysocks
Message:

Update @wordpress packages

Update packages to include these bug fixes from Gutenberg:

  • Navigation: Fix click-button size, submenu directions, scrollbars.
  • Group - Fix overzealous regex when restoring inner containers
  • Babel Preset: Update Babel packages to 7.16 version
  • theme.json: adds a setting property that enables some other ones
  • Polish metabox container.
  • Fix submenu justification and spacer orientation.
  • Fix Gutenberg 11.8.2 in WordPress trunk
  • Strip meta tags from pasted links in Chromium
  • Hide visilibility and status for navigation posts
  • Navigation: Refactor and simplify setup state.
  • Nav block menu switcher - decode HTML entities and utilise accessible markup pattern
  • Rename fse_navigation_area to wp_navigation_area
  • theme.json: adds a setting property that enables some other ones
  • Revert "theme.json: adds a setting property that enables some other ones"
  • Skip flaky image block test
  • WordPress/gutenberg@3c935c4
  • React to any errors coming up in gutenberg_migrate_menu_to_navigation_post
  • Return wp error from wp_insert_post
  • Fix not transforming logical assignments for packages

See #54337.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/calendar.php

    r52042 r52161  
    108108}
    109109
    110 // We only want to register these functions and actions when
    111 // we are on single sites. On multi sites we use `post_count` option.
    112 if ( ! is_multisite() ) {
    113     /**
    114      * Handler for updating the has published posts flag when a post is deleted.
    115      *
    116      * @param int $post_id Deleted post ID.
    117      */
    118     function block_core_calendar_update_has_published_post_on_delete( $post_id ) {
    119         $post = get_post( $post_id );
    120 
    121         if ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {
    122             return;
    123         }
    124 
    125         block_core_calendar_update_has_published_posts();
     110/**
     111 * Handler for updating the has published posts flag when a post is deleted.
     112 *
     113 * @param int $post_id Deleted post ID.
     114 */
     115function block_core_calendar_update_has_published_post_on_delete( $post_id ) {
     116    if ( is_multisite() ) {
     117        return;
    126118    }
    127119
    128     /**
    129      * Handler for updating the has published posts flag when a post status changes.
    130      *
    131      * @param string  $new_status The status the post is changing to.
    132      * @param string  $old_status The status the post is changing from.
    133      * @param WP_Post $post       Post object.
    134      */
    135     function block_core_calendar_update_has_published_post_on_transition_post_status( $new_status, $old_status, $post ) {
    136         if ( $new_status === $old_status ) {
    137             return;
    138         }
     120    $post = get_post( $post_id );
    139121
    140         if ( 'post' !== get_post_type( $post ) ) {
    141             return;
    142         }
    143 
    144         if ( 'publish' !== $new_status && 'publish' !== $old_status ) {
    145             return;
    146         }
    147 
    148         block_core_calendar_update_has_published_posts();
     122    if ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {
     123        return;
    149124    }
    150125
    151     add_action( 'delete_post', 'block_core_calendar_update_has_published_post_on_delete' );
    152     add_action( 'transition_post_status', 'block_core_calendar_update_has_published_post_on_transition_post_status', 10, 3 );
     126    block_core_calendar_update_has_published_posts();
    153127}
     128
     129/**
     130 * Handler for updating the has published posts flag when a post status changes.
     131 *
     132 * @param string  $new_status The status the post is changing to.
     133 * @param string  $old_status The status the post is changing from.
     134 * @param WP_Post $post       Post object.
     135 */
     136function block_core_calendar_update_has_published_post_on_transition_post_status( $new_status, $old_status, $post ) {
     137    if ( is_multisite() ) {
     138        return;
     139    }
     140
     141    if ( $new_status === $old_status ) {
     142        return;
     143    }
     144
     145    if ( 'post' !== get_post_type( $post ) ) {
     146        return;
     147    }
     148
     149    if ( 'publish' !== $new_status && 'publish' !== $old_status ) {
     150        return;
     151    }
     152
     153    block_core_calendar_update_has_published_posts();
     154}
     155
     156add_action( 'delete_post', 'block_core_calendar_update_has_published_post_on_delete' );
     157add_action( 'transition_post_status', 'block_core_calendar_update_has_published_post_on_transition_post_status', 10, 3 );
Note: See TracChangeset for help on using the changeset viewer.