This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add Param to Show Number of Posts in RSS | |
* | |
* Source: https://wordpress.stackexchange.com/questions/4736/get-all-posts-in-rss | |
*/ | |
add_filter('option_posts_per_rss', 'my_posts_per_rss'); | |
function my_posts_per_rss($option) | |
{ | |
if (isset($_GET['posts'])) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add param to display gallery in full size in RSS | |
*/ | |
add_filter( | |
'shortcode_atts_gallery', | |
function ($out) { | |
$out['link'] = 'file'; // By defaul show file link in gallery, not attachmnet URL | |
if (is_feed() and $_GET['gallery'] === 'full') { | |
$out['size'] = 'full'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add RSS Feed Summary Params | |
* | |
* Source: https://wordpress.stackexchange.com/a/195197 | |
*/ | |
add_action('rss_tag_pre', function ($tag) { | |
$summary = filter_input(INPUT_GET, 'summary', FILTER_SANITIZE_STRING); | |
if ('yes' === $summary) | |
add_filter('option_rss_use_excerpt', '__return_true'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add Image to RSS | |
* | |
* Source: https://wordpress.stackexchange.com/a/292763 | |
* Source: https://gist.github.com/DaveyJake/aa59667cd3ced5809b4d | |
*/ | |
function remote_file_size($url) | |
{ | |
$data = get_headers($url, true); |