Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional fields to be sent #116

Merged
merged 11 commits into from
Aug 24, 2021
Merged

Conversation

Rahmon
Copy link
Contributor

@Rahmon Rahmon commented Aug 16, 2021

Description of the Change

This change adds new fields about the post to be sent.

Alternate Designs

Benefits

Possible Drawbacks

Verification Process

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Applicable Issues

Changelog Entry

Added new fields to be sent to the API: thumbnailImageUri, embeddedImagesCount, and keywords.

@Rahmon Rahmon added the enhancement New feature or request label Aug 16, 2021
@Rahmon Rahmon self-assigned this Aug 16, 2021
@jeffpaul jeffpaul added this to the 1.1.0 milestone Aug 16, 2021
@Rahmon Rahmon requested a review from felipeelia August 17, 2021 12:38
felipeelia
felipeelia previously approved these changes Aug 17, 2021
@@ -180,29 +180,44 @@ function get_post_data( $post ) {
$content = apply_filters( 'the_content', get_the_content( null, false, $post ) );
$content = str_replace( ']]>', ']]>', $content );
$canonical_url = wp_get_canonical_url( $post );
$keywords = '';

// Support Yoast SEO canonical URL.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should update the comment to mention keywords.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated @dinhtungdu

Comment on lines +209 to +220
'thumbnailImageUri' => get_the_post_thumbnail_url( $post, 'full' ),
'embeddedImagesCount' => Utils\get_number_of_embedded_images( $content ),
'classificationCode' => '',
'collectionName' => '',
'isSponsored' => false,
'promoPlainText' => '',
'keywords' => $keywords,
'creditLine' => '',
'ownership' => '',
'editorialAccessName' => '',
'subtype' => '',
'redirectToUrl' => '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we filter the falsy items below, so most of this will be removed. Please see #62 (comment) for more info about omitting empty keys.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dinhtungdu

I saw that. I've added the fields even with an empty string to keep track since these fields will be addressed in the future.

@Rahmon Rahmon requested a review from dinhtungdu August 18, 2021 21:34
@Rahmon Rahmon requested a review from felipeelia August 23, 2021 13:45
@jeffpaul jeffpaul merged commit bbaf749 into develop Aug 24, 2021
@jeffpaul jeffpaul deleted the feature/add-additional-fields branch August 24, 2021 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants