mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-04-22 19:13:44 +03:00
Contributors: Check if a pledge exists before displaying the pledge name
If somehow a pledge is deleted, the contributors listing in wp-admin shows an error trying to display the linked pledge.
This commit is contained in:
parent
5ffca9420f
commit
f47024efda
|
@ -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 ) ) {
|
||||
|
|
Loading…
Reference in a new issue