mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-02 09:11:17 +03:00
Pass back error if upload fails
This commit is contained in:
parent
66772080a5
commit
e279f9ba49
|
@ -131,9 +131,10 @@ function process_form_new() {
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = \media_handle_sideload( $logo, $new_pledge_id );
|
$result = \media_handle_sideload( $logo, $new_pledge_id );
|
||||||
if ( ! is_wp_error( $result ) ) {
|
if ( is_wp_error( $result ) ) {
|
||||||
set_post_thumbnail( $new_pledge_id, $result );
|
return $result;
|
||||||
}
|
}
|
||||||
|
set_post_thumbnail( $new_pledge_id, $result );
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'success';
|
return 'success';
|
||||||
|
|
Loading…
Reference in a new issue