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

You appear to be a bot. Output may be restricted

Description

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

Usage

$string = convert_chars( $content, $deprecated );

Parameters

$content
( string ) required – String of characters to be converted.
$deprecated
( string ) optional – Not used.

Returns

string Converted string.

Source

File name: wordpress/wp-includes/formatting.php
Lines:

1 to 11 of 11
function convert_chars( $content, $deprecated = '' ) {
  if ( ! empty( $deprecated ) ) {
    _deprecated_argument( convert_chars, '0.71' );
  }

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

  return $content;
}
 

 View on GitHub View on Trac