wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



convert_chars › WordPress Function

Od0.71
Przestarzałyn/a
convert_chars ( $content, $deprecated = '' )
Parametry: (2)
  • (string) $content String of characters to be converted.
    Wymagane: Tak
  • (string) $deprecated Not used.
    Wymagane: Nie
    Domyślny: (puste)
Powrót:
  • (string) Converted string.
Zdefiniowane na:
Codex:

Converts lone & characters into `&` (a.k.a. `&`)



Źródło

function convert_chars( $content, $deprecated = '' ) {
	if ( ! empty( $deprecated ) ) {
		_deprecated_argument( __FUNCTION__, '0.71' );
	}

	if ( str_contains( $content, '&' ) ) {
		$content = preg_replace( '/&([^#])(?![a-z1-4]{1,8};)/i', '&$1', $content );
	}

	return $content;
}