WordPress.org

Forums

WP_OEmbed: Only variables should be passed by reference (2 posts)

  1. chrishoward
    Member
    Posted 1 year ago #

    I'm getting this strict warning: "Only variables should be passed by reference" and it's being triggered in: wp-includes/class-oembed.php, line 135 which is:

    if ( $html = wp_remote_retrieve_body( wp_safe_remote_get( $url ) ) ) {

    The value for $url is a string, and has nowhere been passed by reference.

    I've looked at other forum posts with this message, but none have applied to WP_OEmbed, that I've found.

  2. jetonr
    Member
    Posted 1 year ago #

    Same strict standards warning on my case!
    Strict Standards: Only variables should be passed by reference in class-oembed.php on line 135
    I am using the WP_oEmbed() class like in the example below:

    $video_link = 'http://www.hulu.com/watch/585278';
    $oembed = new WP_oEmbed();
    $provider = $oembed->discover( $video_link );
    $data = $oembed->fetch( $provider, $video_link );
    var_dump($data);

    P.S.: Hulu doesn't work like this or maybe because I am in Europe. All other providers work just fine.

Topic Closed

This topic has been closed to new replies.

About this Topic