Theme: Single pledge view (#43)

* Theme: Create template part for single pledge

* Plugin: Add functions for handling xprofile data

* Plugin: Add helper function for getting contributor user objects

* Theme: Display aggregated contributor data on single pledge view

* Theme: Add functions, markup, and styles to show team badges

* Theme: Add badge for Test team

* Theme: Add tentative URL for report a pledge link

* Theme: Add support for post thumbnails

* Theme: Add org logo to single pledge view

* Theme: Update `$content_width` to 960

This matches the width of the content in the global header and
the About page.

* Move pledge template to a file used by the template heirarchy

* Clean up some PHPCS errors

* Move pledge structure out to just the list items

* Create file for single pledge styles

* style badge grid into a grid.

* Add a custom image size for the logo

* Update styles

* Un-hide pledges with no confirmed contributors

* Fix content width
This commit is contained in:
Corey McKrill 2019-10-28 10:38:49 -07:00 committed by Kelly Dwan
parent 2ec665bcbb
commit dbdcf26bd9
17 changed files with 683 additions and 53 deletions

View file

@ -3,7 +3,7 @@ namespace WordPressDotOrg\FiveForTheFuture\Contributor;
use WordPressDotOrg\FiveForTheFuture;
use WordPressDotOrg\FiveForTheFuture\Pledge;
use WP_Error, WP_Post;
use WP_Error, WP_Post, WP_User;
defined( 'WPINC' ) || die();
@ -196,3 +196,16 @@ function get_pledge_contributors( $pledge_id, $status = 'publish', $contributor_
return $posts;
}
/**
* Get the user objects that correspond with pledge contributor posts.
*
* @param WP_Post[] $contributor_posts
*
* @return WP_User[]
*/
function get_contributor_user_objects( array $contributor_posts ) {
return array_map( function( WP_Post $post ) {
return get_user_by( 'login', $post->post_title );
}, $contributor_posts );
}