wp-includes/connectors.php:522Resolves application-password credentials for a connector.
$autharrayarray{username:function wp_connectors_get_application_password_credentials( array $auth ): array { // Check environment variable first. $env_var_name = $auth['env_var_name'] ?? ''; if ( '' !== $env_var_name ) { $env_value = getenv( $env_var_name ); if ( false !== $env_value && '' !== $env_value ) { $credentials = wp_connectors_parse_application_password_credentials( $env_value ); if ( '' !== $credentials['username'] && '' !== $credentials['password'] ) { $credentials['source'] = 'env'; return $credentials; } _doing_it_wrong( __FUNCTION__, sprintf( /* translators: %s: Environment variable name. */ __( 'The %s environment variable must contain application password credentials in "username:password" format.' ), esc_html( $env_var_name ) ), '7.1.0' ); } } // Check PHP constant. $constant_name = $auth['constant_name'] ?? ''; if ( '' !== $constant_name && defined( $constant_name ) ) { $const_value = constant( $constant_name ); if ( is_string( $const_value ) && '' !== $const_value ) { $credentials = wp_connectors_parse_application_password_credentials( $const_value ); if ( '' !== $credentials['username'] && '' !== $credentials['password'] ) { $credentials['source'] = 'constant'; return $credentials; } _doing_it_wrong( __FUNCTION__, sprintf( /* translators: %s: PHP constant name. */ __( 'The %s constant must contain application password credentials in "username:password" format.' ), esc_html( $constant_name ) ), '7.1.0' ); } } // Check database. $stored = get_option( $auth['setting_name'] ?? '', array() ); $username = is_array( $stored ) && isset( $stored['username'] ) && is_string( $stored['username'] ) ? $stored['username'] : ''; $password = is_array( $stored ) && isset( $stored['password'] ) && is_string( $stored['password'] ) ? $stored['password'] : ''; return array( 'username' => $username, 'password' => $password, 'source' => '' !== $username && '' !== $password ? 'database' : 'none', );}Introduced in 7.1.0.
Signature, return type and hooks compared across 1 parsed release.
src/wp-includes/connectors.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.