You are here

public static function ShareaholicUtilities::turn_on_locations in Share Buttons, Related Posts, Content Analytics - Shareaholic 8

Same name and namespace in other branches
  1. 7.3 utilities.php \ShareaholicUtilities::turn_on_locations()

Passed an array of location names mapped to ids per app.

Parameters

array $array:

1 call to ShareaholicUtilities::turn_on_locations()
ShareaholicUtilities::set_default_location_settings in ./utilities.php
Given an object, set the default on/off locations for share buttons and recommendations

File

./utilities.php, line 602

Class

ShareaholicUtilities

Code

public static function turn_on_locations($array, $turn_off_array = array()) {
  if (is_array($array)) {
    foreach ($array as $app => $ids) {
      if (is_array($ids)) {
        foreach ($ids as $name => $id) {
          self::update_options(array(
            $app => array(
              $name => 'on',
            ),
          ));
        }
      }
    }
  }
  if (is_array($turn_off_array)) {
    foreach ($turn_off_array as $app => $ids) {
      if (is_array($ids)) {
        foreach ($ids as $name => $id) {
          self::update_options(array(
            $app => array(
              $name => 'off',
            ),
          ));
        }
      }
    }
  }
}