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

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Recently uploaded (20)

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
 
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...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
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
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 

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