WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Decimal Entities (2 posts)

  1. primexx
    Member
    Posted 7 years ago #

    Is there a easy way of using decimal entities for all special characters outputted by wordpress, rather than a mix of html entities and decimal entities?

  2. Kafkaesqui

    Posted 7 years ago #

    It's actually rather easy to accomplish:

    NCR Everywhere:
    Download plugin | View source

    To use, download ncr-everywhere.php, upload it to your plugins directory, and activate NCR Everywhere under Plugins in WordPress.

    It's not much of a plugin since all it does is hook the internal WP function ent2ncr() -- which translates any HTML character entity to its numeric character reference (NCR) -- into various text display filters. Or at least the filters WordPress presently doesn't touch with ent2ncr() (in general it's only the RSS output that requires it).

    If you wanted to you could skip the plugin and, if your theme has a functions.php, just add the following lines to it:

    add_filter('category_description', 'ent2ncr', 10);
    add_filter('list_cats', 'ent2ncr', 10);
    add_filter('comment_author', 'ent2ncr', 10);
    add_filter('comment_text', 'ent2ncr', 10);
    add_filter('single_post_title', 'ent2ncr', 10);
    add_filter('the_title', 'ent2ncr', 10);
    add_filter('the_content', 'ent2ncr', 10);
    add_filter('the_excerpt', 'ent2ncr', 10);
    add_filter('bloginfo', 'ent2ncr', 10);

Topic Closed

This topic has been closed to new replies.

About this Topic