Top Wordpress dashboard hacks

3,424 views
3,334 views

Published on

Wordpress dashboard hacks for developers and freelancers

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,424
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
20
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Top Wordpress dashboard hacks

  1. 1. WORDPRESS DASHBOARD HACKS FORDEVELOPERS AND FREELANCERS By Pankaj Subedi
  2. 2. SOURCE AND REFERENCES :: http://www.studiograsshopper.ch/ http://www.wprecipes.com http://www.catswhocode.com http://wpsnipp.com
  3. 3. THE DASHBOARD IS AN ESSENTIAL PART OFWORDPRESS, AS IT IS THE PLACE WHERE YOU WRITEPOSTS AND INSTALL PLUGINS. BUT AS A DEVELOPERAND/OR FREELANCER, YOU HAVE TO BE CAREFULABOUT WHAT YOUR CLIENTS ARE DOING ON THEDASHBOARD OF THEIR WORDPRESS POWEREDWEBSITES. TODAY, I HAVE COMPILED 10 SUPERUSEFUL HACKS TO CUSTOMIZE, MODIFY OR ENHANCEWORDPRESS DASHBOARD.
  4. 4. REMOVE MENU ITEMS FROM WORDPRESS ADMIN BARHere is a super useful code snippet for developers who wants to prevent theirclients to access some dashboard menus, such as “Plugins” or “Settings”. Pastethis code into your theme functions.php file to remove menus from the admin bar. function wps_admin_bar() { global $wp_admin_bar; $wp_admin_bar->remove_menu(wp-logo); $wp_admin_bar->remove_menu(about); $wp_admin_bar->remove_menu(wporg); $wp_admin_bar->remove_menu(documentation); $wp_admin_bar->remove_menu(support-forums); $wp_admin_bar->remove_menu(feedback); $wp_admin_bar->remove_menu(view-site); } add_action( wp_before_admin_bar_render, wps_admin_bar );
  5. 5. REMOVE THE SCREEN OPTIONS TAB WITHSCREEN_OPTIONS HOOKDon’t need the “Screen Options” button? Here is a simple hack toremove it. Paste the code below into yourfunctions.php file, save it, andyou’re done.function remove_screen_options(){ return false;}add_filter(screen_options_show_screen, remove_screen_options);
  6. 6. CHANGE DEFAULT “ENTER TITLE HERE” TEXT WITHIN POST TITLE INPUT FIELDIf for some reason you need to replace the “Enter title here” text within posttitle input field by a custom text, here is an easy way to do it. Define a newtext on line 2, then paste the code into your functions.php file. function title_text_input( $title ){ return $title = Enter new title; } add_filter( enter_title_here, title_text_input );
  7. 7. CHANGE DASHBOARD FOOTER TEXTChanging the dashboard footer text is pretty easy as well. Update the codebelow with your custom text on line 2, then include the snippet intoyour functions.php file. function remove_footer_admin () { echo "Your own text"; } add_filter(admin_footer_text, remove_footer_admin);
  8. 8. DISABLE THE “PLEASE UPDATE NOW” MESSAGE IN WP DASHBOARDSecurity is indeed a crucial aspect of a website and you should alwaysupdate all blogs you manage to prevent any risk of hacking. But whenworking with clients, sometimes you may want to hide the “pleaseupdate now” message generated by WordPress when a new version isavailable.Simply add this code to your functions.php file to hide the message.if ( !current_user_can( edit_users ) ) { add_action( init, create_function( $a, "remove_action( init, wp_version_check );" ), 2 ); add_filter( pre_option_update_core, create_function( $a, "return null;" ) );}
  9. 9. DISABLE THEME SWITCHINGThe best way to prevent your clients from switching theme is definitelyby disabling theme switching. Paste the following codeinto functions.php and your clients will not be able to switch themesanymore.add_action(admin_init, slt_lock_theme);function slt_lock_theme() { global $submenu, $userdata; get_currentuserinfo(); if ($userdata->ID != 1) { unset($submenu[themes.php][5]); unset($submenu[themes.php][15]); }}
  10. 10. CHANGE WORDPRESS DASHBOARD COLORSIf you ever wanted to be able to change WordPress dashboard colors(as well as font or even display) without having to edit WordPresscore files, you’ll like this hack for sure.The following example features a basic style change (grey header isreplaced by a blue one) but you can easily add as many styles as youwish within the <style> and </style> tags.function custom_colors() { echo <style type="text/css">#wphead{background:#069}</style >;} add_action(admin_head, custom_colors);
  11. 11. CREATE CUSTOM HELP MESSAGES If you’re building a site for a client and they have some problems with some parts of the dashboard, a good idea is to provide contextual help to the client. The following hack will allow you to add a custom help messages for the blog admin. As usual, you only have to paste the code into your functions.php file.function my_admin_help($text, $screen) { // Check were only on my Settings page if (strcmp($screen, MY_PAGEHOOK) == 0 ) { $text = Here is some very useful information to help you use this plugin...; return $text; } // Let the default WP Dashboard help stuff through on other Admin pages return $text;}add_action( contextual_help, my_admin_help );
  12. 12. CHANGE WORDPRESS DEFAULT FROM EMAILADDRESSIf you want to change WordPress default FROM email adress,simply paste the following snippet into yourfunctions.php file. Don’tforget to put the desired email adress on line 5 and desired name online 8.add_filter(wp_mail_from, new_mail_from);add_filter(wp_mail_from_name, new_mail_from_name);function new_mail_from($old) { return admin@yourdomain.com;}function new_mail_from_name($old) { return Your Blog Name;}

×