You are here

function hook_bodyclasses_info in Body Classes 7

Exposes different methods to obtain classes for the body tag.

Return value

array An associative array, keyed by machine name, where the "name" represents a human readable name for the method, and "function" is a callable function to retrieve the related classes.

See also

bodyclasses_bodyclasses_info()

1 function implements hook_bodyclasses_info()

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

bodyclasses_bodyclasses_info in ./bodyclasses.module
Implements hook_bodyclasses_info().
2 invocations of hook_bodyclasses_info()
bodyclasses_admin in ./bodyclasses.admin.inc
Menu callback for the Body Classes module to display its administration.
bodyclasses_get_bodyclasses in ./bodyclasses.module
Retrieve all body classes defined by all modules.

File

./bodyclasses.api.php, line 17
API documentation for the Body Classes Drupal module.

Code

function hook_bodyclasses_info() {

  // Tell the Body Classes module that we can add classes about the Node to
  // the body tag.
  if (module_exists('node')) {
    $bodyclasses['node'] = array(
      // The human readable name.
      'name' => t('Node'),
      // The function that will return an array of all related classes.
      'function' => 'mymodule_bodyclasses_node',
    );
  }
  return $bodyclasses;
}