Make WordPress Core


Ignore:
Timestamp:
11/15/2021 12:47:22 PM (5 years 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.

Location:
trunk/src/wp-includes/blocks
Files:
2 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 );
  • trunk/src/wp-includes/blocks/navigation.php

    r52103 r52161  
    148148        if ( ! empty( $block->context['navigationArea'] ) ) {
    149149                $area    = $block->context['navigationArea'];
    150                 $mapping = get_option( 'fse_navigation_areas', array() );
     150                $mapping = get_option( 'wp_navigation_areas', array() );
    151151                if ( ! empty( $mapping[ $area ] ) ) {
    152152                        $attributes['navigationMenuId'] = $mapping[ $area ];
     
    180180                return '';
    181181        }
     182
     183        // Restore legacy classnames for submenu positioning.
     184        $layout_class = '';
     185        if ( isset( $attributes['layout']['justifyContent'] ) ) {
     186                if ( 'right' === $attributes['layout']['justifyContent'] ) {
     187                        $layout_class .= 'items-justified-right';
     188                } elseif ( 'space-between' === $attributes['layout']['justifyContent'] ) {
     189                        $layout_class .= 'items-justified-space-between';
     190                }
     191        }
     192
    182193        $colors     = block_core_navigation_build_css_colors( $attributes );
    183194        $font_sizes = block_core_navigation_build_css_font_sizes( $attributes );
     
    185196                $colors['css_classes'],
    186197                $font_sizes['css_classes'],
    187                 $is_responsive_menu ? array( 'is-responsive' ) : array()
     198                $is_responsive_menu ? array( 'is-responsive' ) : array(),
     199                $layout_class ? array( $layout_class ) : array()
    188200        );
    189201
Note: See TracChangeset for help on using the changeset viewer.