How can I change Max Embed Size in WordPress 3.5?

after updating to WordPress 3.5 my automatic embeds are limited to a width of 500px, and the settings for this size have been removed with WordPress 3.5

Also, I can’t find the Values in the wp_options table.

Read More

Does anyone know how to change them again?

Cheers,
fischi

Related posts

Leave a Reply

2 comments

  1. See the function wp_embed_defaults() in wp-includes/media.php:

    function wp_embed_defaults() {
        if ( ! empty( $GLOBALS['content_width'] ) )
            $width = (int) $GLOBALS['content_width'];
    
        if ( empty( $width ) )
            $width = 500;
    
        $height = min( ceil( $width * 1.5 ), 1000 );
    
        return apply_filters( 'embed_defaults', compact( 'width', 'height' ) );
    }
    

    To change these values filter embed_defaults:

    add_filter( 'embed_defaults', 'wpse_76102_new_embed_size' );
    
    function wpse_76102_new_embed_size()
    {
        // adjust these pixel values to your needs
        return array( 'width' => 1000, 'height' => 600 );
    }