The blocks_discover_fieldtypes hook is called when Blocks needs to determine which fieldtypes support Blocks. Extensions may add or remove fieldtypes from the list of valid fieldtypes.

blocks_discover_fieldtypes is called with a single PHP array of stdClass objects, and should return that same PHP array, potentially modified.

The format of the objects within the array is as follows:

  • type – ExpressionEngine's identifier for the fieldtype. E.g. 'wygwam'.
  • version – The version of the fieldtype. E.g., '1.2'.
  • name – The human-readable name of the fieldtype. E.g. 'Wygwam'.
  • adapter (optional) – An object that serves as an adapter to a fieldtype. If the adapter is set, before Blocks calls a method on the fieldtype, it first checks if the adapter has the same method, and calls it instead. If the adapter has a setFieldtype method, it will be called with the actual fieldtype that is being shimmed.


The blocks_post_save hook is called after Blocks has finished saving.

The parameters that are passed to the hook follow:

  • blocks – The blocks that now belong to the field.
  • context – The context of the field, as an array.
    • $context['site_id']
    • $context['entry_id']
    • $context['field_id']