SlideShare a Scribd company logo
Creating Customizable
Widgets for
Unpredictable Needs
Amanda Giles
http://bit.ly/boswp1115
WordPress Boston – Nov 30, 2015 - #BostonWP
Who am I?
• Independent IT Consultant
• WordPress Developer (Themes and Plugins)
• Run the Seacoast NH WordPress Meetup
• Lover
• Fighter
• Sneezer
• Teacher / Trainer
• My favorite quote is from Calvin & Hobbes:
“Virtue isn’t better than vice, it’s just different.
http://bit.ly/boswp1115
And I have cats!
http://bit.ly/boswp1115
Information Gathering…
• Who here has used a widget?
• Who here has created a widget?
• Who has lost hours trying widget after widget
to find the “right” one?
http://bit.ly/boswp1115
Who is this talk geared towards?
Developers
http://bit.ly/boswp1115
But what if I’m not a
developer?
http://bit.ly/boswp1115
http://bit.ly/boswp1115
Why you should stay
(even if you’re not a developer)
• Might convince a plugin developer to modify a
widget to address your needs
• Might find a widget that’s close to your needs
and hire someone to modify it
• Might decide to roll up your sleeves and try your
hand at coding
http://bit.ly/boswp1115
What is a widget?
• A way to take [inputted] criteria from a WordPress user
and convert that to into output for a website visitor.
• Drag and Drop widgets into widget areas under
Appearance > Widgets
• Collect input [criteria] from user via a form
• When website is viewed, content is displayed to a
website visitor
http://bit.ly/boswp1115
Widget Examples
http://bit.ly/boswp1115
Why create your own widgets?
http://bit.ly/boswp1115
But seriously…
Creating widgets is a way to control
the content of what's being presented
while giving the user choices about
that content, its presentation, and its
location.
http://bit.ly/boswp1115
How do we do this?
For Users:
Anticipate what choices or variations
the user might want
For Developers:
Offer ways to adjust the
output where feasible
http://bit.ly/boswp1115
What does that mean?
For Users:
Anticipate what choices or variations
the user might want
• Offer choices to filter the content shown
• Offer choices about how that content is shown
• Offer style choices
• Provide basic clean styling or no styling
http://bit.ly/boswp1115
What does that mean?
For Developers:
Offer ways to adjust the
output where feasible
• Be sure to tag output elements with id/class so
styles can be easily overridden
• Use hooks to allow filtering of output (for
developers)
http://bit.ly/boswp1115
Anatomy of a widget
1. Declaration/Construct
Tell WordPress some information about your widget and how to identify it
2. User Interface / Form
Define the form that will gather user's choices about the widget instance
3. Update/Save Logic
Save the user's choices about the widget instance
4. Widget/Output Logic
Display the widget instance to the website visitor
5. Register the Widget
Tell WordPress to register your widget and include it on the
Appearance > Widgets page
http://bit.ly/boswp1115
Widget Code Structure
1. Declaration/Construct
2. User Interface / Form
3. Update/Save Logic
4. Widget/Output Logic
5. Register Widget using Widget Name
0. Widget Name & “extends WP_Widget”
http://bit.ly/boswp1115
“Show Posts” widget
We’re going to look at a widget that displays posts.
Our first pass, we’ll focus on the basic user choices:
• Specify Widget Title (or not)
• Choose one or more specific post IDs
• Choose post type (post, page, custom post types)
• Choose # of posts to show
• Choose what to sort by
• Choose the sort order (ascending, descending)
• Choose whether to show the post thumbnail/featured image
• Choose whether to display the full post content or excerpt
http://bit.ly/boswp1115
On to the coding!
http://bit.ly/boswp1115
Second Pass
On our second pass through the widget we will
add the following touches to flush it out further:
• Add CSS for the widget output on website
• Add CSS for the Admin User Interface/Form
• Place hooks to allow filtering on several
elements
http://bit.ly/boswp1115
What is a hook?
A hook is an "event" which allows for additional
code to be run when it occurs.
One or more functions can be associated with a
hook and they will all run when the hook is
triggered.
http://bit.ly/boswp1115
Why use hooks?
Hooks are placed within WordPress core, plugins,
and themes to allow customization by developers
without direct edits of the code.
Hooks are the proper way to alter the default
behavior of code which is not yours to edit.
http://bit.ly/boswp1115
Types of hooks
Action hooks allow you to run code at a certain
point within the code.
Examples in WP core include initialization, before
main query is run, header or footer of a page/post.
Filter hooks allow you to alter data, content,
parameters. A filter hook is passed information to
filter and returns it altered (or not).
Examples in WP code include displaying content,
page/post title, pre-saving content (admin).
http://bit.ly/boswp1115
http://bit.ly/boswp1115
Questions?
http://bit.ly/boswp1115
Thank You!
Find these slides and all related files at:
http://bit.ly/boswp1115
www.AmandaGiles.com
@AmandaGilesNH on Twitter
amanda@amandagiles.com
Please feel free to send me feedback or questions

More Related Content

What's hot

Rebrand WordPress Admin
Rebrand WordPress AdminRebrand WordPress Admin
Rebrand WordPress Admin
Chandra Prakash Thapa
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themesrfair404
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1Yoav Farhi
 
WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...Denise Williams
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structure
keithdevon
 
Becoming a better WordPress Developer
Becoming a better WordPress DeveloperBecoming a better WordPress Developer
Becoming a better WordPress Developer
Joey Kudish
 
Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp MontrealCustom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp Montreal
Joey Kudish
 
Theming Wordpress with Adobe
Theming Wordpress with AdobeTheming Wordpress with Adobe
Theming Wordpress with Adobe
Grace Solivan
 
Introduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentIntroduction to WordPress Theme Development
Introduction to WordPress Theme Development
Sitdhibong Laokok
 
Introduction to Custom WordPress Themeing
Introduction to Custom WordPress ThemeingIntroduction to Custom WordPress Themeing
Introduction to Custom WordPress Themeing
Jamie Schmid
 
Theming 101
Theming 101Theming 101
Theming 101
WinnipegWordcamp
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012Joe Querin
 
How to Prepare a WordPress Theme for Public Release
How to Prepare a WordPress Theme for Public ReleaseHow to Prepare a WordPress Theme for Public Release
How to Prepare a WordPress Theme for Public Release
David Yeiser
 
What is (not) WordPress
What is (not) WordPressWhat is (not) WordPress
What is (not) WordPress
Nikolay Bachiyski
 
The Future Of WordPress Presentation
The Future Of WordPress PresentationThe Future Of WordPress Presentation
The Future Of WordPress Presentation
Dougal Campbell
 
WordPress Theme Development
WordPress Theme DevelopmentWordPress Theme Development
WordPress Theme Development
WisdmLabs
 
WordPress Custom Post Types
WordPress Custom Post TypesWordPress Custom Post Types
WordPress Custom Post Types
Nile Flores
 
WordCamp Boston 2012 - Creating Content With Shortcodes
WordCamp Boston 2012 - Creating Content With ShortcodesWordCamp Boston 2012 - Creating Content With Shortcodes
WordCamp Boston 2012 - Creating Content With Shortcodes
Jon Bishop
 
WordPress plugins
WordPress pluginsWordPress plugins
WordPress plugins
Christopher Ross
 

What's hot (20)

Rebrand WordPress Admin
Rebrand WordPress AdminRebrand WordPress Admin
Rebrand WordPress Admin
 
WordPress Child Themes
WordPress Child ThemesWordPress Child Themes
WordPress Child Themes
 
WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1WordPress Developers Israel Meetup #1
WordPress Developers Israel Meetup #1
 
WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...WordPress Custom Fields: Control your content presentation by breaking out of...
WordPress Custom Fields: Control your content presentation by breaking out of...
 
WordPress Theme Structure
WordPress Theme StructureWordPress Theme Structure
WordPress Theme Structure
 
Seven deadly theming sins
Seven deadly theming sinsSeven deadly theming sins
Seven deadly theming sins
 
Becoming a better WordPress Developer
Becoming a better WordPress DeveloperBecoming a better WordPress Developer
Becoming a better WordPress Developer
 
Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp MontrealCustom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp Montreal
 
Theming Wordpress with Adobe
Theming Wordpress with AdobeTheming Wordpress with Adobe
Theming Wordpress with Adobe
 
Introduction to WordPress Theme Development
Introduction to WordPress Theme DevelopmentIntroduction to WordPress Theme Development
Introduction to WordPress Theme Development
 
Introduction to Custom WordPress Themeing
Introduction to Custom WordPress ThemeingIntroduction to Custom WordPress Themeing
Introduction to Custom WordPress Themeing
 
Theming 101
Theming 101Theming 101
Theming 101
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012
 
How to Prepare a WordPress Theme for Public Release
How to Prepare a WordPress Theme for Public ReleaseHow to Prepare a WordPress Theme for Public Release
How to Prepare a WordPress Theme for Public Release
 
What is (not) WordPress
What is (not) WordPressWhat is (not) WordPress
What is (not) WordPress
 
The Future Of WordPress Presentation
The Future Of WordPress PresentationThe Future Of WordPress Presentation
The Future Of WordPress Presentation
 
WordPress Theme Development
WordPress Theme DevelopmentWordPress Theme Development
WordPress Theme Development
 
WordPress Custom Post Types
WordPress Custom Post TypesWordPress Custom Post Types
WordPress Custom Post Types
 
WordCamp Boston 2012 - Creating Content With Shortcodes
WordCamp Boston 2012 - Creating Content With ShortcodesWordCamp Boston 2012 - Creating Content With Shortcodes
WordCamp Boston 2012 - Creating Content With Shortcodes
 
WordPress plugins
WordPress pluginsWordPress plugins
WordPress plugins
 

Similar to Creating Customizable Widgets for Unpredictable Needs

Technical SEO for WordPress Developers, Designers and Webmasters
Technical SEO for WordPress Developers, Designers and WebmastersTechnical SEO for WordPress Developers, Designers and Webmasters
Technical SEO for WordPress Developers, Designers and Webmasters
Henry Visotski
 
Should you use WordPress for your non-profit websites?
Should you use WordPress for your non-profit websites?Should you use WordPress for your non-profit websites?
Should you use WordPress for your non-profit websites?
Bethany Siegler
 
WordPress Workshop with Tadpole, SATW 2013 Conference
WordPress Workshop with Tadpole, SATW 2013 ConferenceWordPress Workshop with Tadpole, SATW 2013 Conference
WordPress Workshop with Tadpole, SATW 2013 Conference
Tadpole Collective
 
HTML Purifier, WYSIWYG, and TinyMCE
HTML Purifier, WYSIWYG, and TinyMCEHTML Purifier, WYSIWYG, and TinyMCE
HTML Purifier, WYSIWYG, and TinyMCE
cgmonroe
 
How to deliver a WordPress website to your client ...the RIGHT way
How to deliver a WordPress website to your client ...the RIGHT wayHow to deliver a WordPress website to your client ...the RIGHT way
How to deliver a WordPress website to your client ...the RIGHT way
Cath Hughes
 
WordPress Complete Tutorial
WordPress Complete TutorialWordPress Complete Tutorial
WordPress Complete Tutorial
OpenSource Technologies Pvt. Ltd.
 
Creating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsCreating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable Needs
Amanda Giles
 
A word press site even your mother can use
A word press site even your mother can useA word press site even your mother can use
A word press site even your mother can use
Jerrett Farmer
 
A word press site even your mother can use
A word press site even your mother can useA word press site even your mother can use
A word press site even your mother can use
InMotion Hosting
 
A word press site even your mother can use
A word press site even your mother can useA word press site even your mother can use
A word press site even your mother can use
Jerrett Farmer
 
How To Get Started After Installing Wordpress ( Wordcamp, Delhi )
How To Get Started After Installing Wordpress ( Wordcamp, Delhi )How To Get Started After Installing Wordpress ( Wordcamp, Delhi )
How To Get Started After Installing Wordpress ( Wordcamp, Delhi )
abhim12
 
WordPress Plugins to add style to your website
WordPress Plugins to add style to your websiteWordPress Plugins to add style to your website
WordPress Plugins to add style to your website
Belinda Johnstone
 
Wordpress Shortcode
Wordpress ShortcodeWordpress Shortcode
Wordpress Shortcode
Binh Dang Ngoc
 
Developing Blocks without React - Attributes.pptx
Developing Blocks without React - Attributes.pptxDeveloping Blocks without React - Attributes.pptx
Developing Blocks without React - Attributes.pptx
Jonathan Bossenger
 
How to build a Project Hub with Hubsites and Sitedesign and Sitescripts
How to build a Project Hub with Hubsites and Sitedesign and Sitescripts How to build a Project Hub with Hubsites and Sitedesign and Sitescripts
How to build a Project Hub with Hubsites and Sitedesign and Sitescripts
Knut Relbe-Moe [MVP, MCT]
 
Maintaining Retainers as a WordPress Developer
Maintaining Retainers as a WordPress DeveloperMaintaining Retainers as a WordPress Developer
Maintaining Retainers as a WordPress Developer
DevinVinson
 
WordPress Basics
WordPress BasicsWordPress Basics
WordPress Basics
Doug Fisher
 
MA Magazines: City Uni - Further Wordpress customisations, process and plugin...
MA Magazines: City Uni - Further Wordpress customisations, process and plugin...MA Magazines: City Uni - Further Wordpress customisations, process and plugin...
MA Magazines: City Uni - Further Wordpress customisations, process and plugin...
Dan Davies
 
Salesforce CI (Continuous Integration) - SFDX + Bitbucket Pipelines
Salesforce CI (Continuous Integration) - SFDX + Bitbucket PipelinesSalesforce CI (Continuous Integration) - SFDX + Bitbucket Pipelines
Salesforce CI (Continuous Integration) - SFDX + Bitbucket Pipelines
Abhinav Gupta
 

Similar to Creating Customizable Widgets for Unpredictable Needs (20)

Technical SEO for WordPress Developers, Designers and Webmasters
Technical SEO for WordPress Developers, Designers and WebmastersTechnical SEO for WordPress Developers, Designers and Webmasters
Technical SEO for WordPress Developers, Designers and Webmasters
 
Should you use WordPress for your non-profit websites?
Should you use WordPress for your non-profit websites?Should you use WordPress for your non-profit websites?
Should you use WordPress for your non-profit websites?
 
WordPress Workshop with Tadpole, SATW 2013 Conference
WordPress Workshop with Tadpole, SATW 2013 ConferenceWordPress Workshop with Tadpole, SATW 2013 Conference
WordPress Workshop with Tadpole, SATW 2013 Conference
 
HTML Purifier, WYSIWYG, and TinyMCE
HTML Purifier, WYSIWYG, and TinyMCEHTML Purifier, WYSIWYG, and TinyMCE
HTML Purifier, WYSIWYG, and TinyMCE
 
How to deliver a WordPress website to your client ...the RIGHT way
How to deliver a WordPress website to your client ...the RIGHT wayHow to deliver a WordPress website to your client ...the RIGHT way
How to deliver a WordPress website to your client ...the RIGHT way
 
WordPress Complete Tutorial
WordPress Complete TutorialWordPress Complete Tutorial
WordPress Complete Tutorial
 
Creating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable NeedsCreating Customizable Widgets for Unpredictable Needs
Creating Customizable Widgets for Unpredictable Needs
 
A word press site even your mother can use
A word press site even your mother can useA word press site even your mother can use
A word press site even your mother can use
 
A word press site even your mother can use
A word press site even your mother can useA word press site even your mother can use
A word press site even your mother can use
 
A word press site even your mother can use
A word press site even your mother can useA word press site even your mother can use
A word press site even your mother can use
 
How To Get Started After Installing Wordpress ( Wordcamp, Delhi )
How To Get Started After Installing Wordpress ( Wordcamp, Delhi )How To Get Started After Installing Wordpress ( Wordcamp, Delhi )
How To Get Started After Installing Wordpress ( Wordcamp, Delhi )
 
WordPress Plugins to add style to your website
WordPress Plugins to add style to your websiteWordPress Plugins to add style to your website
WordPress Plugins to add style to your website
 
Wordpress Shortcode
Wordpress ShortcodeWordpress Shortcode
Wordpress Shortcode
 
937079
937079937079
937079
 
Developing Blocks without React - Attributes.pptx
Developing Blocks without React - Attributes.pptxDeveloping Blocks without React - Attributes.pptx
Developing Blocks without React - Attributes.pptx
 
How to build a Project Hub with Hubsites and Sitedesign and Sitescripts
How to build a Project Hub with Hubsites and Sitedesign and Sitescripts How to build a Project Hub with Hubsites and Sitedesign and Sitescripts
How to build a Project Hub with Hubsites and Sitedesign and Sitescripts
 
Maintaining Retainers as a WordPress Developer
Maintaining Retainers as a WordPress DeveloperMaintaining Retainers as a WordPress Developer
Maintaining Retainers as a WordPress Developer
 
WordPress Basics
WordPress BasicsWordPress Basics
WordPress Basics
 
MA Magazines: City Uni - Further Wordpress customisations, process and plugin...
MA Magazines: City Uni - Further Wordpress customisations, process and plugin...MA Magazines: City Uni - Further Wordpress customisations, process and plugin...
MA Magazines: City Uni - Further Wordpress customisations, process and plugin...
 
Salesforce CI (Continuous Integration) - SFDX + Bitbucket Pipelines
Salesforce CI (Continuous Integration) - SFDX + Bitbucket PipelinesSalesforce CI (Continuous Integration) - SFDX + Bitbucket Pipelines
Salesforce CI (Continuous Integration) - SFDX + Bitbucket Pipelines
 

Recently uploaded

2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
WSO2
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 

Recently uploaded (20)

2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 

Creating Customizable Widgets for Unpredictable Needs

  • 1. Creating Customizable Widgets for Unpredictable Needs Amanda Giles http://bit.ly/boswp1115 WordPress Boston – Nov 30, 2015 - #BostonWP
  • 2. Who am I? • Independent IT Consultant • WordPress Developer (Themes and Plugins) • Run the Seacoast NH WordPress Meetup • Lover • Fighter • Sneezer • Teacher / Trainer • My favorite quote is from Calvin & Hobbes: “Virtue isn’t better than vice, it’s just different. http://bit.ly/boswp1115
  • 3. And I have cats! http://bit.ly/boswp1115
  • 4. Information Gathering… • Who here has used a widget? • Who here has created a widget? • Who has lost hours trying widget after widget to find the “right” one? http://bit.ly/boswp1115
  • 5. Who is this talk geared towards? Developers http://bit.ly/boswp1115
  • 6. But what if I’m not a developer? http://bit.ly/boswp1115
  • 8. Why you should stay (even if you’re not a developer) • Might convince a plugin developer to modify a widget to address your needs • Might find a widget that’s close to your needs and hire someone to modify it • Might decide to roll up your sleeves and try your hand at coding http://bit.ly/boswp1115
  • 9. What is a widget? • A way to take [inputted] criteria from a WordPress user and convert that to into output for a website visitor. • Drag and Drop widgets into widget areas under Appearance > Widgets • Collect input [criteria] from user via a form • When website is viewed, content is displayed to a website visitor http://bit.ly/boswp1115
  • 11. Why create your own widgets? http://bit.ly/boswp1115
  • 12. But seriously… Creating widgets is a way to control the content of what's being presented while giving the user choices about that content, its presentation, and its location. http://bit.ly/boswp1115
  • 13. How do we do this? For Users: Anticipate what choices or variations the user might want For Developers: Offer ways to adjust the output where feasible http://bit.ly/boswp1115
  • 14. What does that mean? For Users: Anticipate what choices or variations the user might want • Offer choices to filter the content shown • Offer choices about how that content is shown • Offer style choices • Provide basic clean styling or no styling http://bit.ly/boswp1115
  • 15. What does that mean? For Developers: Offer ways to adjust the output where feasible • Be sure to tag output elements with id/class so styles can be easily overridden • Use hooks to allow filtering of output (for developers) http://bit.ly/boswp1115
  • 16. Anatomy of a widget 1. Declaration/Construct Tell WordPress some information about your widget and how to identify it 2. User Interface / Form Define the form that will gather user's choices about the widget instance 3. Update/Save Logic Save the user's choices about the widget instance 4. Widget/Output Logic Display the widget instance to the website visitor 5. Register the Widget Tell WordPress to register your widget and include it on the Appearance > Widgets page http://bit.ly/boswp1115
  • 17. Widget Code Structure 1. Declaration/Construct 2. User Interface / Form 3. Update/Save Logic 4. Widget/Output Logic 5. Register Widget using Widget Name 0. Widget Name & “extends WP_Widget” http://bit.ly/boswp1115
  • 18. “Show Posts” widget We’re going to look at a widget that displays posts. Our first pass, we’ll focus on the basic user choices: • Specify Widget Title (or not) • Choose one or more specific post IDs • Choose post type (post, page, custom post types) • Choose # of posts to show • Choose what to sort by • Choose the sort order (ascending, descending) • Choose whether to show the post thumbnail/featured image • Choose whether to display the full post content or excerpt http://bit.ly/boswp1115
  • 19. On to the coding! http://bit.ly/boswp1115
  • 20. Second Pass On our second pass through the widget we will add the following touches to flush it out further: • Add CSS for the widget output on website • Add CSS for the Admin User Interface/Form • Place hooks to allow filtering on several elements http://bit.ly/boswp1115
  • 21. What is a hook? A hook is an "event" which allows for additional code to be run when it occurs. One or more functions can be associated with a hook and they will all run when the hook is triggered. http://bit.ly/boswp1115
  • 22. Why use hooks? Hooks are placed within WordPress core, plugins, and themes to allow customization by developers without direct edits of the code. Hooks are the proper way to alter the default behavior of code which is not yours to edit. http://bit.ly/boswp1115
  • 23. Types of hooks Action hooks allow you to run code at a certain point within the code. Examples in WP core include initialization, before main query is run, header or footer of a page/post. Filter hooks allow you to alter data, content, parameters. A filter hook is passed information to filter and returns it altered (or not). Examples in WP code include displaying content, page/post title, pre-saving content (admin). http://bit.ly/boswp1115
  • 26. Thank You! Find these slides and all related files at: http://bit.ly/boswp1115 www.AmandaGiles.com @AmandaGilesNH on Twitter amanda@amandagiles.com Please feel free to send me feedback or questions