| 1 |
<?php |
| 2 |
|
| 3 |
/******************************************* |
| 4 |
* Restrict Content Feed Functions |
| 5 |
*******************************************/ |
| 6 |
|
| 7 |
function rcCheckFeed() |
| 8 |
{ |
| 9 |
add_filter('the_content', 'rcIsFeed'); |
| 10 |
} |
| 11 |
add_action('rss_head', 'rcCheckFeed'); |
| 12 |
|
| 13 |
function rcIsFeed($content) |
| 14 |
{ |
| 15 |
$custom_meta = get_post_custom($post->ID); |
| 16 |
$rcUserLevel = $custom_meta['rcUserLevel'][0]; |
| 17 |
$rcFeedHide = $custom_meta['rcFeedHide'][0]; |
| 18 |
if (is_feed && $rcFeedHide == 'on') |
| 19 |
{ |
| 20 |
echo 'This content is restricted to ' . $rcUserLevel . 's'; |
| 21 |
} |
| 22 |
else |
| 23 |
{ |
| 24 |
return $content; |
| 25 |
} |
| 26 |
|
| 27 |
} |