Update intro text for action and filter docs

This commit is contained in:
Tetrakern 2024-04-15 23:15:28 +02:00
parent ede5710fc7
commit 0514d53196
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
# Actions
The following [action hooks](https://developer.wordpress.org/reference/functions/do_action/) can be used to customize templates without the need to duplicate the template files, greatly reducing the risk of them becoming outdated due to updates in the future. Actions can be easily added or overwritten in child themes or plugins. See `includes/functions/hooks/`.
The following [action hooks](https://developer.wordpress.org/reference/functions/do_action/) can be used to customize templates without the need to duplicate template files, greatly reducing the risk of them becoming outdated due to updates in the future. Actions can be easily added or overwritten in child themes or plugins. This list is probably incomplete. See `includes/functions/hooks/`.
### Example: Add Discord invite link to chapter top actions
This is an example of how to add a Discord invite link to the chapter top actions via the the `fictioneer_chapter_actions_top_center` hook. The link will feature a [Font Awesome Discord icon](https://fontawesome.com/icons/discord?f=brands) and be located between the formatting modal toggle (priority: 10) and fullscreen buttons (priority: 20). Note that no arguments of the hook are used because we do not need any of them here.

View File

@ -1,5 +1,5 @@
# Filters
The following [filter hooks](https://developer.wordpress.org/reference/functions/add_filter/) can be used to customize the output of action hooks and other functions without having to modify said functions. Filters can be easily added or overwritten in child themes or plugins. See `includes/functions/hooks/`.
The following [filter hooks](https://developer.wordpress.org/reference/functions/add_filter/) can be used to customize the output of action hooks and other functions without having to modify said functions. Filters can be easily added or overwritten in child themes or plugins. This list is probably incomplete. See `includes/functions/hooks/`.
### Example: Add link to subscription options
This is an example of how to add a link to the subscription popup menu via the `'fictioneer_filter_subscribe_buttons'` hook. The link will feature a [Font Awesome link icon](https://fontawesome.com/icons/link?s=solid&f=classic) and be added in first place. Note how the link is pulled from the authors meta data, which you would need to add yourself as it does not exist outside this example.