hElementDiscover
This hook is used to list all the available Elements provided by the currently installed plugins.
You shouldn’t use this hook directly. Use the default implementation provided by the JavaScript Plugin object. See Elements for details.
A plugin should append to the elements
array, being careful not to remove any entries added by other plugins. For example,
P.hook('hElementDiscover', function(response) { response.elements.push( ["example_plugin:test", "Example Test Element"] ); });
Arguments
This hook does not take any arguments.
Response
Return information by changing these properties of the response
object.
Name | Type | Description |
elements |
Array |
Append an array of [name, description] for each Element. |
JavaScript template
P.hook('hElementDiscover', function(response) { // Respond to hook, for example // response.elements = ... });