Skip to content

Conversation

sirreal
Copy link
Member

@sirreal sirreal commented Sep 5, 2025

Remove conditional scripts and styles from themes. They target browsers that are not supported by WordPress and should never be used. The conditional scripts and styles are rendered as plain HTML comments by any supported browser.

Microsoft dropped support for conditional comments in IE10 when it was released 12 years ago, making IE9 the final version to support conditional comments.

Any modern browser treats these script tags as a single HTML comment, so these conditional comments should never used by any post-IE9 browser.

  • Remove twentyfifteen conditional styles
  • Remove twentytwelve conditional styles
  • Remove twentysixteen conditional scripts and styles
  • Remove twentyfourteen conditional styles
  • Remove twentythirteen conditional styles
  • Remove twentyseventeen conditional scripts and styles

Companion to #9497 that removes support for conditional scripts and styles from Core.

Trac ticket: https://core.trac.wordpress.org/ticket/63821


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Copy link

github-actions bot commented Sep 5, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props jonsurrell, sabernhardt.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link

github-actions bot commented Sep 5, 2025

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@sabernhardt
Copy link

sabernhardt commented Sep 5, 2025

The theme revisions are already part of tickets 58836 (and 56699 earlier). The files need to stay there, and the handles need to be registered. The files' contents could be reduced to a single comment, but they need to exist for child themes.

@sirreal
Copy link
Member Author

sirreal commented Sep 5, 2025

Thanks for linking those @sabernhardt 👍 I'll close this, it's duplicated a lot of your work.

@sirreal sirreal closed this Sep 5, 2025
@sirreal sirreal deleted the remove-conditions-script-styles-themes branch September 5, 2025 19:35
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.

2 participants