| 1 |
<?php |
| 2 |
|
| 3 |
/******************************************* |
| 4 |
* Restrict Content User Checks |
| 5 |
*******************************************/ |
| 6 |
|
| 7 |
function rcCheckUser() |
| 8 |
{ |
| 9 |
if (current_user_can('read')) |
| 10 |
{ |
| 11 |
if (current_user_can('edit_posts')) |
| 12 |
{ |
| 13 |
if (current_user_can('upload_files')) |
| 14 |
{ |
| 15 |
if (current_user_can('moderate_comments')) |
| 16 |
{ |
| 17 |
if (current_user_can('switch_themes')) |
| 18 |
{ |
| 19 |
//do nothing here for admin |
| 20 |
} |
| 21 |
else |
| 22 |
{ |
| 23 |
add_filter('the_content', 'rcMetaDisplayEditor'); |
| 24 |
} |
| 25 |
} |
| 26 |
else |
| 27 |
{ |
| 28 |
add_filter('the_content', 'rcMetaDisplayAuthor'); |
| 29 |
} |
| 30 |
} |
| 31 |
else |
| 32 |
{ |
| 33 |
add_filter('the_content', 'rcMetaDisplayContributor'); |
| 34 |
} |
| 35 |
} |
| 36 |
else |
| 37 |
{ |
| 38 |
add_filter('the_content', 'rcMetaDisplaySubscriber'); |
| 39 |
} |
| 40 |
} |
| 41 |
else |
| 42 |
{ |
| 43 |
add_filter('the_content', 'rcMetaDisplayNone'); |
| 44 |
} |
| 45 |
|
| 46 |
} |
| 47 |
add_action('loop_start', 'rcCheckUser'); |
| 48 |
|