WordPress.org

Plugin Directory

HTML Special Characters Helper

Admin widget on the Add/Edit Post pages for inserting HTML encodings of special characters into the post.

Filters

The plugin exposes two filters for hooking. Typically, customizations utilizing this hook would be put into your active theme's functions.php file, or used by another plugin.

c2c_html_special_characters (filter)

The 'c2c_html_special_characters' hook allows you to remove existing characters or entire groups of characters, and/or add new characters or groups of characters.

Arguments:

  • $codes (array) : An association array in which the keys are a grouping name and the values are associative arrays themselves with the code as the key and the human-friendly descriptions as the values.

Example:

/**
 * Add a new grouping of characters (accented 'A's).
 *
 * @param array $characters Default HTML special characters.
 * @return array
 */
function more_html_special_characters( $characters ) {
    $characters['accented_a'] = array(
        'name'     => 'Accented A',
        'À' => 'A grave accent',
        'Á' => 'A accute accent',
        'Â'  => 'A circumflex',
        'Ã' => 'A tilde',
        'Ä'   => 'A umlaut',
        'Å'  => 'A ring',
        'Æ'  => 'AE ligature',
    );
    return $characters; // Important!
}
add_filter( 'c2c_html_special_characters', 'more_html_special_characters' );

c2c_html_special_characters_post_type (filter)

The 'c2c_html_special_characters_post_type' hook allows you to specify which post_types for which the HTML Special Characters metabox should be shown.

Arguments:

  • $post_types (array) : An array of post types. By default, this value is array( 'page', 'post' )

Example:

/**
 * Show HTML Special Characters Helper for additional post_types.
 *
 * @param array $post_types Arry of post types.
 * @return array
 */
function more_html_special_characters_post_types( $post_types ) {
    $post_types[] = 'products'; // Show for products
    unset( $post_types['page'] ); // Don't show for pages
    return $post_types;
}
add_filter( 'c2c_html_special_characters_post_types', 'more_html_special_characters_post_types' );

Requires: 2.8 or higher
Compatible up to: 4.1.7
Last Updated: 2015-2-16
Active Installs: 1,000+

Ratings

5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,2,2
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1
100,1,1