mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-04 18:05:45 +03:00
parent
5c5ae83287
commit
858d70b045
3 changed files with 115 additions and 46 deletions
|
@ -2,7 +2,7 @@
|
|||
namespace WordPressDotOrg\FiveForTheFuture\Contributor;
|
||||
|
||||
use WordPressDotOrg\FiveForTheFuture;
|
||||
use WordPressDotOrg\FiveForTheFuture\Pledge;
|
||||
use WordPressDotOrg\FiveForTheFuture\{ Pledge, XProfile };
|
||||
use WP_Error, WP_Post, WP_User;
|
||||
|
||||
defined( 'WPINC' ) || die();
|
||||
|
@ -249,16 +249,25 @@ function get_contributor_user_objects( array $contributor_posts ) {
|
|||
*/
|
||||
function render_my_pledges() {
|
||||
$user = wp_get_current_user();
|
||||
$success_message = process_my_pledges_form();
|
||||
$profile_data = XProfile\get_contributor_user_data( $user->ID );
|
||||
$pledge_url = get_permalink( get_page_by_path( 'for-organizations' ) );
|
||||
$success_message = process_my_pledges_form();
|
||||
|
||||
$contributor_posts = get_posts( array(
|
||||
'title' => $user->user_login,
|
||||
'post_type' => CPT_ID,
|
||||
'post_title' => $user->user_login,
|
||||
'post_status' => array( 'pending', 'publish' ),
|
||||
'numberposts' => 100,
|
||||
) );
|
||||
|
||||
$confirmed_pledge_ids = array_reduce( $contributor_posts, function( $carry, $post ) {
|
||||
if ( 'publish' === $post->post_status ) {
|
||||
$carry[] = $post->ID;
|
||||
}
|
||||
|
||||
return $carry;
|
||||
}, array() );
|
||||
|
||||
ob_start();
|
||||
require FiveForTheFuture\get_views_path() . 'list-my-pledges.php';
|
||||
return ob_get_clean();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue