-
Notifications
You must be signed in to change notification settings - Fork 7
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
SIT-3060: Change sectionNames to allSections field #275
Conversation
@@ -269,7 +269,7 @@ function get_post_data( $post ) { | |||
'publishedAt' => gmdate( \DateTime::RFC3339, strtotime( $post->post_date_gmt ) ), | |||
'plainText' => wp_strip_all_tags( $content ), | |||
'size' => str_word_count( wp_strip_all_tags( $content ) ), | |||
'sectionNames' => Utils\get_post_categories( $post->ID ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we want to keep this field as the next step in a subsequent release will change the data in the sectionNames
field to hold the Primary Category
includes/functions/content-sync.php
Outdated
@@ -269,7 +269,7 @@ function get_post_data( $post ) { | |||
'publishedAt' => gmdate( \DateTime::RFC3339, strtotime( $post->post_date_gmt ) ), | |||
'plainText' => wp_strip_all_tags( $content ), | |||
'size' => str_word_count( wp_strip_all_tags( $content ) ), | |||
'sectionNames' => Utils\get_post_categories( $post->ID ), | |||
'allSections' => Utils\get_post_categories( $post->ID ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this new field sending the category data across in the following requested sample format showing multiple, nested categories?:
['/world/asia-pacific','/business/healthcare-pharmaceuticals','/world']
@oscarssanchez what's your ETA on getting this PR ready for merge/release? |
$categories = get_the_category( $post_id ); | ||
$paths = []; | ||
|
||
foreach ( $categories as $category ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be worth adding some validation / casting in here just in case something hooks into get_the_categories filter and returns something odd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tott are you ok with the latest changes on this?
Kudos, SonarCloud Quality Gate passed!
|
Noting that @oscarssanchez confirmed with @tott offline on approval of the changes here, so going to merge in for the 1.1.1 milestone release |
Description of the Change
Here we are just swapping the
sectionNames
field toallSections
per new Sophi fields.Alternate Designs
Possible Drawbacks
Verification Process
Checklist:
Changelog Entry
Credits
Props @