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

Simply poll & Events Calendar plugins clashing

It might be due to the position on the admin sidebar in Simply Poll. Go to simply-poll/lib/admin.php and on line 40 remove the , 6 from the end of the add_menu_page() function and see what happens. I’ll have a look at the other plugin as well to check what they are doing. Simply Poll developer

Get categories names as an array to use it in theme settings

Thanks Michael for the tip. I finally got it. The solution is as follows: $options[] = array( “section” => “zzz”, “id” => HS_SHORTNAME . “_multicheckbox_inputs”, “title” => __( ‘Multi-Checkbox’, ‘hs_textdomain’ ), “desc” => __( ‘Some Description’, ‘hs_textdomain’ ), “type” => “multi-checkbox”, “std” => ”, “choices” => my_list_cats() ); And in functions.php: function my_list_cats() { $cats … 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