Update FILTERS.md

This commit is contained in:
Tetrakern 2024-10-13 21:18:24 +02:00
parent ca4e93e17a
commit 467688b6a7

View File

@ -476,6 +476,47 @@ Filters the intermediate output array of the chapter support links in the `ficti
---
### `apply_filters( 'fictioneer_filter_enable_chapter_list_transients', $bool, $post_id )`
Filters the boolean return value of the `fictioneer_enable_chapter_list_transients()` function. By default, this depends on the `fictioneer_caching_active()` function returning false and the `fictioneer_disable_chapter_list_transients` option being off.
**Parameter:**
* $bool (boolean) Whether the Transients are enabled or not.
* $post_id (int) Post ID of the story.
---
### `apply_filters( 'fictioneer_filter_enable_menu_transients', $bool, $location )`
Filters the boolean return value of the `fictioneer_enable_chapter_list_transients()` function. By default, this depends on the `fictioneer_caching_active()` function returning false and the `fictioneer_disable_chapter_list_transients` option being off. Possible locations are 'nav_menu', 'mobile_nav_menu', and 'footer_menu'.
**Parameter:**
* $bool (boolean) Whether the Transients are enabled or not.
* $location (string) Location identifier of the menu.
---
### `apply_filters( 'fictioneer_filter_enable_shortcode_transients', $bool, $shortcode )`
Filters the boolean return value of the `fictioneer_enable_shortcode_transients()` function. By default, this depends on the `FICTIONEER_SHORTCODE_TRANSIENT_EXPIRATION` constant being greater than -1 and the `fictioneer_disable_shortcode_transients` option being off. This can conflict with external object caches.
**Parameter:**
* $bool (boolean) Whether the Transients are enabled or not.
* $shortcode (string|null) The shortcode in question for reference.
**Example:**
```php
function child_enable_shortcode_transients_for_frontpage( $bool ) {
// Specifically turn on Transients on the frontpage (if not cached in ANY way),
// ignoring the setting option.
if ( is_front_page() ) {
return true;
}
return $bool;
}
add_filter( 'fictioneer_filter_enable_shortcode_transients', 'child_enable_shortcode_transients_for_frontpage' );
```
---
### `apply_filters( 'fictioneer_filter_get_support_links', $links, $post_id, $parent_id, $author_id )`
Filters the array of support links returned for the current post (or post ID if provided). First it checks the post meta, then the parent post meta (if any), and finally the author meta if still empty. The first non-empty value is added to the array.
@ -1681,14 +1722,6 @@ Filters the WP_Query arguments in the `fictioneer_showcase` shortcode. The optio
---
### `apply_filters( 'fictioneer_filter_enable_shortcode_transients', $bool )`
Filters the boolean return value of the `fictioneer_enable_shortcode_transients()` function. By default, this depends on the `FICTIONEER_SHORTCODE_TRANSIENT_EXPIRATION` constant being greater than -1. Because the Transients would interfere with caching. If you exclude a page from caching, it might make sense to turn them on for that page.
**Parameter:**
* $bool (boolean) Whether the Transients are enabled or not by default.
---
### `apply_filters( 'fictioneer_filter_sitemap_page_template_excludes', $excludes )`
Filters the exclusion array of page templates for the custom theme sitemap. By default, these are `'user-profile.php'`, `'singular-bookmarks.php'`, `'singular-bookshelf.php'`, and `'singular-bookshelf-ajax.php'`.