hook_update_status_alter

6 core.php hook_update_status_alter(&$projects)
7 update.api.php hook_update_status_alter(&$projects)
8 update.api.php hook_update_status_alter(&$projects)

Alter the information about available updates for projects.

Parameters

$projects: Reference to an array of information about available updates to each project installed on the system.

See also

update_calculate_project_data()

Related topics

1 invocation of hook_update_status_alter()

File

developer/hooks/core.php, line 1386
These are the hooks that are invoked by the Drupal core.

Code

function hook_update_status_alter(&$projects) {
  $settings = variable_get('update_advanced_project_settings', array());
  foreach ($projects as $project => $project_info) {
    if (isset($settings[$project]) && isset($settings[$project]['check']) && 
        ($settings[$project]['check'] == 'never' ||
         (isset($project_info['recommended']) &&
          $settings[$project]['check'] === $project_info['recommended']))) {
      $projects[$project]['status'] = UPDATE_NOT_CHECKED;
      $projects[$project]['reason'] = t('Ignored from settings');
      if (!empty($settings[$project]['notes'])) {
        $projects[$project]['extra'][] = array(
          'class' => 'admin-note', 
          'label' => t('Administrator note'), 
          'data' => $settings[$project]['notes'],
        );
      }
    }
  }
}
Login or register to post comments