Permalink
Browse files

update list of basic metadata properties

update basic properties to reflect what is on the current OGP website.
This is a breaking change because it removes the location and contact
related properties.  Also add default value for new 'locale' property
based on the WordPress locale.

Fixes #3
  • Loading branch information...
1 parent 7c9d1ff commit f47655202d59c0e5b5032b4b86764f7a87813640 @willnorris committed May 21, 2012
Showing with 12 additions and 9 deletions.
  1. +12 −9 opengraph.php
View
@@ -57,14 +57,7 @@ function opengraph_metadata() {
'title', 'type', 'image', 'url',
// optional
- 'site_name', 'description',
-
- // location
- 'longitude', 'latitude', 'street-address', 'locality', 'region',
- 'postal-code', 'country-name',
-
- // contact
- 'email', 'phone_number', 'fax_number',
+ 'audio', 'description', 'determiner', 'locale', 'site_name', 'video',
);
foreach ($properties as $property) {
@@ -84,8 +77,9 @@ function opengraph_default_metadata() {
add_filter('opengraph_image', 'opengraph_default_image', 5);
add_filter('opengraph_url', 'opengraph_default_url', 5);
- add_filter('opengraph_site_name', 'opengraph_default_sitename', 5);
add_filter('opengraph_description', 'opengraph_default_description', 5);
+ add_filter('opengraph_locale', 'opengraph_default_locale', 5);
+ add_filter('opengraph_site_name', 'opengraph_default_sitename', 5);
}
add_filter('wp', 'opengraph_default_metadata');
@@ -165,6 +159,15 @@ function opengraph_default_description( $description ) {
/**
+ * Default locale property, using the WordPress locale.
+ */
+function opengraph_default_locale( $locale ) {
+ if ( empty($locale) ) $locale = get_locale();
+ return $locale;
+}
+
+
+/**
* Output Open Graph <meta> tags in the page header.
*/
function opengraph_meta_tags() {

0 comments on commit f476552

Please sign in to comment.