• Resolved DickRaney

    (@dickraney)


    This is a follow up to an earlier thread https://wordpress.org/support/topic/video-preview-image-quality/

    I’m using this code to set max image resolution of preview image

    add_filter( 'rocket_lazyload_youtube_thumbnail_resolution', function( $thumbnail_resolution ) {
    	return maxresdefault;
    } );
    

    It’s working but I see warnings in my error log:

    PHP Warning: Use of undefined constant maxresdefault - assumed 'maxresdefault' (this will throw an Error in a future version of PHP)

    How can I fix that and get future ready?

    • This topic was modified 7 years, 1 month ago by DickRaney.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor WP Rocket

    (@wp_rocket)

    You’re missing the quotes around the value, it should be:

    add_filter( 'rocket_lazyload_youtube_thumbnail_resolution', function( $thumbnail_resolution ) {
    	return 'maxresdefault';
    } );
    Thread Starter DickRaney

    (@dickraney)

    Perfect. Thanks!!

    imemodvd

    (@imemodvd)

    Where can I add this code? Thank you

    I got it , Add to “main.php”

    • This reply was modified 7 years ago by imemodvd.
    • This reply was modified 7 years ago by imemodvd.
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Video preview image quality’ is closed to new replies.