From 3c9146aa3a977692b17dc761a4c90fca12fa9b6c Mon Sep 17 00:00:00 2001 From: Tetrakern <26898880+Tetrakern@users.noreply.github.com> Date: Fri, 10 Mar 2023 15:20:48 +0100 Subject: [PATCH] Rename shortcode filters --- FILTERS.md | 296 ++++++++++--------- partials/_latest-chapters-compact.php | 2 +- partials/_latest-chapters.php | 2 +- partials/_latest-posts.php | 2 +- partials/_latest-recommendations-compact.php | 2 +- partials/_latest-recommendations.php | 2 +- partials/_latest-stories-compact.php | 2 +- partials/_latest-stories.php | 2 +- partials/_latest-updates-compact.php | 2 +- partials/_latest-updates.php | 2 +- partials/_showcase.php | 2 +- 11 files changed, 172 insertions(+), 144 deletions(-) diff --git a/FILTERS.md b/FILTERS.md index 8f02d324..01b894f4 100644 --- a/FILTERS.md +++ b/FILTERS.md @@ -369,139 +369,6 @@ Filters the boolean return value of the `fictioneer_is_editor( $user_id )` funct --- -### `apply_filters( 'fictioneer_filter_latest_chapters_query_args', $query_args, $args )` -Filters the query arguments in the `fictioneer_latest_chapters` shortcode. The optional taxonomy arrays can include categories, tags, fandoms, genres, and characters. - -**$query_args:** -* $post_type (string) – `'fcn_chapter'` -* $post_status (string) – `'publish'` -* $author_name (string|null) – `$args['author']` -* $post__in (array) – `$args['post_ids']` -* $meta_key (string) – `'fictioneer_chapter_hidden'` -* $meta_value (int) – `0` -* $orderby (string) – `$args['orderby']` -* $order (string) – `$args['order']` -* $posts_per_page (int) – `$args['count']` -* $no_found_rows (boolean) – `true` -* $update_post_term_cache (boolean) – `false` - -**$args:** -* $simple (boolean) – Whether to render the simple variants. Default `false`. -* $author (boolean|string) – The author provided by the shortcode. Default `false`. -* $count (int) – The number of posts provided by the shortcode. Default `1`. -* $orderby (string) – Optional. Default `'date'`. -* $order (string) – Optional. Default `'desc'`. -* $spoiler (boolean) – Optional. Show preview un-obfuscated. Default `false`. -* $source (boolean) – Optional. Show chapter source story. Default `true`. -* $post_ids (\[string]) – Array of post IDs. Default empty. -* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty. -* $relation (string) – Relationship between taxonomies. Default `'AND'`. -* $classes (\[string]) – Array of additional CSS classes. Default empty. - ---- - -### `apply_filters( 'fictioneer_filter_latest_posts_query_args', $query_args, $args )` -Filters the query arguments in the `fictioneer_latest_posts` shortcode. The optional taxonomy arrays can include categories and tags. - -**$query_args:** -* $post_type (string) – `'post'` -* $post_status (string) – `'publish'` -* $post__in (array) – `$args['post_ids']` -* $author_name (string|null) – `$args['author']` -* $has_password (boolean) – `false` -* $orderby (string) – `'date'` -* $order (string) – `'desc'` -* $posts_per_page (int) – `$args['count']` -* $ignore_sticky_posts (boolean) – `true` -* $no_found_rows (boolean) – `true` - -**$args:** -* $author (boolean|string) – The author provided by the shortcode. Default `false`. -* $count (int) – The number of posts provided by the shortcode. Default `1`. -* $post_ids (\[string]) – Array of post IDs. Default empty. -* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty. -* $relation (string) – Relationship between taxonomies. Default `'AND'`. -* $classes (\[string]) – Array of additional CSS classes. Default empty. - ---- - -### `apply_filters( 'fictioneer_filter_latest_recommendations_query_args', $query_args, $args )` -Filters the query arguments in the `fictioneer_latest_recommendations` shortcode. The optional taxonomy arrays can include categories, tags, fandoms, genres, and characters. - -**$query_args:** -* $post_type (string) – `'fcn_recommendation'` -* $post_status (string) – `'publish'` -* $author_name (string|null) – `$args['author']` -* $post__in (array) – `$args['post_ids']` -* $orderby (string) – `$args['orderby']` -* $order (string) – `$args['order']` -* $posts_per_page (int) – `$args['count']` -* $no_found_rows (boolean) – `true` - -**$args:** -* $author (boolean|string) – The author provided by the shortcode. Default `false`. -* $count (int) – The number of posts provided by the shortcode. Default `1`. -* $orderby (string) – Optional. Default `'date'`. -* $order (string) – Optional. Default `'desc'`. -* $post_ids (\[string]) – Array of post IDs. Default empty. -* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty. -* $relation (string) – Relationship between taxonomies. Default `'AND'`. -* $classes (\[string]) – Array of additional CSS classes. Default empty. - ---- - -### `apply_filters( 'fictioneer_filter_latest_stories_query_args', $query_args, $args )` -Filters the query arguments in the `fictioneer_latest_stories` shortcode. The optional taxonomy arrays can include categories, tags, fandoms, genres, and characters. - -**$query_args:** -* $post_type (string) – `'fcn_story'` -* $post_status (string) – `'publish'` -* $author_name (string|null) – `$args['author']` -* $post__in (array) – `$args['post_ids']` -* $meta_key (string) – `'fictioneer_story_sticky'` -* $orderby (string) – `'meta_value ' . $args['orderby']` -* $order (string) – `$args['order']` -* $posts_per_page (int) – `$args['count']` -* $no_found_rows (boolean) – `true` - -**$args:** -* $author (boolean|string) – The author provided by the shortcode. Default `false`. -* $count (int) – The number of posts provided by the shortcode. Default `1`. -* $orderby (string) – Optional. Default `'date'`. -* $order (string) – Optional. Default `'desc'`. -* $post_ids (\[string]) – Array of post IDs. Default empty. -* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty. -* $relation (string) – Relationship between taxonomies. Default `'AND'`. -* $classes (\[string]) – Array of additional CSS classes. Default empty. - ---- - -### `apply_filters( 'fictioneer_filter_latest_updates_query_args', $query_args, $args )` -Filters the query arguments in the `fictioneer_latest_updates` shortcode. The optional taxonomy arrays can include categories, tags, fandoms, genres, and characters. - -**$query_args:** -* $post_type (string) – `'fcn_story'` -* $post_status (string) – `'publish'` -* $author_name (string|null) – `$args['author']` -* $post__in (array) – `$args['post_ids']` -* $meta_key (string) – `'fictioneer_chapters_added'` -* $orderby (string) – `'meta_value'` -* $order (string) – `$args['order']` -* $posts_per_page (int) – `$args['count'] + 4` -* $no_found_rows (boolean) – `true` - -**$args:** -* $simple (boolean) – Whether to render the simple variants. Default `false`. -* $author (boolean|string) – The author provided by the shortcode. Default `false`. -* $count (int) – The number of posts provided by the shortcode. Default `1`. -* $order (string) – Optional. Default `'desc'`. -* $post_ids (\[string]) – Array of post IDs. Default empty. -* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty. -* $relation (string) – Relationship between taxonomies. Default `'AND'`. -* $classes (\[string]) – Array of additional CSS classes. Default empty. - ---- - ### `apply_filters( 'fictioneer_filter_mobile_quick_buttons', $buttons )` Filters the intermediate output array of the `fictioneer_mobile_quick_buttons()` function before it is imploded and rendered via the `fictioneer_mobile_menu_bottom` hook. By default and depending on the page, the output can contain buttons to darken and brighten the site, toggle chapter options, open the formatting modal, or change site settings. @@ -638,7 +505,168 @@ Filters the HTML for the search title before it is rendered in the `search.php` --- -### `apply_filters( 'fictioneer_filter_showcase_query_args', $query_args, $args )` +### `apply_filters( 'fictioneer_filter_shortcode_blog_query_args', $query_args, $args )` +Filters the query arguments in the `fictioneer_blog` shortcode. + +**$query_args:** +* $post_type (string) – `post` +* $post_status (string) – `'publish'` +* $author_name (string|null) – Limit posts to a specific author. +* $tag__not_in (\[string]|null) – Array of tag IDs to exclude. +* $category__not_in (\[string]|null) – Array of category IDs to exclude. +* $paged (int) – Current page. +* $posts_per_page (int) – Posts per page, defaults to theme option. +* $tax_query (array|null) – Query for taxonomies. + +**$args:** +* $per_page (string|null) – Optional. The number of posts per page. +* $author (string|null) – Optional. The author provided by the shortcode. +* $exclude_tag_ids (string|null) – Optional. Comma-separated list of tag IDs. +* $exclude_cat_ids (string|null) – Optional. Comma-separated list of category IDs. +* $categories (string|null) – Optional. Comma-separated list of category names. +* $tags (string|null) – Optional. Comma-separated list of tag names. +* $fandoms (string|null) – Optional. Comma-separated list of fandom names. +* $genres (string|null) – Optional. Comma-separated list of genre names. +* $characters (string|null) – Optional. Comma-separated list of character names. +* $rel (string|null) – Optional. Relationship between taxonomies (`AND` or `OR`). +* $class (string|null) – Optional. Additional CSS classes. + +--- + +### `apply_filters( 'fictioneer_filter_shortcode_latest_chapters_query_args', $query_args, $args )` +Filters the query arguments in the `fictioneer_latest_chapters` shortcode. The optional taxonomy arrays can include categories, tags, fandoms, genres, and characters. + +**$query_args:** +* $post_type (string) – `'fcn_chapter'` +* $post_status (string) – `'publish'` +* $author_name (string|null) – `$args['author']` +* $post__in (array) – `$args['post_ids']` +* $meta_key (string) – `'fictioneer_chapter_hidden'` +* $meta_value (int) – `0` +* $orderby (string) – `$args['orderby']` +* $order (string) – `$args['order']` +* $posts_per_page (int) – `$args['count']` +* $no_found_rows (boolean) – `true` +* $update_post_term_cache (boolean) – `false` + +**$args:** +* $simple (boolean) – Whether to render the simple variants. Default `false`. +* $author (boolean|string) – The author provided by the shortcode. Default `false`. +* $count (int) – The number of posts provided by the shortcode. Default `1`. +* $orderby (string) – Optional. Default `'date'`. +* $order (string) – Optional. Default `'desc'`. +* $spoiler (boolean) – Optional. Show preview un-obfuscated. Default `false`. +* $source (boolean) – Optional. Show chapter source story. Default `true`. +* $post_ids (\[string]) – Array of post IDs. Default empty. +* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty. +* $relation (string) – Relationship between taxonomies. Default `'AND'`. +* $classes (\[string]) – Array of additional CSS classes. Default empty. + +--- + +### `apply_filters( 'fictioneer_filter_shortcode_latest_posts_query_args', $query_args, $args )` +Filters the query arguments in the `fictioneer_latest_posts` shortcode. The optional taxonomy arrays can include categories and tags. + +**$query_args:** +* $post_type (string) – `'post'` +* $post_status (string) – `'publish'` +* $post__in (array) – `$args['post_ids']` +* $author_name (string|null) – `$args['author']` +* $has_password (boolean) – `false` +* $orderby (string) – `'date'` +* $order (string) – `'desc'` +* $posts_per_page (int) – `$args['count']` +* $ignore_sticky_posts (boolean) – `true` +* $no_found_rows (boolean) – `true` + +**$args:** +* $author (boolean|string) – The author provided by the shortcode. Default `false`. +* $count (int) – The number of posts provided by the shortcode. Default `1`. +* $post_ids (\[string]) – Array of post IDs. Default empty. +* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty. +* $relation (string) – Relationship between taxonomies. Default `'AND'`. +* $classes (\[string]) – Array of additional CSS classes. Default empty. + +--- + +### `apply_filters( 'fictioneer_filter_shortcode_latest_recommendations_query_args', $query_args, $args )` +Filters the query arguments in the `fictioneer_latest_recommendations` shortcode. The optional taxonomy arrays can include categories, tags, fandoms, genres, and characters. + +**$query_args:** +* $post_type (string) – `'fcn_recommendation'` +* $post_status (string) – `'publish'` +* $author_name (string|null) – `$args['author']` +* $post__in (array) – `$args['post_ids']` +* $orderby (string) – `$args['orderby']` +* $order (string) – `$args['order']` +* $posts_per_page (int) – `$args['count']` +* $no_found_rows (boolean) – `true` + +**$args:** +* $author (boolean|string) – The author provided by the shortcode. Default `false`. +* $count (int) – The number of posts provided by the shortcode. Default `1`. +* $orderby (string) – Optional. Default `'date'`. +* $order (string) – Optional. Default `'desc'`. +* $post_ids (\[string]) – Array of post IDs. Default empty. +* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty. +* $relation (string) – Relationship between taxonomies. Default `'AND'`. +* $classes (\[string]) – Array of additional CSS classes. Default empty. + +--- + +### `apply_filters( 'fictioneer_filter_shortcode_latest_stories_query_args', $query_args, $args )` +Filters the query arguments in the `fictioneer_latest_stories` shortcode. The optional taxonomy arrays can include categories, tags, fandoms, genres, and characters. + +**$query_args:** +* $post_type (string) – `'fcn_story'` +* $post_status (string) – `'publish'` +* $author_name (string|null) – `$args['author']` +* $post__in (array) – `$args['post_ids']` +* $meta_key (string) – `'fictioneer_story_sticky'` +* $orderby (string) – `'meta_value ' . $args['orderby']` +* $order (string) – `$args['order']` +* $posts_per_page (int) – `$args['count']` +* $no_found_rows (boolean) – `true` + +**$args:** +* $author (boolean|string) – The author provided by the shortcode. Default `false`. +* $count (int) – The number of posts provided by the shortcode. Default `1`. +* $orderby (string) – Optional. Default `'date'`. +* $order (string) – Optional. Default `'desc'`. +* $post_ids (\[string]) – Array of post IDs. Default empty. +* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty. +* $relation (string) – Relationship between taxonomies. Default `'AND'`. +* $classes (\[string]) – Array of additional CSS classes. Default empty. + +--- + +### `apply_filters( 'fictioneer_filter_shortcode_latest_updates_query_args', $query_args, $args )` +Filters the query arguments in the `fictioneer_latest_updates` shortcode. The optional taxonomy arrays can include categories, tags, fandoms, genres, and characters. + +**$query_args:** +* $post_type (string) – `'fcn_story'` +* $post_status (string) – `'publish'` +* $author_name (string|null) – `$args['author']` +* $post__in (array) – `$args['post_ids']` +* $meta_key (string) – `'fictioneer_chapters_added'` +* $orderby (string) – `'meta_value'` +* $order (string) – `$args['order']` +* $posts_per_page (int) – `$args['count'] + 4` +* $no_found_rows (boolean) – `true` + +**$args:** +* $simple (boolean) – Whether to render the simple variants. Default `false`. +* $author (boolean|string) – The author provided by the shortcode. Default `false`. +* $count (int) – The number of posts provided by the shortcode. Default `1`. +* $order (string) – Optional. Default `'desc'`. +* $post_ids (\[string]) – Array of post IDs. Default empty. +* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty. +* $relation (string) – Relationship between taxonomies. Default `'AND'`. +* $classes (\[string]) – Array of additional CSS classes. Default empty. + +--- + +### `apply_filters( 'fictioneer_filter_shortcode_showcase_query_args', $query_args, $args )` Filters the query arguments in the `fictioneer_showcase` shortcode. The optional taxonomy arrays can include categories, tags, fandoms, genres, and characters. **$query_args:** diff --git a/partials/_latest-chapters-compact.php b/partials/_latest-chapters-compact.php index bf1ab911..1e4fd679 100644 --- a/partials/_latest-chapters-compact.php +++ b/partials/_latest-chapters-compact.php @@ -46,7 +46,7 @@ if ( ! empty( $args['taxonomies'] ) ) { } // Apply filters -$query_args = apply_filters( 'fictioneer_filter_latest_chapters_query_args', $query_args, $args ); +$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_chapters_query_args', $query_args, $args ); // Query chapters $entries = new WP_Query( $query_args ); diff --git a/partials/_latest-chapters.php b/partials/_latest-chapters.php index f70596b6..1415bab9 100644 --- a/partials/_latest-chapters.php +++ b/partials/_latest-chapters.php @@ -47,7 +47,7 @@ if ( ! empty( $args['taxonomies'] ) ) { } // Apply filters -$query_args = apply_filters( 'fictioneer_filter_latest_chapters_query_args', $query_args, $args ); +$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_chapters_query_args', $query_args, $args ); // Query chapters $entries = new WP_Query( $query_args ); diff --git a/partials/_latest-posts.php b/partials/_latest-posts.php index 4ba44290..8e9117fc 100644 --- a/partials/_latest-posts.php +++ b/partials/_latest-posts.php @@ -41,7 +41,7 @@ if ( ! empty( $args['taxonomies'] ) ) { } // Apply filters -$query_args = apply_filters( 'fictioneer_filter_latest_posts_query_args', $query_args, $args ); +$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_posts_query_args', $query_args, $args ); // Query post $latest_entries = new WP_Query( $query_args ); diff --git a/partials/_latest-recommendations-compact.php b/partials/_latest-recommendations-compact.php index 6538cd69..b6864b8b 100644 --- a/partials/_latest-recommendations-compact.php +++ b/partials/_latest-recommendations-compact.php @@ -43,7 +43,7 @@ if ( ! empty( $args['taxonomies'] ) ) { } // Apply filters -$query_args = apply_filters( 'fictioneer_filter_latest_recommendations_query_args', $query_args, $args ); +$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_recommendations_query_args', $query_args, $args ); // Query chapters $entries = new WP_Query( $query_args ); diff --git a/partials/_latest-recommendations.php b/partials/_latest-recommendations.php index d53624cf..23390aaa 100644 --- a/partials/_latest-recommendations.php +++ b/partials/_latest-recommendations.php @@ -44,7 +44,7 @@ if ( ! empty( $args['taxonomies'] ) ) { } // Apply filters -$query_args = apply_filters( 'fictioneer_filter_latest_recommendations_query_args', $query_args, $args ); +$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_recommendations_query_args', $query_args, $args ); // Query recommendations $entries = new WP_Query( $query_args ); diff --git a/partials/_latest-stories-compact.php b/partials/_latest-stories-compact.php index ccd692b7..a89587cc 100644 --- a/partials/_latest-stories-compact.php +++ b/partials/_latest-stories-compact.php @@ -42,7 +42,7 @@ if ( ! empty( $args['taxonomies'] ) ) { } // Apply filters -$query_args = apply_filters( 'fictioneer_filter_latest_stories_query_args', $query_args, $args ); +$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_stories_query_args', $query_args, $args ); // Query stories $entries = new WP_Query( $query_args ); diff --git a/partials/_latest-stories.php b/partials/_latest-stories.php index 2c3b8753..e81f17c6 100644 --- a/partials/_latest-stories.php +++ b/partials/_latest-stories.php @@ -42,7 +42,7 @@ if ( ! empty( $args['taxonomies'] ) ) { } // Apply filters -$query_args = apply_filters( 'fictioneer_filter_latest_stories_query_args', $query_args, $args ); +$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_stories_query_args', $query_args, $args ); // Query stories $entries = new WP_Query( $query_args ); diff --git a/partials/_latest-updates-compact.php b/partials/_latest-updates-compact.php index 51620342..427f3127 100644 --- a/partials/_latest-updates-compact.php +++ b/partials/_latest-updates-compact.php @@ -49,7 +49,7 @@ if ( ! empty( $args['taxonomies'] ) ) { } // Apply filters -$query_args = apply_filters( 'fictioneer_filter_latest_updates_query_args', $query_args, $args ); +$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_updates_query_args', $query_args, $args ); // Query stories $entries = new WP_Query( $query_args ); diff --git a/partials/_latest-updates.php b/partials/_latest-updates.php index b34b9af5..b7c2014a 100644 --- a/partials/_latest-updates.php +++ b/partials/_latest-updates.php @@ -50,7 +50,7 @@ if ( ! empty( $args['taxonomies'] ) ) { } // Apply filters -$query_args = apply_filters( 'fictioneer_filter_latest_updates_query_args', $query_args, $args ); +$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_updates_query_args', $query_args, $args ); // Query stories $entries = new WP_Query( $query_args ); diff --git a/partials/_showcase.php b/partials/_showcase.php index 77d7f933..e8a61014 100644 --- a/partials/_showcase.php +++ b/partials/_showcase.php @@ -46,7 +46,7 @@ if ( ! empty( $args['taxonomies'] ) ) { } // Apply filters -$query_args = apply_filters( 'fictioneer_filter_showcase_query_args', $query_args, $args ); +$query_args = apply_filters( 'fictioneer_filter_shortcode_showcase_query_args', $query_args, $args ); // Query collections $query = new WP_Query( $query_args );