page = $page; $this->action = $action; } /** * @return string */ public function get() { return $this->create_url(); } /** * @return string */ private function create_url() { $url = get_admin_url(); $url .= 'admin.php?'; $query = []; $query['page'] = $this->page; if ( ! empty( $this->action ) ) { $query['twofas-action'] = $this->action; } $url .= http_build_query( $query ); return $url; } }