Viewing 1 replies (of 1 total)
  • Hi christopheran,

    And thank you for using WP RSS Aggregator.

    We’ve created a snippet for you that, if included with WordPress (perhaps in functions.php) will process all headings of all incoming items and transform them into a text-only version. This is a rough example, so please feel free to customize as needed.

    Also please note that this will only work with Simple Feeds Bundle add-ons, and will not work if the Feed to Post add-on is installed.


    if (true) {

    if (!function_exists('my_normalize_rss_item_heading_chars')) {
    function my_normalize_rss_item_heading_chars($text) {
    // Replaces specifically the <| thing with a dash
    $text = preg_replace('/[\x{25C4}]/u', '-', $text);
    // Replaces all other "cool" chars with nothing
    $text = preg_replace('/[^\x20-\x7E]/','', $text);
    // Remove extra space around text
    $text = trim($text);

    return $text;
    }
    }

    add_filter('wprss_populate_post_data', function($data, $item) {
    /* @var $data array */
    /* @var $item SimplePie_Item */

    $data['post_title'] = my_normalize_rss_item_heading_chars($data['post_title']);

    return $data;
    });
    }

Viewing 1 replies (of 1 total)
  • The topic ‘Removing icons in titles’ is closed to new replies.