RSS Includes Pages - Version 1.0

Version Description

Download this release

Release Info

Developer Marios Alexandrou
Plugin Icon 128x128 RSS Includes Pages
Version 1.0
Comparing to
See all releases

Version 1.0

Files changed (2) hide show
  1. readme.txt +23 -0
  2. rss-includes-pages.php +23 -0
readme.txt ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Plugin Name ===
2
+ Contributors: marios-alexandrou
3
+ Tags: rss, feed, feeds, pages
4
+ Requires at least: 2.5
5
+ Tested up to: 2.5
6
+ Stable tag: 1.0
7
+
8
+ Modifies RSS feeds so that they include pages and not just posts.
9
+
10
+ == Description ==
11
+
12
+ Modifies RSS feeds so that they include pages and not just posts. Turning off the plug-in restores RSS feeds to their default state.
13
+
14
+ == Installation ==
15
+
16
+ 1. Upload the rss-inc-feeds folder to the `/wp-content/plugins/` directory
17
+ 2. Activate the plugin through the 'Plugins' menu in WordPress
18
+
19
+ == Frequently Asked Questions ==
20
+
21
+ = Will this plugin work with other RSS feed related plugins? =
22
+
23
+ Yes. The modifications to the feed are done at a low level and other plugins should remain compatible.
rss-includes-pages.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: RSS Includes Pages
4
+ Version: 1.0
5
+ Plugin URI: http://www.mariosalexandrou.com/blog/rss-includes-pages.asp
6
+ Description: Include pages (not just posts) in RSS feeds. Particularly useful to those that use WordPress as a CMS.
7
+ Author: Marios Alexandrou
8
+ Author URI: http://www.mariosalexandrou.com/
9
+ */
10
+ add_filter('posts_where', 'ma_posts_where');
11
+
12
+ function ma_posts_where($var){
13
+ if (!is_feed()){ // check if this is a feed
14
+ return $var; // if not, return an unmodified variable
15
+ } else {
16
+ global $table_prefix; // get the table prefix
17
+ $find = $table_prefix . 'posts.post_type = \'post\''; // find where the query filters by post_type
18
+ $replace = '(' . $find . ' OR ' . $table_prefix . 'posts.post_type = \'page\')'; // add OR post_type 'page' to the query
19
+ $var = str_replace($find, $replace, $var); // change the query
20
+ }
21
+ return $var; // return the variable
22
+ }
23
+ ?>