akirk / enable-mastodon-apps

Allow accessing your WordPress blog with Mastodon clients
https://wordpress.org/plugins/enable-mastodon-apps
GNU General Public License v2.0
34 stars 5 forks source link

Add the Hooks Documentation in the Wiki #86

Closed akirk closed 4 months ago

akirk commented 4 months ago

This adds a script that extracts the hooks offered by the Enable Mastodon Apps plugin and writes to the Enable Mastodon Apps Wiki Hooks Documentation.

This is a screenshot of the mastodon_api_account page.

Screenshot 2024-03-16 at 06 16 52

Adding Hook Documentation

In this PR you can also see how hooks can be documented:

Add a comment block before the apply_filters or do_action function call. The first line will be the text displayed in the hooks list:

Screenshot 2024-03-16 at 06 21 50

Other lines appear on the documentation page (Example: mastodon_api_account).

Add example code by writing:

* Example:
* ```php
* apply_filters( 'hook_name', function ( $params ) {
*    // modify params
*    return $params;
* } );
* ```

Extraction process