-
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
fix/338: add Util function to fetch primary category #350
Conversation
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.
The code looks good. I have a concern about the 4th Unit test added.
$this->assertEquals( $term_name, 'Uncategorized' ); | ||
} | ||
|
||
public function test_get_primary_category__custom_category__yoast_activated() { |
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.
Looks like this last test is a full-copy of the previous one (except the category name) and does not test any alternative workflow.
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.
you're correct!
Holding off on merge here as we're awaiting Sophi team approval on the pending 1.3.0 release and I'd prefer to not change any additional code. Once 1.3.0 is released, I'll merge this in so we can deploy/test and prepare as part of a 1.3.1/1.4.0 release. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Description of the Change
Adds a Util function
get_primary_category
.This function returns the primary category name set through Yoast.
If Yoast is deactivated, then it returns the category set at index 0.
Closes #338
Verification Process
Checklist:
Changelog Entry
Credits
Props @vjayaseelan90 @jeffpaul @Sidsector9