Commit d249b47f authored by swentel's avatar swentel

Add another example hook

parent 3a49776d
......@@ -140,9 +140,22 @@ Micropub.
If you are using a Micropub client (or in-built in a Reader), using one or
more syndication targets can help you to create an outbox request. Create a
syndication target which is not a URL. These won't be added then to the
webmention queue. Once done, you need to implement a hook with custom code:
webmention queue. Once done, you need to implement two hooks with custom code:
```
/**
* Implements hook_indieweb_micropub_node_pre_create_alter().
*/
function hook_indieweb_micropub_node_pre_create_alter(&$values, &$payload) {
// Reset mp-syndicate-to in case you configure to automatically send
// a webmention to the link found in in-reply-to.
if (!empty($payload['mp-syndicate-to'])) {
if (in_array('activitypub_reply', $payload['mp-syndicate-to'])) {
$payload['mp-syndicate-to'] = ['activitypub_reply'];
}
}
}
/**
* Implements hook_indieweb_micropub_node_saved().
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment