[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * Server-side rendering of the `core/query-pagination` block. 4 * 5 * @package WordPress 6 */ 7 8 /** 9 * Renders the `core/query-pagination` block on the server. 10 * 11 * @param array $attributes Block attributes. 12 * @param string $content Block default content. 13 * 14 * @return string Returns the wrapper for the Query pagination. 15 */ 16 function render_block_core_query_pagination( $attributes, $content ) { 17 if ( empty( trim( $content ) ) ) { 18 return ''; 19 } 20 21 $classes = ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) ? 'has-link-color' : ''; 22 $wrapper_attributes = get_block_wrapper_attributes( 23 array( 24 'aria-label' => __( 'Pagination' ), 25 'class' => $classes, 26 ) 27 ); 28 29 return sprintf( 30 '<nav %1$s>%2$s</nav>', 31 $wrapper_attributes, 32 $content 33 ); 34 } 35 36 /** 37 * Registers the `core/query-pagination` block on the server. 38 */ 39 function register_block_core_query_pagination() { 40 register_block_type_from_metadata( 41 __DIR__ . '/query-pagination', 42 array( 43 'render_callback' => 'render_block_core_query_pagination', 44 ) 45 ); 46 } 47 add_action( 'init', 'register_block_core_query_pagination' );
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Fri Mar 24 08:20:02 2023 | Cross-referenced by PHPXref |