ds and their order. * @param bool - Is that a setup wizard call or not? * @param string - Additional HTML data attribute. * @param string $role - The role, that is when global settings of the plugin are selected. * * @since 2.6.0 */ $methods = \apply_filters( WP_2FA_PREFIX . 'methods_settings', array(), $setup_wizard, $data_role, $role ); ksort( $methods ); foreach ( $methods as $method ) { echo $method; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } /** * Adds and filters extension values in the settings store array ($output). * * @param array $output - Array with the currently stored settings. * @param array $input - Array with the input ($_POST) values. * * @return array * * @since 2.6.0 */ public static function settings_store( array $output, array $input ) { if ( isset( $input[ self::POLICY_SETTINGS_NAME ] ) && \is_array( $input[ self::POLICY_SETTINGS_NAME ] ) ) { foreach ( $input[ self::POLICY_SETTINGS_NAME ] as $order => $method ) { $output[ self::POLICY_SETTINGS_NAME ][ $order ] = $method; } } return $output; } /** * Returns the method by its slug. * * @param string $provider_name - The slug to search for. * * @return bool|\WP2FA\Methods * * @since 2.7.0 */ public static function get_method_by_provider_name( string $provider_name ) { foreach ( self::get_methods() as $method ) { if ( $provider_name === $method::METHOD_NAME ) { return $method; } } return \false; } /** * Returns all of the registered methods. * * @return array * * @since 2.7.0 */ private static function get_methods(): array { if ( empty( self::$methods ) ) { /** * Gives the ability to add classes to the Class_Helper array. * * @since 2.7.0 */ \do_action( WP_2FA_PREFIX . 'add_to_class_map' ); self::$methods = Classes_Helper::get_classes_by_namespace( self::METHODS_NAMESPACE ); } return self::$methods; } } }