• When I use wordpress embed (Youtube) on a custom post type the aspect ratio class (wp-embed-aspect) is applied incorrectly.

    Let’s say I have a 16:9 video: https://www.youtube.com/watch?v=peHVRC07b5U

    If I embed it on the default post type, the aspect ratio is recognized correctly, and a class of ” wp-embed-aspect-16-9 ” is applied.

    If I embed the same video on a custom post type, wordpress applies a wrong class: ” wp-embed-aspect-4-3 ”.

    Why is that?

    Also I was looking through the plugin that creates the custom post type, and the only code that was doing anything with embeds was this:

    if ( ! function_exists( 'llms_content' ) ) {
    	function llms_content( $content = '' ) {
    		$content = do_shortcode( shortcode_unautop( wpautop( convert_chars( wptexturize( $content ) ) ) ) );
    		global $wp_embed;
    		if ( $wp_embed && method_exists( $wp_embed, 'autoembed' ) ) {
    			$content = $wp_embed->autoembed( $content );
    		}
    		return $content;
    	}
    }

    I don’t entirely understand what this does, maybe I should spend more time analyzing this, but maybe someone else will know faster?

    The page I need help with: [log in to see the link]

  • The topic ‘WP embeds wp-embed-aspect class doubled bug’ is closed to new replies.