Working on some custom functionality, or building out a new fieldtype? Bloqs was built with you in mind and comes packaged with some features to make your life as easy as possible.
The blocks_discover_fieldtypes hook is called when Bloqs needs to determine which fieldtypes support Bloqs. 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 Bloqs calls a method on the fieldtype, it first checks if the adapter has the same method, and calls it instead. If the adapter has asetFieldtype method, it will be called with the actual fieldtype that is being shimmed.
The blocks_post_save hook is called after Bloqs has finished saving.
The parameters that are passed to the hook are as follows: