You are here

function _social_media_links_cleanup_platforms in Social Media Links Block and Field 7

Helper function to clean up the platforms array from the empty values.

Parameters

array $platforms: The array with the platforms.

Return value

array The cleaned platforms array.

2 calls to _social_media_links_cleanup_platforms()
social_media_links_block_view in ./social_media_links.module
Implements hook_block_view().
social_media_links_widget_render in plugins/content_types/social_media_link_widget.inc

File

./social_media_links.module, line 707
Functions for the Social Media Links module.

Code

function _social_media_links_cleanup_platforms($platforms) {
  foreach ((array) $platforms as $key => $platform) {
    if (empty($platform['platform_value'])) {
      unset($platforms[$key]);
    }
  }
  return $platforms;
}