SlideShare a Scribd company logo
iThemes Exchange
for developers
Simple ecommerce for WordPress
Where do you jump in?
How is Exchange Organized
● /lib
How is Exchange Organized
● /lib
● /api
How is Exchange Organized
● /lib
● /api
● /core-addons
How do I register an add-on?
exchange-addon-stripe/exchange-addon-stripe.php
How do I generate a settings page?
exchange-addon-stripe/exchange-addon-stripe.php
How do I generate a settings page?
exchange-addon-stripe/lib/addon-settings.php
How do Products & Product Types
work?
● All Exchange products are a single WP
post_type
● Product Features are tied to product types
● Admin UI is reactive to the registered types
o Setup Wizard
o Sidebar
o Add / Edit products
ithemes-exchange/lib/products/class.products-post-type.php
One WP post_type
How do Products & Product Types work?
Admin UI is Reactive
How do Products & Product Types work?
How do I register a Product Type?
Product Types are
an add-on category
How do I register a Product Type?
exchange-addon-membership/exchange-addon-membership.php
Product Types are
an add-on category
What are Product Features?
product_feature all the things!
ithemes-exchange/lib/product-features/
How do Product Features work?
product_feature all the things!
ithemes-exchange/lib/product-features/class.downloads.php
hooked to it_exchange_enabled_addons_loaded
How do Product Features work?
product_feature all the things!
ithemes-exchange/lib/product-features/
How do Product Features work?
Use the Abstract
Class to create
Product Features
How do Product Features work?
ithemes-exchange/lib/product-features/class.inventory.php
See the inventory
product feature as
example of
abstract
implementation.
How do Product Features work?
product_feature all the things!
ithemes-exchange/lib/product-features/
Why use our Product Feature class?
● it_exchange_product_supports_feature()
● it_exchange_product_has_feature()
● it_exchange_update_product_feature()
● it_exchange_get_product_feature()
● it_exchange_add_feature_support_to_product_type()
● it_exchange_remove_feature_support_for_product_type()
● it_exchange_product_type_supports_feature()
● it_exchange_get_registered_product_features()
It exposes your feature to all these API functions
ithemes-exchange/api/product-features.php
How do I use a Product Feature?
product features API
ithemes-exchange/api/theme/products.php
How do Exchange Pages work?
How do Exchange Pages work?
Pages have 1-3 options: Exchange, WordPress,
Disabled
How do I register an Exchange
page?
ithemes-
exchange/lib/api/pages.php
How does templating work?
We have #alot of template-parts
ithemes-exchange/lib/templates/
http://hyperboleandahalf.blogspot.com/2010/04/alot-is-better-than-you-at-
everything.html
How does templating work?
Standard Templating Components
ithemes-exchange/lib/templates/content-store.php
How does templating work?
Top Level v. Loops v. Elements ( all template-
parts )
ithemes-exchange/lib/templates/content-login.php
Loops are template-parts too but their primary job is to
call additional (but related) template-parts.
ithemes-exchange/lib/templates/content-login/loops/fields.php
TopLevelLoop
How does templating work?
Top Level v. Loops v. Elements ( all template-
parts ) Elements are usually extremely small chunks of HTML
ithemes-exchange/lib/templates/content-login/loops/fields.phpLoop
ithemes-exchange/lib/templates/content-login/elements/username.php
Element
There are 3 ways increasingly complex ways to alter output
1. WordPress Hooks ( multiple hooks in every template part )
o Ideal for quick additions to non-distributed code
2. Overwriting individual template parts in your theme
o Ideal for theme authors or clients that have highly customized
themes and may need some custom CSS classes, etc.
3. Inserting, removing, rearranging template parts with the templating
API
o Ideal for add-on developers and clients that may enable
additional add-ons without you in the future.
How should I modify the templates?
1) WordPress Hooks (simple)
How should I modify the templates?
ithemes-exchange/lib/templates/content-registration/elements/email.php
2) Overwriting template parts in your theme (moderately difficult)
How should I modify the templates?
ithemes-exchange/lib/templates/content-store/elements/featured-image.php
themes/twentythirteen-child-exchange/exchange/content-store/elements/featured-image.php
2) Overwriting template parts in your theme (moderately difficult)
How should I modify the templates?
ithemes-exchange/lib/templates/content-store/elements/featured-image.php
themes/twentythirteen-child-exchange/exchange/content-store/elements/featured-image.php
Exchange looks for the template-parts in the following locations by
default
1. [child-theme]/exchange/
2. [parent-theme]/exchange/
3. ithemes-exchange/lib/templates/
2) Overwriting template parts in your theme (moderately difficult)
How should I modify the templates?
3) Inserting / deleting / rearranging ( difficult but powerful )
How should I modify the templates?
ithemes-exchange/api/template-parts.php
3) Inserting / deleting / rearranging ( difficult but powerful )
How should I modify the templates?
ithemes-exchange/lib/templates/content-login/loops/fields.php
ithemes-exchange/api/template-parts.php
3) Inserting / deleting / rearranging ( difficult but powerful )
How should I modify the templates?
ithemes-exchange/lib/templates/content-login/loops/fields.php
ithemes-exchange/api/template-parts.php
How should I modify the templates?
ithemes-exchange/lib/templates/content-store/elements/featured-image.php
Exchange looks for the template-parts in the following locations by
default
1. [child-theme]/exchange/
2. [parent-theme]/exchange/
3. ithemes-exchange/lib/templates/
3) Inserting / deleting / rearranging ( difficult but powerful )
How should I modify the templates?
ithemes-exchange/lib/templates/content-store/elements/featured-image.php
Exchange looks for the template-parts in the following locations by
default
1. [child-theme]/exchange/
2. [parent-theme]/exchange/
3. locations added via the ‘it_exchange_possible_template_paths’
filter
4. ithemes-exchange/lib/templates/
3) Inserting / deleting / rearranging ( difficult but powerful )
ithemes-exchange/lib/functions/template-functions.php
How should I modify the templates?
ithemes-exchange/lib/templates/content-store/elements/featured-image.php
3) Inserting / deleting / rearranging ( difficult but powerful )
ithemes-exchange/core-addons/taxes/taxes-simple/init.php
filters generated inside
it_exchange_get_template_part_loops()
How should I modify the templates?
3) Inserting / deleting / rearranging ( difficult but powerful )
ithemes-exchange/core-addons/taxes/taxes-simple/init.php
How should I modify the templates?
3) Inserting / deleting / rearranging ( difficult but powerful )
before after
How does the Theme API work?
it_exchange( ‘context’, ‘tag’, $options );
ithemes-exchange/api/theme/
How does the Theme API work?
it_exchange( ‘context’, ‘tag’, $options );
ithemes-exchange/api/theme/product.php
it_exchange( ‘product’, ‘found’);
it_exchange( ‘product’, ‘description’);
How does the Theme API work?
it_exchange( ‘context’, ‘tag’, $options );
ithemes-exchange/api/theme/product.php
it_exchange( ‘product’, ‘baseprice’, array( ‘before’ => ‘<p>’, ‘after’ => ‘</p>’ ) );
How does the Theme API work?
Prefixes
ithemes-exchange/api/theme/product.php
it_exchange( ‘product’, ‘get-description’);
it_exchange( ‘product’, ‘has-description’);
it_exchange( ‘product’, ‘supports-description’);
it_exchange( ‘product’, ‘description’); // prints the description
// returns a boolean
// returns a boolean
// returns the description
How does the Theme API work?
A couple examples
ithemes-exchange/lib/templates/super-widget-cart.php
iThemes Exchange
for developers

More Related Content

Similar to iThemes Exchange for Developers

Whats next in templating
Whats next in templatingWhats next in templating
Whats next in templating
Filip Bruun Bech-Larsen
 
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)Ranel Padon
 
Meet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir KalashnikauMeet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir Kalashnikau
Amasty
 
Joomla Explained - As Easy as 1, 2, 3
Joomla Explained - As Easy as 1, 2, 3Joomla Explained - As Easy as 1, 2, 3
Joomla Explained - As Easy as 1, 2, 3
Rod Martin
 
Modules and Components Introduction in Joomla! 2.5
Modules and Components Introduction in Joomla! 2.5Modules and Components Introduction in Joomla! 2.5
Modules and Components Introduction in Joomla! 2.5
Vishwash Gaur
 
Spree framework overview
Spree framework overviewSpree framework overview
Spree framework overview
martin_hong91
 
Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012
Vishwash Gaur
 
AtoM's Command Line Tasks - An Introduction
AtoM's Command Line Tasks - An IntroductionAtoM's Command Line Tasks - An Introduction
AtoM's Command Line Tasks - An Introduction
Artefactual Systems - AtoM
 
Whats next in templating
Whats next in templatingWhats next in templating
Whats next in templating
Filip Bruun Bech-Larsen
 
Extending WP-e-Commerce WordCamp UK
Extending WP-e-Commerce WordCamp UKExtending WP-e-Commerce WordCamp UK
Extending WP-e-Commerce WordCamp UK
jghazally
 
Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)
Amit Kumar Singh
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction PresentationNerd Tzanetopoulos
 
Introduction to the Magento eCommerce Platform
Introduction to the Magento eCommerce PlatformIntroduction to the Magento eCommerce Platform
Introduction to the Magento eCommerce Platform
Jarne W. Beutnagel
 
ElggCamp Santiago - Dev Edition
ElggCamp Santiago - Dev EditionElggCamp Santiago - Dev Edition
ElggCamp Santiago - Dev Edition
Brett Profitt
 
ElggCamp Santiago> For Developers!
ElggCamp Santiago> For Developers!ElggCamp Santiago> For Developers!
ElggCamp Santiago> For Developers!
Condiminds
 
DIWD 2011
DIWD 2011DIWD 2011
The future of templating and frameworks
The future of templating and frameworksThe future of templating and frameworks
The future of templating and frameworks
Filip Bruun Bech-Larsen
 
Joomla 4 custom fields and workflow
Joomla 4 custom fields and workflowJoomla 4 custom fields and workflow
Joomla 4 custom fields and workflow
Tim Plummer
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
Steve Mortiboy
 

Similar to iThemes Exchange for Developers (20)

Whats next in templating
Whats next in templatingWhats next in templating
Whats next in templating
 
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
Batch Scripting with Drupal (Featuring the EntityFieldQuery API)
 
Meet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir KalashnikauMeet Magento Belarus 2015: Uladzimir Kalashnikau
Meet Magento Belarus 2015: Uladzimir Kalashnikau
 
forms builder
forms builderforms builder
forms builder
 
Joomla Explained - As Easy as 1, 2, 3
Joomla Explained - As Easy as 1, 2, 3Joomla Explained - As Easy as 1, 2, 3
Joomla Explained - As Easy as 1, 2, 3
 
Modules and Components Introduction in Joomla! 2.5
Modules and Components Introduction in Joomla! 2.5Modules and Components Introduction in Joomla! 2.5
Modules and Components Introduction in Joomla! 2.5
 
Spree framework overview
Spree framework overviewSpree framework overview
Spree framework overview
 
Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012Techgig Webinar: Joomla Introduction and Module Development June 2012
Techgig Webinar: Joomla Introduction and Module Development June 2012
 
AtoM's Command Line Tasks - An Introduction
AtoM's Command Line Tasks - An IntroductionAtoM's Command Line Tasks - An Introduction
AtoM's Command Line Tasks - An Introduction
 
Whats next in templating
Whats next in templatingWhats next in templating
Whats next in templating
 
Extending WP-e-Commerce WordCamp UK
Extending WP-e-Commerce WordCamp UKExtending WP-e-Commerce WordCamp UK
Extending WP-e-Commerce WordCamp UK
 
Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)Joomla @ Barcamp4(Feb 08 Pune)
Joomla @ Barcamp4(Feb 08 Pune)
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction Presentation
 
Introduction to the Magento eCommerce Platform
Introduction to the Magento eCommerce PlatformIntroduction to the Magento eCommerce Platform
Introduction to the Magento eCommerce Platform
 
ElggCamp Santiago - Dev Edition
ElggCamp Santiago - Dev EditionElggCamp Santiago - Dev Edition
ElggCamp Santiago - Dev Edition
 
ElggCamp Santiago> For Developers!
ElggCamp Santiago> For Developers!ElggCamp Santiago> For Developers!
ElggCamp Santiago> For Developers!
 
DIWD 2011
DIWD 2011DIWD 2011
DIWD 2011
 
The future of templating and frameworks
The future of templating and frameworksThe future of templating and frameworks
The future of templating and frameworks
 
Joomla 4 custom fields and workflow
Joomla 4 custom fields and workflowJoomla 4 custom fields and workflow
Joomla 4 custom fields and workflow
 
Getting started with WordPress development
Getting started with WordPress developmentGetting started with WordPress development
Getting started with WordPress development
 

Recently uploaded

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 

Recently uploaded (20)

GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 

iThemes Exchange for Developers

  • 3. Where do you jump in?
  • 4. How is Exchange Organized ● /lib
  • 5. How is Exchange Organized ● /lib ● /api
  • 6. How is Exchange Organized ● /lib ● /api ● /core-addons
  • 7. How do I register an add-on? exchange-addon-stripe/exchange-addon-stripe.php
  • 8. How do I generate a settings page? exchange-addon-stripe/exchange-addon-stripe.php
  • 9. How do I generate a settings page? exchange-addon-stripe/lib/addon-settings.php
  • 10. How do Products & Product Types work? ● All Exchange products are a single WP post_type ● Product Features are tied to product types ● Admin UI is reactive to the registered types o Setup Wizard o Sidebar o Add / Edit products
  • 12. Admin UI is Reactive How do Products & Product Types work?
  • 13. How do I register a Product Type? Product Types are an add-on category
  • 14. How do I register a Product Type? exchange-addon-membership/exchange-addon-membership.php Product Types are an add-on category
  • 15. What are Product Features? product_feature all the things! ithemes-exchange/lib/product-features/
  • 16. How do Product Features work? product_feature all the things! ithemes-exchange/lib/product-features/class.downloads.php hooked to it_exchange_enabled_addons_loaded
  • 17. How do Product Features work? product_feature all the things! ithemes-exchange/lib/product-features/
  • 18. How do Product Features work? Use the Abstract Class to create Product Features
  • 19. How do Product Features work? ithemes-exchange/lib/product-features/class.inventory.php See the inventory product feature as example of abstract implementation.
  • 20. How do Product Features work? product_feature all the things! ithemes-exchange/lib/product-features/
  • 21. Why use our Product Feature class? ● it_exchange_product_supports_feature() ● it_exchange_product_has_feature() ● it_exchange_update_product_feature() ● it_exchange_get_product_feature() ● it_exchange_add_feature_support_to_product_type() ● it_exchange_remove_feature_support_for_product_type() ● it_exchange_product_type_supports_feature() ● it_exchange_get_registered_product_features() It exposes your feature to all these API functions ithemes-exchange/api/product-features.php
  • 22. How do I use a Product Feature? product features API ithemes-exchange/api/theme/products.php
  • 23. How do Exchange Pages work?
  • 24. How do Exchange Pages work? Pages have 1-3 options: Exchange, WordPress, Disabled
  • 25. How do I register an Exchange page? ithemes- exchange/lib/api/pages.php
  • 26. How does templating work? We have #alot of template-parts ithemes-exchange/lib/templates/ http://hyperboleandahalf.blogspot.com/2010/04/alot-is-better-than-you-at- everything.html
  • 27. How does templating work? Standard Templating Components ithemes-exchange/lib/templates/content-store.php
  • 28. How does templating work? Top Level v. Loops v. Elements ( all template- parts ) ithemes-exchange/lib/templates/content-login.php Loops are template-parts too but their primary job is to call additional (but related) template-parts. ithemes-exchange/lib/templates/content-login/loops/fields.php TopLevelLoop
  • 29. How does templating work? Top Level v. Loops v. Elements ( all template- parts ) Elements are usually extremely small chunks of HTML ithemes-exchange/lib/templates/content-login/loops/fields.phpLoop ithemes-exchange/lib/templates/content-login/elements/username.php Element
  • 30. There are 3 ways increasingly complex ways to alter output 1. WordPress Hooks ( multiple hooks in every template part ) o Ideal for quick additions to non-distributed code 2. Overwriting individual template parts in your theme o Ideal for theme authors or clients that have highly customized themes and may need some custom CSS classes, etc. 3. Inserting, removing, rearranging template parts with the templating API o Ideal for add-on developers and clients that may enable additional add-ons without you in the future. How should I modify the templates?
  • 31. 1) WordPress Hooks (simple) How should I modify the templates? ithemes-exchange/lib/templates/content-registration/elements/email.php
  • 32. 2) Overwriting template parts in your theme (moderately difficult) How should I modify the templates? ithemes-exchange/lib/templates/content-store/elements/featured-image.php themes/twentythirteen-child-exchange/exchange/content-store/elements/featured-image.php
  • 33. 2) Overwriting template parts in your theme (moderately difficult) How should I modify the templates? ithemes-exchange/lib/templates/content-store/elements/featured-image.php themes/twentythirteen-child-exchange/exchange/content-store/elements/featured-image.php Exchange looks for the template-parts in the following locations by default 1. [child-theme]/exchange/ 2. [parent-theme]/exchange/ 3. ithemes-exchange/lib/templates/
  • 34. 2) Overwriting template parts in your theme (moderately difficult) How should I modify the templates?
  • 35. 3) Inserting / deleting / rearranging ( difficult but powerful ) How should I modify the templates? ithemes-exchange/api/template-parts.php
  • 36. 3) Inserting / deleting / rearranging ( difficult but powerful ) How should I modify the templates? ithemes-exchange/lib/templates/content-login/loops/fields.php ithemes-exchange/api/template-parts.php
  • 37. 3) Inserting / deleting / rearranging ( difficult but powerful ) How should I modify the templates? ithemes-exchange/lib/templates/content-login/loops/fields.php ithemes-exchange/api/template-parts.php
  • 38. How should I modify the templates? ithemes-exchange/lib/templates/content-store/elements/featured-image.php Exchange looks for the template-parts in the following locations by default 1. [child-theme]/exchange/ 2. [parent-theme]/exchange/ 3. ithemes-exchange/lib/templates/ 3) Inserting / deleting / rearranging ( difficult but powerful )
  • 39. How should I modify the templates? ithemes-exchange/lib/templates/content-store/elements/featured-image.php Exchange looks for the template-parts in the following locations by default 1. [child-theme]/exchange/ 2. [parent-theme]/exchange/ 3. locations added via the ‘it_exchange_possible_template_paths’ filter 4. ithemes-exchange/lib/templates/ 3) Inserting / deleting / rearranging ( difficult but powerful ) ithemes-exchange/lib/functions/template-functions.php
  • 40. How should I modify the templates? ithemes-exchange/lib/templates/content-store/elements/featured-image.php 3) Inserting / deleting / rearranging ( difficult but powerful ) ithemes-exchange/core-addons/taxes/taxes-simple/init.php filters generated inside it_exchange_get_template_part_loops()
  • 41. How should I modify the templates? 3) Inserting / deleting / rearranging ( difficult but powerful ) ithemes-exchange/core-addons/taxes/taxes-simple/init.php
  • 42. How should I modify the templates? 3) Inserting / deleting / rearranging ( difficult but powerful ) before after
  • 43. How does the Theme API work? it_exchange( ‘context’, ‘tag’, $options ); ithemes-exchange/api/theme/
  • 44. How does the Theme API work? it_exchange( ‘context’, ‘tag’, $options ); ithemes-exchange/api/theme/product.php it_exchange( ‘product’, ‘found’); it_exchange( ‘product’, ‘description’);
  • 45. How does the Theme API work? it_exchange( ‘context’, ‘tag’, $options ); ithemes-exchange/api/theme/product.php it_exchange( ‘product’, ‘baseprice’, array( ‘before’ => ‘<p>’, ‘after’ => ‘</p>’ ) );
  • 46. How does the Theme API work? Prefixes ithemes-exchange/api/theme/product.php it_exchange( ‘product’, ‘get-description’); it_exchange( ‘product’, ‘has-description’); it_exchange( ‘product’, ‘supports-description’); it_exchange( ‘product’, ‘description’); // prints the description // returns a boolean // returns a boolean // returns the description
  • 47. How does the Theme API work? A couple examples ithemes-exchange/lib/templates/super-widget-cart.php