• H2GD Part 38: YouTube oembed returning unexpected ‘)’

    Today I noticed that YouTube videos embedded directly into WordPress were displaying an unexpected ) after the video. I mentioned it on the WordPress IRC; apparently it’s a YouTube bug… thanks Clorith.

    Here’s a simple fix, which I wrote as a plugin called youtube_oembed_fix, but you could implement in your theme’s functions.php file.


    add_filter( 'oembed_result', "ytoef_ytoef", 11, 3 );

    function ytoef_ytoef( $html, $url, $args ) {
      $html = rtrim( $html, ")");
      return( $html );
    }
     

    The above is not implemented on this site. So I would have expected the unwanted ) to have appeared until YouTube implement the fix.

    However, I have Jetpack installed, with the Shortcode Embeds module Activated. And Jetpack’s code is hiding the problem.

    Hurrah or boo, depending on your point of view.


    , ,

    Published:

    Last updated:

    August 18, 2014

Categories

Tide times from tidetimes.org.uk

Tide Times & Heights for Langstone Harbour on
9th August 2022
02:38 Low Tide ( 1.67m )
09:44 High Tide ( 4.32m )
15:10 Low Tide ( 1.73m )
22:13 High Tide ( 4.53m )

Tide times from tidetimes.org.uk

Tide Times & Heights for Northney on
9th August 2022
02:47 Low Tide ( 1.11m )
09:54 High Tide ( 4.08m )
15:15 Low Tide ( 1.16m )
22:14 High Tide ( 4.33m )
WordPress version:6.0.1
Gutenberg version:13.7.3

[clone]

[cloned]