Make WordPress Core


Ignore:
Timestamp:
10/20/2020 01:33:02 PM (4 years ago)
Author:
youknowriad
Message:

Block Editor: Update the WordPress Packages to the latest version.

This includes the packages that match the Gutenberg 9.2 Release.
It is going to be the last block-editor features update for WordPress 5.6.
It also updates the block-supports code base to the latest APIs.

Props isabel_brison, noisysocks, desrosj.
Fixes #51570.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-supports/align.php

    r49135 r49226  
    88/**
    99 * Registers the align block attribute for block types that support it.
     10 *
     11 * @access private
    1012 *
    1113 * @param WP_Block_Type $block_type Block Type.
     
    3436 * This will be applied to the block markup in the front-end.
    3537 *
    36  * @param array         $attributes       Comprehensive list of attributes to be applied.
     38 * @access private
     39 *
     40 * @param WP_Block_Type $block_type       Block Type.
    3741 * @param array         $block_attributes Block attributes.
    38  * @param WP_Block_Type $block_type       Block Type.
    3942 *
    4043 * @return array Block alignment CSS classes and inline styles.
    4144 */
    42 function wp_apply_alignment_support( $attributes, $block_attributes, $block_type ) {
     45function wp_apply_alignment_support( $block_type, $block_attributes ) {
     46    $attributes        = array();
    4347    $has_align_support = false;
    4448    if ( property_exists( $block_type, 'supports' ) ) {
     
    4953
    5054        if ( $has_block_alignment ) {
    51             $attributes['css_classes'][] = sprintf( 'align%s', $block_attributes['align'] );
     55            $attributes['class'] = sprintf( 'align%s', $block_attributes['align'] );
    5256        }
    5357    }
     
    5559    return $attributes;
    5660}
     61
     62// Register the block support.
     63WP_Block_Supports::get_instance()->register(
     64    'align',
     65    array(
     66        'register_attribute' => 'wp_register_alignment_support',
     67        'apply'              => 'wp_apply_alignment_support',
     68    )
     69);
Note: See TracChangeset for help on using the changeset viewer.