'Use Image Puller',
'value' => false,
);
$settings ['image_puller__prod_url'] = array(
'label' => 'Production URL (replace ' . get_site_url() . ')',
'type' => 'text',
'value' => '',
);
return $settings;
}
function ref( $refs, $a, $b, $settings ) {
if ( ! $settings['show_image_puller']['value'] ) {
return $refs;
}
ob_start();
wp_enqueue_script( 'jquery' );
?>
Search | Pull
'Pull images',
'content' => 'Pull images
' . ob_get_clean(),
);
return $refs;
}
public function ajax_pull() {
var_dump( $_POST );
$path = str_replace(get_site_url() . '/', ABSPATH, $_POST['missed']);
$path = explode('?', $path);
$path = $path[0];
var_dump($path);
file_put_contents($path, file_get_contents($_POST['source']));
exit();
}
public static function get_instance() {
if ( null === self::$instance ) {
self::$instance = new self();
}
return self::$instance;
}
}
Debug_Tool_Image_Puller::get_instance();