mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-04 18:05:45 +03:00
Merge branch 'production' into fix/9
# Conflicts: # themes/wporg-5ftf/single.php
This commit is contained in:
commit
368d05e74d
23 changed files with 964 additions and 51 deletions
|
@ -100,6 +100,11 @@ function populate_list_table_columns( $column, $post_id ) {
|
|||
$contributor = get_post( $post_id );
|
||||
$pledge = get_post( $contributor->post_parent );
|
||||
|
||||
if ( ! $pledge ) {
|
||||
esc_html_e( 'Unattached', 'wordpressorg' );
|
||||
break;
|
||||
}
|
||||
|
||||
$pledge_name = get_the_title( $pledge );
|
||||
|
||||
if ( current_user_can( 'edit_post', $pledge->ID ) ) {
|
||||
|
@ -134,6 +139,20 @@ function create_new_contributor( $wporg_username, $pledge_id ) {
|
|||
return wp_insert_post( $args, true );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a contributor post from a pledge.
|
||||
*
|
||||
* This wrapper function ensures we have a standardized way of removing a contributor that will still
|
||||
* transition a post status (see PledgeMeta\update_confirmed_contributor_count).
|
||||
*
|
||||
* @param int $contributor_post_id
|
||||
*
|
||||
* @return false|WP_Post|null
|
||||
*/
|
||||
function remove_contributor( $contributor_post_id ) {
|
||||
return wp_trash_post( $contributor_post_id );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the contributor posts associated with a particular pledge post.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue