Hi,
This is a good suggestion and we have adopted it for version 1.9.0.
Thanks for the review and suggestions.
Thread Starter
atallen
(@atallen74)
great job, thanks for the update.
141 images are now created from 150 posts. These images are on the server of https://livingdocs.io/
Each image needs an ID in the query parameters.
See the following picture:
https://server.livingdocs.io/api/v1/images/p-1110202.JPG?id=MQkvMjAyMi8wNS8xNS81OTAwMDg4Yy0wMmQyLTQ0ODMtODdmYi1hZDY5ZDEzNTUwMzAuanBlZwk4MTM%3D
If you remove the query parameters here, the image can no longer be displayed.
Is there a way that the plugin works with the attachments.?
But it rarely happens that I get these posts, and then I can also embed the picture manually.
Thank you for the plugin! It makes my work on my website much easier.
I think the following code will help.
add_filter( 'xo_featured_image_tools_image_url', function( $url ) {
if ( 0 !== strpos( $url, 'https://example.com/' ) ) { return $url; }
$ch = curl_init( $url );
curl_setopt_array( $ch, array(
CURLOPT_HEADER => true,
CURLOPT_NOBODY => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
) );
$content = curl_exec( $ch );
curl_close( $ch );
if ( preg_match( '/Location: (.*)/i', $content, $m ) ) {
$url = esc_url( trim( $m[1] ) );
}
return $url;
} );
Replace ‘example.com’ in the code with ‘server.livingdocs.io’, etc.
Thread Starter
atallen
(@atallen74)
Awesome, the code works perfectly.
Thanks for your support…!!
Will this code be overwritten with the next update…?
Wouldn’t be bad, I can quickly install it again…
greeting
atallen
There are no plans to add it for the time being, as we have to create a screen for entering the URL. excuse me.