Open Graph

I just added a new plugin to WordPress.org plugins repo. its called Open Graph Wp Implementation.
On its own, it just adds meta data to the <head> section of WP to make the site a social object. Its meant for other plugin developers to be able to build and integrate social plugins.

I have added 2 actions and a few functions for governing the meta data WP sends to the browser.
The actions are
‘open_graph_head_pre’ and ‘open_graph_head_post’. Both run before meta data is echoed to the browser so both can be used to edit the meta data.
‘open_graph_head_pre’ action is run before the meta data is setup. So you can edit all defaults with this action. (set_home_type( $type ) , set_default_img( $url ) )
‘open_graph_head_post’ action is run after the meta data is setup. So you can use this and set_og_data( $key, $value ) to edit/add any number of meta data before executing it.
Always use open_graph_instance() to get the instance of the class. I can change the class name in future but will always keep this function constant

Alternatively, you can use the method echo_meta( $meta_array ) with ‘wp_head’ action for your own meta data (keywords description etc etc etc)

Another cool method is get_image_url();

I will add some code examples in next few days.
Use dependency to check if this plugin is active if you plan to use it.

If you’ve any doubts please post a comment below.

Download link for the plugin: http://wordpress.org/extend/plugins/open-graph

Note: attachment added. Save this as a php file
Sample code for open graph plugin extension

 

My first WordPress theme

I learnt a lot about WordPress themes in the past few days. html5 and css3 are pretty neat and helped me a lot in the process. Internet Explorer gave me a tough time so I have decided to not support it by default. If some version shows good in Internet Explorer, its good news.
One of the key features with html5 is the ability of showing up neat pages on phones. I don’t think I can make my site for a phone yet.  Overall it was a good experience trying out html5 and css3.
Toolbox theme from automattic gives a really good playground to try out html5 and make good stuff with it. I have multiple format types but I haven’t found time to use them.  Making a new facebook plugin to start putting status updates and comments integration will be up soon.
Except for IE, if any version of other browsers show mad stuff on my site, please inform me via the comments. Any designer friends are welcome to come up and help me make a good design out of this. this is more or less the standard toolbox theme with very few modifications so you can simply copy the style.css from this site and have the theme up in no time for your own WordPress installation.
My mid semester exams start tomorrow and I haven’t studied anything yet. So I should probably hit back to that now.

 

March 11, 2011 : just released version 1.1 of the theme