wp/wp-includes/blocks/comments-pagination-previous.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
child 22 8c2e4d02f4ef
equal deleted inserted replaced
20:7b1b88e27a20 21:48c4eec2b7e6
     5  * @package WordPress
     5  * @package WordPress
     6  */
     6  */
     7 
     7 
     8 /**
     8 /**
     9  * Renders the `core/comments-pagination-previous` block on the server.
     9  * Renders the `core/comments-pagination-previous` block on the server.
       
    10  *
       
    11  * @since 6.0.0
    10  *
    12  *
    11  * @param array    $attributes Block attributes.
    13  * @param array    $attributes Block attributes.
    12  * @param string   $content    Block default content.
    14  * @param string   $content    Block default content.
    13  * @param WP_Block $block      Block instance.
    15  * @param WP_Block $block      Block instance.
    14  *
    16  *
    20 	$pagination_arrow = get_comments_pagination_arrow( $block, 'previous' );
    22 	$pagination_arrow = get_comments_pagination_arrow( $block, 'previous' );
    21 	if ( $pagination_arrow ) {
    23 	if ( $pagination_arrow ) {
    22 		$label = $pagination_arrow . $label;
    24 		$label = $pagination_arrow . $label;
    23 	}
    25 	}
    24 
    26 
    25 	$filter_link_attributes = function() {
    27 	$filter_link_attributes = static function () {
    26 		return get_block_wrapper_attributes();
    28 		return get_block_wrapper_attributes();
    27 	};
    29 	};
    28 	add_filter( 'previous_comments_link_attributes', $filter_link_attributes );
    30 	add_filter( 'previous_comments_link_attributes', $filter_link_attributes );
    29 
    31 
    30 	$previous_comments_link = get_previous_comments_link( $label );
    32 	$previous_comments_link = get_previous_comments_link( $label );
    38 	return $previous_comments_link;
    40 	return $previous_comments_link;
    39 }
    41 }
    40 
    42 
    41 /**
    43 /**
    42  * Registers the `core/comments-pagination-previous` block on the server.
    44  * Registers the `core/comments-pagination-previous` block on the server.
       
    45  *
       
    46  * @since 6.0.0
    43  */
    47  */
    44 function register_block_core_comments_pagination_previous() {
    48 function register_block_core_comments_pagination_previous() {
    45 	register_block_type_from_metadata(
    49 	register_block_type_from_metadata(
    46 		__DIR__ . '/comments-pagination-previous',
    50 		__DIR__ . '/comments-pagination-previous',
    47 		array(
    51 		array(