WP_AI_Client_Prompt_Builder::snake_to_camel_case( string $snake_case ): string

In this article

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.

Converts snake_case to camelCase.

Parameters

$snake_casestringrequired
The snake_case string.

Return

string The camelCase string.

Source

private function snake_to_camel_case( string $snake_case ): string {
	$parts = explode( '_', $snake_case );

	$camel_case  = $parts[0];
	$parts_count = count( $parts );
	for ( $i = 1; $i < $parts_count; $i++ ) {
		$camel_case .= ucfirst( $parts[ $i ] );
	}

	return $camel_case;
}

Changelog

VersionDescription
7.0.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.