mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-18 17:33:43 +03:00
Block binding: Add value for displaying short contribution details
This commit is contained in:
parent
f2e80b8d07
commit
0e5b8788eb
|
@ -59,5 +59,11 @@ function get_meta_binding_value( $args, $block ) {
|
|||
number_format_i18n( absint( $contribution_data['hours'] ) ),
|
||||
count( $contribution_data['teams'] )
|
||||
);
|
||||
case 'org-contribution-short-details':
|
||||
$contribution_data = get_aggregate_contributor_data_for_pledge( $block->context['postId'] );
|
||||
return sprintf(
|
||||
__( 'Has pledged %s hours per week.', 'wporg-5ftf' ),
|
||||
number_format_i18n( absint( $contribution_data['hours'] ) ),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,8 +65,8 @@ if ( is_search() ) {
|
|||
<div class="wp-block-group">
|
||||
<!-- wp:post-title {"isLink":true,"fontSize":"heading-3"} /-->
|
||||
|
||||
<!-- wp:paragraph -->
|
||||
<p>Has pledged…</p>
|
||||
<!-- wp:paragraph {"style":{"elements":{"link":{"color":{"text":"var:preset|color|charcoal-4"}}}},"textColor":"charcoal-4","metadata":{"bindings":{"content":{"source":"wporg-5ftf/pledge-meta","args":{"key":"org-contribution-short-details"}}}}} -->
|
||||
<p class="has-charcoal-4-color has-text-color has-link-color"></p>
|
||||
<!-- /wp:paragraph -->
|
||||
|
||||
<!-- wp:post-excerpt {"moreText":"[MORE]","showMoreOnNewLine":false,"excerptLength":50} /-->
|
||||
|
|
Loading…
Reference in a new issue