You are here

function date_deploy_get_date_fields in Deploy - Content Staging 6

Get an array of all date fields.

Return value

Array of date fields, keyed by name.

1 call to date_deploy_get_date_fields()
date_node_deploy in modules/date_deploy/date_deploy.module
Implementation of hook_node_deploy().

File

modules/date_deploy/date_deploy.module, line 9

Code

function date_deploy_get_date_fields() {

  // This isn't changing much, so cache it to save some queries.
  static $date_fields = array();
  if (empty($date_fields)) {

    // TODO: determine a better way to grab all available date types.
    $date_types = array(
      'datetime',
      'date',
      'datestamp',
    );
    $fields = content_fields();
    foreach ($fields as $name => $field) {
      if (in_array($field['type'], $date_types)) {
        $date_fields[$name] = $field;
      }
    }
  }
  return $date_fields;
}