is_active = isset( $_GET['tab'] ) && $_GET['tab'] === $name; $this->name = $name; $this->label = $label; $this->settings_fields_option_group = $settings_fields_option_group; $this->page_name = $page_name; $this->has_submit_button = $has_submit_button; } /** * @return string */ public function get_name() { return $this->name; } /** * @return string */ public function get_label() { return $this->label; } /** * @return string */ public function get_settings_fields_option_group() { return $this->settings_fields_option_group; } /** * @return string */ public function get_page_name() { return $this->page_name; } /** * @return bool */ public function is_active() { return $this->is_active; } /** * @param bool $is_active */ public function set_is_active( $is_active ) { $this->is_active = $is_active; } public function get_tab_href() { $query = array( 'page' => $this->page_name, 'tab' => $this->name, ); return add_query_arg( $query, admin_url( 'admin.php' ) ); } /** * @return string */ public function get_classes() { return $this->is_active ? 'nav-tab nav-tab-active' : 'nav-tab'; } /** * @return bool */ public function has_submit_button() { return $this->has_submit_button; } }