• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Manage custom options pages in Wordpress
 

Manage custom options pages in Wordpress

on

  • 1,814 views

How to create a custom Theme Options in your Wordpress Theme. Wordcamp 2013, Bologna, Italy.

How to create a custom Theme Options in your Wordpress Theme. Wordcamp 2013, Bologna, Italy.

Statistics

Views

Total Views
1,814
Views on SlideShare
1,636
Embed Views
178

Actions

Likes
4
Downloads
30
Comments
0

4 Embeds 178

http://www.wpcon.it 170
http://2013.bologna.wordcamp.org 6
http://www.layout1966.it 1
https://www.google.it 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Manage custom options pages in Wordpress Manage custom options pages in Wordpress Presentation Transcript

    • Manage custom options pages in Wordpress SIMONE D’AMICO WORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • RELATORE Simone D’Amico Web: simonedamico.com Twitter: @dymissy Facebook: dymissyBIOWeb Developer by vocation. Team Leader at Your Inspiration. Blogger.He loves everything that revolves around the user experience and webdevelopment, with a focus on jQuery and Wordpress. Furthermore he writes forvarious Italian online magazines such as Html.it and Your Inspiration Web orinternational blogs as webexpedition18.com and webification.WORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • WORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • THEME OPTIONS IN WORDPRESSWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • THEME OPTIONS IN WORDPRESSWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • WHY SHOULD I USE A THEME OPTIONS? • Improve customer experience • Don’t reinvent the wheel • Higher maintainable code • …and much more!WORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • OPTIONS APIWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • OPTIONS API • Way of storing data in your Wordpress installation • Easy way to use, access, update and delete options • Stored in wp_options table Add / Delete Options Get / Update Options • add_option() • get_option() • delete_option() • update_option() • add_site_option() • get_site_option() • delete_site_option() • update_site_option()WORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • OPTIONS APIWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • SETTINGS APIWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • SETTINGS API• First added in Wordpress2.7• Allows admin pagescontaining settings forms• Lets you define sectionswithin settings pages andfields within each sectionWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • SETTINGS API Setting Register/Unregister Add Field/Section • register_setting() • add_settings_field() • unregister_setting() • add_settings_section() Options Form Rendering Errors • settings_fields() • add_settings_error() • do_settings_sections() • get_settings_errors() • do_settings_fields() • settings_errors()WORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • SETTINGS API: A CONCRETE EXAMPLEWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • SETTINGS API: A CONCRETE EXAMPLE 1. Register the settingsWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • SETTINGS API: A CONCRETE EXAMPLE 2. Add a new submenu page in Wordpress admin areaWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • SETTINGS API: A CONCRETE EXAMPLE 3. Print the Theme Options pageWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • SETTINGS API: A CONCRETE EXAMPLE 3. Print the Theme Options pageWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • SETTINGS API: A CONCRETE EXAMPLE 4. Add new sectionsWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • SETTINGS API: A CONCRETE EXAMPLE 4. Add new sectionsWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • SETTINGS API: A CONCRETE EXAMPLE 5. Add fields to the sectionWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • SETTINGS API: A CONCRETE EXAMPLE 5. Add fields to the sectionWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • SETTINGS API: A CONCRETE EXAMPLE Let’s take a look to the final result!WORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • SETTINGS API: A CONCRETE EXAMPLE Example is available under GPL 2.0 license at: http://j.mp/WTBb4QWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • OPTIONS FRAMEWORK THEMEWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • ADVANCED THEME OPTIONS EXAMPLEWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • OPTIONS FRAMEWORK THEME • Do we really need to code from scratch the Theme Options? • Options Framework Theme could do that for us! • The Options Framework Theme makes it easy to include a full featured options panel in any WordPress theme. • It’s a bundled version of the Options Framework Plugin for those folks who want to build the options directly into the theme. • Released under GPL 2.0 license • https://github.com/devinsays/options-framework-themeWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • OPTIONS FRAMEWORK THEMEWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • OPTIONS FRAMEWORK THEMEWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • ANY QUESTIONS?WORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13
    • ThanksSIMONE D’AMICOWORDCAMP BOLOGNA - 9 FEBBRAIO 2013 @WORDCAMPBOLOGNA # WPCAMPBO13