'', 'label' => esc_html__( 'General', 'accessibility-checker' ), 'order' => 1, ], ] ); // sort settings tab items. if ( is_array( $settings_tab_items ) ) { usort( $settings_tab_items, function ( $a, $b ) { if ( $a['order'] < $b['order'] ) { return -1; } if ( $a['order'] === $b['order'] ) { return 0; } return 1; } ); } // Get the active tab from the $_GET param. $default_tab = null; $settings_tab = isset( $_GET['tab'] ) ? sanitize_text_field( $_GET['tab'] ) : $default_tab; // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Nonce verification and sanitization not required for tab display. $settings_tab = ( array_search( $settings_tab, array_column( $settings_tab_items, 'slug' ), true ) !== false ) ? $settings_tab : $default_tab; ?>