SlideShare a Scribd company logo
1 of 22
Download to read offline
CUSTOMISING
WORDPRESS’
ADMIN PANEL

#wcgva
Hello! I’m
Jesper van Engelen.
Plugin developer
Core contributor
WP translator
AdminColumns.com
WP developer
We’re lucky to be
in WordPress
#wcgva @jesperengelen
WORDPRESS POWERS 47,847,425 WEBSITES
13%
16%
18%
22%
24%
26%
2011 2012 2013 2014 2015 2016
(give or take)
SO WHY IS THE
BACKEND ALWAYS
SO DARN UGLY?
What have
you done to
my beautiful
WordPress?
Let’s clean
wp-admin
#wcgva @jesperengelen
1.
The Menu (API)
Keep what you need,
discard what you don’t
3 plugins
“
Why do it yourself if somebody has
already done it for you?
Or simply do it yourself: The Menu API
add_menu_page( [..] )
add_submenu_page( [..] )
Add
remove_menu_page( $slug )
remove_submenu_page( $slug )
Remove
WHAT’S A
SLUG?
Removing menu items
add_action( 'admin_menu', 'myplugin_clean_menu' );
function myplugin_clean_menu() {
// Default menu items
remove_menu_page( 'options-general.php' );
remove_menu_page( 'tools.php' );
remove_menu_page( 'edit-comments.php' );
remove_menu_page( 'edit.php' );
remove_menu_page( 'themes.php' );
// Plugin menu items
remove_menu_page( 'wpseo_dashboard' );
}
Old New
2.
The Columns (API)
Display information that is
relevant to your content
THE
PROBLEM
2 plugins
“
Why do it yourself if somebody has
already done it for you?
The Columns API
Add and remove columns
add_filter( 'manage_[post_type]_posts_columns', 'mp_columns' );
function mp_columns( $columns ) {
/* Add or remove columns here */
return $columns;
}
Create column content
add_action( 'manage_[post_type]_custom_column', 'mp_column_rent' );
function mp_column_rent( $column, $post_id ) {
/* Output content for columns */
}
The Columns API
Add and remove columns
add_filter( 'manage_[post_type]_posts_columns', 'mp_columns' );
function mp_columns( $columns ) {
/* Add or remove columns here */
return $columns;
}
Create column content
add_action( 'manage_[post_type]_custom_column', 'mp_column_rent' );
function mp_column_rent( $column, $post_id ) {
/* Output content for columns */
}
Add and remove columnsReal Estate:
add_filter( 'manage_realestate_posts_columns', 'mp_columns', 100 );
function mp_columns( $columns ) {
// Remove existing columns
unset( $columns['date'] );
unset( $columns['wpseo-score'] );
unset( $columns['wpseo-score-readability'] );
// Add new column)
$columns = array_slice( $columns, 0, 1, true )
+ array( 'image' => __( 'Image' ) )
+ array_slice( $columns, 1, NULL, true )
+ array( 'rent' => __( 'Rent' ) );
return $columns;
}
add_action( 'manage_realestate_posts_custom_column', 'mp_column', 10, 2 );
function mp_column( $column, $post_id ) {
// Image column
if ( $column == 'image' ) {
echo get_the_post_thumbnail( $post_id, array(80,80) );
}
// Monthly rent column
if ( $column == 'rent' ) {
$rent = get_post_meta( $post_id, 'rent', true );
if ( ! $rent ) {
_e( 'n/a' );
} else {
echo number_format( $rent, 0, '.', ',' ) . ' CHF';
}
}
}
Add column contentReal Estate:
Old New
OH YEAH!
THANKS!
Any questions?
…or talk to me on Twitter @jesperengelen

More Related Content

What's hot

Mysql Aggregate
Mysql AggregateMysql Aggregate
Mysql Aggregate
lotlot
 
Who Needs Ruby When You've Got CodeIgniter
Who Needs Ruby When You've Got CodeIgniterWho Needs Ruby When You've Got CodeIgniter
Who Needs Ruby When You've Got CodeIgniter
ciconf
 

What's hot (19)

Oop php 5
Oop php 5Oop php 5
Oop php 5
 
HTML::FormHandler
HTML::FormHandlerHTML::FormHandler
HTML::FormHandler
 
Paypal + symfony
Paypal + symfonyPaypal + symfony
Paypal + symfony
 
Mysql Aggregate
Mysql AggregateMysql Aggregate
Mysql Aggregate
 
Image manipulation in WordPress 3.5
Image manipulation in WordPress 3.5Image manipulation in WordPress 3.5
Image manipulation in WordPress 3.5
 
Web development today
Web development todayWeb development today
Web development today
 
Андрей Юртаев - Improve theming with (Twitter) Bootstrap
Андрей Юртаев - Improve theming with (Twitter) BootstrapАндрей Юртаев - Improve theming with (Twitter) Bootstrap
Андрей Юртаев - Improve theming with (Twitter) Bootstrap
 
Type Systems & Props Design - Exploring PropTypes, TypeScript, Flow & Reason
Type Systems & Props Design - Exploring PropTypes, TypeScript, Flow & ReasonType Systems & Props Design - Exploring PropTypes, TypeScript, Flow & Reason
Type Systems & Props Design - Exploring PropTypes, TypeScript, Flow & Reason
 
Print function in PHP
Print function in PHPPrint function in PHP
Print function in PHP
 
Who Needs Ruby When You've Got CodeIgniter
Who Needs Ruby When You've Got CodeIgniterWho Needs Ruby When You've Got CodeIgniter
Who Needs Ruby When You've Got CodeIgniter
 
Building Dynamic Navigation in your Rails 4 Layout
Building Dynamic Navigation in your Rails 4 LayoutBuilding Dynamic Navigation in your Rails 4 Layout
Building Dynamic Navigation in your Rails 4 Layout
 
symfony & jQuery (phpDay)
symfony & jQuery (phpDay)symfony & jQuery (phpDay)
symfony & jQuery (phpDay)
 
Codigo taller-plugins
Codigo taller-pluginsCodigo taller-plugins
Codigo taller-plugins
 
mondrian-olap JRuby library
mondrian-olap JRuby librarymondrian-olap JRuby library
mondrian-olap JRuby library
 
WooCommerce filters
WooCommerce filtersWooCommerce filters
WooCommerce filters
 
WordCamp Raleigh 2015 - So You Want to Build and Release a Plugin
WordCamp Raleigh 2015 - So You Want to Build and Release a PluginWordCamp Raleigh 2015 - So You Want to Build and Release a Plugin
WordCamp Raleigh 2015 - So You Want to Build and Release a Plugin
 
Ruby Metaprogramming
Ruby MetaprogrammingRuby Metaprogramming
Ruby Metaprogramming
 
DB API Usage - How to write DBAL compliant code
DB API Usage - How to write DBAL compliant codeDB API Usage - How to write DBAL compliant code
DB API Usage - How to write DBAL compliant code
 
$.Template
$.Template$.Template
$.Template
 

Similar to WordCamp Geneva Presentation - Customising WordPress' Admin Panel - 19 Nov. 2016

10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
arcware
 
Avinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPressAvinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPress
wpnepal
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Paulo Ragonha
 

Similar to WordCamp Geneva Presentation - Customising WordPress' Admin Panel - 19 Nov. 2016 (20)

Keeping It Simple
Keeping It SimpleKeeping It Simple
Keeping It Simple
 
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
10 Things Every Plugin Developer Should Know (WordCamp Atlanta 2013)
 
WordPress as a Content Management System
WordPress as a Content Management SystemWordPress as a Content Management System
WordPress as a Content Management System
 
Avinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPressAvinash Kundaliya: Javascript and WordPress
Avinash Kundaliya: Javascript and WordPress
 
Amp Up Your Admin
Amp Up Your AdminAmp Up Your Admin
Amp Up Your Admin
 
WordPress plugin #3
WordPress plugin #3WordPress plugin #3
WordPress plugin #3
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven Development
 
Gutenberg sous le capot, modules réutilisables
Gutenberg sous le capot, modules réutilisablesGutenberg sous le capot, modules réutilisables
Gutenberg sous le capot, modules réutilisables
 
Say Goodbye to Procedural Programming - Nick Sutterer
Say Goodbye to Procedural Programming - Nick SuttererSay Goodbye to Procedural Programming - Nick Sutterer
Say Goodbye to Procedural Programming - Nick Sutterer
 
Empowering users: modifying the admin experience
Empowering users: modifying the admin experienceEmpowering users: modifying the admin experience
Empowering users: modifying the admin experience
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
Building Large jQuery Applications
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery Applications
 
Advanced jQuery
Advanced jQueryAdvanced jQuery
Advanced jQuery
 
Msql
Msql Msql
Msql
 
Drupal Menu System
Drupal Menu SystemDrupal Menu System
Drupal Menu System
 
DRUPAL Menu System
DRUPAL Menu SystemDRUPAL Menu System
DRUPAL Menu System
 
Django quickstart
Django quickstartDjango quickstart
Django quickstart
 
Using and reusing CakePHP plugins
Using and reusing CakePHP pluginsUsing and reusing CakePHP plugins
Using and reusing CakePHP plugins
 
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptjQuery & 10,000 Global Functions: Working with Legacy JavaScript
jQuery & 10,000 Global Functions: Working with Legacy JavaScript
 

Recently uploaded

%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Recently uploaded (20)

8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 

WordCamp Geneva Presentation - Customising WordPress' Admin Panel - 19 Nov. 2016

  • 2. Hello! I’m Jesper van Engelen. Plugin developer Core contributor WP translator AdminColumns.com WP developer
  • 3. We’re lucky to be in WordPress #wcgva @jesperengelen
  • 4. WORDPRESS POWERS 47,847,425 WEBSITES 13% 16% 18% 22% 24% 26% 2011 2012 2013 2014 2015 2016 (give or take)
  • 5. SO WHY IS THE BACKEND ALWAYS SO DARN UGLY?
  • 6. What have you done to my beautiful WordPress?
  • 8. 1. The Menu (API) Keep what you need, discard what you don’t
  • 9. 3 plugins “ Why do it yourself if somebody has already done it for you?
  • 10. Or simply do it yourself: The Menu API add_menu_page( [..] ) add_submenu_page( [..] ) Add remove_menu_page( $slug ) remove_submenu_page( $slug ) Remove
  • 12. Removing menu items add_action( 'admin_menu', 'myplugin_clean_menu' ); function myplugin_clean_menu() { // Default menu items remove_menu_page( 'options-general.php' ); remove_menu_page( 'tools.php' ); remove_menu_page( 'edit-comments.php' ); remove_menu_page( 'edit.php' ); remove_menu_page( 'themes.php' ); // Plugin menu items remove_menu_page( 'wpseo_dashboard' ); }
  • 14. 2. The Columns (API) Display information that is relevant to your content
  • 16. 2 plugins “ Why do it yourself if somebody has already done it for you?
  • 17. The Columns API Add and remove columns add_filter( 'manage_[post_type]_posts_columns', 'mp_columns' ); function mp_columns( $columns ) { /* Add or remove columns here */ return $columns; } Create column content add_action( 'manage_[post_type]_custom_column', 'mp_column_rent' ); function mp_column_rent( $column, $post_id ) { /* Output content for columns */ }
  • 18. The Columns API Add and remove columns add_filter( 'manage_[post_type]_posts_columns', 'mp_columns' ); function mp_columns( $columns ) { /* Add or remove columns here */ return $columns; } Create column content add_action( 'manage_[post_type]_custom_column', 'mp_column_rent' ); function mp_column_rent( $column, $post_id ) { /* Output content for columns */ }
  • 19. Add and remove columnsReal Estate: add_filter( 'manage_realestate_posts_columns', 'mp_columns', 100 ); function mp_columns( $columns ) { // Remove existing columns unset( $columns['date'] ); unset( $columns['wpseo-score'] ); unset( $columns['wpseo-score-readability'] ); // Add new column) $columns = array_slice( $columns, 0, 1, true ) + array( 'image' => __( 'Image' ) ) + array_slice( $columns, 1, NULL, true ) + array( 'rent' => __( 'Rent' ) ); return $columns; }
  • 20. add_action( 'manage_realestate_posts_custom_column', 'mp_column', 10, 2 ); function mp_column( $column, $post_id ) { // Image column if ( $column == 'image' ) { echo get_the_post_thumbnail( $post_id, array(80,80) ); } // Monthly rent column if ( $column == 'rent' ) { $rent = get_post_meta( $post_id, 'rent', true ); if ( ! $rent ) { _e( 'n/a' ); } else { echo number_format( $rent, 0, '.', ',' ) . ' CHF'; } } } Add column contentReal Estate:
  • 22. THANKS! Any questions? …or talk to me on Twitter @jesperengelen