Skip to content

Shortcode: Fix broken Youtube URL on Classic Editor#46433

Merged
kraftbj merged 3 commits intotrunkfrom
fix/youtube-embed-link
Jan 13, 2026
Merged

Shortcode: Fix broken Youtube URL on Classic Editor#46433
kraftbj merged 3 commits intotrunkfrom
fix/youtube-embed-link

Conversation

@arthur791004
Copy link
Copy Markdown
Contributor

@arthur791004 arthur791004 commented Jan 2, 2026

Fixes #46409

Proposed changes:

  • Let's try to enable wpcom_youtube_embed_crazy_url_init for non-REST API requests

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

  • Apply changes to your site via Jetpack Beta Tester
  • Create a new post with classic editor
  • Add YouTube URL
  • Adjust the alignment
  • Save the post
  • Ensure the result looks correct on both editor and frontend
  • Create a new post with block editor
  • Add Embed YouTube block
  • Adjust the alignment
  • Save the post
  • Ensure the result looks correct on both editor and frontend

Copilot AI review requested due to automatic review settings January 2, 2026 08:06
@arthur791004 arthur791004 changed the title Fix/youtube embed link Shortcode: Fix broken Youtube URL Jan 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 2, 2026

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the fix/youtube-embed-link branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/youtube-embed-link

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added [Feature] Shortcodes / Embeds [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ labels Jan 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 2, 2026

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: February 3, 2026
    • Code freeze: February 3, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Jan 2, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request aims to fix a broken YouTube embed link issue by modifying how the YouTube shortcode filter is registered. The key change removes a conditional check that was previously used to determine when the filter should be hooked.

  • Removes the conditional jetpack_shortcodes_should_hook_pre_kses() check before adding the pre_kses filter
  • Adds a changelog entry documenting this bugfix

Reviewed changes

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

File Description
projects/plugins/jetpack/modules/shortcodes/youtube.php Removes conditional wrapper and unconditionally registers the pre_kses filter for YouTube embed conversion
projects/plugins/jetpack/changelog/fix-youtube-embed-link Adds changelog entry documenting the YouTube URL fix as a patch-level bugfix

Significance: patch
Type: bugfix

Shortcode: Fix broken Youtube URL
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

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

The word "Youtube" should be "YouTube" (with capital T and capital B) to match the official brand name and the naming convention used throughout the codebase.

Suggested change
Shortcode: Fix broken Youtube URL
Shortcode: Fix broken YouTube URL

Copilot uses AI. Check for mistakes.
@jp-launch-control
Copy link
Copy Markdown

jp-launch-control Bot commented Jan 2, 2026

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/plugins/jetpack/modules/shortcodes/youtube.php 161/257 (62.65%) 0.48% -2 💚

Full summary · PHP report · JS report

@arthur791004 arthur791004 force-pushed the fix/youtube-embed-link branch from 05b8283 to 6ac741e Compare January 2, 2026 08:28
@Automattic Automattic deleted a comment from Copilot AI Jan 2, 2026
@arthur791004 arthur791004 changed the title Shortcode: Fix broken Youtube URL WIP Shortcode: Fix broken Youtube URL Jan 2, 2026
@arthur791004 arthur791004 self-assigned this Jan 12, 2026
@arthur791004 arthur791004 changed the title WIP Shortcode: Fix broken Youtube URL Shortcode: Fix broken Youtube URL on Classic Editor Jan 12, 2026
Copilot AI review requested due to automatic review settings January 12, 2026 07:21
@arthur791004 arthur791004 force-pushed the fix/youtube-embed-link branch from 6ac741e to e641934 Compare January 12, 2026 07:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@arthur791004 arthur791004 added Bug When a feature is broken and / or not performing as intended [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Jan 12, 2026
@kraftbj kraftbj merged commit b549cb1 into trunk Jan 13, 2026
70 of 71 checks passed
@kraftbj kraftbj deleted the fix/youtube-embed-link branch January 13, 2026 19:04
@github-actions github-actions Bot removed the [Status] Needs Review This PR is ready for review. label Jan 13, 2026
@github-actions github-actions Bot added this to the jetpack/15.5 milestone Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug When a feature is broken and / or not performing as intended [Feature] Shortcodes / Embeds [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

YouTube wpcom_youtube_embed_crazy_url embed handler does not run anymore

3 participants