@@ -348,14 +348,16 @@ public function wp_media_transcoding( $wp_metadata, $attachment_id, $autoformat
348348 // Get author name with fallback to username.
349349 $ author_first_name = '' ;
350350 $ author_last_name = '' ;
351+ $ author_email = '' ;
351352
352353 if ( $ attachment_author ) {
353- $ author_first_name = $ attachment_author ->first_name ;
354- $ author_last_name = $ attachment_author ->last_name ;
354+ $ author_first_name = $ attachment_author ->first_name ?? '' ;
355+ $ author_last_name = $ attachment_author ->last_name ?? '' ;
356+ $ author_email = $ attachment_author ->user_email ?? '' ;
355357
356358 // If first and last names are empty, use username as fallback.
357359 if ( empty ( $ author_first_name ) && empty ( $ author_last_name ) ) {
358- $ author_first_name = $ attachment_author ->user_login ;
360+ $ author_first_name = $ attachment_author ->user_login ?? '' ;
359361 }
360362 }
361363
@@ -379,7 +381,7 @@ public function wp_media_transcoding( $wp_metadata, $attachment_id, $autoformat
379381 'watermark ' => boolval ( $ rtgodam_watermark ),
380382 'resolutions ' => array ( 'auto ' ),
381383 'video_quality ' => $ rtgodam_video_compress_quality ,
382- 'wp_author_email ' => apply_filters ( 'godam_author_email_to_send ' , $ attachment_author ? $ attachment_author -> user_email : '' , $ attachment_id ),
384+ 'wp_author_email ' => apply_filters ( 'godam_author_email_to_send ' , $ author_email , $ attachment_id ),
383385 'wp_site ' => $ site_url ,
384386 'wp_author_first_name ' => apply_filters ( 'godam_author_first_name_to_send ' , $ author_first_name , $ attachment_id ),
385387 'wp_author_last_name ' => apply_filters ( 'godam_author_last_name_to_send ' , $ author_last_name , $ attachment_id ),
0 commit comments