wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_sanitize_block_gap_value › WordPress Function

Seit7.1.0
Veraltetn/v
wp_sanitize_block_gap_value ( $gap_value )
Parameter:
  • (string|array|null) $gap_value Block gap value.
    Erforderlich: Ja
Gibt zurück:
  • (string|array|null) Sanitized block gap value.
Definiert in:
Codex:

Sanitizes a block gap value before layout style generation.



Quellcode

function wp_sanitize_block_gap_value( $gap_value ) {
	if ( is_array( $gap_value ) ) {
		foreach ( $gap_value as $key => $value ) {
			$gap_value[ $key ] = ! is_scalar( $value ) || ( $value && preg_match( '%[\\\(&=}]|/\*%', (string) $value ) ) ? null : $value;
		}

		return $gap_value;
	}

	return $gap_value && preg_match( '%[\\\(&=}]|/\*%', $gap_value ) ? null : $gap_value;
}