Upload
wordcamp-cape-town
View
333
Download
0
Embed Size (px)
DESCRIPTION
From my experience of making WordPress sites for clients, and for clients in South Africa in particular, there are a lot of people out there who get over-whelmed if updating their site isn’t quick and easy and involves too many menus and processes. As developers I think we can get too caught up in how clever we are being, without considering the needs of the end user. My talk aims to put across some solutions I’ve come across for making the whole process of updating a site as painless and simple as possible
Citation preview
IMPROVING EASE OF USE WITHWORDPRESS ADMIN DASHBOARD
OVERVIEW
1. User Roles.2. The Login Screen.3. The Dashboard.4. The Content Editor.5. Other
USER ROLES
- Create a “clean” admin account- Set-up the main user as an editor- Use the current_user_can() function:
if ( !current_user_can( 'administrator' ) ) { //do something awesome here}
THE LOGIN
Hook: login_head
THE DASHBOARD
Tidy up...
-�Does the client need this item?-�Will the client use this item?-�Is this item an enhancement?
THE DASHBOARD
Hook: wp_dashboard_setup// Globalise the Meta Box Widgets Arrayglobal $wp_meta_boxes;unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
THE DASHBOARD
THE DASHBOARD
THE DASHBOARD
Hook: admin_menu// Globalise the Menu Arrayglobal $menu;...unset( $menu[key($menu)] );...
THE DASHBOARD
// Add Theme Editing Capabilities$role_object = get_role( 'editor' );$role_object->add_cap( 'edit_theme_options' );
THE DASHBOARD
Hook: admin_head// Globalise the Submenu Arrayglobal $submenu;...unset( $submenu['themes.php'][7] );...
THE CONTENT EDITOR
THE CONTENT EDITOR
Hook: admin_head...<style>#edit-slug-box strong, #sample-permalink, #edit-slug-buttons {display:none;}</style>...
THE CONTENT EDITOR
THE CONTENT EDITOR
THE CONTENT EDITOR
Hook: tiny_mce_before_init// Force paste as plain text...$init['oninit'] = 'setPlainText';
THE CONTENT EDITOR
THE CONTENT EDITOR
THE CONTENT EDITOR
Hook: admin_init// Add custom meta boxadd_meta_box( $id, $title, $callback, ... );
THE CONTENT EDITOR
THE CONTENT EDITOR
THE CONTENT EDITOR
// render any shortcode and convert new lines to breaknl2br( $string ) # retains line breaksdo_shortcode( $content ) # applies any shortcode(s) in $content
...$meta = nl2br( get_post_meta( $postid, $field, $single = true ) );return do_shortcode($meta);...
THE CONTENT EDITOR
THE CONTENT EDITOR
// render any shortcode in widgets.add_filter('widget_text', 'do_shortcode');
Filter: widget_text
OTHER CONSIDERATIONS
OTHER CONSIDERATIONS
<a href="facebook.com">Facebook</a> <!-- Will return an error -->
// http://www.facebook.com, www.facebook.com, facebook.com will all work.if( strpos( $url, 'http://' ) === false )
return 'http://' . $url;else
return $url...
Allow for Errors
Consider creating a plugin
CONCLUSION
If it is difficult to update, it won’t get updated.
~fin...