Extend filter

This commit is contained in:
Tetrakern 2024-04-08 09:29:22 +02:00
parent 65af4d3239
commit 2d2ccbc3ed
2 changed files with 6 additions and 2 deletions

View File

@ -1330,7 +1330,7 @@ Filters the intermediate output array in the `_card-story.php` partial before it
---
### `apply_filters( 'fictioneer_filter_story_chapter_posts_query', $query_args )`
### `apply_filters( 'fictioneer_filter_story_chapter_posts_query', $query_args, $story_id, $chapter_ids )`
Filters the arguments for the story chapter posts query, an utility function called in various places. There are two variants depending on whether the `FICTIONEER_QUERY_ID_ARRAY_LIMIT` is exceeded or not.
**$query_args:**
@ -1345,6 +1345,10 @@ Filters the arguments for the story chapter posts query, an utility function cal
* $no_found_rows (boolean) - Do not return number of rows. Default `true`.
* $update_post_term_cache (boolean) - Do not update posts terms cache. Default `true`.
**Parameters:**
* $story_id (int) The story ID.
* $chapter_ids (array) Array with chapter IDs assigned to the story.
---
### `apply_filters( 'fictioneer_filter_story_identity', $output, $story_id, $story )`

View File

@ -201,7 +201,7 @@ function fictioneer_get_story_chapter_posts( $story_id ) {
'update_post_term_cache' => false // Improve performance
);
$query_args = apply_filters( 'fictioneer_filter_story_chapter_posts_query', $query_args );
$query_args = apply_filters( 'fictioneer_filter_story_chapter_posts_query', $query_args, $story_id, $chapter_ids );
$chapter_query = new WP_Query( $query_args );