Skip to content

Commit

Permalink
release: fixes
Browse files Browse the repository at this point in the history
- Fixed sharing on LinkedIn: updated LinkedIn API Version
- Updated Facebook API Version
  • Loading branch information
vytisbulkevicius authored Jun 4, 2024
2 parents 6c8d585 + 9182ea1 commit 944dda6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion includes/admin/services/class-rop-facebook-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function set_api( $app_id = '', $secret = '' ) {
array(
'app_id' => $this->strip_whitespace( $app_id ),
'app_secret' => $this->strip_whitespace( $secret ),
'default_graph_version' => 'v12.0',
'default_graph_version' => 'v16.0',
)
);
} catch ( Exception $exception ) {
Expand Down
11 changes: 9 additions & 2 deletions includes/admin/services/class-rop-linkedin-service.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
*/
class Rop_Linkedin_Service extends Rop_Services_Abstract {

/**
* The version of the Linkedin API.
*
* @see https://learn.microsoft.com/en-us/linkedin/marketing/versioning?view=li-lms-2024-05
*/
public const LINKEDIN_VERSION = 202405;

/**
* An instance of authenticated LinkedIn user.
*
Expand Down Expand Up @@ -573,7 +580,7 @@ public function share( $post_details, $args = array() ) {
'x-li-format' => 'json',
'X-Restli-Protocol-Version' => '2.0.0',
'Authorization' => 'Bearer ' . $token,
'Linkedin-Version' => defined( 'ROP_LINKEDIN_VERSION' ) ? ROP_LINKEDIN_VERSION : 202304,
'Linkedin-Version' => defined( 'ROP_LINKEDIN_VERSION' ) ? ROP_LINKEDIN_VERSION : self::LINKEDIN_VERSION,
),
)
);
Expand Down Expand Up @@ -971,7 +978,7 @@ private function linkedin_upload_assets( $image_url, $args, $token ) {
'x-li-format' => 'json',
'X-Restli-Protocol-Version' => '2.0.0',
'Authorization' => 'Bearer ' . $token,
'Linkedin-Version' => defined( 'ROP_LINKEDIN_VERSION' ) ? ROP_LINKEDIN_VERSION : 202304,
'Linkedin-Version' => defined( 'ROP_LINKEDIN_VERSION' ) ? ROP_LINKEDIN_VERSION : self::LINKEDIN_VERSION,
),
)
);
Expand Down

0 comments on commit 944dda6

Please sign in to comment.