Excluding private/protected posts via IP

Bypass Password Protected Posts You are, unfortunately right about the lack of filters, and hacking the core is inevitable. One solutions that seems to work revolves around the sanitize_post_field() function which fires off a number of interesting filters if its $context argument is not set to raw. The template function that is responsible for deciding … Read more

How to make the Newsletter plugin visible to users with author privileges?

The plugin contains for example these lines: add_menu_page(‘Newsletter’, ‘Newsletter’, ($this->options[‘editor’] == 1) ? ‘manage_categories’ : ‘manage_options’, ‘newsletter_main_index’); add_submenu_page(‘newsletter_main_index’, $title, $title, ($newsletter->options[‘editor’] == 1) ? ‘manage_categories’ : ‘manage_options’, $name, $name); add_submenu_page(null, $title, $title, ($newsletter->options[‘editor’] == 1) ? ‘manage_categories’ : ‘manage_options’, $name, $name); so it looks like you have the option to display the Newsletter menu for … Read more

“You do not have sufficient permissions to access this page” upon accessing my newly created plugin page

add_options_page(“OSCommerce Product Display”, “OSCommerce Product Display”, 1, “OSCommerce Product Display”, “oscimp_admin”); should be add_options_page( ‘OSCommerce Product Display’, ‘OSCommerce Product Display’, ‘administrator’, ‘os_commerce_display_main’, ‘oscimp_admin’ ); Solution is untested. Docs: Roles and Capabilities, add_options_page The 3rd parameter is capability, not user level or whatever you were thinking. I set it to admin, see the docs on roles … Read more

Why are authors allowed to approve comments on their posts? How to revoke privilege?

The ability to set comment status is tied to the “edit_comment” capability, which is a meta-capability in WordPress. It maps to the “edit_post” capability, which is another meta-capability that varies depending on whether a post is published or not. In the end, if a post is published, then edit_comment ends up mapping to “edit_published_posts” for … Read more