metatag_opengraph.metatag.inc 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  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. 'maxlength' => 0,
  123. 'weight' => ++$weight,
  124. ) + $og_defaults;
  125. $info['tags']['og:determiner'] = array(
  126. 'label' => t('Content title determiner'),
  127. '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."),
  128. 'weight' => ++$weight,
  129. 'form' => array(
  130. '#type' => 'select',
  131. '#options' => array(
  132. 'auto' => 'Automatic',
  133. 'a' => 'A',
  134. 'an' => 'An',
  135. 'the' => 'The',
  136. ),
  137. '#empty_option' => t('- Ignore -'),
  138. ),
  139. 'devel_generate' => array(
  140. 'type' => 'select',
  141. ),
  142. ) + $og_defaults;
  143. $info['tags']['og:description'] = array(
  144. 'label' => t('Content description'),
  145. 'description' => t('A one to two sentence description of the content.'),
  146. 'maxlength' => 0,
  147. 'weight' => ++$weight,
  148. ) + $og_defaults;
  149. // Basic tags.
  150. $info['tags']['og:updated_time'] = array(
  151. 'label' => t('Content modification date & time'),
  152. '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."),
  153. 'weight' => ++$weight,
  154. ) + $og_defaults;
  155. $info['tags']['og:see_also'] = array(
  156. 'label' => t('See also'),
  157. 'description' => t('URLs to related content.'),
  158. 'multiple' => TRUE,
  159. 'weight' => ++$weight,
  160. ) + $og_defaults;
  161. $info['tags']['og:image'] = array(
  162. 'label' => t('Image'),
  163. 'description' => t('The URL of an image which should represent the content. The image must be at least 200 x 200 pixels in size; 600 x 316 pixels is a recommended minimum size, and for best results use an image least 1200 x 630 pixels in size. 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 specifically the first one.'),
  164. 'multiple' => TRUE,
  165. 'image' => TRUE,
  166. 'weight' => ++$weight,
  167. 'devel_generate' => array(
  168. 'type' => 'image',
  169. ),
  170. ) + $og_defaults;
  171. $info['tags']['og:image:url'] = array(
  172. 'label' => t('Image URL'),
  173. '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.'),
  174. 'multiple' => TRUE,
  175. 'image' => TRUE,
  176. 'weight' => ++$weight,
  177. 'devel_generate' => array(
  178. 'type' => 'image',
  179. ),
  180. ) + $og_defaults;
  181. $info['tags']['og:image:secure_url'] = array(
  182. 'label' => t('Secure image URL'),
  183. '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.'),
  184. 'multiple' => TRUE,
  185. 'secure' => TRUE,
  186. 'image' => TRUE,
  187. 'weight' => ++$weight,
  188. 'devel_generate' => array(
  189. 'type' => 'image',
  190. ),
  191. ) + $og_defaults;
  192. $info['tags']['og:image:type'] = array(
  193. 'label' => t('Image type'),
  194. '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.'),
  195. 'multiple' => TRUE,
  196. 'weight' => ++$weight,
  197. ) + $og_defaults;
  198. $info['tags']['og:image:width'] = array(
  199. 'label' => t('Image width'),
  200. '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.'),
  201. 'multiple' => TRUE,
  202. 'weight' => ++$weight,
  203. 'devel_generate' => array(
  204. 'type' => 'image',
  205. ),
  206. ) + $og_defaults;
  207. $info['tags']['og:image:height'] = array(
  208. 'label' => t('Image height'),
  209. '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.'),
  210. 'multiple' => TRUE,
  211. 'weight' => ++$weight,
  212. 'devel_generate' => array(
  213. 'type' => 'image',
  214. ),
  215. ) + $og_defaults;
  216. $info['tags']['og:latitude'] = array(
  217. 'label' => t('Latitude'),
  218. 'weight' => ++$weight,
  219. 'devel_generate' => array(
  220. 'type' => 'float',
  221. ),
  222. ) + $og_defaults;
  223. $info['tags']['og:longitude'] = array(
  224. 'label' => t('Longitude'),
  225. 'weight' => ++$weight,
  226. 'devel_generate' => array(
  227. 'type' => 'float',
  228. ),
  229. ) + $og_defaults;
  230. $info['tags']['og:street_address'] = array(
  231. 'label' => t('Street address'),
  232. 'weight' => ++$weight,
  233. 'replaces' => array(
  234. 'og:street-address',
  235. ),
  236. ) + $og_defaults;
  237. $info['tags']['og:locality'] = array(
  238. 'label' => t('Locality'),
  239. 'weight' => ++$weight,
  240. ) + $og_defaults;
  241. $info['tags']['og:region'] = array(
  242. 'label' => t('Region'),
  243. 'weight' => ++$weight,
  244. ) + $og_defaults;
  245. $info['tags']['og:postal_code'] = array(
  246. 'label' => t('Postal/ZIP code'),
  247. 'weight' => ++$weight,
  248. 'replaces' => array(
  249. 'og:postal-code',
  250. ),
  251. ) + $og_defaults;
  252. $info['tags']['og:country_name'] = array(
  253. 'label' => t('Country name'),
  254. 'weight' => ++$weight,
  255. 'replaces' => array(
  256. 'og:country-name',
  257. ),
  258. ) + $og_defaults;
  259. $info['tags']['og:email'] = array(
  260. 'label' => t('Email'),
  261. 'weight' => ++$weight,
  262. 'devel_generate' => array(
  263. 'type' => 'email',
  264. ),
  265. ) + $og_defaults;
  266. $info['tags']['og:phone_number'] = array(
  267. 'label' => t('Phone number'),
  268. 'weight' => ++$weight,
  269. 'devel_generate' => array(
  270. 'type' => 'phone',
  271. ),
  272. ) + $og_defaults;
  273. $info['tags']['og:fax_number'] = array(
  274. 'label' => t('Fax number'),
  275. 'weight' => ++$weight,
  276. 'devel_generate' => array(
  277. 'type' => 'phone',
  278. ),
  279. ) + $og_defaults;
  280. $info['tags']['og:locale'] = array(
  281. 'label' => t('Locale'),
  282. 'description' => 'The locale these tags are marked up in, must be in the format language_TERRITORY. Default is en_US.',
  283. 'weight' => ++$weight,
  284. 'is_language' => TRUE,
  285. 'devel_generate' => array(
  286. 'maxlength' => 1,
  287. ),
  288. ) + $og_defaults;
  289. $info['tags']['og:locale:alternate'] = array(
  290. 'label' => t('Alternative locales'),
  291. 'description' => 'Other locales this content is available in, must be in the format language_TERRITORY, e.g. "fr_FR".',
  292. 'weight' => ++$weight,
  293. 'multiple' => TRUE,
  294. 'is_language' => TRUE,
  295. 'devel_generate' => array(
  296. 'maxlength' => 1,
  297. ),
  298. ) + $og_defaults;
  299. // For the "article" og:type.
  300. $article_defaults = array(
  301. 'dependencies' => array(
  302. array(
  303. 'dependency' => 'og:type',
  304. 'attribute' => 'value',
  305. 'condition' => 'value',
  306. 'value' => 'article',
  307. ),
  308. ),
  309. );
  310. $info['tags']['article:author'] = array(
  311. 'label' => t('Article author'),
  312. '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."),
  313. 'multiple' => TRUE,
  314. 'weight' => ++$weight,
  315. ) + $og_defaults + $article_defaults;
  316. $info['tags']['article:publisher'] = array(
  317. 'label' => t('Article publisher'),
  318. 'description' => t("Links an article to a publisher's Facebook page."),
  319. 'weight' => ++$weight,
  320. ) + $og_defaults + $article_defaults;
  321. $info['tags']['article:section'] = array(
  322. 'label' => t('Article section'),
  323. 'description' => t('The primary section of this website the content belongs to.'),
  324. 'weight' => ++$weight,
  325. ) + $og_defaults + $article_defaults;
  326. $info['tags']['article:tag'] = array(
  327. 'label' => t('Article tag(s)'),
  328. 'description' => t('Appropriate keywords for this content.'),
  329. 'multiple' => TRUE,
  330. 'weight' => ++$weight,
  331. ) + $og_defaults + $article_defaults;
  332. $info['tags']['article:published_time'] = array(
  333. 'label' => t('Article publication date & time'),
  334. '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."),
  335. 'weight' => ++$weight,
  336. ) + $og_defaults + $article_defaults;
  337. $info['tags']['article:modified_time'] = array(
  338. 'label' => t('Article modification date & time'),
  339. '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."),
  340. 'weight' => ++$weight,
  341. ) + $og_defaults + $article_defaults;
  342. $info['tags']['article:expiration_time'] = array(
  343. 'label' => t('Article expiration date & time'),
  344. '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."),
  345. 'weight' => ++$weight,
  346. ) + $og_defaults + $article_defaults;
  347. // For the "profile" og:type.
  348. $profile_defaults = array(
  349. 'dependencies' => array(
  350. array(
  351. 'dependency' => 'og:type',
  352. 'attribute' => 'value',
  353. 'condition' => 'value',
  354. 'value' => 'profile',
  355. ),
  356. ),
  357. );
  358. $info['tags']['profile:first_name'] = array(
  359. 'label' => t('First name'),
  360. 'description' => t("The first name of the person who's Profile page this is."),
  361. 'weight' => ++$weight,
  362. ) + $og_defaults + $profile_defaults;
  363. $info['tags']['profile:last_name'] = array(
  364. 'label' => t('Last name'),
  365. 'description' => t("The person's last name."),
  366. 'weight' => ++$weight,
  367. ) + $og_defaults + $profile_defaults;
  368. $info['tags']['profile:username'] = array(
  369. 'label' => t('Username'),
  370. 'description' => t("A pseudonym / alias of this person."),
  371. 'weight' => ++$weight,
  372. ) + $og_defaults + $profile_defaults;
  373. $info['tags']['profile:gender'] = array(
  374. 'label' => t('Gender'),
  375. 'description' => t("Any of Facebook's gender values should be allowed, the initial two being 'male' and 'female'."),
  376. 'weight' => ++$weight,
  377. ) + $og_defaults + $profile_defaults;
  378. // Tags related to audio.
  379. $info['tags']['og:audio'] = array(
  380. 'label' => t('Audio URL'),
  381. 'description' => t('The URL to an audio file that complements this object.'),
  382. 'weight' => ++$weight,
  383. 'devel_generate' => array(
  384. 'type' => 'url',
  385. ),
  386. ) + $og_defaults;
  387. $info['tags']['og:audio:secure_url'] = array(
  388. 'label' => t('Audio secure URL'),
  389. 'description' => t('The secure URL to an audio file that complements this object. All "http://" URLs will automatically be converted to "https://".'),
  390. 'secure' => TRUE,
  391. 'weight' => ++$weight,
  392. 'devel_generate' => array(
  393. 'type' => 'url',
  394. ),
  395. ) + $og_defaults;
  396. $info['tags']['og:audio:type'] = array(
  397. 'label' => t('Audio type'),
  398. 'description' => t('The MIME type of the audio file. Examples include "application/mp3" for an MP3 file.'),
  399. 'weight' => ++$weight,
  400. ) + $og_defaults;
  401. // For the "book" og:type.
  402. $book_defaults = array(
  403. 'dependencies' => array(
  404. array(
  405. 'dependency' => 'og:type',
  406. 'attribute' => 'value',
  407. 'condition' => 'value',
  408. 'value' => 'book',
  409. ),
  410. ),
  411. );
  412. $info['tags']['book:author'] = array(
  413. 'label' => t("Book's author"),
  414. '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."),
  415. 'multiple' => TRUE,
  416. 'weight' => ++$weight,
  417. ) + $og_defaults + $book_defaults;
  418. $info['tags']['book:isbn'] = array(
  419. 'label' => t("Book's ISBN"),
  420. '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."),
  421. 'weight' => ++$weight,
  422. ) + $og_defaults + $book_defaults;
  423. $info['tags']['book:release_date'] = array(
  424. 'label' => t('Book release date'),
  425. '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."),
  426. 'weight' => ++$weight,
  427. ) + $og_defaults + $book_defaults;
  428. $info['tags']['book:tag'] = array(
  429. 'label' => t('Book tags'),
  430. 'description' => t('Appropriate keywords for this book.'),
  431. 'multiple' => TRUE,
  432. 'weight' => ++$weight,
  433. ) + $og_defaults + $book_defaults;
  434. // For the "video" og:type.
  435. $video_defaults = array();
  436. // 'dependencies' => array(
  437. // array(
  438. // 'dependency' => 'og:type',
  439. // 'attribute' => 'value',
  440. // 'condition' => 'value',
  441. // 'value' => 'profile',
  442. // ),
  443. // ),
  444. // );
  445. $info['tags']['og:video:url'] = array(
  446. 'label' => t('Video URL'),
  447. 'description' => t('The URL to a video file that complements this object.'),
  448. 'weight' => ++$weight,
  449. 'replaces' => array(
  450. 'og:video',
  451. ),
  452. 'devel_generate' => array(
  453. 'type' => 'url',
  454. ),
  455. ) + $og_defaults;
  456. $info['tags']['og:video:secure_url'] = array(
  457. 'label' => t('Video secure URL'),
  458. '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://".'),
  459. 'secure' => TRUE,
  460. 'weight' => ++$weight,
  461. 'devel_generate' => array(
  462. 'type' => 'url',
  463. ),
  464. ) + $og_defaults;
  465. $info['tags']['og:video:width'] = array(
  466. 'label' => t('Video width'),
  467. 'description' => t('The width of the video.'),
  468. 'weight' => ++$weight,
  469. 'devel_generate' => array(
  470. 'type' => 'integer',
  471. ),
  472. ) + $og_defaults;
  473. $info['tags']['og:video:height'] = array(
  474. 'label' => t('Video height'),
  475. 'description' => t('The height of the video.'),
  476. 'weight' => ++$weight,
  477. 'devel_generate' => array(
  478. 'type' => 'integer',
  479. ),
  480. ) + $og_defaults;
  481. $info['tags']['og:video:type'] = array(
  482. 'label' => t('Video type'),
  483. '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.'),
  484. 'weight' => ++$weight,
  485. ) + $og_defaults;
  486. $info['tags']['video:actor'] = array(
  487. 'label' => t('Actor(s)'),
  488. 'description' => t('Links to the Facebook profiles for actor(s) that appear in the video.'),
  489. 'multiple' => TRUE,
  490. 'weight' => ++$weight,
  491. ) + $og_defaults + $video_defaults;
  492. $info['tags']['video:actor:role'] = array(
  493. 'label' => t("Actors' role"),
  494. 'description' => t("The roles of the actor(s)."),
  495. 'multiple' => TRUE,
  496. 'weight' => ++$weight,
  497. ) + $og_defaults + $video_defaults;
  498. $info['tags']['video:director'] = array(
  499. 'label' => t('Director(s)'),
  500. 'description' => t('Links to the Facebook profiles for director(s) that worked on the video.'),
  501. 'weight' => ++$weight,
  502. ) + $og_defaults + $video_defaults;
  503. $info['tags']['video:writer'] = array(
  504. 'label' => t('Scriptwriter(s)'),
  505. 'description' => t('Links to the Facebook profiles for scriptwriter(s) for the video.'),
  506. 'multiple' => TRUE,
  507. 'weight' => ++$weight,
  508. ) + $og_defaults + $video_defaults;
  509. $info['tags']['video:duration'] = array(
  510. 'label' => t('Video duration (seconds)'),
  511. 'description' => t('The length of the video in seconds'),
  512. 'weight' => ++$weight,
  513. ) + $og_defaults + $video_defaults;
  514. $info['tags']['video:release_date'] = array(
  515. 'label' => t('Release date'),
  516. 'description' => t('The date the video was released.'),
  517. 'weight' => ++$weight,
  518. ) + $og_defaults + $video_defaults;
  519. $info['tags']['video:tag'] = array(
  520. 'label' => t('Tag'),
  521. 'description' => t('Tag words associated with this video.'),
  522. 'multiple' => TRUE,
  523. 'weight' => ++$weight,
  524. ) + $og_defaults + $video_defaults;
  525. $info['tags']['video:series'] = array(
  526. 'label' => t('Series'),
  527. 'description' => t('The TV show this series belongs to.'),
  528. 'weight' => ++$weight,
  529. 'dependencies' => array(
  530. array(
  531. 'dependency' => 'og:type',
  532. 'attribute' => 'value',
  533. 'condition' => 'value',
  534. 'value' => 'video.episode',
  535. ),
  536. ),
  537. ) + $og_defaults + $video_defaults;
  538. return $info;
  539. }
  540. function _metatag_opengraph_type_options() {
  541. $options = array(
  542. t('Activities') => array(
  543. 'activity' => t('Activity'),
  544. 'sport' => t('Sport'),
  545. ),
  546. t('Businesses') => array(
  547. 'bar' => t('Bar', array('context' => 'an establishment')),
  548. 'company' => t('Company'),
  549. 'cafe' => t('Cafe'),
  550. 'hotel' => t('Hotel'),
  551. 'restaurant' => t('Restaurant'),
  552. ),
  553. t('Groups') => array(
  554. 'cause' => t('Cause'),
  555. 'sports_league' => t('Sports league'),
  556. 'sports_team' => t('Sports team'),
  557. ),
  558. t('Organizations') => array(
  559. 'band' => t('Band'),
  560. 'government' => t('Government'),
  561. 'non_profit' => t('Non-profit'),
  562. 'school' => t('School'),
  563. 'university' => t('University'),
  564. ),
  565. t('People') => array(
  566. 'actor' => t('Actor'),
  567. 'athlete' => t('Athlete'),
  568. 'author' => t('Author'),
  569. 'director' => t('Director'),
  570. 'musician' => t('Musician'),
  571. 'politician' => t('Politician'),
  572. 'profile' => t('Profile'),
  573. 'public_figure' => t('Public figure'),
  574. ),
  575. t('Places') => array(
  576. 'city' => t('City'),
  577. 'country' => t('Country'),
  578. 'landmark' => t('Landmark'),
  579. 'place' => t('Place'),
  580. 'state_province' => t('State or province'),
  581. ),
  582. t('Products and Entertainment') => array(
  583. 'album' => t('Album'),
  584. 'book' => t('Book'),
  585. 'drink' => t('Drink'),
  586. 'food' => t('Food'),
  587. 'game' => t('Game'),
  588. 'product' => t('Product'),
  589. 'product.group' => t('Product group'),
  590. 'song' => t('Song'),
  591. 'video.movie' => t('Movie'),
  592. 'video.tv_show' => t('TV show'),
  593. 'video.episode' => t('TV show episode'),
  594. 'video.other' => t('Miscellaneous video'),
  595. ),
  596. t('Websites') => array(
  597. 'website' => t('Website'),
  598. 'article' => t('Article (inc blog)'),
  599. ),
  600. );
  601. return $options;
  602. }