Skip to content

Commit

Permalink
Jetpack plugin - JSON API: Fix Warnings in post endpoints (#38365)
Browse files Browse the repository at this point in the history
* Jetpack plugin - JSON API: Fix Warnings in post endpoints
  • Loading branch information
fgiannar authored Jul 17, 2024
1 parent e17e397 commit 7181da9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Jetpack plugin - JSON API: Fix Warnings in post endpoints
8 changes: 3 additions & 5 deletions projects/plugins/jetpack/sal/class.json-api-post-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ public function get_author() {
// phpcs:disable WordPress.NamingConventions.ValidVariableName
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
$active_blog = get_active_blog_for_user( $user->ID );
$site_id = $active_blog->blog_id;
$site_id = $active_blog->blog_id ?? -1;
$profile_URL = "https://gravatar.com/{$user->user_login}";
} else {
$profile_URL = 'https://gravatar.com/' . md5( strtolower( trim( $user->user_email ) ) );
Expand Down Expand Up @@ -1017,11 +1017,9 @@ private function get_media_item_v1_1( $media_id ) {
}
}

$response['videopress_guid'] = $info->guid;
$response['videopress_guid'] = $info->guid ?? null;
$response['videopress_processing_done'] = true;
if ( '0000-00-00 00:00:00' === $info->finish_date_gmt ) {
$response['videopress_processing_done'] = false;
}
$response['videopress_processing_done'] = isset( $info->finish_date_gmt ) && '0000-00-00 00:00:00' !== $info->finish_date_gmt ? $info->finish_date_gmt : false;
}
}

Expand Down

0 comments on commit 7181da9

Please sign in to comment.