Create tasks based on post types#22718
Conversation
…create-all-dynamic-tasks
04255c3 to
c052dff
Compare
Pull Request Test Coverage Report for Build e38babf55c2d6bc027a1405c8548cf4cac30b000Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
| /** | ||
| * Represents the task for setting search appearance templates. | ||
| */ | ||
| class Set_Search_Appearance_Templates extends Abstract_Post_Type_Task { |
There was a problem hiding this comment.
I am thinking that it might make sense to have these in the infrastructure folder since they are super tightly coupled with WP 🤔
There was a problem hiding this comment.
That was a conscious decision actually, as I would like us to have all tasks gathered in a single layer and not scattered throughout multiple ones.
| * @return Post_Type_Task_Interface | ||
| */ | ||
| public function duplicate_for_post_type( string $post_type ): Post_Type_Task_Interface { | ||
| $clone = clone $this; |
There was a problem hiding this comment.
I might be misremembering clone but I thought this copied memory pointers so when you do this and set ->duration on one object does this also change it in the other or is that fine 🤔
There was a problem hiding this comment.
But I clone and then I do $clone->set_post_type( $post_type );, but my end results are what I expected 🤔
Not sure if/how I could improve this? I'd be happy to implement a different approach
Co-authored-by: Thijs van der Heijden <thijsoo@users.noreply.github.com>
Context
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
http://example.com/wp-json/yoast/v1/get_tasks) now also includes the following tasks too:productone is included only when Woo is activeis_completedis:true.false.hrefvalues and confirm that you are pointed to the settings of the respective post typeYoast settings->Categories & tags->Categoriesand save a couple of settings to confirm everything looks good.Relevant test scenarios
Test instructions for QA when the code is in the RC
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.Documentation
Quality assurance
Innovation
innovationlabel.Fixes #