metatag_opengraph.metatag.inc 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. <?php
  2. /**
  3. * @file
  4. * Metatag integration for the metatag_opengraph module.
  5. */
  6. /**
  7. * Implements hook_metatag_bundled_config_alter().
  8. */
  9. function metatag_opengraph_metatag_bundled_config_alter(array &$configs) {
  10. foreach ($configs as &$config) {
  11. switch ($config->instance) {
  12. case 'global':
  13. $config->config += array(
  14. 'og:site_name' => array('value' => '[site:name]'),
  15. 'og:title' => array('value' => '[current-page:title]'),
  16. 'og:type' => array('value' => 'article'),
  17. 'og:url' => array('value' => '[current-page:url:absolute]'),
  18. );
  19. break;
  20. case 'global:frontpage':
  21. $config->config += array(
  22. 'og:description' => array('value' => '[site:slogan]'),
  23. 'og:title' => array('value' => '[site:name]'),
  24. 'og:type' => array('value' => 'website'),
  25. 'og:url' => array('value' => '[site:url]'),
  26. );
  27. break;
  28. // On error pages point everything to the homepage.
  29. case 'global:403':
  30. case 'global:404':
  31. $config->config += array(
  32. 'og:title' => array('value' => '[site:name]'),
  33. 'og:type' => array('value' => 'website'),
  34. 'og:url' => array('value' => '[site:url]'),
  35. );
  36. break;
  37. case 'node':
  38. $config->config += array(
  39. 'article:modified_time' => array('value' => '[node:changed:custom:c]'),
  40. 'article:published_time' => array('value' => '[node:created:custom:c]'),
  41. 'og:description' => array('value' => '[node:summary]'),
  42. 'og:title' => array('value' => '[node:title]'),
  43. 'og:updated_time' => array('value' => '[node:changed:custom:c]'),
  44. );
  45. break;
  46. case 'taxonomy_term':
  47. $config->config += array(
  48. 'og:description' => array('value' => '[term:description]'),
  49. 'og:title' => array('value' => '[term:name]'),
  50. );
  51. break;
  52. case 'user':
  53. $config->config += array(
  54. 'og:title' => array('value' => '[user:name]'),
  55. 'og:type' => array('value' => 'profile'),
  56. 'profile:username' => array('value' => '[user:name]'),
  57. );
  58. if (variable_get('user_pictures')) {
  59. $config->config += array(
  60. 'og:image' => array('value' => '[user:picture:url]'),
  61. // For now keep the old default.
  62. // 'og:image:url' => array('value' => '[user:picture:url]'),
  63. );
  64. }
  65. break;
  66. }
  67. }
  68. }
  69. /**
  70. * Implements hook_metatag_info().
  71. */
  72. function metatag_opengraph_metatag_info() {
  73. $info['groups']['open-graph'] = array(
  74. 'label' => t('Open Graph'),
  75. 'description' => t("The <a href=\"@ogp\">Open Graph meta tags</a> are used control how Facebook, Pinterest, LinkedIn and other social networking sites interpret the site's content.", array('@ogp' => 'http://ogp.me/')),
  76. 'form' => array(
  77. '#weight' => 50,
  78. ),
  79. );
  80. // Default values for each meta tag.
  81. $og_defaults = array(
  82. 'description' => '',
  83. 'class' => 'DrupalTextMetaTag',
  84. 'group' => 'open-graph',
  85. 'element' => array(
  86. '#theme' => 'metatag_property',
  87. ),
  88. );
  89. // Open Graph meta tags stack after the Facebook tags.
  90. $weight = 25;
  91. $info['tags']['og:site_name'] = array(
  92. 'label' => t('Site name'),
  93. 'description' => t('A human-readable name for the site, e.g., <em>IMDb</em>.'),
  94. 'context' => array('global'),
  95. 'weight' => ++$weight,
  96. ) + $og_defaults;
  97. $info['tags']['og:type'] = array(
  98. 'label' => t('Content type'),
  99. 'description' => t('The type of the content, e.g., <em>movie</em>.'),
  100. 'weight' => ++$weight,
  101. 'select_or_other' => TRUE,
  102. 'form' => array(
  103. '#type' => 'select',
  104. '#options' => _metatag_opengraph_type_options(),
  105. '#empty_option' => t('- None -'),
  106. ),
  107. 'devel_generate' => array(
  108. 'type' => 'select',
  109. ),
  110. ) + $og_defaults;
  111. $info['tags']['og:url'] = array(
  112. 'label' => t('Page URL'),
  113. 'description' => t('Preferred page location or URL to help eliminate duplicate content for search engines, e.g., <em>http://www.imdb.com/title/tt0117500/</em>.'),
  114. 'weight' => ++$weight,
  115. 'devel_generate' => array(
  116. 'type' => 'canonical',
  117. ),
  118. ) + $og_defaults;
  119. $info['tags']['og:title'] = array(
  120. 'label' => t('Content title'),
  121. 'description' => t('The title of the content, e.g., <em>The Rock</em>.'),
  122. 'weight' => ++$weight,
  123. ) + $og_defaults;
  124. $info['tags']['og:determiner'] = array(
  125. 'label' => t('Content title determiner'),
  126. 'description' => t("The word that appears before the content's title in a sentence. The default ignores this value, the 'Automatic' value should be sufficient if this is actually needed."),
  127. 'weight' => ++$weight,
  128. 'form' => array(
  129. '#type' => 'select',
  130. '#options' => array(
  131. 'auto' => 'Automatic',
  132. 'a' => 'A',
  133. 'an' => 'An',
  134. 'the' => 'The',
  135. ),
  136. '#empty_option' => t('- Ignore -'),
  137. ),
  138. 'devel_generate' => array(
  139. 'type' => 'select',
  140. ),
  141. ) + $og_defaults;
  142. $info['tags']['og:description'] = array(
  143. 'label' => t('Content description'),
  144. 'description' => t('A one to two sentence description of the content.'),
  145. 'weight' => ++$weight,
  146. ) + $og_defaults;
  147. // Basic tags.
  148. $info['tags']['og:updated_time'] = array(
  149. 'label' => t('Content modification date & time'),
  150. 'description' => t("The date this content was last modified, with an optional time value. Needs to be in <a href='http://en.wikipedia.org/wiki/ISO_8601'>ISO 8601</a> format. Can be the same as the 'Article modification date' tag."),
  151. 'weight' => ++$weight,
  152. ) + $og_defaults;
  153. $info['tags']['og:see_also'] = array(
  154. 'label' => t('See also'),
  155. 'description' => t('URLs to related content.'),
  156. 'multiple' => TRUE,
  157. 'weight' => ++$weight,
  158. ) + $og_defaults;
  159. $info['tags']['og:image'] = array(
  160. 'label' => t('Image'),
  161. 'description' => t('The URL of an image which should represent the content. For best results use an image that is at least 1200 x 630 pixels in size, but at least 600 x 316 pixels is a recommended minimum. Supports PNG, JPEG and GIF formats. Should not be used if og:image:url is used. Note: if multiple images are added many services (e.g. Facebook) will default to the largest image, not the first one.'),
  162. 'multiple' => TRUE,
  163. 'image' => TRUE,
  164. 'weight' => ++$weight,
  165. 'devel_generate' => array(
  166. 'type' => 'image',
  167. ),
  168. ) + $og_defaults;
  169. $info['tags']['og:image:url'] = array(
  170. 'label' => t('Image URL'),
  171. 'description' => t('A alternative version of og:image and has exactly the same requirements; only one needs to be used. Note: some services do not accept this tag and will only accept the "image" tag above.'),
  172. 'multiple' => TRUE,
  173. 'image' => TRUE,
  174. 'weight' => ++$weight,
  175. 'devel_generate' => array(
  176. 'type' => 'image',
  177. ),
  178. ) + $og_defaults;
  179. $info['tags']['og:image:secure_url'] = array(
  180. 'label' => t('Secure image URL'),
  181. 'description' => t('The secure URL (HTTPS) of an image which should represent the content. The image must be at least 50px by 50px and have a maximum aspect ratio of 3:1. Supports PNG, JPEG and GIF formats. All "http://" URLs will automatically be converted to "https://". Note: if multiple images are added many services (e.g. Facebook) will default to the largest image, not the first one.'),
  182. 'multiple' => TRUE,
  183. 'secure' => TRUE,
  184. 'image' => TRUE,
  185. 'weight' => ++$weight,
  186. 'devel_generate' => array(
  187. 'type' => 'image',
  188. ),
  189. ) + $og_defaults;
  190. $info['tags']['og:image:type'] = array(
  191. 'label' => t('Image type'),
  192. 'description' => t('The type of image referenced above. Should be either "image/gif" for a GIF image, "image/jpeg" for a JPG/JPEG image, or "image/png" for a PNG image. Note: there should be one value for each image, and having more than there are images may cause problems.'),
  193. 'multiple' => TRUE,
  194. 'weight' => ++$weight,
  195. ) + $og_defaults;
  196. $info['tags']['og:image:width'] = array(
  197. 'label' => t('Image width'),
  198. 'description' => t('The width of the above image(s). Note: if both the unsecured and secured images are provided, they should both be the same size.'),
  199. 'multiple' => TRUE,
  200. 'weight' => ++$weight,
  201. 'devel_generate' => array(
  202. 'type' => 'image',
  203. ),
  204. ) + $og_defaults;
  205. $info['tags']['og:image:height'] = array(
  206. 'label' => t('Image height'),
  207. 'description' => t('The height of the above image(s). Note: if both the unsecured and secured images are provided, they should both be the same size.'),
  208. 'multiple' => TRUE,
  209. 'weight' => ++$weight,
  210. 'devel_generate' => array(
  211. 'type' => 'image',
  212. ),
  213. ) + $og_defaults;
  214. $info['tags']['og:latitude'] = array(
  215. 'label' => t('Latitude'),
  216. 'weight' => ++$weight,
  217. 'devel_generate' => array(
  218. 'type' => 'float',
  219. ),
  220. ) + $og_defaults;
  221. $info['tags']['og:longitude'] = array(
  222. 'label' => t('Longitude'),
  223. 'weight' => ++$weight,
  224. 'devel_generate' => array(
  225. 'type' => 'float',
  226. ),
  227. ) + $og_defaults;
  228. $info['tags']['og:street_address'] = array(
  229. 'label' => t('Street address'),
  230. 'weight' => ++$weight,
  231. 'replaces' => array(
  232. 'og:street-address',
  233. ),
  234. ) + $og_defaults;
  235. $info['tags']['og:locality'] = array(
  236. 'label' => t('Locality'),
  237. 'weight' => ++$weight,
  238. ) + $og_defaults;
  239. $info['tags']['og:region'] = array(
  240. 'label' => t('Region'),
  241. 'weight' => ++$weight,
  242. ) + $og_defaults;
  243. $info['tags']['og:postal_code'] = array(
  244. 'label' => t('Postal/ZIP code'),
  245. 'weight' => ++$weight,
  246. 'replaces' => array(
  247. 'og:postal-code',
  248. ),
  249. ) + $og_defaults;
  250. $info['tags']['og:country_name'] = array(
  251. 'label' => t('Country name'),
  252. 'weight' => ++$weight,
  253. 'replaces' => array(
  254. 'og:country-name',
  255. ),
  256. ) + $og_defaults;
  257. $info['tags']['og:email'] = array(
  258. 'label' => t('Email'),
  259. 'weight' => ++$weight,
  260. 'devel_generate' => array(
  261. 'type' => 'email',
  262. ),
  263. ) + $og_defaults;
  264. $info['tags']['og:phone_number'] = array(
  265. 'label' => t('Phone number'),
  266. 'weight' => ++$weight,
  267. 'devel_generate' => array(
  268. 'type' => 'phone',
  269. ),
  270. ) + $og_defaults;
  271. $info['tags']['og:fax_number'] = array(
  272. 'label' => t('Fax number'),
  273. 'weight' => ++$weight,
  274. 'devel_generate' => array(
  275. 'type' => 'phone',
  276. ),
  277. ) + $og_defaults;
  278. $info['tags']['og:locale'] = array(
  279. 'label' => t('Locale'),
  280. 'description' => 'The locale these tags are marked up in, must be in the format language_TERRITORY. Default is en_US.',
  281. 'weight' => ++$weight,
  282. 'is_language' => TRUE,
  283. 'devel_generate' => array(
  284. 'maxlength' => 1,
  285. ),
  286. ) + $og_defaults;
  287. $info['tags']['og:locale:alternate'] = array(
  288. 'label' => t('Alternative locales'),
  289. 'description' => 'Other locales this content is available in, must be in the format language_TERRITORY, e.g. "fr_FR".',
  290. 'weight' => ++$weight,
  291. 'multiple' => TRUE,
  292. 'is_language' => TRUE,
  293. 'devel_generate' => array(
  294. 'maxlength' => 1,
  295. ),
  296. ) + $og_defaults;
  297. // For the "article" og:type.
  298. $article_defaults = array(
  299. 'dependencies' => array(
  300. array(
  301. 'dependency' => 'og:type',
  302. 'attribute' => 'value',
  303. 'condition' => 'value',
  304. 'value' => 'article',
  305. ),
  306. ),
  307. );
  308. $info['tags']['article:author'] = array(
  309. 'label' => t('Article author'),
  310. 'description' => t("Links an article to an author's Facebook profile, should be either URLs to the author's profile page or their Facebook profile IDs."),
  311. 'multiple' => TRUE,
  312. 'weight' => ++$weight,
  313. ) + $og_defaults + $article_defaults;
  314. $info['tags']['article:publisher'] = array(
  315. 'label' => t('Article publisher'),
  316. 'description' => t("Links an article to a publisher's Facebook page."),
  317. 'weight' => ++$weight,
  318. ) + $og_defaults + $article_defaults;
  319. $info['tags']['article:section'] = array(
  320. 'label' => t('Article section'),
  321. 'description' => t('The primary section of this website the content belongs to.'),
  322. 'weight' => ++$weight,
  323. ) + $og_defaults + $article_defaults;
  324. $info['tags']['article:tag'] = array(
  325. 'label' => t('Article tag(s)'),
  326. 'description' => t('Appropriate keywords for this content.'),
  327. 'multiple' => TRUE,
  328. 'weight' => ++$weight,
  329. ) + $og_defaults + $article_defaults;
  330. $info['tags']['article:published_time'] = array(
  331. 'label' => t('Article publication date & time'),
  332. 'description' => t("The date this content was published on, with an optional time value. Needs to be in <a href='http://en.wikipedia.org/wiki/ISO_8601'>ISO 8601</a> format."),
  333. 'weight' => ++$weight,
  334. ) + $og_defaults + $article_defaults;
  335. $info['tags']['article:modified_time'] = array(
  336. 'label' => t('Article modification date & time'),
  337. 'description' => t("The date this content was last modified, with an optional time value. Needs to be in <a href='http://en.wikipedia.org/wiki/ISO_8601'>ISO 8601</a> format."),
  338. 'weight' => ++$weight,
  339. ) + $og_defaults + $article_defaults;
  340. $info['tags']['article:expiration_time'] = array(
  341. 'label' => t('Article expiration date & time'),
  342. 'description' => t("The date this content will expire, with an optional time value. Needs to be in <a href='http://en.wikipedia.org/wiki/ISO_8601'>ISO 8601</a> format."),
  343. 'weight' => ++$weight,
  344. ) + $og_defaults + $article_defaults;
  345. // For the "profile" og:type.
  346. $profile_defaults = array(
  347. 'dependencies' => array(
  348. array(
  349. 'dependency' => 'og:type',
  350. 'attribute' => 'value',
  351. 'condition' => 'value',
  352. 'value' => 'profile',
  353. ),
  354. ),
  355. );
  356. $info['tags']['profile:first_name'] = array(
  357. 'label' => t('First name'),
  358. 'description' => t("The first name of the person who's Profile page this is."),
  359. 'weight' => ++$weight,
  360. ) + $og_defaults + $profile_defaults;
  361. $info['tags']['profile:last_name'] = array(
  362. 'label' => t('Last name'),
  363. 'description' => t("The person's last name."),
  364. 'weight' => ++$weight,
  365. ) + $og_defaults + $profile_defaults;
  366. $info['tags']['profile:username'] = array(
  367. 'label' => t('Username'),
  368. 'description' => t("A pseudonym / alias of this person."),
  369. 'weight' => ++$weight,
  370. ) + $og_defaults + $profile_defaults;
  371. $info['tags']['profile:gender'] = array(
  372. 'label' => t('Gender'),
  373. 'description' => t("Any of Facebook's gender values should be allowed, the initial two being 'male' and 'female'."),
  374. 'weight' => ++$weight,
  375. ) + $og_defaults + $profile_defaults;
  376. // Tags related to audio.
  377. $info['tags']['og:audio'] = array(
  378. 'label' => t('Audio URL'),
  379. 'description' => t('The URL to an audio file that complements this object.'),
  380. 'weight' => ++$weight,
  381. 'devel_generate' => array(
  382. 'type' => 'url',
  383. ),
  384. ) + $og_defaults;
  385. $info['tags']['og:audio:secure_url'] = array(
  386. 'label' => t('Audio secure URL'),
  387. 'description' => t('The secure URL to an audio file that complements this object. All "http://" URLs will automatically be converted to "https://".'),
  388. 'secure' => TRUE,
  389. 'weight' => ++$weight,
  390. 'devel_generate' => array(
  391. 'type' => 'url',
  392. ),
  393. ) + $og_defaults;
  394. $info['tags']['og:audio:type'] = array(
  395. 'label' => t('Audio type'),
  396. 'description' => t('The MIME type of the audio file. Examples include "application/mp3" for an MP3 file.'),
  397. 'weight' => ++$weight,
  398. ) + $og_defaults;
  399. // For the "book" og:type.
  400. $book_defaults = array(
  401. 'dependencies' => array(
  402. array(
  403. 'dependency' => 'og:type',
  404. 'attribute' => 'value',
  405. 'condition' => 'value',
  406. 'value' => 'book',
  407. ),
  408. ),
  409. );
  410. $info['tags']['book:author'] = array(
  411. 'label' => t("Book's author"),
  412. 'description' => t("Links to the book's author's Facebook profile, should be either URLs to the author's profile page or their Facebook profile IDs."),
  413. 'multiple' => TRUE,
  414. 'weight' => ++$weight,
  415. ) + $og_defaults + $book_defaults;
  416. $info['tags']['book:isbn'] = array(
  417. 'label' => t("Book's ISBN"),
  418. 'description' => t("The book's <a href=\"http://en.wikipedia.org/wiki/International_Standard_Book_Number\">International Standard Book Number</a>, which may be in one of several formats."),
  419. 'weight' => ++$weight,
  420. ) + $og_defaults + $book_defaults;
  421. $info['tags']['book:release_date'] = array(
  422. 'label' => t('Book release date'),
  423. 'description' => t("The date this content will expire, with an optional time value. Needs to be in <a href='http://en.wikipedia.org/wiki/ISO_8601'>ISO 8601</a> format."),
  424. 'weight' => ++$weight,
  425. ) + $og_defaults + $book_defaults;
  426. $info['tags']['book:tag'] = array(
  427. 'label' => t('Book tags'),
  428. 'description' => t('Appropriate keywords for this book.'),
  429. 'multiple' => TRUE,
  430. 'weight' => ++$weight,
  431. ) + $og_defaults + $book_defaults;
  432. // For the "video" og:type.
  433. $video_defaults = array();
  434. // 'dependencies' => array(
  435. // array(
  436. // 'dependency' => 'og:type',
  437. // 'attribute' => 'value',
  438. // 'condition' => 'value',
  439. // 'value' => 'profile',
  440. // ),
  441. // ),
  442. // );
  443. $info['tags']['og:video:url'] = array(
  444. 'label' => t('Video URL'),
  445. 'description' => t('The URL to a video file that complements this object.'),
  446. 'weight' => ++$weight,
  447. 'replaces' => array(
  448. 'og:video',
  449. ),
  450. 'devel_generate' => array(
  451. 'type' => 'url',
  452. ),
  453. ) + $og_defaults;
  454. $info['tags']['og:video:secure_url'] = array(
  455. 'label' => t('Video secure URL'),
  456. 'description' => t('A URL to a video file that complements this object using the HTTPS protocol. All "http://" URLs will automatically be converted to "https://".'),
  457. 'secure' => TRUE,
  458. 'weight' => ++$weight,
  459. 'devel_generate' => array(
  460. 'type' => 'url',
  461. ),
  462. ) + $og_defaults;
  463. $info['tags']['og:video:width'] = array(
  464. 'label' => t('Video width'),
  465. 'description' => t('The width of the video.'),
  466. 'weight' => ++$weight,
  467. 'devel_generate' => array(
  468. 'type' => 'integer',
  469. ),
  470. ) + $og_defaults;
  471. $info['tags']['og:video:height'] = array(
  472. 'label' => t('Video height'),
  473. 'description' => t('The height of the video.'),
  474. 'weight' => ++$weight,
  475. 'devel_generate' => array(
  476. 'type' => 'integer',
  477. ),
  478. ) + $og_defaults;
  479. $info['tags']['og:video:type'] = array(
  480. 'label' => t('Video type'),
  481. 'description' => t('The MIME type of the video file. Examples include "application/x-shockwave-flash" for a Flash video, or "text/html" if this is a standalone web page containing a video.'),
  482. 'weight' => ++$weight,
  483. ) + $og_defaults;
  484. $info['tags']['video:actor'] = array(
  485. 'label' => t('Actor(s)'),
  486. 'description' => t('Links to the Facebook profiles for actor(s) that appear in the video.'),
  487. 'multiple' => TRUE,
  488. 'weight' => ++$weight,
  489. ) + $og_defaults + $video_defaults;
  490. $info['tags']['video:actor:role'] = array(
  491. 'label' => t("Actors' role"),
  492. 'description' => t("The roles of the actor(s)."),
  493. 'multiple' => TRUE,
  494. 'weight' => ++$weight,
  495. ) + $og_defaults + $video_defaults;
  496. $info['tags']['video:director'] = array(
  497. 'label' => t('Director(s)'),
  498. 'description' => t('Links to the Facebook profiles for director(s) that worked on the video.'),
  499. 'weight' => ++$weight,
  500. ) + $og_defaults + $video_defaults;
  501. $info['tags']['video:writer'] = array(
  502. 'label' => t('Scriptwriter(s)'),
  503. 'description' => t('Links to the Facebook profiles for scriptwriter(s) for the video.'),
  504. 'multiple' => TRUE,
  505. 'weight' => ++$weight,
  506. ) + $og_defaults + $video_defaults;
  507. $info['tags']['video:duration'] = array(
  508. 'label' => t('Video duration (seconds)'),
  509. 'description' => t('The length of the video in seconds'),
  510. 'weight' => ++$weight,
  511. ) + $og_defaults + $video_defaults;
  512. $info['tags']['video:release_date'] = array(
  513. 'label' => t('Release date'),
  514. 'description' => t('The date the video was released.'),
  515. 'weight' => ++$weight,
  516. ) + $og_defaults + $video_defaults;
  517. $info['tags']['video:tag'] = array(
  518. 'label' => t('Tag'),
  519. 'description' => t('Tag words associated with this video.'),
  520. 'multiple' => TRUE,
  521. 'weight' => ++$weight,
  522. ) + $og_defaults + $video_defaults;
  523. $info['tags']['video:series'] = array(
  524. 'label' => t('Series'),
  525. 'description' => t('The TV show this series belongs to.'),
  526. 'weight' => ++$weight,
  527. 'dependencies' => array(
  528. array(
  529. 'dependency' => 'og:type',
  530. 'attribute' => 'value',
  531. 'condition' => 'value',
  532. 'value' => 'video.episode',
  533. ),
  534. ),
  535. ) + $og_defaults + $video_defaults;
  536. return $info;
  537. }
  538. function _metatag_opengraph_type_options() {
  539. $options = array(
  540. t('Activities') => array(
  541. 'activity' => t('Activity'),
  542. 'sport' => t('Sport'),
  543. ),
  544. t('Businesses') => array(
  545. 'bar' => t('Bar', array('context' => 'an establishment')),
  546. 'company' => t('Company'),
  547. 'cafe' => t('Cafe'),
  548. 'hotel' => t('Hotel'),
  549. 'restaurant' => t('Restaurant'),
  550. ),
  551. t('Groups') => array(
  552. 'cause' => t('Cause'),
  553. 'sports_league' => t('Sports league'),
  554. 'sports_team' => t('Sports team'),
  555. ),
  556. t('Organizations') => array(
  557. 'band' => t('Band'),
  558. 'government' => t('Government'),
  559. 'non_profit' => t('Non-profit'),
  560. 'school' => t('School'),
  561. 'university' => t('University'),
  562. ),
  563. t('People') => array(
  564. 'actor' => t('Actor'),
  565. 'athlete' => t('Athlete'),
  566. 'author' => t('Author'),
  567. 'director' => t('Director'),
  568. 'musician' => t('Musician'),
  569. 'politician' => t('Politician'),
  570. 'profile' => t('Profile'),
  571. 'public_figure' => t('Public figure'),
  572. ),
  573. t('Places') => array(
  574. 'city' => t('City'),
  575. 'country' => t('Country'),
  576. 'landmark' => t('Landmark'),
  577. 'state_province' => t('State or province'),
  578. ),
  579. t('Products and Entertainment') => array(
  580. 'album' => t('Album'),
  581. 'book' => t('Book'),
  582. 'drink' => t('Drink'),
  583. 'food' => t('Food'),
  584. 'game' => t('Game'),
  585. 'product' => t('Product'),
  586. 'song' => t('Song'),
  587. 'video.movie' => t('Movie'),
  588. 'video.tv_show' => t('TV show'),
  589. 'video.episode' => t('TV show episode'),
  590. 'video.other' => t('Miscellaneous video'),
  591. ),
  592. t('Websites') => array(
  593. 'website' => t('Website'),
  594. 'article' => t('Article (inc blog)'),
  595. ),
  596. );
  597. return $options;
  598. }