protected function redirect_on_save() {
		$update             = false;
		$refresh_transients = $this->refresh_transients();
		$reset_api_key      = Singleton::get_instance( 'Remote_Management', $this )->reset_api_key();

		/**
		 * Filter to add to $option_page array.
		 *
		 * @since 8.0.0
		 * @return array
		 */
		$option_page = apply_filters( 'github_updater_save_redirect', [ 'github_updater' ] );

		if ( ( isset( $_POST['action'] ) && 'update' === $_POST['action'] ) &&
			( isset( $_POST['option_page'] ) && in_array( $_POST['option_page'], $option_page, true ) )
		) {
			$update = true;
		}

		$redirect_url = is_multisite() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );

		if ( $update || $refresh_transients || $reset_api_key ) {
			$query = isset( $_POST['_wp_http_referer'] ) ? parse_url( $_POST['_wp_http_referer'], PHP_URL_QUERY ) : null;
			parse_str( $query, $arr );
			$arr['tab']    = ! empty( $arr['tab'] ) ? $arr['tab'] : 'github_updater_settings';
			$arr['subtab'] = ! empty( $arr['subtab'] ) ? $arr['subtab'] : 'github_updater';

			$location = add_query_arg(
				[
					'page'               => 'github-updater',
					'tab'                => $arr['tab'],
					'subtab'             => $arr['subtab'],
					'refresh_transients' => $refresh_transients,
					'reset'              => $reset_api_key,
					'updated'            => $update,
				],
				$redirect_url
			);
			wp_safe_redirect( $location );
			exit;
		}
	}
protected function redirect_on_save() {
		$update             = false;
		$refresh_transients = $this->refresh_transients();
		$reset_api_key      = Singleton::get_instance( 'Remote_Management', $this )->reset_api_key();

		/**
		 * Filter to add to $option_page array.
		 *
		 * @since 8.0.0
		 * @return array
		 */
		$option_page = apply_filters( 'github_updater_save_redirect', [ 'github_updater' ] );

		if ( ( isset( $_POST['action'] ) && 'update' === $_POST['action'] ) &&
			( isset( $_POST['option_page'] ) && in_array( $_POST['option_page'], $option_page, true ) )
		) {
			$update = true;
		}

		$redirect_url = is_multisite() ? network_admin_url( 'settings.php' ) : admin_url( 'options-general.php' );

		if ( $update || $refresh_transients || $reset_api_key ) {
			$query = isset( $_POST['_wp_http_referer'] ) ? parse_url( $_POST['_wp_http_referer'], PHP_URL_QUERY ) : null;
			parse_str( $query, $arr );
			$arr['tab']    = ! empty( $arr['tab'] ) ? $arr['tab'] : 'github_updater_settings';
			$arr['subtab'] = ! empty( $arr['subtab'] ) ? $arr['subtab'] : 'github_updater';

			$location = add_query_arg(
				[
					'page'               => 'github-updater',
					'tab'                => $arr['tab'],
					'subtab'             => $arr['subtab'],
					'refresh_transients' => $refresh_transients,
					'reset'              => $reset_api_key,
					'updated'            => $update,
				],
				$redirect_url
			);
			wp_safe_redirect( $location );
			exit;
		}
	}
protected function redirect_on_save ( ) { $ update = false ; $ refresh_transients = $ this -> refresh_transients ( ) ; $ reset_api_key = Singleton :: get_instance ( 'Remote_Management' , $ this ) -> reset_api_key ( ) ; /**
		 * Filter to add to $option_page array.
		 *
		 * @since 8.0.0
		 * @return array
		 */ $ option_page = apply_filters ( 'github_updater_save_redirect' , [ 'github_updater' ] ) ; if ( ( isset ( $ _POST [ 'action' ] ) && 'update' === $ _POST [ 'action' ] ) && ( isset ( $ _POST [ 'option_page' ] ) && in_array ( $ _POST [ 'option_page' ] , $ option_page , true ) ) ) { $ update = true ; } $ redirect_url = is_multisite ( ) ? network_admin_url ( 'settings.php' ) : admin_url ( 'options-general.php' ) ; if ( $ update || $ refresh_transients || $ reset_api_key ) { $ query = isset ( $ _POST [ '_wp_http_referer' ] ) ? parse_url ( $ _POST [ '_wp_http_referer' ] , PHP_URL_QUERY ) : null ; parse_str ( $ query , $ arr ) ; $ arr [ 'tab' ] = ! empty ( $ arr [ 'tab' ] ) ? $ arr [ 'tab' ] : 'github_updater_settings' ; $ arr [ 'subtab' ] = ! empty ( $ arr [ 'subtab' ] ) ? $ arr [ 'subtab' ] : 'github_updater' ; $ location = add_query_arg ( [ 'page' => 'github-updater' , 'tab' => $ arr [ 'tab' ] , 'subtab' => $ arr [ 'subtab' ] , 'refresh_transients' => $ refresh_transients , 'reset' => $ reset_api_key , 'updated' => $ update , ] , $ redirect_url ) ; wp_safe_redirect ( $ location ) ; exit ; } }
Redirect to correct Settings tab on Save.
Redirect to correct Settings tab on Save .