SlideShare a Scribd company logo
1 of 47
Download to read offline
Your Custom WordPress
Admin Pages Suck
(and how to make them unsucky)
Anthony Montalbano          @italianst4

       anthony@ambrdetroit.com
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
What are you talking about?!
What are you talking about?!
What are you talking about?!
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
What are you talking about?!



"This stuff needs
    to stop."
                           ~Ryan Imel
First World Problem?
Be a Good Guy Greg!
The WordPress
Admin
It's in the details...
The WordPress Admin

Icons
The WordPress Admin

Header
The WordPress Admin

Buttons
The WordPress Admin

Forms
The WordPress Admin

Containers
Locating your admin page


  ●   Navbar
  ●   Toolbar
  ●   Dashboard
  ●   Post Edit
  ●   Widgets
  ●   Default Admin Pages
  ●   Plugins Page
Styling
Let's make things sexy
Wrap it up!



              <div class="wrap">

                       <!-- MAGIC GOES HERE --
              >

              </div>
Admin UI Basics




            <div class="wrap">
              <h1>WordCamp Detroit</h1>
              <div id="icon-users" class="icon32"></div>
              <h2>WordCamp Detroit</h2>
              <h3>WordCamp Detroit</h3>
              <h4>WordCamp Detroit</h4>
              <span>I will make better admin UIs</span>
              <br/><br/>
              <code>jQuery('#badUI').remove();</code>
            </div>
Buttons




<div class="wrap">
  <input class="button-primary" value="<?php _e('Save Options'); ?>"
type="button" />
  <br /><br />
  <input class="button-secondary" value="<?php _e('Empty Trash'); ?>"
type="button" />
  <br /><br />
  <a href="#" class="button-secondary">Don't click me</a>
</div>
Notices




<div class="wrap">
  <div class="updated"><p>Settings are saved!</p></div>
  <div class="error"><p>Oh no, it failed</p></div>
</div>
Forms
Forms (continued)
<div class="wrap">
  <form method="POST" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
    <table class="form-table">
      <tr valign="top">
        <th scope="row">
          <label for="name">Name<span> *</span></label>
        </th>
        <td>
          <input id="name" maxlength="45" size="10" name="name" value=""
type="text" />
          <p class="description">What do they call you?</p>
        </td>
      </tr>
      <tr valign="top">
        <th scope="row">
          <label for="gender">Gender<span> *</span></label>
        </th>
        <td>
          <select id="gender" name="gender">
             <option value="male">Male<option>
             <option value="female">Female<option>
          </select>
        </td>
      </tr>
Forms (continued, again)
<tr valign="top">
        <th scope="row">
          <label for="aboutyou">About You</label>
        </th>
        <td>
          <textarea id="aboutyou"></textarea>
        </td>
      </tr>
      <tr valign="top">
        <th scope="row">
          <label for="awesome">Are you awesome?</label>
        </th>
        <td>
          <fieldset>
             <label for="awesome">
               <input id="awesome" name="awesome" value="" type="checkbox"
value="1" /> Umm, yeah!
             </label>
          </fieldset>
        </td>
      </tr>
Forms (continued, and again)
<tr>
        <th scope="row">
          <label for="color">Color</label>
        </th>
        <td>
          <fieldset>
             <legend class="screen-reader-text"><span>Date
Format</span></legend>
             <label title="red">
               <input type="radio" name="color" value="red" checked="
checked">
               <span>Red</span>
             </label><br>
             <label title="blue">
               <input type="radio" name="color" value="blue">
               <span>Blue</span>
             </label><br>
             <label title="green">
               <input type="radio" name="color" value="green">
               <span>Green</span>
             </label><br>
          </fieldset>
    </table>
  </form>
</div>
Tabs




  <div class="wrap">
    <h2 class="nav-tab-wrapper">
      Just Some Tabs
      <a href="#" class="nav-tab nav-tab-active">Tab 1</a>
      <a href="#" class="nav-tab">Tab 2</a>
    </h2>
  </div>
Static Tables




    <div class="wrap">
      <table class="widefat">
        <thead><tr>
           <th>Name</th> <th>Email</th>
        </tr></thead>
        <tfoot><tr>
           <th>Name</th> <th>Email</th>
        </tr></tfoot>
        <tbody><tr>
           <td>Anthony Montalbano</td>
    <td>anthony@ambrdetroit.com</td>
        </tr></tbody>
      </table>
    </div>
Interactive
Elements
Click, click, drag, clickity, click!
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
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');
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/
Pagination



   <div class="wrap">
     <div class="tablenav">
     <?php
     $posts_per_page = 15;
     $num_of_records = 500;

    $page_links = paginate_links( array(
      'base' => add_query_arg( 'paged', '%#%' ),
      'format' => '',
      'prev_text' => __('&laquo;'),
      'next_text' => __('&raquo;'),
      'total' => ceil($num_of_records/$posts_per_page),
      'current' => $_GET['paged']
    ));
Pagination (continued)
   if ( $page_links ) { ?>
       <div class="tablenav-pages">
          <?php echo sprintf( '<span class="displaying-num"
   >' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
                number_format_i18n( ( $_GET['paged'] - 1 ) *
   $posts_per_page + 1 ),
                number_format_i18n( min( $_GET['paged'] *
   $posts_per_page, $num_of_records ) ),
                number_format_i18n( $num_of_records ),
                $page_links
             );
          ?>
       </div>
     <?php } ?>
     </div>
   </div>




              http://codex.wordpress.org/Function_Reference/paginate_links
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/
Admin Pointers




How to add pointers:
http://wp.tutsplus.com/tutorials/integrating-with-wordpress-ui-admin-pointers/
Data Retention
Maybe we should save that...
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
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
Settings API




               http://codex.wordpress.org/Settings_API
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
Explore more
It's only just begun...
Admin UI Reference Plugin




Download the plugin here:
   https://github.com/bueltge/WordPress-Admin-Style
Additional Sources

UI Pattern and Style Guide
http://codex.wordpress.org/User:TECannon/UI_Pattern_and_Style_Guide

Creating Admin Themes
http://codex.wordpress.org/Creating_Admin_Themes

Posts Screen
http://codex.wordpress.org/Posts_Screen

WordPress.org Style Guide
http://dotorgstyleguide.wordpress.com/

Unofficial WordPress Plugin User Interface Guide
http://wpcandy.com/presents/wordpress-plugin-user-interface-guide
Contribute




     http://make.wordpress.org/ui/
Some final thoughts




      Keep it simple.
Some final thoughts
Thank you!

  Anthony Montalbano

      @italianst4

anthony@ambrdetroit.com

More Related Content

What's hot

Nanoformats
NanoformatsNanoformats
Nanoformatsrozario
 
The project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicerThe project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicerAndrei Hortúa
 
Index css history
Index css historyIndex css history
Index css historyGaejang Guk
 
Page Caching Resurrected
Page Caching ResurrectedPage Caching Resurrected
Page Caching ResurrectedBen Scofield
 
Introduction to ZendX jQuery
Introduction to ZendX jQueryIntroduction to ZendX jQuery
Introduction to ZendX jQuerydennisdc
 
Jinja2 Templates - San Francisco Flask Meetup
Jinja2 Templates - San Francisco Flask MeetupJinja2 Templates - San Francisco Flask Meetup
Jinja2 Templates - San Francisco Flask MeetupAlan Hamlett
 
Web Technology Lab files with practical
Web Technology Lab  files with practicalWeb Technology Lab  files with practical
Web Technology Lab files with practicalNitesh Dubey
 
Front-End Dev Tools
Front-End Dev ToolsFront-End Dev Tools
Front-End Dev ToolsNetguru
 
Rapid HTML Prototyping with Bootstrap - Chris Griffith
Rapid HTML Prototyping with Bootstrap - Chris GriffithRapid HTML Prototyping with Bootstrap - Chris Griffith
Rapid HTML Prototyping with Bootstrap - Chris GriffithUXPA International
 
How to create a basic template
How to create a basic templateHow to create a basic template
How to create a basic templatevathur
 
Django Admin: Widgetry & Witchery
Django Admin: Widgetry & WitcheryDjango Admin: Widgetry & Witchery
Django Admin: Widgetry & WitcheryPamela Fox
 
ActiveResource & REST
ActiveResource & RESTActiveResource & REST
ActiveResource & RESTRobbert
 
Django Templates
Django TemplatesDjango Templates
Django TemplatesWilly Liu
 

What's hot (20)

[ HackFest.pl 2012] Testing - what for and how
[ HackFest.pl 2012] Testing - what for and how[ HackFest.pl 2012] Testing - what for and how
[ HackFest.pl 2012] Testing - what for and how
 
Nanoformats
NanoformatsNanoformats
Nanoformats
 
Tercer trabajo de drapi 02
Tercer trabajo de drapi 02Tercer trabajo de drapi 02
Tercer trabajo de drapi 02
 
The project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicerThe project gutenberg e book, fairy tales from brazil, by elsie spicer
The project gutenberg e book, fairy tales from brazil, by elsie spicer
 
Index css history
Index css historyIndex css history
Index css history
 
Page Caching Resurrected
Page Caching ResurrectedPage Caching Resurrected
Page Caching Resurrected
 
Introduction to ZendX jQuery
Introduction to ZendX jQueryIntroduction to ZendX jQuery
Introduction to ZendX jQuery
 
Jinja2 Templates - San Francisco Flask Meetup
Jinja2 Templates - San Francisco Flask MeetupJinja2 Templates - San Francisco Flask Meetup
Jinja2 Templates - San Francisco Flask Meetup
 
Web Technology Lab files with practical
Web Technology Lab  files with practicalWeb Technology Lab  files with practical
Web Technology Lab files with practical
 
Test upload
Test uploadTest upload
Test upload
 
Stole16
Stole16Stole16
Stole16
 
Polymer
PolymerPolymer
Polymer
 
Coding part
Coding partCoding part
Coding part
 
The Thinking behind BEM
The Thinking behind BEMThe Thinking behind BEM
The Thinking behind BEM
 
Front-End Dev Tools
Front-End Dev ToolsFront-End Dev Tools
Front-End Dev Tools
 
Rapid HTML Prototyping with Bootstrap - Chris Griffith
Rapid HTML Prototyping with Bootstrap - Chris GriffithRapid HTML Prototyping with Bootstrap - Chris Griffith
Rapid HTML Prototyping with Bootstrap - Chris Griffith
 
How to create a basic template
How to create a basic templateHow to create a basic template
How to create a basic template
 
Django Admin: Widgetry & Witchery
Django Admin: Widgetry & WitcheryDjango Admin: Widgetry & Witchery
Django Admin: Widgetry & Witchery
 
ActiveResource & REST
ActiveResource & RESTActiveResource & REST
ActiveResource & REST
 
Django Templates
Django TemplatesDjango Templates
Django Templates
 

Similar to Your Custom WordPress Admin Pages Suck

HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2James Pearce
 
Enjoy the vue.js
Enjoy the vue.jsEnjoy the vue.js
Enjoy the vue.jsTechExeter
 
HTML5 New and Improved
HTML5   New and ImprovedHTML5   New and Improved
HTML5 New and ImprovedTimothy Fisher
 
Javascript
JavascriptJavascript
Javascripttimsplin
 
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular UJoonas Lehtinen
 
Action View Form Helpers - 1, Season 2
Action View Form Helpers - 1, Season 2Action View Form Helpers - 1, Season 2
Action View Form Helpers - 1, Season 2RORLAB
 
Caracteristicas Basicas De Htlm
Caracteristicas Basicas De HtlmCaracteristicas Basicas De Htlm
Caracteristicas Basicas De HtlmMaria S Rivera
 
Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101Ted Kulp
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentationguest5d87aa6
 
Private slideshow
Private slideshowPrivate slideshow
Private slideshowsblackman
 
Desenvolvimento web com Ruby on Rails (parte 2)
Desenvolvimento web com Ruby on Rails (parte 2)Desenvolvimento web com Ruby on Rails (parte 2)
Desenvolvimento web com Ruby on Rails (parte 2)Joao Lucas Santana
 
Django - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazosDjango - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazosIgor Sobreira
 
Implementation of GUI Framework part3
Implementation of GUI Framework part3Implementation of GUI Framework part3
Implementation of GUI Framework part3masahiroookubo
 
jQuery Mobile - Desenvolvimento para dispositivos móveis
jQuery Mobile - Desenvolvimento para dispositivos móveisjQuery Mobile - Desenvolvimento para dispositivos móveis
jQuery Mobile - Desenvolvimento para dispositivos móveisPablo Garrido
 
QCon 2015 - Thinking in components: A new paradigm for Web UI
QCon 2015 - Thinking in components: A new paradigm for Web UIQCon 2015 - Thinking in components: A new paradigm for Web UI
QCon 2015 - Thinking in components: A new paradigm for Web UIOliver Häger
 
Creating web api and consuming part 2
Creating web api and consuming part 2Creating web api and consuming part 2
Creating web api and consuming part 2Dipendra Shekhawat
 

Similar to Your Custom WordPress Admin Pages Suck (20)

HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2
 
Enjoy the vue.js
Enjoy the vue.jsEnjoy the vue.js
Enjoy the vue.js
 
HTML5 New and Improved
HTML5   New and ImprovedHTML5   New and Improved
HTML5 New and Improved
 
Javascript
JavascriptJavascript
Javascript
 
Vaadin Components @ Angular U
Vaadin Components @ Angular UVaadin Components @ Angular U
Vaadin Components @ Angular U
 
Action View Form Helpers - 1, Season 2
Action View Form Helpers - 1, Season 2Action View Form Helpers - 1, Season 2
Action View Form Helpers - 1, Season 2
 
JS-05-Handlebars.ppt
JS-05-Handlebars.pptJS-05-Handlebars.ppt
JS-05-Handlebars.ppt
 
Caracteristicas Basicas De Htlm
Caracteristicas Basicas De HtlmCaracteristicas Basicas De Htlm
Caracteristicas Basicas De Htlm
 
Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101
 
Jquery presentation
Jquery presentationJquery presentation
Jquery presentation
 
Private slideshow
Private slideshowPrivate slideshow
Private slideshow
 
Desenvolvimento web com Ruby on Rails (parte 2)
Desenvolvimento web com Ruby on Rails (parte 2)Desenvolvimento web com Ruby on Rails (parte 2)
Desenvolvimento web com Ruby on Rails (parte 2)
 
Django - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazosDjango - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazos
 
HTML5 Essentials
HTML5 EssentialsHTML5 Essentials
HTML5 Essentials
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
Implementation of GUI Framework part3
Implementation of GUI Framework part3Implementation of GUI Framework part3
Implementation of GUI Framework part3
 
jQuery Mobile - Desenvolvimento para dispositivos móveis
jQuery Mobile - Desenvolvimento para dispositivos móveisjQuery Mobile - Desenvolvimento para dispositivos móveis
jQuery Mobile - Desenvolvimento para dispositivos móveis
 
iWebkit
iWebkitiWebkit
iWebkit
 
QCon 2015 - Thinking in components: A new paradigm for Web UI
QCon 2015 - Thinking in components: A new paradigm for Web UIQCon 2015 - Thinking in components: A new paradigm for Web UI
QCon 2015 - Thinking in components: A new paradigm for Web UI
 
Creating web api and consuming part 2
Creating web api and consuming part 2Creating web api and consuming part 2
Creating web api and consuming part 2
 

More from Anthony Montalbano

7 tips to better manage client expectations
7 tips to better manage client expectations7 tips to better manage client expectations
7 tips to better manage client expectationsAnthony Montalbano
 
Building a mini-theme with WordPress REST API
Building a mini-theme with WordPress REST APIBuilding a mini-theme with WordPress REST API
Building a mini-theme with WordPress REST APIAnthony Montalbano
 
Making static sites dynamic (with WordPress yo!)
Making static sites dynamic (with WordPress yo!)Making static sites dynamic (with WordPress yo!)
Making static sites dynamic (with WordPress yo!)Anthony Montalbano
 
Building a website with WordPress
Building a website with WordPressBuilding a website with WordPress
Building a website with WordPressAnthony Montalbano
 
Getting Acclimated to WordPress
Getting Acclimated to WordPressGetting Acclimated to WordPress
Getting Acclimated to WordPressAnthony Montalbano
 
Things to think about when starting a startup
Things to think about when starting a startupThings to think about when starting a startup
Things to think about when starting a startupAnthony Montalbano
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress pluginAnthony Montalbano
 
Steve Barman - CSS and WordPress
Steve Barman - CSS and WordPressSteve Barman - CSS and WordPress
Steve Barman - CSS and WordPressAnthony Montalbano
 
The Power of WordPress Plugins
The Power of WordPress PluginsThe Power of WordPress Plugins
The Power of WordPress PluginsAnthony Montalbano
 

More from Anthony Montalbano (13)

7 tips to better manage client expectations
7 tips to better manage client expectations7 tips to better manage client expectations
7 tips to better manage client expectations
 
Building a mini-theme with WordPress REST API
Building a mini-theme with WordPress REST APIBuilding a mini-theme with WordPress REST API
Building a mini-theme with WordPress REST API
 
How to Execute Your Idea (v2)
How to Execute Your Idea (v2)How to Execute Your Idea (v2)
How to Execute Your Idea (v2)
 
Making static sites dynamic (with WordPress yo!)
Making static sites dynamic (with WordPress yo!)Making static sites dynamic (with WordPress yo!)
Making static sites dynamic (with WordPress yo!)
 
WordPress REST API
WordPress REST APIWordPress REST API
WordPress REST API
 
Building a website with WordPress
Building a website with WordPressBuilding a website with WordPress
Building a website with WordPress
 
Getting Acclimated to WordPress
Getting Acclimated to WordPressGetting Acclimated to WordPress
Getting Acclimated to WordPress
 
How to Execute your Idea
How to Execute your IdeaHow to Execute your Idea
How to Execute your Idea
 
The wp config.php
The wp config.phpThe wp config.php
The wp config.php
 
Things to think about when starting a startup
Things to think about when starting a startupThings to think about when starting a startup
Things to think about when starting a startup
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
 
Steve Barman - CSS and WordPress
Steve Barman - CSS and WordPressSteve Barman - CSS and WordPress
Steve Barman - CSS and WordPress
 
The Power of WordPress Plugins
The Power of WordPress PluginsThe Power of WordPress Plugins
The Power of WordPress Plugins
 

Recently uploaded

Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 

Recently uploaded (20)

Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 

Your Custom WordPress Admin Pages Suck

  • 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
  • 3. What are you talking about?!
  • 4. What are you talking about?!
  • 5. What are you talking about?!
  • 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
  • 9. Be a Good Guy Greg!
  • 10. The WordPress Admin It's in the details...
  • 16. Locating your admin page ● Navbar ● Toolbar ● Dashboard ● Post Edit ● Widgets ● Default Admin Pages ● Plugins Page
  • 18. Wrap it up! <div class="wrap"> <!-- MAGIC GOES HERE -- > </div>
  • 19. Admin UI Basics <div class="wrap"> <h1>WordCamp Detroit</h1> <div id="icon-users" class="icon32"></div> <h2>WordCamp Detroit</h2> <h3>WordCamp Detroit</h3> <h4>WordCamp Detroit</h4> <span>I will make better admin UIs</span> <br/><br/> <code>jQuery('#badUI').remove();</code> </div>
  • 20. Buttons <div class="wrap"> <input class="button-primary" value="<?php _e('Save Options'); ?>" type="button" /> <br /><br /> <input class="button-secondary" value="<?php _e('Empty Trash'); ?>" type="button" /> <br /><br /> <a href="#" class="button-secondary">Don't click me</a> </div>
  • 21. Notices <div class="wrap"> <div class="updated"><p>Settings are saved!</p></div> <div class="error"><p>Oh no, it failed</p></div> </div>
  • 22. Forms
  • 23. Forms (continued) <div class="wrap"> <form method="POST" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> <table class="form-table"> <tr valign="top"> <th scope="row"> <label for="name">Name<span> *</span></label> </th> <td> <input id="name" maxlength="45" size="10" name="name" value="" type="text" /> <p class="description">What do they call you?</p> </td> </tr> <tr valign="top"> <th scope="row"> <label for="gender">Gender<span> *</span></label> </th> <td> <select id="gender" name="gender"> <option value="male">Male<option> <option value="female">Female<option> </select> </td> </tr>
  • 24. Forms (continued, again) <tr valign="top"> <th scope="row"> <label for="aboutyou">About You</label> </th> <td> <textarea id="aboutyou"></textarea> </td> </tr> <tr valign="top"> <th scope="row"> <label for="awesome">Are you awesome?</label> </th> <td> <fieldset> <label for="awesome"> <input id="awesome" name="awesome" value="" type="checkbox" value="1" /> Umm, yeah! </label> </fieldset> </td> </tr>
  • 25. Forms (continued, and again) <tr> <th scope="row"> <label for="color">Color</label> </th> <td> <fieldset> <legend class="screen-reader-text"><span>Date Format</span></legend> <label title="red"> <input type="radio" name="color" value="red" checked=" checked"> <span>Red</span> </label><br> <label title="blue"> <input type="radio" name="color" value="blue"> <span>Blue</span> </label><br> <label title="green"> <input type="radio" name="color" value="green"> <span>Green</span> </label><br> </fieldset> </table> </form> </div>
  • 26. Tabs <div class="wrap"> <h2 class="nav-tab-wrapper"> Just Some Tabs <a href="#" class="nav-tab nav-tab-active">Tab 1</a> <a href="#" class="nav-tab">Tab 2</a> </h2> </div>
  • 27. Static Tables <div class="wrap"> <table class="widefat"> <thead><tr> <th>Name</th> <th>Email</th> </tr></thead> <tfoot><tr> <th>Name</th> <th>Email</th> </tr></tfoot> <tbody><tr> <td>Anthony Montalbano</td> <td>anthony@ambrdetroit.com</td> </tr></tbody> </table> </div>
  • 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/
  • 32. Pagination <div class="wrap"> <div class="tablenav"> <?php $posts_per_page = 15; $num_of_records = 500; $page_links = paginate_links( array( 'base' => add_query_arg( 'paged', '%#%' ), 'format' => '', 'prev_text' => __('&laquo;'), 'next_text' => __('&raquo;'), 'total' => ceil($num_of_records/$posts_per_page), 'current' => $_GET['paged'] ));
  • 33. Pagination (continued) if ( $page_links ) { ?> <div class="tablenav-pages"> <?php echo sprintf( '<span class="displaying-num" >' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s', number_format_i18n( ( $_GET['paged'] - 1 ) * $posts_per_page + 1 ), number_format_i18n( min( $_GET['paged'] * $posts_per_page, $num_of_records ) ), number_format_i18n( $num_of_records ), $page_links ); ?> </div> <?php } ?> </div> </div> http://codex.wordpress.org/Function_Reference/paginate_links
  • 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/
  • 36. Data Retention Maybe we should save that...
  • 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
  • 41. Explore more It's only just begun...
  • 42. Admin UI Reference Plugin Download the plugin here: https://github.com/bueltge/WordPress-Admin-Style
  • 43. Additional Sources UI Pattern and Style Guide http://codex.wordpress.org/User:TECannon/UI_Pattern_and_Style_Guide Creating Admin Themes http://codex.wordpress.org/Creating_Admin_Themes Posts Screen http://codex.wordpress.org/Posts_Screen WordPress.org Style Guide http://dotorgstyleguide.wordpress.com/ Unofficial WordPress Plugin User Interface Guide http://wpcandy.com/presents/wordpress-plugin-user-interface-guide
  • 44. Contribute http://make.wordpress.org/ui/
  • 45. Some final thoughts Keep it simple.
  • 47. Thank you! Anthony Montalbano @italianst4 anthony@ambrdetroit.com