equal
deleted
inserted
replaced
5 * @package WordPress |
5 * @package WordPress |
6 */ |
6 */ |
7 |
7 |
8 /** |
8 /** |
9 * Renders the `core/comments-pagination` block on the server. |
9 * Renders the `core/comments-pagination` 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 * |
15 * |
14 * @return string Returns the wrapper for the Comments pagination. |
16 * @return string Returns the wrapper for the Comments pagination. |
20 |
22 |
21 if ( post_password_required() ) { |
23 if ( post_password_required() ) { |
22 return; |
24 return; |
23 } |
25 } |
24 |
26 |
|
27 $classes = ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) ? 'has-link-color' : ''; |
|
28 $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); |
|
29 |
25 return sprintf( |
30 return sprintf( |
26 '<div %1$s>%2$s</div>', |
31 '<div %1$s>%2$s</div>', |
27 get_block_wrapper_attributes(), |
32 $wrapper_attributes, |
28 $content |
33 $content |
29 ); |
34 ); |
30 } |
35 } |
31 |
36 |
32 /** |
37 /** |
33 * Registers the `core/comments-pagination` block on the server. |
38 * Registers the `core/comments-pagination` block on the server. |
|
39 * |
|
40 * @since 6.0.0 |
34 */ |
41 */ |
35 function register_block_core_comments_pagination() { |
42 function register_block_core_comments_pagination() { |
36 register_block_type_from_metadata( |
43 register_block_type_from_metadata( |
37 __DIR__ . '/comments-pagination', |
44 __DIR__ . '/comments-pagination', |
38 array( |
45 array( |