Fix: Ensure core WordPress fields remain visible when unchecked in settings #76
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.
Unchecking core fields like
post_titleorpost_contentin the settings UI caused them to disappear permanently, preventing users from re-enabling them.Root cause: The available fields list only included fields marked as indexable in saved settings or discovered as post meta. Core WordPress fields that were unchecked became invisible.
Changes
Added
get_core_fields()method to define fields that must always be available:post_title,post_content,post_excerptpost_date,post_modified(already protected)post_author,permalinkUpdated field discovery in two locations:
WPLoupe_Settings_Page::get_available_fields()- Settings page field list now starts with core fieldsWP_Loupe_REST::handle_post_type_fields_request()- REST endpoint returns core fields firstCore fields now remain in the UI with checkboxes unchecked, allowing users to toggle them without losing access.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/d95a9d895352c30f47604ad1b825ab8fa9d1a373/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/Toflar/state-set-index/zipball/c374bc1efd56a91a547c8dfdc3facbfa09e1b295/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/antecedent/patchwork/zipball/8b6b235f405af175259c8f56aea5fc23ab9f03ce/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/doctrine/dbal/zipball/1a2fbd0e93b8dec7c3d1ac2b6396a7b929b130dc/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/doctrine/lexer/zipball/31ad66abc0fc9e1a1f2d9bc6a42668d2fbbcd6dd/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/hamcrest/hamcrest-php/zipball/f8b1c0173b22fa6ec77a81fe63e5b01eba7e6487/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/joomla-framework/string/zipball/da2329e05f1f5fc98b709f8638f279513bcd1108/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/loupe-php/loupe/zipball/1fc08816d475d2972ee13da0d55d90abac2081cb/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/loupe-php/matcher/zipball/298d7855200f4d7e45bea3165c3c64753689354c/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/mjaschen/phpgeo/zipball/7cd19b96d3626a16c9045bec784eb3f8ab72b976/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/mockery/mockery/zipball/1f4efdd7d3beafe9807b08156dfcb176d18f1699/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/nitotm/efficient-language-detector/zipball/f7f999d8bfd7e4aaf3fb1cf4ba8ca91ea9bbddab/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/47e34210757a2f37a97dcd207d032e1b01e64c7a/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)https://api.github.com/repos/wamania/php-stemmer/zipball/d96509294ea843b4b86e4900df27424a6ea0ace8/usr/bin/php8.3 -n -c /tmp/mcvZg0 /usr/bin/composer install --no-interaction(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.