Filter hook 'pre_ent2ncr'

in WP Core File wp-includes/formatting.php at line 4110

View Source

pre_ent2ncr

Filter Hook
Description
Filters text before named entities are converted into numbered entities. A non-null string must be returned for the filter to be evaluated.

Hook Information

File Location wp-includes/formatting.php View on GitHub
Hook Type Filter
Line Number 4110

Hook Parameters

Type Name Description
string|null $converted_text The text to be converted. Default null.
string $text The text prior to entity conversion.

Usage Examples

Basic Usage
<?php
// Hook into pre_ent2ncr
add_filter('pre_ent2ncr', 'my_custom_filter', 10, 2);

function my_custom_filter($converted_text, $text) {
    // Your custom filtering logic here
    return $converted_text;
}

Source Code Context

wp-includes/formatting.php:4110 - How this hook is used in WordPress core
<?php
4105  	 * @since 3.3.0
4106  	 *
4107  	 * @param string|null $converted_text The text to be converted. Default null.
4108  	 * @param string      $text           The text prior to entity conversion.
4109  	 */
4110  	$filtered = apply_filters( 'pre_ent2ncr', null, $text );
4111  	if ( null !== $filtered ) {
4112  		return $filtered;
4113  	}
4114  
4115  	$to_ncr = array(

PHP Documentation

<?php
/**
	 * Filters text before named entities are converted into numbered entities.
	 *
	 * A non-null string must be returned for the filter to be evaluated.
	 *
	 * @since 3.3.0
	 *
	 * @param string|null $converted_text The text to be converted. Default null.
	 * @param string      $text           The text prior to entity conversion.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/formatting.php
Related Hooks

Related hooks will be displayed here in future updates.