Skip to content

Instantly share code, notes, and snippets.

@NateJacobs
Last active August 29, 2015 14:06

Revisions

  1. NateJacobs revised this gist Nov 2, 2014. 1 changed file with 18 additions and 0 deletions.
    18 changes: 18 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -1,30 +1,48 @@
    <?php

    // change the frequency of the update posts
    function ngtj_change_tng_rss_update_schedule($schedule) {
    return 'hourly';
    }
    add_filter('tng_wp_rss_post_schedule', 'ngtj_change_tng_rss_update_schedule');

    // change the TNG RSS url
    function ngtj_change_tng_rss_url($url) {
    return 'http://mytngwebsite.com';
    }
    add_filter('tng_wp_rss_url', 'ngtj_change_tng_rss_url');

    // change the author of the update post
    function ngtj_change_tng_rss_user_id($author_id) {
    return 2;
    }
    add_filter('tng_wp_rss_post_author_id', 'ngtj_change_tng_rss_user_id');

    // change the title of the update post
    function ngtj_change_tng_rss_title($title) {
    return 'This is the new title';
    }
    add_filter('tng_wp_rss_post_title', 'ngtj_change_tng_rss_title');

    // change the class of the list in the update post
    function ngtj_change_tng_rss_ul_class($class) {
    return 'list-inline';
    }
    add_filter('tng_wp_rss_list_class', 'ngtj_change_tng_rss_ul_class');

    // add content before the TNG RSS feed in the update post
    function ngtj_add_content_before($content) {
    return '<table class="table"><thead><th>Header 1</th><th>Header 2</th></thead><tbody><tr><td>Hello 1</td><td>Hello 2</td></tr><tr><td>Goodbye 1</td><td>Goodbye 2</td></tr></tbody></table>';
    }
    add_filter('tng_wp_rss_before_content', 'ngtj_add_content_before');

    // add content after the TNG RSS feed in the udpate post
    function ngtj_add_content_after($content) {
    return 'After list content';
    }
    add_filter('tng_wp_rss_after_content', 'ngtj_add_content_after');

    // replace the TNG RSS feed content completely in the update post
    function ngtj_filter_post_content($content) {
    return 'This has been replaced completely.';
    }
  2. NateJacobs created this gist Sep 14, 2014.
    31 changes: 31 additions & 0 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    <?php

    function ngtj_change_tng_rss_user_id($author_id) {
    return 2;
    }
    add_filter('tng_wp_rss_post_author_id', 'ngtj_change_tng_rss_user_id');

    function ngtj_change_tng_rss_title($title) {
    return 'This is the new title';
    }
    add_filter('tng_wp_rss_post_title', 'ngtj_change_tng_rss_title');

    function ngtj_change_tng_rss_ul_class($class) {
    return 'list-inline';
    }
    add_filter('tng_wp_rss_list_class', 'ngtj_change_tng_rss_ul_class');

    function ngtj_add_content_before($content) {
    return '<table class="table"><thead><th>Header 1</th><th>Header 2</th></thead><tbody><tr><td>Hello 1</td><td>Hello 2</td></tr><tr><td>Goodbye 1</td><td>Goodbye 2</td></tr></tbody></table>';
    }
    add_filter('tng_wp_rss_before_content', 'ngtj_add_content_before');

    function ngtj_add_content_after($content) {
    return 'After list content';
    }
    add_filter('tng_wp_rss_after_content', 'ngtj_add_content_after');

    function ngtj_filter_post_content($content) {
    return 'This has been replaced completely.';
    }
    add_filter('tng_wp_rss_post_content', 'ngtj_filter_post_content');