public static function get_instance()
 {
     // If the single instance hasn't been set, set it now.
     if (null == self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Exemple #2
0
 public function dln_fetch_images_from_url()
 {
     if (!isset($_POST[DLN_ABE_NONCE]) || !wp_verify_nonce($_POST[DLN_ABE_NONCE], DLN_ABE_NONCE)) {
         $url = isset($_POST['url']) ? $_POST['url'] : '';
         if (!empty($url) && filter_var($url, FILTER_VALIDATE_URL) !== false) {
             $fetch_helper = DLN_Helper_Fetch::get_instance();
             $image_urls = $fetch_helper->fetch_images_from_url($url);
         }
         $image_urls = !empty($image_urls) ? json_encode($image_urls) : '';
         exit($image_urls);
     }
     exit('0');
 }