Title: wp_connectors_parse_application_password_credentials
Published: August 20, 2026

---

# wp_connectors_parse_application_password_credentials( string $value ): array{username:

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_connectors_parse_application_password_credentials/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/functions/wp_connectors_parse_application_password_credentials/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_connectors_parse_application_password_credentials/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_connectors_parse_application_password_credentials/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_connectors_parse_application_password_credentials/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_connectors_parse_application_password_credentials/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_connectors_parse_application_password_credentials/?output_format=md#wp--skip-link--target)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Parses a `username:password` credentials string.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/wp_connectors_parse_application_password_credentials/?output_format=md#description)󠁿

Splits on the first colon, matching the HTTP Basic authentication userinfo format,
so passwords may contain colons.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_connectors_parse_application_password_credentials/?output_format=md#parameters)󠁿

 `$value`stringrequired

The raw credentials string.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_connectors_parse_application_password_credentials/?output_format=md#return)󠁿

 array{username: string, password: string} Parsed credentials. Both values are empty
when the string is malformed.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_connectors_parse_application_password_credentials/?output_format=md#source)󠁿

    ```php
    function wp_connectors_parse_application_password_credentials( string $value ): array {
    	$separator = strpos( $value, ':' );
    	// Trim so surrounding whitespace or a trailing newline (common when the
    	// value comes from a file or `.env`) does not become part of the credentials.
    	$username = false === $separator ? '' : trim( substr( $value, 0, $separator ) );
    	$password = false === $separator ? '' : trim( substr( $value, $separator + 1 ) );

    	if ( '' === $username || '' === $password ) {
    		return array(
    			'username' => '',
    			'password' => '',
    		);
    	}

    	return array(
    		'username' => $username,
    		'password' => $password,
    	);
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/connectors.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/connectors.php#L483)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/connectors.php#L483-L501)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_connectors_parse_application_password_credentials/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_connectors_get_application_password_credentials()](https://developer.wordpress.org/reference/functions/wp_connectors_get_application_password_credentials/)`wp-includes/connectors.php` |

Resolves application-password credentials for a connector.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_connectors_parse_application_password_credentials/?output_format=md#changelog)󠁿

| Version | Description | 
| [7.1.0](https://developer.wordpress.org/reference/since/7.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_connectors_parse_application_password_credentials%2F)
before being able to contribute a note or feedback.