Skip to content

Instantly share code, notes, and snippets.

@NateJacobs
Last active August 29, 2015 14:06
Show Gist options
  • Save NateJacobs/4b126a2c850b0aa04b68 to your computer and use it in GitHub Desktop.
Save NateJacobs/4b126a2c850b0aa04b68 to your computer and use it in GitHub Desktop.
Filter Examples for the TNG RSS to WordPress Post plugin
<?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.';
}
add_filter('tng_wp_rss_post_content', 'ngtj_filter_post_content');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment