public function execute()
 {
     $task = isset($_POST['task']) ? esc_html(stripslashes($_POST['task'])) : '';
     if ($task != '') {
         if (!WDWLibrary::verify_nonce('uninstall_bwg')) {
             die('Sorry, your nonce did not verify.');
         }
     }
     if (method_exists($this, $task)) {
         $this->{$task}();
     } else {
         $this->display();
     }
 }
 public function execute()
 {
     $task = WDWLibrary::get('task');
     $from_menu = isset($_GET['page']) && esc_html($_GET['page']) == 'BWGShortcode' ? TRUE : FALSE;
     if ($task != '' && $from_menu) {
         if (!WDWLibrary::verify_nonce('BWGShortcode')) {
             die('Sorry, your nonce did not verify.');
         }
     }
     if (method_exists($this, $task)) {
         $this->{$task}();
     }
     $this->display();
 }
 public function execute()
 {
     $task = WDWLibrary::get('task');
     $id = WDWLibrary::get('current_id', 0);
     $message = WDWLibrary::get('message');
     if ($task != '') {
         if (!WDWLibrary::verify_nonce('themes_bwg')) {
             die('Sorry, your nonce did not verify.');
         }
     }
     echo WDWLibrary::message_id($message);
     if (method_exists($this, $task)) {
         $this->{$task}($id);
     } else {
         $this->display();
     }
 }
function bwg_ajax()
{
    if (function_exists('current_user_can')) {
        if (!current_user_can('manage_options')) {
            die('Access Denied');
        }
    } else {
        die('Access Denied');
    }
    global $wpdb;
    require_once WD_BWG_DIR . '/framework/WDWLibrary.php';
    $page = WDWLibrary::get('action');
    if ($page != '' && ($page == 'BWGShortcode' || $page == 'addAlbumsGalleries' || $page == 'editThumb' || $page == 'addTags')) {
        if (!WDWLibrary::verify_nonce($page) && $page != 'BWGShortcode') {
            die('Sorry, your nonce did not verify.');
        }
        require_once WD_BWG_DIR . '/admin/controllers/BWGController' . ucfirst($page) . '.php';
        $controller_class = 'BWGController' . ucfirst($page);
        $controller = new $controller_class();
        $controller->execute();
    }
}