Skip to content

Commit

Permalink
Update contributor.php (#266)
Browse files Browse the repository at this point in the history
* Update contributor.php

Store wporg user id as post meta to enable easier reporting for contributors.
  • Loading branch information
pkevan authored Jul 3, 2024
1 parent 554347a commit c880f28
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/wporg-5ftf/includes/contributor.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,16 @@ function add_pledge_contributors( $pledge_id, $contributors ) {
$results = array();

foreach ( $contributors as $wporg_username ) {
$wporg_user = get_user_by( 'slug', $wporg_username );

$args = array(
'post_type' => CPT_ID,
'post_title' => sanitize_user( $wporg_username ),
'post_parent' => $pledge_id,
'post_status' => 'pending',
'meta_input' => array(
'wporg_user_id' => $wporg_user->ID,
),
);

$result = wp_insert_post( $args, true );
Expand Down

0 comments on commit c880f28

Please sign in to comment.