Your SlideShare is downloading. ×
0
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
BuddyPress Groups API
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

BuddyPress Groups API

5,945

Published on

Creating killer group extensions with BuddyPress.

Creating killer group extensions with BuddyPress.

Published in: Technology
4 Comments
13 Likes
Statistics
Notes
No Downloads
Views
Total Views
5,945
On Slideshare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
45
Comments
4
Likes
13
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 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
  • 3. It’s all about Abstraction
  • 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
  • 12. Let’s Build a Twitter Extension Live Demo... gulp.
  • 13. Thank You! http://codex.buddypress.org/developer-docs/group- extension-api/ Submit your group extensions to the WordPress plugin repo tagged with “BuddyPress”.

×