예제 #1
0
  public function delete($args) {
    
    
    global $wf;

    if (isset($args)) {
      parent::delete($args);
    } else {
      
      MPV::incl("roles");
    
      if ($this->is_postback()) {
      
        // delete the role
      
        $role = $wf->role(MasterPress::$id);
      
        if ($role && !is_woof_silent($role)) {
          remove_role($role->id);
          wp_redirect( MasterPress::admin_url( "roles", "manage", array("id" => MasterPress::$id), false ) );
          exit;
        }
      
      } else {


        $this->setup_view( array(
            "view" => "roles",
            "title_args" => array( 
              "text" => MPV_Roles::__p() 
            )
          )
        );    
      
        $this->manage();
      
      }
    
    }
    
  }