You are here

function hook_social_media_links_platform_info in Social Media Links Block and Field 7

Defines all platforms by the module.

Return value

array An associative array whose keys define the key for the platform (social network) and contains information about the platform. Each platform description is itself an associative array, with the following key-value pairs:

  • title: (required) The name of the platform / social network.
  • base url: (required) The base url for the platform (prefix) to build the link: {base url} + {user value} = link url The base url will be shown on the configuration page before the input field.
  • link attributes:
  • image alt: A optional alternativ text that will be used for the icon alt attribute.
1 function implements hook_social_media_links_platform_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

social_media_links_social_media_links_platform_info in ./social_media_links.platforms.inc
Register the default platforms.
1 invocation of hook_social_media_links_platform_info()
social_media_links_platforms in ./social_media_links.module
Get the available platforms.

File

./social_media_links.api.php, line 26
API documentation for Social Media Links Block module.

Code

function hook_social_media_links_platform_info() {
  $platforms = array();

  // A simple example for twitter.
  $platforms['twitter'] = array(
    'title' => t('Twitter'),
    'base url' => 'http://www.twitter.com/',
  );

  // A expample for Google+ with an alternative alt text.
  $platforms['googleplus'] = array(
    'title' => t('Google+'),
    'base url' => 'https://plus.google.com/',
    'image alt' => 'Google+ icon',
  );
  return $platforms;
}