Reply To: First image in post from facebook to be uploaded to WP and set as featured image

Change 1000+ of WordPress Featured Images in 5 Minutes! Forums Questions and Answers First image in post from facebook to be uploaded to WP and set as featured image Reply To: First image in post from facebook to be uploaded to WP and set as featured image

#13642
Julian
Participant

Update 2:

After debugging the code I found the issue:

Inside class-quick-featured-images-pro-tools.php and class-quick-featured-images-pro-defaults.php the code is set to “delete the optional query string”. Now this may be fine in 90 % of the cases however for facebook images served by *fbcdn.net it appears to be absolutely necessary to keep the parameters in the URL.

I fixed it like this:

if ( $img_src ) {

// delete optional query string in img src

// ins-20180421-jsin: need to remove this for FB images to work because they have parameters…

if (strpos($img_src[1], ‘fbcdn’) !== false) {
// image is served from facebook, skip default

$url = $img_src[1];
}

//in this case, it’s not facebook, so let’s stick to default
else {
$url = preg_replace( ‘/([^?]+).*/’, ‘\1’, $img_src[ 1 ] );
}
// end ins-20180421-jsin

// default …: $url = preg_replace( ‘/([^?]+).*/’, ‘\1’, $img_src[ 1 ] );

// exclude images from current domain

For me this works and I can continue with my work. However it might make sense to integrate something special for this kind of images in the official code, what do you think?

Kind regards
Julian

Choose your currency:

Close
Converted prices are for reference only - all orders are charged in € Euros (€) EUR.
  • USDUS Dollars ($)
  • EUREuros (€)
  • GBPPounds Sterling (£)
  • CADCanadian Dollars ($)
  • AUDAustralian Dollars ($)
  • BRLBrazilian Real (R$)
  • INRIndian Rupee (₹)
  • CZKCzech Koruna
  • DKKDanish Krone
  • HKDHong Kong Dollar ($)
  • HUFHungarian Forint
  • ILSIsraeli Shekel (₪)
  • JPYJapanese Yen (¥)
  • MYRMalaysian Ringgits
  • MXNMexican Peso ($)
  • NZDNew Zealand Dollar ($)
  • NOKNorwegian Krone
  • PHPPhilippine Pesos
  • PLNPolish Zloty
  • SGDSingapore Dollar ($)
  • SEKSwedish Krona
  • CHFSwiss Franc
  • TWDTaiwan New Dollars
  • THBThai Baht (฿)
  • TRYTurkish Lira (₺)
  • RUBRussian Rubles