mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-06 10:45:44 +03:00
Pass back error if upload fails
This commit is contained in:
parent
66772080a5
commit
e279f9ba49
1 changed files with 3 additions and 2 deletions
|
@ -131,9 +131,10 @@ function process_form_new() {
|
|||
}
|
||||
|
||||
$result = \media_handle_sideload( $logo, $new_pledge_id );
|
||||
if ( ! is_wp_error( $result ) ) {
|
||||
set_post_thumbnail( $new_pledge_id, $result );
|
||||
if ( is_wp_error( $result ) ) {
|
||||
return $result;
|
||||
}
|
||||
set_post_thumbnail( $new_pledge_id, $result );
|
||||
}
|
||||
|
||||
return 'success';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue