paginate_links on custom query in admin – ‘sufficient permissions’ error

The last part of the URL is being treated as part of the page value.. /wp-admin/admin.php?page=user-feedback/user-feedback.php/page/2/ The bold part is your plugin page, so when you go adding parts onto that URL it’s considered to be part of that URL. If you use this instead it should work no problem. /wp-admin/admin.php?page=user-feedback/user-feedback.php&paged=2 Note: You can actually … Read more

How can I add a menu item to the admin area?

The code itself is fine. But you would need to activate the plug-in: you can’t simply place the file in the plug-ins directory. You will need to give the plug-in a ‘header’ too. See the Codex. Alternatively, place the code in your theme’s functions.php, but really it should be in a plug-in.

Limiting Admin Backend Search to Title

This is possible by altering the search query via the posts_search hook. http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php#L2202 A default search query will look like this: ..AND (((wp_posts.post_title LIKE \’%search terms%\’) OR (wp_posts.post_content LIKE \’%search terms%\’))) We need to remove the post content search, a regular expression should be enough. add_filter( ‘posts_search’, ‘wpse_45153_filter_search’, null, 2 ); function wpse_45153_filter_search( $search, $a_wp_query … Read more

remove menus for a specific role?

Here is your answer: function remove_menus () { global $menu; if( (current_user_can(‘install_themes’)) ) { $restricted = array(); } // check if admin and hide nothing else { // for all other users if ($current_user->user_level < 10) $restricted = array(__(‘Dashboard’), __(‘Posts’), __(‘Media’), __(‘Links’), __(‘Pages’), __(‘Appearance’), __(‘Tools’), __(‘Users’), __(‘Settings’), __(‘Comments’), __(‘Plugins’)); // this removes a lot! Just … Read more

avoiding the display of certain categories to certain user roles at content entry time

It uses get_terms and wp_get_object_terms internally to get the categories. You can achieve what you want using a filter associated with these functions. <?php //$args = apply_filters( ‘get_terms_args’, $args, $taxonomies ); add_filter(‘get_terms_args’, ‘wpse53900_filter_cat’); function wpse53900_filter_cat($args, $taxonomies){ //this is where you can check the taxonomies and roles to filter out the ones you want //additionally, make … Read more