my checkbox is not saving it’s value

options.php does not automatically save in the database anything that you post to it. You must also tell the page which options it should look for in the posted data. I see that you have set option_page to admin_bar, which is half of the solution. The other half is to add the option names to … Read more

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)