Changeset 49226 for trunk/src/wp-includes/block-supports/align.php
- Timestamp:
- 10/20/2020 01:33:02 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/align.php
r49135 r49226 8 8 /** 9 9 * Registers the align block attribute for block types that support it. 10 * 11 * @access private 10 12 * 11 13 * @param WP_Block_Type $block_type Block Type. … … 34 36 * This will be applied to the block markup in the front-end. 35 37 * 36 * @param array $attributes Comprehensive list of attributes to be applied. 38 * @access private 39 * 40 * @param WP_Block_Type $block_type Block Type. 37 41 * @param array $block_attributes Block attributes. 38 * @param WP_Block_Type $block_type Block Type.39 42 * 40 43 * @return array Block alignment CSS classes and inline styles. 41 44 */ 42 function wp_apply_alignment_support( $attributes, $block_attributes, $block_type ) { 45 function wp_apply_alignment_support( $block_type, $block_attributes ) { 46 $attributes = array(); 43 47 $has_align_support = false; 44 48 if ( property_exists( $block_type, 'supports' ) ) { … … 49 53 50 54 if ( $has_block_alignment ) { 51 $attributes['c ss_classes'][] = sprintf( 'align%s', $block_attributes['align'] );55 $attributes['class'] = sprintf( 'align%s', $block_attributes['align'] ); 52 56 } 53 57 } … … 55 59 return $attributes; 56 60 } 61 62 // Register the block support. 63 WP_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.