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