SlideShare a Scribd company logo
BuddyPress
Group Extension API

          Andy Peatling
                @apeatling
    buddypress.org/developers/apeatling
What’s API?
      Are People Interested
       Angry People Inc.


Application Programming
        Interface
        All Peanuts Inside
      Another Pointless Idea
It’s all about

Abstraction
Me (developer)


Writing code without an API
     More complex and scattered code

     When the app changes, my code breaks!

     Usually quite “hacky”


       Application
Me (developer)


      Writing code using an API
            Simple and standardized code
API
            When the app changes, the API takes
            care of it, your code doesn’t break!
            Lower barrier for entry


              Application
A Real World Example
              Fetch posts in WordPress without an API


Work out the query you need, check the database?
SELECT ID FROM wp_posts WHERE post_type = 'post' AND post_status =
'publish' ORDER BY post_date DESC LIMIT 20



Loop the results manually
foreach ( (array) $posts as $post ) ....



What about security? Oh dear...
wp_esc() ... wp_filter_kses() ??
A Real World Example
       Fetch posts in WordPress without an API


  If the database schema changes in a new version of
             WordPress, your code breaks.


If the post fields change in a new version of WordPress,
         your code knows nothing about them.


              Your code is hacker fodder.
A Real World Example
                Fetch posts in WordPress using the API


Fetch the posts you need, who cares about the database?
get_posts( ‘numberposts=20’ );



Loop the results using the built in WordPress loop
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();



Security? No worries.
the_content(); the_title(); the_tags();
A Real World Example
         Fetch posts in WordPress using the API


No need to worry about database changes, get_posts() will
          update in new versions of WordPress.


If new post fields are available, you can use them in your
              code using new template tags.


             Your code is safe.... hopefully. :)
The WordPress API is Everywhere
                    wp_authenticate()
get_posts()


                          WP_Widget
       get_usermeta()


                      add_filter()
 add_action()


                      current_user_can()
update_usermeta()
BuddyPress Group Extension API
   Making it very simple to build new
       custom group features
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
Let’s Build a Twitter Extension
         Live Demo... gulp.
Thank You!

http://codex.buddypress.org/developer-docs/group-
                  extension-api/

Submit your group extensions to the WordPress plugin
          repo tagged with “BuddyPress”.

More Related Content

PDF
How to Create a Custom WordPress Plugin
PDF
WordPress REST API
PPTX
Wordcamp2012 build your plugin
PDF
Assignment 5 - MVP 2 Live Demo
PDF
Building a mini-theme with WordPress REST API
PDF
Article builder free trial
PPTX
Introduction to Selenium WebDriver
PDF
WordPress is advancing rAPIdly - WordCamp San Antonio 2015
How to Create a Custom WordPress Plugin
WordPress REST API
Wordcamp2012 build your plugin
Assignment 5 - MVP 2 Live Demo
Building a mini-theme with WordPress REST API
Article builder free trial
Introduction to Selenium WebDriver
WordPress is advancing rAPIdly - WordCamp San Antonio 2015

Similar to BuddyPress Groups API (20)

KEY
CSI: WordPress -- Getting Into the Guts
PDF
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
PDF
WordCamp Wilmington 2017 WP-API Why?
PPTX
Beyond the Theme - Using WordPress as an API
KEY
WordPress - Open Source Overview Presentation
PDF
Bending word press to your will
PPTX
Word press rest api sudarshan shrestha
PDF
IRJET- Mail Server Communication:PHP
PDF
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
PDF
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress Coding
PPTX
WordPress Rest API
PPTX
Your API is not a Website!
PDF
Complex things explained easily
PDF
WordPress as an Application Framework
PPTX
Library 2.0 : Weblogs : Wordpress
PDF
WordPress Code Architecture
PPTX
WordPress for Applications
PDF
Beyond The Browser - Creating a RESTful Web Service With WordPress
PDF
Hacking For Innovation
KEY
Intro to WordPress Plugins
CSI: WordPress -- Getting Into the Guts
WordCamp Birmingham 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Wilmington 2017 WP-API Why?
Beyond the Theme - Using WordPress as an API
WordPress - Open Source Overview Presentation
Bending word press to your will
Word press rest api sudarshan shrestha
IRJET- Mail Server Communication:PHP
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress Coding
WordPress Rest API
Your API is not a Website!
Complex things explained easily
WordPress as an Application Framework
Library 2.0 : Weblogs : Wordpress
WordPress Code Architecture
WordPress for Applications
Beyond The Browser - Creating a RESTful Web Service With WordPress
Hacking For Innovation
Intro to WordPress Plugins
Ad

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPT
Teaching material agriculture food technology
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Empathic Computing: Creating Shared Understanding
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
cuic standard and advanced reporting.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
A Presentation on Artificial Intelligence
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Diabetes mellitus diagnosis method based random forest with bat algorithm
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Review of recent advances in non-invasive hemoglobin estimation
MIND Revenue Release Quarter 2 2025 Press Release
Teaching material agriculture food technology
Assigned Numbers - 2025 - Bluetooth® Document
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
The Rise and Fall of 3GPP – Time for a Sabbatical?
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Encapsulation_ Review paper, used for researhc scholars
20250228 LYD VKU AI Blended-Learning.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Empathic Computing: Creating Shared Understanding
A comparative analysis of optical character recognition models for extracting...
cuic standard and advanced reporting.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Unlocking AI with Model Context Protocol (MCP)
The AUB Centre for AI in Media Proposal.docx
A Presentation on Artificial Intelligence
Ad

BuddyPress Groups API

  • 1. BuddyPress Group Extension API Andy Peatling @apeatling buddypress.org/developers/apeatling
  • 2. What’s API? Are People Interested Angry People Inc. Application Programming Interface All Peanuts Inside Another Pointless Idea
  • 4. Me (developer) Writing code without an API More complex and scattered code When the app changes, my code breaks! Usually quite “hacky” Application
  • 5. Me (developer) Writing code using an API Simple and standardized code API When the app changes, the API takes care of it, your code doesn’t break! Lower barrier for entry Application
  • 6. A Real World Example Fetch posts in WordPress without an API Work out the query you need, check the database? SELECT ID FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY post_date DESC LIMIT 20 Loop the results manually foreach ( (array) $posts as $post ) .... What about security? Oh dear... wp_esc() ... wp_filter_kses() ??
  • 7. A Real World Example Fetch posts in WordPress without an API If the database schema changes in a new version of WordPress, your code breaks. If the post fields change in a new version of WordPress, your code knows nothing about them. Your code is hacker fodder.
  • 8. A Real World Example Fetch posts in WordPress using the API Fetch the posts you need, who cares about the database? get_posts( ‘numberposts=20’ ); Loop the results using the built in WordPress loop <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); Security? No worries. the_content(); the_title(); the_tags();
  • 9. A Real World Example Fetch posts in WordPress using the API No need to worry about database changes, get_posts() will update in new versions of WordPress. If new post fields are available, you can use them in your code using new template tags. Your code is safe.... hopefully. :)
  • 10. The WordPress API is Everywhere wp_authenticate() get_posts() WP_Widget get_usermeta() add_filter() add_action() current_user_can() update_usermeta()
  • 11. BuddyPress Group Extension API Making it very simple to build new custom group features
  • 18. Let’s Build a Twitter Extension Live Demo... gulp.
  • 19. Thank You! http://codex.buddypress.org/developer-docs/group- extension-api/ Submit your group extensions to the WordPress plugin repo tagged with “BuddyPress”.