You are here

function hook_quickedit_editor_metadata_alter in Quick Edit 7

Alter a field metadata that is used by the front-end.

Parameters

$metadata: Information used by the front-end to make the field in-place editable.

array $context: An array with the following key-value pairs:

  • 'entity_type': the entity type
  • 'entity': the entity object
  • 'field_name': the field name
  • 'field': (not provided for "extra" fields) the field instance as returned by field_info_instance()
  • 'items': (not provided for "extra" fields) the items of this field on this entity
1 invocation of hook_quickedit_editor_metadata_alter()
QuickEditMetadataGenerator::generateFieldMetadata in includes/QuickEditMetadataGenerator.php
Implements QuickEditMetadataGeneratorInterface::generateFieldMetadata().

File

./quickedit.api.php, line 87
Hooks provided by the Quick Edit module.

Code

function hook_quickedit_editor_metadata_alter(&$metadata, $context) {

  // Exclude every node title from in-place editing.
  if ($context['entity_type'] === 'node' && $context['field_name'] === 'title') {
    $metadata['access'] = FALSE;
  }
}