Plugin Options

436 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
436
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Plugin Options

  1. 1. Theme options. When the consumer just needs that little bit more customisation to make themselves feel accomplished.
  2. 2. 4 essential components. • Variables • Form action and setup • Form code • wp-admin menu hook • ??? • PROFIT!!!
  3. 3. Variables • $options is an array that stores your options in elements. • Each option needs at least 3 attributes: ‘name’, ‘id’, and ‘type’. • Optional attributes are ‘desc’, ‘std’, ‘options’
  4. 4. Form action and setup • theme_add_admin() • Saves, resets, and deletes options in the database • gets form code from following function and prepares it for wp-admin
  5. 5. Form code • theme_admin() • all the code seen on wp- admin is here • switch() creates fields • form save and reset
  6. 6. wp-admin menu hook • add_action() • admin_menu • theme_add_admin
  7. 7. Just how cool does it get?
  8. 8. Code can be found at baffleinc.com/wordcampnz
  9. 9. Stellar • 100% no-frills free! (I’m not even gonna charge you for child-themes!) • Utilises theme options • CMS/blog • 100% CSS themeable
  10. 10. Harley Alexander ★ baffleinc.com ★ twitter.com/baffleinc ★ baffleinc@gmail.com

×