New filter: wpseo_schema_main_image_id#22499
Merged
thijsoo merged 1 commit intoYoast:trunkfrom Sep 1, 2025
Merged
Conversation
Contributor
Author
|
Not sure why the checks are failing as the reason seems unrelated to my changes. |
thijsoo
approved these changes
Sep 1, 2025
Contributor
thijsoo
left a comment
There was a problem hiding this comment.
Thank you for your submission @JoryHogeveen I will merge this so it can go into a next release. It should land in 26.0.
Contributor
Author
|
Hi Thijs, perfect, thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Allow changing the main image ID through a filter.
I have a client project which has custom featured images for taxonomies, many other tools, like WooCommerce also do this similarly.
This PR allows me to change the schema output correctly without doing more skechy changes to the full schema output using the
wpseo_schema_webpagefilter.Summary
This PR can be summarized in the following changelog entry:
wpseo_schema_main_image_id. Props to @JoryHogeveen.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:
Filter example for when the
categorytaxonomy has a custom image field namedfeatured_imagethat returns the image ID:Relevant test scenarios
No real relevant test scenarios I can think of other than a single filter change so make sure the results are as expected.
Test instructions for QA when the code is in the RC
QA can test this PR by following these steps:
wp_poststable and mark down its ID. For me after uploading an image it was1031.ImageObjectschema. This will change with this filter.Impact check
This PR affects the following parts of the plugin, which may require extra testing:
None
UI changes
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.Documentation
Quality assurance
Innovation
innovationlabel.Fixes #