Skip to content

Enhanced dynamic content handling for archive titles#2879

Closed
girishpanchal30 wants to merge 2 commits into
developmentfrom
feat/otter-internal/266
Closed

Enhanced dynamic content handling for archive titles#2879
girishpanchal30 wants to merge 2 commits into
developmentfrom
feat/otter-internal/266

Conversation

@girishpanchal30

Copy link
Copy Markdown
Contributor

Closes https://github.com/Codeinwp/otter-internals/issues/266

Summary

Added toggle and input field for the archive title dynamic content.

Screenshots

Screenshot from 2026-06-24 15-36-03

Test instructions

  • Create a category.
  • Open the Site Editor to add dynamic content > archive title to the archive template.
  • Check if the dynamic content is displayed correctly on the frontend.
  • Change the settings of the dynamic content block and check if the changes are reflected on the frontend.

Checklist before the final review

  • Included E2E or unit tests for the changes in this PR.
  • Visual elements are not affected by independent changes.
  • It is at least compatible with the minimum WordPress version.
  • It loads additional script in frontend only if it is required.
  • Does not impact the Core Web Vitals.
  • In case of deprecation, old blocks are safely migrated.
  • It is usable in Widgets and FSE.
  • Copy/Paste is working if the attributes are modified.
  • PR is following the best practices

@girishpanchal30 girishpanchal30 requested a review from Copilot June 24, 2026 10:10
@girishpanchal30 girishpanchal30 added the pr-checklist-skip Allow this Pull Request to skip checklist. label Jun 24, 2026
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Jun 24, 2026
@pirate-bot

Copy link
Copy Markdown
Contributor

Bundle Size Diff

Package Old Size New Size Diff
Animations 178.27 KB 178.27 KB 0 B (0.00%)
Blocks 1.64 MB 1.64 MB 937 B (0.05%)
CSS 7.87 KB 7.87 KB 0 B (0.00%)
Dashboard 111.06 KB 111.06 KB 0 B (0.00%)
Onboarding 68.14 KB 68.14 KB 0 B (0.00%)
Export Import 4.7 KB 4.7 KB 0 B (0.00%)
Pro 328.48 KB 328.48 KB 0 B (0.00%)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the Dynamic Value “archive title” handling by adding UI controls to optionally override (or remove) the default WordPress archive title prefix and wiring the new attributes through the editor preview + PHP rendering.

Changes:

  • Added an “Override Archive Title Prefix” toggle and optional prefix text input for archiveTitle dynamic content.
  • Extended the dynamic value format + editor preview attribute handling to include the new archive title settings.
  • Updated the PHP dynamic-content parser and introduced server-side logic to apply the prefix override via get_the_archive_title_prefix.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/blocks/plugins/dynamic-content/value/index.js Adds new archive-title-related attributes to the dynamic value format and editor-side preview requests.
src/blocks/plugins/dynamic-content/value/fields.js Adds settings UI (toggle + input) for archive title prefix override.
inc/plugins/class-dynamic-content.php Parses new data-archive-title-* attributes and applies an optional archive title prefix override when resolving dynamic content.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread inc/plugins/class-dynamic-content.php Outdated
Comment thread inc/plugins/class-dynamic-content.php Outdated
Comment thread inc/plugins/class-dynamic-content.php
@pirate-bot

pirate-bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Plugin build for 033289a is ready 🛎️!

@pirate-bot

pirate-bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

E2E Tests

Playwright Test Status: See serial and parallel matrix jobs

Performance Results serverResponse: {"q25":460.4,"q50":468,"q75":500,"cnt":10}, firstPaint: {"q25":512.7,"q50":588.15,"q75":692.4,"cnt":10}, domContentLoaded: {"q25":3478.6,"q50":3512.95,"q75":3554,"cnt":10}, loaded: {"q25":3480.8,"q50":3514.85,"q75":3556.4,"cnt":10}, firstContentfulPaint: {"q25":4027.9,"q50":4053.35,"q75":4119,"cnt":10}, firstBlock: {"q25":13674.9,"q50":13730.15,"q75":13920.4,"cnt":10}, type: {"q25":22.15,"q50":23.76,"q75":27.49,"cnt":10}, typeWithoutInspector: {"q25":20.13,"q50":21.32,"q75":21.91,"cnt":10}, typeWithTopToolbar: {"q25":26.81,"q50":27.73,"q75":28.5,"cnt":10}, typeContainer: {"q25":12.44,"q50":12.98,"q75":13.4,"cnt":10}, focus: {"q25":104.8,"q50":106.53,"q75":112.09,"cnt":10}, inserterOpen: {"q25":35.85,"q50":36.52,"q75":37.31,"cnt":10}, inserterSearch: {"q25":12.18,"q50":12.37,"q75":13.14,"cnt":10}, inserterHover: {"q25":4.45,"q50":4.65,"q75":4.71,"cnt":20}, loadPatterns: {"q25":1490.82,"q50":1529.73,"q75":1689.52,"cnt":10}, listViewOpen: {"q25":219.26,"q50":226.47,"q75":232.24,"cnt":10}

@Soare-Robert-Daniel

Copy link
Copy Markdown
Contributor

@abaicus should we go with your solution? #2880

@abaicus

abaicus commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@Soare-Robert-Daniel yes. We don't need additional controls (like the prefix) so we should be ok.

@abaicus abaicus closed this Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants