Remote Image to Local
// Add Shortcode function get_remote_shortcode( $atts , $content = null ) { // Attributes $atts = shortcode_atts( array( 'file' => '', 'post_id' => '', ), $atts ); $img = media_sideload_image( $file, $post_id ); if(is_wp_error($img)) { echo $img->get_error_message(); return; } else { return $img; } } add_shortcode( 'get_remote', 'get_remote_shortcode' );