Retrieve only posts from a specific user in wp-admin/edit.php

You will need to filter that list. function alter_views_wpse_103613($views) { $role=”blogger_simple”; if (current_user_can($role)) { $views = array(‘mine’=>$views[‘mine’]); } return $views; } add_filter( ‘views_edit-post’, ‘alter_views_wpse_103613’ ); That filter list is part of the WP_List_Table class if you want to investigate more. Look for the views method.

Change the “Default Avatar” admin option via functions.php

You can just update the option field avatar_default to your new image url: add_filter( ‘avatar_defaults’, ‘mytheme_default_avatar’ ); function mytheme_default_avatar( $avatar_defaults ) { $avatar = get_option(‘avatar_default’); $new_avatar_url = get_template_directory_uri() . ‘/images/default_avatar.png’; if( $avatar != $new_avatar_url ) { update_option( ‘avatar_default’, $new_avatar_url ); } $avatar_defaults[ $new_avatar_url ] = ‘Default Avatar’; return $avatar_defaults; }

WordPress Admin Login Custom Logo

I personally like to use something like this. This will look for a logo image in your templates /images/ folder or directory, then display it in place of the default WordPress Logo. function my_login_logo() { if(file_exists(TEMPLATEPATH.’/images/logo.png’)) $logo = ‘/images/logo.png’; else if(file_exists(TEMPLATEPATH.’/images/logo.jpg’)) $logo = ‘/images/logo.jpg’; else if(file_exists(TEMPLATEPATH.’/images/logo.gif’)) $logo = ‘/images/logo.gif’; ?> <style type=”text/css”> body.login div#login h1 … Read more

Add a custom text to admin footer in a Custom Post Type page

This should do. Put the following in your functions.php if (in_array($GLOBALS[‘pagenow’], array(‘edit.php’, ‘post.php’, ‘post-new.php’))) add_filter(‘admin_footer_text’, ‘my_custom_footer_admin_text’); function my_custom_footer_admin_text($text) { $post_type = filter_input(INPUT_GET, ‘post_type’); if (! $post_type) $post_type = get_post_type(filter_input(INPUT_GET, ‘post’)); if (‘my_post_type’ == $post_type) return ‘my custom message’; return $text; }

In the Admin Dashboard, can I choose which sections to display?

If you just want to remove the menu options, you can use the remove_menu_page function in your functions.php file remove_menu_page Add this code to functions.php: function remove_menus(){ remove_menu_page( ‘index.php’ ); //Dashboard remove_menu_page( ‘edit-comments.php’ ); //Comments remove_menu_page( ‘themes.php’ ); //Appearance remove_menu_page( ‘plugins.php’ ); //Plugins remove_menu_page( ‘users.php’ ); //Users remove_menu_page( ‘tools.php’ ); //Tools remove_menu_page( ‘options-general.php’ ); //Settings … Read more

Add Custom Script in Other Plugin’s Options page

There are several ways to add scripts only to certain admin pages. The best option, from my point of view, is to hook into admin_enqueue_scripts and use the $hook parameter: add_action(‘admin_enqueue_scripts’, ‘cyb_admin_scripts’); function cyb_admin_scripts( $hook ) { //You may need adjustment here to match for page //If the URL of your page is admin.php?page=psbg, the … Read more

always by default show welcome panel in the dashboard

thanks @birgire with your help i change the code to make this work. everyone that looking for the same solution you can use this code: add_action( ‘load-index.php’, ‘show_welcome_panel’ ); function show_welcome_panel() { $user_id = get_current_user_id(); if ( 1 != get_user_meta( $user_id, ‘show_welcome_panel’, true ) ) update_user_meta( $user_id, ‘show_welcome_panel’, 1 ); }

Add sub menu page in your plugin

The add_submenu_page first parameter should be the top menu page handle which in you case is a-qoute so: function a_qoute_admin_action(){ add_menu_page( __(‘Reservations Pages’),// the page title __(‘Donation’),//menu title ‘edit_themes’,//capability ‘a-qoute’,//menu slug/handle this is what you need!!! ‘qoute_settings’,//callback function ”,//icon_url, ”//position ); add_submenu_page( ‘a-qoute’, ‘Donations Log’, //page title ‘Donations Log’, //menu title ‘edit_themes’, //capability, ‘DonationsLog’,//menu slug … Read more