The schema uses the "Home page settings" even if they're set to "Use Static Front Page Instead" is checked
Pikamander2 opened this issue · 1 comments
The AIOSEOP schema uses the "Home page settings" title and description even if they're set to "Use Static Front Page Instead" is checked.
Steps to reproduce:
- Go to the editing page for your home page (/wp-admin/post.php?post=8&action=edit) and edit the AIOSEOP title and description to be something like "This should appear". Save the post.
- Go to the AIOSEOP general settings page (/wp-admin/admin.php?page=all-in-one-seo-pack%2Faioseop_class.php) and edit the home page title and description to be something like "This should not appear." Save the settings.
- Change the "Use Static Front Page Instead" option to "Enabled". The other two fields will disappear. Save the settings again.
- View the home page's source code
Expected behavior
In the home page's source code, you should see This should appear
in the aioseop-schema JSON markup.
Actual behavior
The aioseop-schema JSON markup will instead say This should not appear
, which is being pulled from the General Settings page even though "Use Static Front Page Instead" is checked.
Besides being the wrong behavior, this bug is also very annoying the first time it happens because after checking the "Use Static Front Page Instead" option, the Home Title and Home Description fields on the General Page are hidden, which makes it difficult for normal users to track down where the unwanted schema text is coming from.
Desired fix
Fixing this bug should just be a matter of checking whether the "Use Static Front Page Instead" option is enabled, and if so, pulling the schema data from the static front page's two fields instead.
Version Info (please complete the following information):
- WordPress version: 5.4.1
- All in One SEO Pack version: 3.4.3
- PHP version: 7.4.5
@EkoJR I've been able to reproduce this.
Related to https://github.com/awesomemotive/aioseop-pro/issues/878