28
IMPROVING EASE OF USE WITH WORDPRESS ADMIN DASHBOARD

Byron Rode (improving ease of use with the word press admin)

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

Page 1: Byron Rode (improving ease of use with the word press admin)

IMPROVING EASE OF USE WITHWORDPRESS ADMIN DASHBOARD

Page 2: Byron Rode (improving ease of use with the word press admin)

OVERVIEW

1. User Roles.2. The Login Screen.3. The Dashboard.4. The Content Editor.5. Other

Page 3: Byron Rode (improving ease of use with the word press admin)

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}

Page 4: Byron Rode (improving ease of use with the word press admin)

THE LOGIN

Hook: login_head

Page 5: Byron Rode (improving ease of use with the word press admin)

THE DASHBOARD

Tidy up...

-�Does the client need this item?-�Will the client use this item?-�Is this item an enhancement?

Page 6: Byron Rode (improving ease of use with the word press admin)

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']);

Page 7: Byron Rode (improving ease of use with the word press admin)

THE DASHBOARD

Page 8: Byron Rode (improving ease of use with the word press admin)

THE DASHBOARD

Page 9: Byron Rode (improving ease of use with the word press admin)

THE DASHBOARD

Hook: admin_menu// Globalise the Menu Arrayglobal $menu;...unset( $menu[key($menu)] );...

Page 10: Byron Rode (improving ease of use with the word press admin)

THE DASHBOARD

// Add Theme Editing Capabilities$role_object = get_role( 'editor' );$role_object->add_cap( 'edit_theme_options' );

Page 11: Byron Rode (improving ease of use with the word press admin)

THE DASHBOARD

Hook: admin_head// Globalise the Submenu Arrayglobal $submenu;...unset( $submenu['themes.php'][7] );...

Page 12: Byron Rode (improving ease of use with the word press admin)

THE CONTENT EDITOR

Page 13: Byron Rode (improving ease of use with the word press admin)

THE CONTENT EDITOR

Hook: admin_head...<style>#edit-slug-box strong, #sample-permalink, #edit-slug-buttons {display:none;}</style>...

Page 14: Byron Rode (improving ease of use with the word press admin)

THE CONTENT EDITOR

Page 15: Byron Rode (improving ease of use with the word press admin)

THE CONTENT EDITOR

Page 16: Byron Rode (improving ease of use with the word press admin)

THE CONTENT EDITOR

Hook: tiny_mce_before_init// Force paste as plain text...$init['oninit'] = 'setPlainText';

Page 17: Byron Rode (improving ease of use with the word press admin)

THE CONTENT EDITOR

Page 18: Byron Rode (improving ease of use with the word press admin)

THE CONTENT EDITOR

Page 19: Byron Rode (improving ease of use with the word press admin)

THE CONTENT EDITOR

Hook: admin_init// Add custom meta boxadd_meta_box( $id, $title, $callback, ... );

Page 20: Byron Rode (improving ease of use with the word press admin)

THE CONTENT EDITOR

Page 21: Byron Rode (improving ease of use with the word press admin)

THE CONTENT EDITOR

Page 22: Byron Rode (improving ease of use with the word press admin)

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);...

Page 23: Byron Rode (improving ease of use with the word press admin)

THE CONTENT EDITOR

Page 24: Byron Rode (improving ease of use with the word press admin)

THE CONTENT EDITOR

// render any shortcode in widgets.add_filter('widget_text', 'do_shortcode');

Filter: widget_text

Page 25: Byron Rode (improving ease of use with the word press admin)

OTHER CONSIDERATIONS

Page 26: Byron Rode (improving ease of use with the word press admin)

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

Page 27: Byron Rode (improving ease of use with the word press admin)

CONCLUSION

If it is difficult to update, it won’t get updated.

Page 28: Byron Rode (improving ease of use with the word press admin)

~fin...