You are here

function hook_metatag_tags_alter in Schema.org Metatag 8.2

Adjust Schema Metatags tags.

Use hook_metatag_tags_alter() to change tag information.

Schema Metatag adds new information to the standard Metatag definition. Use this hook to alter that information.

Parameters

array $definitions: An array of the tag definitions.

File

./schema_metatag.api.php, line 19
Document all supported APIs.

Code

function hook_metatag_tags_alter(&$definitions) {

  // Set up the Schema Service tags to only display "GovernmentService" in the
  // @type option list.
  $definitions['schema_service_type']['property_type'] = 'type';
  $definitions['schema_service_type']['tree_parent'] = [
    'GovernmentService',
  ];
  $definitions['schema_service_type']['tree_depth'] = 0;

  // Set up the Schema Organization tags to display every "LocalBusiness" option
  // in the @type option list.
  $definitions['schema_organization_type']['property_type'] = 'type';
  $definitions['schema_organization_type']['tree_parent'] = [
    'LocalBusiness',
  ];
  $definitions['schema_organization_type']['tree_depth'] = -1;

  // Use a different PropertyType plugin for Schema Recipe instructions, the
  // HowToStep instead of the Text type used by Schema Recipe. Make it a multiple
  // value too since there will be more than one step.
  $definitions['schema_recipe_recipe_instructions']['property_type'] = 'how_to_step';
  $definitions['schema_recipe_recipe_instructions']['tree_parent'] = [
    'HowToStep',
  ];
  $definitions['schema_recipe_recipe_instructions']['tree_depth'] = -1;
  $definitions['schema_recipe_recipe_instructions']['multiple'] = TRUE;
}