Where to place code?
-
Hi Guys
I have started off with Buddypress now. And now it is time to expand it.
Can somebody help me define some terms?
When is it suitable to create a widget?
When is it needed to create a component?
What is the relationship between a widget and a component?
-
Well, a component can be considered a type of plugin similar to any other WordPress plugin, except instead of hooking into WordPress alone, it’s hooking into BuddyPress AND WordPress.
Widgets are accessories, more or less. They aren’t 100% necessary, but most people welcome them as they’re an easy way to include whatever content it is that your plugin is supposed to spit out, on whatever pages that someone has enabled widgets to be displayed on.
A new component is needed when BuddyPress simply doesn’t have the capability that you want or need. The two next components currently in development are status updates (think twitter) and photo albums (think flickr.) Those are functionalities that don’t currently exist in BuddyPress.
Now both of those components may/will have their own widgets also, to do different things. The status update widget may incorporate the ability for the blog author to update their status from their blog, or it might display x amount of recent updates, or both. The photo album widget may include the most recent x photos, recent photo comments, etc…
In the case of BuddyPress, most widgets will come as part of a component. The component will bring in new functionality, and the widgets will allow that function to be displayed without knowing any HTML or PHP.
- The topic ‘Where to place code?’ is closed to new replies.