Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The example provided for hook_variable_info() looks like this:
function hook_variable_info($options) {
$variables['site_name'] = array(
'type' => 'string',
'title' => t('Name', array(), $options),
'default' => 'Drupal',
'description' => t('The name of this website.', array(), $options),
'required' => TRUE,
);
$variables['site_403'] = array(
'type' => 'drupal_path',
'title' => t('Default 403 (access denied) page', array(), $options),
'default' => '',
'description' => t('This page is displayed when the requested document is denied to the current user. Leave blank to display a generic "access denied" page.', array(), $options),
);
return $variables;
}
The problem is that the 'required' element listed for the 'site_name' is not documented in the docblock above it, so are the docs wrong or is the example wrong?
Comments