Skip to content

fix: WP 7.0 compat, correct CX ID URL encoding, block.json role - #51

Merged
acockrell merged 2 commits into
mainfrom
fix/wp7-compat-and-cleanup
Jun 21, 2026
Merged

fix: WP 7.0 compat, correct CX ID URL encoding, block.json role#51
acockrell merged 2 commits into
mainfrom
fix/wp7-compat-and-cleanup

Conversation

@acockrell

Copy link
Copy Markdown
Collaborator

Summary

  • rawurlencode for CX IDesc_attr is for HTML attribute context; URL parameters need rawurlencode. CX IDs are alphanumeric so this was benign in practice, but now correct.
  • null version for Google CSE script — suppresses the spurious &ver=1.2.5 WordPress was appending to the external Google URL. External scripts manage their own versioning.
  • role: content in block.json — WordPress 7.0 makes contentOnly mode the default for patterns. Without this, the gpse/search-results block would be hidden/locked when dropped inside a pattern. This keeps it editable.
  • Stale docblockclass-wp-gpse-blocks.php referenced the removed gpse/search-form block; updated to reflect only gpse/search-results exists.
  • Docs — Added 1.2.6 changelog entry to readme.txt; synced README.md stable tag from 1.2.3 → 1.2.5.

Test plan

  • make test-php passes
  • Results page source shows cse.google.com/cse.js?cx=<id> with no &ver= appended
  • gpse/search-results block is editable when placed inside a pattern

- rawurlencode CX ID in script URL (esc_attr is HTML attr context,
  not URL context)
- Pass null version for external Google CSE script to suppress
  spurious &ver= query param
- Add role:content to block.json so block remains editable inside
  contentOnly patterns (WP 7.0 default)
- Fix stale docblock referencing removed gpse/search-form block
- Bump readme.txt changelog to 1.2.6; sync README.md stable tag
@acockrell
acockrell enabled auto-merge (squash) June 21, 2026 03:19
@acockrell
acockrell merged commit d23a478 into main Jun 21, 2026
5 checks passed
@acockrell
acockrell deleted the fix/wp7-compat-and-cleanup branch June 21, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant