public function execute()
 {
     $task = WDILibrary::get('task');
     $id = WDILibrary::get('current_id', 0);
     $message = WDILibrary::get('message');
     echo WDILibrary::message_id($message);
     if (method_exists($this, $task)) {
         check_admin_referer('nonce_wd', 'nonce_wd');
         $this->{$task}($id);
     } else {
         $this->display();
     }
 }
 public function execute()
 {
     $task = WDILibrary::get('task');
     if (method_exists($this, $task)) {
         check_admin_referer('nonce_wd', 'nonce_wd');
         $this->{$task}();
     } else {
         if ($this->is_uninstalled()) {
             $this->already_uninstalled();
         } else {
             $this->display();
         }
     }
 }
예제 #3
0
function wdi_editor_button()
{
    if (function_exists('current_user_can')) {
        if (!current_user_can('manage_options')) {
            die('Access Denied');
        }
    } else {
        die('Access Denied');
    }
    require_once WDI_DIR . '/framework/WDILibrary.php';
    $page = WDILibrary::get('action');
    if ($page != '' && $page == 'WDIEditorShortcode') {
        require_once WDI_DIR . '/admin/controllers/WDIControllerEditorShortcode.php';
        $controller_class = 'WDIControllerEditorShortcode';
        $controller = new $controller_class();
        $controller->execute();
    }
    wp_die();
}