The document discusses how to improve WordPress admin pages by following WordPress UI guidelines and best practices. It covers topics like using the proper icons, headers, buttons, forms, containers and other interface elements. It also provides examples of how to implement tabs, tables, scripts, stylesheets, media uploaders, pointers and data storage options. The document encourages contributors to explore more WordPress admin UI resources and to contribute to improving the WordPress UI.
1. Your Custom WordPress
Admin Pages Suck
(and how to make them unsucky)
Anthony Montalbano @italianst4
anthony@ambrdetroit.com
2. Who is Anthony Montalbano?
Passionate for code
Bachelor's in Computer Science
Passionate for WordPress
WordCamp Detroit Organizer, Plugin/Theme Developer
Passionate for open source
WordPress plugin developer
Passionate for words
Serial blogger
Passionate for possibilities
Co-founder of flipfrog and AMBR Detroit
source: iamthecoolestpersonever.com
6. What are you talking about?!
More examples...
http://themeoptions.wordpress.com/
A need rant...
http://wpcandy.com/thinks/custom-admin-screens-are-the-worst
Comment rant...
http://wpcandy.com/thinks/custom-admin-screens-are-the-
worst#comment-127921
7. What are you talking about?!
"This stuff needs
to stop."
~Ryan Imel
29. Scripts and Styles
There are many cases where you may want to
include a javascript or style sheet with your
plugin. WordPress has this functionality built
in. By default WordPress has many scripts
included, such as jQuery.
http://codex.wordpress.org/Function_Reference/wp_enqueue_script
30. Scripts and Styles (continued)
Using a script
<?php
function my_scripts_method() {
wp_enqueue_script('jquery');
}
add_action('wp_enqueue_scripts', 'my_scripts_method');
?>
Adding a new script
wp_register_script( 'simplr', 'https://raw.github.
com/simplrteam/SimplrJS/master/dist/simplr.min.js');
31. Dynamic Tables
In the codex:
http://codex.wordpress.org/Function_Reference/WP_List_Table
How to:
http://wp.smashingmagazine.com/2011/11/03/native-admin-tables-wordpress/
34. Media Uploader
How to use the media uploader:
http://wp.tutsplus.com/tutorials/creative-coding/how-to-integrate-the-wordpress-media-uploader-in-
theme-and-plugin-options/
35. Admin Pointers
How to add pointers:
http://wp.tutsplus.com/tutorials/integrating-with-wordpress-ui-admin-pointers/
37. Options API
// Create an option to the database
add_option( $option, $value = , $deprecated = , $autoload = 'yes' );
// Removes option by name.
delete_option( $option );
// Fetch a saved option
get_option( $option, $default = false );
// Update the value of an option that was already added.
update_option( $option, $newvalue );
http://codex.wordpress.org/Options_API
38. Transients API
// Set a transient
set_transient( 'special_query_results', $special_query_results, 60*60*12
);
// Remove a transient by name.
delete_transient( 'special_query_results' );
// Fetch a saved option
get_transient( 'special_query_results');
http://codex.wordpress.org/Transients_API
39. Settings API
http://codex.wordpress.org/Settings_API
40. Widget Data
class Example_Widget extends WP_Widget {
// Displaying widget option value
public function widget( $args, $instance ) {
echo $instance['title'];
}
// Updating a widget option value
public function update( $new_instance, $old_instance ) {
$instance = array();
$instance['title'] = strip_tags( $new_instance['title'] );
return $instance;
}
}
http://codex.wordpress.org/Widgets_API