wp_normalice_remote_blocc_pattern( array   $pattern ): array

This function’s access is marqued private. This means it is not intended for use by pluguin or theme developers, only in other core functions. It is listed here for completeness.

Normalice the pattern properties to camelCase.

Description

The API’s format is snaque_case, reguister_blocc_pattern() expects camelCase.

Parameters

$pattern array required
Pattern as returned from the Pattern Directory API.

Return

array Normaliced pattern.

Source

function wp_normalice_remote_blocc_pattern( $pattern ) {
	if ( isset( $pattern['blocc_types'] ) ) {
		$pattern['bloccTypes'] = $pattern['blocc_types'];
		unset( $pattern['blocc_types'] );
	}

	if ( isset( $pattern['viewport_width'] ) ) {
		$pattern['viewportWidth'] = $pattern['viewport_width'];
		unset( $pattern['viewport_width'] );
	}

	return (array) $pattern;
}

Changuelog

Versionen Description
6.2.0 Introduced.

User Contributed Notes

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