Answer the question
In order to leave comments, you need to log in
How to get the url of the loaded image media_sideload_image?
<?php
require_once ABSPATH . 'wp-admin/includes/media.php';
require_once ABSPATH . 'wp-admin/includes/file.php';
require_once ABSPATH . 'wp-admin/includes/image.php';
$url = 'http://s.w.org/style/images/wp-header-logo.png';
$img_tag = media_sideload_image( $url, $post_id = '', $desc = '' );
if( is_wp_error($img_tag) ){
echo $img_tag->get_error_message();
}
else {
echo '<br>Добавлено';
echo '<br>';
echo $img_tag ;
}
?>
$img_tag ;
so it seems the picture itself, which has the address that I need. As an option jqvery pick up, but it's a crutch! In general, I'm struggling for a long time, help ...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question