开发者 | juliobox |
---|---|
更新时间 | 2015年8月12日 07:00 |
捐献地址: | 去捐款 |
PHP版本: | 3.1 及以上 |
WordPress版本: | 4.3 |
Yes, you can play with my filter named "allow_moderate_all_comments", example of use (add this in your functions.php from theme folder):
add_filter( 'allow_moderate_all_comments', '__return_false' ); // This will remove the "all comments" moderation
function check_moderator() { return $GLOBALS['current_user']->ID == 123; } add_filter( 'allow_moderate_all_comments', 'check_moderator' );
No worry, i've think about it!
Use the filter "allowed_moderator_menus" and add your plugins pages. Example of use:
function add_my_plugin_page_for_moderator_menu_this_function_got_a_very_long_name_damn_it( $pages ) { $pages[] = __( 'My plugin page menu name', 'plugin_context' ); } add_action( 'allowed_moderator_menus', 'add_my_plugin_page_for_moderator_menu_this_function_got_a_very_long_name_damn_it' );
Same stuff! use this filter "baw_before_admin_bar_render", example:
function remove_my_plugin_in_admin_bar( &$wp_admin_bar ) { $wp_admin_bar->remove_menu('my-bad-plugin'); } add_action( 'baw_before_admin_bar_render', 'remove_my_plugin_in_admin_bar' );