Add post_status param to shortcodes

This commit is contained in:
Tetrakern 2025-01-12 17:44:38 +01:00
parent 9b3913d0b9
commit d614b973c4
16 changed files with 50 additions and 16 deletions

View File

@ -840,6 +840,7 @@ Renders a multi-column grid of paginated medium cards ordered by publishing date
* **post_type:** Comma-separated list of post types to query. Default `post`. * **post_type:** Comma-separated list of post types to query. Default `post`.
* **post_ids:** Comma-separated list of post IDs, if you want to pick from a curated pool. * **post_ids:** Comma-separated list of post IDs, if you want to pick from a curated pool.
* **post_status:** Either `publish` or `future`, albeit others are possible (but why?). Default `publish`.
* **per_page:** Number of posts per page. Defaults to theme settings. * **per_page:** Number of posts per page. Defaults to theme settings.
* **count:** Limit articles to any positive number, disabling the pagination. * **count:** Limit articles to any positive number, disabling the pagination.
* **order:** Either `desc` (descending) or `asc` (ascending). Default `desc`. * **order:** Either `desc` (descending) or `asc` (ascending). Default `desc`.
@ -900,6 +901,7 @@ Renders paginated blog posts akin to the main blog page, but with options. Only
* **ignore_sticky:** Whether sticky posts should be ignored or not. Default `false`. * **ignore_sticky:** Whether sticky posts should be ignored or not. Default `false`.
* **ignore_protected:** Whether protected posts should be ignored or not. Default `false`. * **ignore_protected:** Whether protected posts should be ignored or not. Default `false`.
* **only_protected:** Whether to query only protected posts or not. Default `false`. * **only_protected:** Whether to query only protected posts or not. Default `false`.
* **post_status:** Either `publish` or `future`, albeit others are possible (but why?). Default `publish`.
* **author:** Only show posts of a specific author. Make sure to use the url-safe nice_name. * **author:** Only show posts of a specific author. Make sure to use the url-safe nice_name.
* **author_ids:** Only show posts of a comma-separated list of author IDs. * **author_ids:** Only show posts of a comma-separated list of author IDs.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude. * **exclude_author_ids:** Comma-separated list of author IDs to exclude.
@ -951,6 +953,7 @@ Renders a multi-column grid of small bookmark cards, ordered by date of creation
Renders a list of chapters identical to those on story pages, ordered by sequence in the source. Must have either the **story_id** or **chapter_ids** parameter, but not both. Renders a list of chapters identical to those on story pages, ordered by sequence in the source. Must have either the **story_id** or **chapter_ids** parameter, but not both.
* **story_id:** ID of a single story. You need either this or **chapters**. * **story_id:** ID of a single story. You need either this or **chapters**.
* **post_status:** Either `publish` or `future`, albeit others are possible (but why?). Default `publish`.
* **chapter_ids:** Comma-separated list of chapter IDs. You need either this or **story**. * **chapter_ids:** Comma-separated list of chapter IDs. You need either this or **story**.
* **count:** Limit chapters to any positive number. Default `-1` (all). * **count:** Limit chapters to any positive number. Default `-1` (all).
* **offset:** Skip a number of chapters, which can make sense if you query all. * **offset:** Skip a number of chapters, which can make sense if you query all.
@ -1023,6 +1026,7 @@ Renders a multi-column grid of small cards, showing the latest four chapters ord
* **spoiler:** The excerpt is obfuscated, set `true` if you want to reveal it. Default `false`. * **spoiler:** The excerpt is obfuscated, set `true` if you want to reveal it. Default `false`.
* **source:** Whether to show the author and story nodes. Default `true`. * **source:** Whether to show the author and story nodes. Default `true`.
* **post_ids:** Comma-separated list of chapter post IDs, if you want to pick from a curated pool. * **post_ids:** Comma-separated list of chapter post IDs, if you want to pick from a curated pool.
* **post_status:** Either `publish` or `future`, albeit others are possible (but why?). Default `publish`.
* **ignore_protected:** Whether protected posts should be ignored or not. Default `false`. * **ignore_protected:** Whether protected posts should be ignored or not. Default `false`.
* **only_protected:** Whether to query only protected posts or not. Default `false`. * **only_protected:** Whether to query only protected posts or not. Default `false`.
* **author_ids:** Only show posts of a comma-separated list of author IDs. * **author_ids:** Only show posts of a comma-separated list of author IDs.
@ -1089,6 +1093,7 @@ Renders the last blog post or a list of blog posts, ignoring sticky posts, order
* **count:** Limit posts to any positive number, although you should keep it reasonable. Default `1`. * **count:** Limit posts to any positive number, although you should keep it reasonable. Default `1`.
* **author:** Only show posts of a specific author. Make sure to use the url-safe nice_name. * **author:** Only show posts of a specific author. Make sure to use the url-safe nice_name.
* **post_ids:** Comma-separated list of post IDs, if you want to pick from a curated pool. * **post_ids:** Comma-separated list of post IDs, if you want to pick from a curated pool.
* **post_status:** Either `publish` or `future`, albeit others are possible (but why?). Default `publish`.
* **ignore_protected:** Whether protected posts should be ignored or not. Default `false`. * **ignore_protected:** Whether protected posts should be ignored or not. Default `false`.
* **only_protected:** Whether to query only protected posts or not. Default `false`. * **only_protected:** Whether to query only protected posts or not. Default `false`.
* **author_ids:** Only show posts of a comma-separated list of author IDs. * **author_ids:** Only show posts of a comma-separated list of author IDs.
@ -1125,6 +1130,7 @@ Renders a multi-column grid of small cards, showing the latest four recommendati
* **order:** Either `desc` (descending) or `asc` (ascending). Default `desc`. * **order:** Either `desc` (descending) or `asc` (ascending). Default `desc`.
* **orderby:** The default is `date`, but you can also use `modified` and [more](https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters). * **orderby:** The default is `date`, but you can also use `modified` and [more](https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters).
* **post_ids:** Comma-separated list of post IDs, if you want to pick from a curated pool. * **post_ids:** Comma-separated list of post IDs, if you want to pick from a curated pool.
* **post_status:** Either `publish` or `future`, albeit others are possible (but why?). Default `publish`.
* **ignore_protected:** Whether protected posts should be ignored or not. Default `false`. * **ignore_protected:** Whether protected posts should be ignored or not. Default `false`.
* **only_protected:** Whether to query only protected posts or not. Default `false`. * **only_protected:** Whether to query only protected posts or not. Default `false`.
* **author_ids:** Only show posts of a comma-separated list of author IDs. * **author_ids:** Only show posts of a comma-separated list of author IDs.
@ -1178,6 +1184,7 @@ Renders a multi-column grid of small cards, showing the latest four stories orde
* **order:** Either `desc` (descending) or `asc` (ascending). Default `desc`. * **order:** Either `desc` (descending) or `asc` (ascending). Default `desc`.
* **orderby:** The default is `date`, but you can also use `modified` and [more](https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters). * **orderby:** The default is `date`, but you can also use `modified` and [more](https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters).
* **post_ids:** Comma-separated list of story post IDs, if you want to pick from a curated pool. * **post_ids:** Comma-separated list of story post IDs, if you want to pick from a curated pool.
* **post_status:** Either `publish` or `future`, albeit others are possible (but why?). Default `publish`.
* **ignore_protected:** Whether protected posts should be ignored or not. Default `false`. * **ignore_protected:** Whether protected posts should be ignored or not. Default `false`.
* **only_protected:** Whether to query only protected posts or not. Default `false`. * **only_protected:** Whether to query only protected posts or not. Default `false`.
* **author_ids:** Only show posts of a comma-separated list of author IDs. * **author_ids:** Only show posts of a comma-separated list of author IDs.
@ -1256,6 +1263,7 @@ Renders a multi-column grid of small cards, showing the latest four updated stor
* **author:** Only show updates of a specific author. Make sure to use the url-safe nice_name. * **author:** Only show updates of a specific author. Make sure to use the url-safe nice_name.
* **order:** Either `desc` (descending) or `asc` (ascending). Default `desc`. * **order:** Either `desc` (descending) or `asc` (ascending). Default `desc`.
* **post_ids:** Comma-separated list of post IDs, if you want to pick from a curated pool. * **post_ids:** Comma-separated list of post IDs, if you want to pick from a curated pool.
* **post_status:** Either `publish` or `future`, albeit others are possible (but why?). Default `publish`.
* **ignore_protected:** Whether protected posts should be ignored or not. Default `false`. * **ignore_protected:** Whether protected posts should be ignored or not. Default `false`.
* **only_protected:** Whether to query only protected posts or not. Default `false`. * **only_protected:** Whether to query only protected posts or not. Default `false`.
* **author_ids:** Only show posts of a comma-separated list of author IDs. * **author_ids:** Only show posts of a comma-separated list of author IDs.
@ -1370,6 +1378,7 @@ Renders dynamic grid of thumbnails with title, showing the latest eight posts of
* **order:** Either `desc` (descending) or `asc` (ascending). Default `desc`. * **order:** Either `desc` (descending) or `asc` (ascending). Default `desc`.
* **orderby:** The default is `date`, but you can also use `rand` and [more](https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters). * **orderby:** The default is `date`, but you can also use `rand` and [more](https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters).
* **post_ids:** Comma-separated list of post IDs, if you want to pick from a curated pool. * **post_ids:** Comma-separated list of post IDs, if you want to pick from a curated pool.
* **post_status:** Either `publish` or `future`, albeit others are possible (but why?). Default `publish`.
* **ignore_protected:** Whether protected posts should be ignored or not. Default `false`. * **ignore_protected:** Whether protected posts should be ignored or not. Default `false`.
* **only_protected:** Whether to query only protected posts or not. Default `false`. * **only_protected:** Whether to query only protected posts or not. Default `false`.
* **author_ids:** Only show posts of a comma-separated list of author IDs. * **author_ids:** Only show posts of a comma-separated list of author IDs.

View File

@ -167,6 +167,7 @@ function fictioneer_get_default_shortcode_args( $attr, $def_count = -1 ) {
'orderby' => $attr['orderby'] ?? '', 'orderby' => $attr['orderby'] ?? '',
'page' => max( 1, get_query_var( 'page' ) ?: get_query_var( 'paged' ) ), 'page' => max( 1, get_query_var( 'page' ) ?: get_query_var( 'paged' ) ),
'posts_per_page' => absint( $attr['per_page'] ?? 0 ) ?: get_option( 'posts_per_page' ), 'posts_per_page' => absint( $attr['per_page'] ?? 0 ) ?: get_option( 'posts_per_page' ),
'post_status' => sanitize_key( $attr['post_status'] ?? 'publish' ),
'post_ids' => fictioneer_explode_list( $attr['post_ids'] ?? '' ), 'post_ids' => fictioneer_explode_list( $attr['post_ids'] ?? '' ),
'author' => sanitize_title( $attr['author'] ?? '' ), 'author' => sanitize_title( $attr['author'] ?? '' ),
'author_ids' => fictioneer_explode_list( $attr['author_ids'] ?? '' ), 'author_ids' => fictioneer_explode_list( $attr['author_ids'] ?? '' ),
@ -411,6 +412,7 @@ function fictioneer_get_splide_inline_init() {
* collections, recommendations, and stories. * collections, recommendations, and stories.
* @param string|null $attr['count'] Optional. Maximum number of items. Default 8. * @param string|null $attr['count'] Optional. Maximum number of items. Default 8.
* @param string|null $attr['author'] Optional. Limit posts to a specific author. * @param string|null $attr['author'] Optional. Limit posts to a specific author.
* @param string|null $attr['post_status'] Optional. Choose a valid post status. Default 'publish'.
* @param string|null $attr['order'] Optional. Order direction. Default 'DESC'. * @param string|null $attr['order'] Optional. Order direction. Default 'DESC'.
* @param string|null $attr['orderby'] Optional. Order argument. Default 'date'. * @param string|null $attr['orderby'] Optional. Order argument. Default 'date'.
* @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs. * @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs.
@ -528,6 +530,7 @@ add_shortcode( 'fictioneer_showcase', 'fictioneer_shortcode_showcase' );
* @param string|null $attr['count'] Optional. Maximum number of items. Default 4. * @param string|null $attr['count'] Optional. Maximum number of items. Default 4.
* @param string|null $attr['author'] Optional. Limit posts to a specific author. * @param string|null $attr['author'] Optional. Limit posts to a specific author.
* @param string|null $attr['type'] Optional. Choose between 'default', 'simple', and 'compact'. * @param string|null $attr['type'] Optional. Choose between 'default', 'simple', and 'compact'.
* @param string|null $attr['post_status'] Optional. Choose a valid post status. Default 'publish'.
* @param string|null $attr['order'] Optional. Order argument. Default 'DESC'. * @param string|null $attr['order'] Optional. Order argument. Default 'DESC'.
* @param string|null $attr['orderby'] Optional. Orderby argument. Default 'date'. * @param string|null $attr['orderby'] Optional. Orderby argument. Default 'date'.
* @param string|null $attr['spoiler'] Optional. Whether to show spoiler content. * @param string|null $attr['spoiler'] Optional. Whether to show spoiler content.
@ -635,6 +638,7 @@ add_shortcode( 'fictioneer_latest_chapters', 'fictioneer_shortcode_latest_chapte
* @param string|null $attr['count'] Optional. Maximum number of items. Default 4. * @param string|null $attr['count'] Optional. Maximum number of items. Default 4.
* @param string|null $attr['author'] Optional. Limit posts to a specific author. * @param string|null $attr['author'] Optional. Limit posts to a specific author.
* @param string|null $attr['type'] Optional. Choose between 'default' and 'compact'. * @param string|null $attr['type'] Optional. Choose between 'default' and 'compact'.
* @param string|null $attr['post_status'] Optional. Choose a valid post status. Default 'publish'.
* @param string|null $attr['order'] Optional. Order argument. Default 'DESC'. * @param string|null $attr['order'] Optional. Order argument. Default 'DESC'.
* @param string|null $attr['orderby'] Optional. Orderby argument. Default 'date'. * @param string|null $attr['orderby'] Optional. Orderby argument. Default 'date'.
* @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs. * @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs.
@ -746,6 +750,7 @@ add_shortcode( 'fictioneer_latest_stories', 'fictioneer_shortcode_latest_stories
* @param string|null $attr['count'] Optional. Maximum number of items. Default 4. * @param string|null $attr['count'] Optional. Maximum number of items. Default 4.
* @param string|null $attr['author'] Optional. Limit posts to a specific author. * @param string|null $attr['author'] Optional. Limit posts to a specific author.
* @param string|null $attr['type'] Optional. Choose between 'default', 'simple', 'single', and 'compact'. * @param string|null $attr['type'] Optional. Choose between 'default', 'simple', 'single', and 'compact'.
* @param string|null $attr['post_status'] Optional. Choose a valid post status. Default 'publish'.
* @param string|null $attr['single'] Optional. Whether to show only one chapter item. Default false. * @param string|null $attr['single'] Optional. Whether to show only one chapter item. Default false.
* @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs. * @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs.
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false. * @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
@ -860,6 +865,7 @@ add_shortcode( 'fictioneer_latest_updates', 'fictioneer_shortcode_latest_story_u
* @param string|null $attr['count'] Optional. Maximum number of items. Default 4. * @param string|null $attr['count'] Optional. Maximum number of items. Default 4.
* @param string|null $attr['author'] Optional. Limit posts to a specific author. * @param string|null $attr['author'] Optional. Limit posts to a specific author.
* @param string|null $attr['type'] Optional. Choose between 'default' and 'compact'. * @param string|null $attr['type'] Optional. Choose between 'default' and 'compact'.
* @param string|null $attr['post_status'] Optional. Choose a valid post status. Default 'publish'.
* @param string|null $attr['order'] Optional. Order argument. Default 'DESC'. * @param string|null $attr['order'] Optional. Order argument. Default 'DESC'.
* @param string|null $attr['orderby'] Optional. Orderby argument. Default 'date'. * @param string|null $attr['orderby'] Optional. Orderby argument. Default 'date'.
* @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs. * @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs.
@ -952,6 +958,7 @@ add_shortcode( 'fictioneer_latest_recommendations', 'fictioneer_shortcode_latest
* *
* @param string|null $attr['count'] Optional. Maximum number of items. Default 1. * @param string|null $attr['count'] Optional. Maximum number of items. Default 1.
* @param string|null $attr['author'] Optional. Limit posts to a specific author. * @param string|null $attr['author'] Optional. Limit posts to a specific author.
* @param string|null $attr['post_status'] Optional. Choose a valid post status. Default 'publish'.
* @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs. * @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs.
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false. * @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
* @param string|null $attr['only_protected'] Optional. Whether to query only protected posts. Default false. * @param string|null $attr['only_protected'] Optional. Whether to query only protected posts. Default false.
@ -1108,6 +1115,7 @@ function fictioneer_shortcode_chapter_list_empty( $attr ) {
* @since 5.0.0 * @since 5.0.0
* *
* @param string $attr['story_id'] Either/Or. The ID of the story the chapters belong to. * @param string $attr['story_id'] Either/Or. The ID of the story the chapters belong to.
* @param string|null $attr['post_status'] Optional. Choose a valid post status. Default 'publish'.
* @param string|null $attr['chapter_ids'] Either/Or. Comma-separated list of chapter IDs. * @param string|null $attr['chapter_ids'] Either/Or. Comma-separated list of chapter IDs.
* @param string|null $attr['count'] Optional. Maximum number of items. Default -1 (all). * @param string|null $attr['count'] Optional. Maximum number of items. Default -1 (all).
* @param string|null $attr['offset'] Optional. Skip a number of posts. * @param string|null $attr['offset'] Optional. Skip a number of posts.
@ -1133,6 +1141,7 @@ function fictioneer_shortcode_chapter_list( $attr ) {
$offset = max( 0, intval( $attr['offset'] ?? 0 ) ); $offset = max( 0, intval( $attr['offset'] ?? 0 ) );
$group = empty( $attr['group'] ) ? false : strtolower( trim( $attr['group'] ) ); $group = empty( $attr['group'] ) ? false : strtolower( trim( $attr['group'] ) );
$heading = empty( $attr['heading'] ) ? false : $attr['heading']; $heading = empty( $attr['heading'] ) ? false : $attr['heading'];
$post_status = sanitize_key( $attr['post_status'] ?? 'publish' );
$story_id = fictioneer_validate_id( $attr['story_id'] ?? -1, 'fcn_story' ); $story_id = fictioneer_validate_id( $attr['story_id'] ?? -1, 'fcn_story' );
$prefer_chapter_icon = get_option( 'fictioneer_override_chapter_status_icons' ); $prefer_chapter_icon = get_option( 'fictioneer_override_chapter_status_icons' );
$hide_icons = get_option( 'fictioneer_hide_chapter_icons' ); $hide_icons = get_option( 'fictioneer_hide_chapter_icons' );
@ -1181,7 +1190,7 @@ function fictioneer_shortcode_chapter_list( $attr ) {
$query_args = array( $query_args = array(
'fictioneer_query_name' => 'fictioneer_shortcode_chapter_list', 'fictioneer_query_name' => 'fictioneer_shortcode_chapter_list',
'post_type' => 'fcn_chapter', 'post_type' => 'fcn_chapter',
'post_status' => 'publish', 'post_status' => $post_status,
'post__in' => $chapters, // Cannot be empty! 'post__in' => $chapters, // Cannot be empty!
'ignore_sticky_posts' => true, 'ignore_sticky_posts' => true,
'orderby' => 'post__in', // Preserve order from meta box 'orderby' => 'post__in', // Preserve order from meta box
@ -1571,6 +1580,7 @@ add_shortcode( 'fictioneer_search', 'fictioneer_shortcode_search' );
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false. * @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
* @param string|null $attr['only_protected'] Optional. Whether to query only protected posts. Default false. * @param string|null $attr['only_protected'] Optional. Whether to query only protected posts. Default false.
* @param string|null $attr['author'] Optional. Limit posts to a specific author. * @param string|null $attr['author'] Optional. Limit posts to a specific author.
* @param string|null $attr['post_status'] Optional. Choose a valid post status. Default 'publish'.
* @param string|null $attr['author_ids'] Optional. Only include posts by these author IDs. * @param string|null $attr['author_ids'] Optional. Only include posts by these author IDs.
* @param string|null $attr['exclude_author_ids'] Optional. Exclude posts with these author IDs. * @param string|null $attr['exclude_author_ids'] Optional. Exclude posts with these author IDs.
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags. * @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
@ -1591,7 +1601,7 @@ function fictioneer_shortcode_blog( $attr ) {
$query_args = array( $query_args = array(
'fictioneer_query_name' => 'blog_shortcode', 'fictioneer_query_name' => 'blog_shortcode',
'post_type' => 'post', 'post_type' => 'post',
'post_status' => 'publish', 'post_status' => $args['post_status'],
'paged' => $args['page'], 'paged' => $args['page'],
'posts_per_page' => $args['posts_per_page'], 'posts_per_page' => $args['posts_per_page'],
'ignore_sticky_posts' => $args['ignore_sticky'] 'ignore_sticky_posts' => $args['ignore_sticky']
@ -1715,6 +1725,7 @@ add_shortcode( 'fictioneer_blog', 'fictioneer_shortcode_blog' );
* @since 5.7.3 * @since 5.7.3
* *
* @param string|null $attr['post_type'] Optional. The post types to query. Default 'post'. * @param string|null $attr['post_type'] Optional. The post types to query. Default 'post'.
* @param string|null $attr['post_status'] Optional. Choose a valid post status. Default 'publish'.
* @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs. * @param string|null $attr['post_ids'] Optional. Limit posts to specific post IDs.
* @param string|null $attr['per_page'] Optional. Number of posts per page. * @param string|null $attr['per_page'] Optional. Number of posts per page.
* @param string|null $attr['count'] Optional. Maximum number of posts. Default -1. * @param string|null $attr['count'] Optional. Maximum number of posts. Default -1.

View File

@ -19,6 +19,7 @@
* @internal $args['orderby'] Sorting of posts. Default 'date'. * @internal $args['orderby'] Sorting of posts. Default 'date'.
* @internal $args['page'] The current page. Default 1. * @internal $args['page'] The current page. Default 1.
* @internal $args['post_ids'] Array of post IDs. Default empty. * @internal $args['post_ids'] Array of post IDs. Default empty.
* @internal $args['post_status'] Queried post status. Default 'publish'.
* @internal $args['author_ids'] Array of author IDs. Default empty. * @internal $args['author_ids'] Array of author IDs. Default empty.
* @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty. * @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty. * @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
@ -50,7 +51,7 @@ $show_terms = ! in_array( $args['terms'], ['none', 'false'] );
$query_args = array( $query_args = array(
'fictioneer_query_name' => 'article_cards', 'fictioneer_query_name' => 'article_cards',
'post_type' => $args['post_type'], 'post_type' => $args['post_type'],
'post_status' => 'publish', 'post_status' => $args['post_status'] ?? 'publish',
'post__in' => $args['post_ids'], // May be empty! 'post__in' => $args['post_ids'], // May be empty!
'order' => $args['order'], 'order' => $args['order'],
'orderby' => $args['orderby'], 'orderby' => $args['orderby'],

View File

@ -17,6 +17,7 @@
* @internal $args['spoiler'] Whether to obscure or show chapter excerpt. * @internal $args['spoiler'] Whether to obscure or show chapter excerpt.
* @internal $args['source'] Whether to show author and story. * @internal $args['source'] Whether to show author and story.
* @internal $args['post_ids'] Array of post IDs. Default empty. * @internal $args['post_ids'] Array of post IDs. Default empty.
* @internal $args['post_status'] Queried post status. Default 'publish'.
* @internal $args['author_ids'] Array of author IDs. Default empty. * @internal $args['author_ids'] Array of author IDs. Default empty.
* @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty. * @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty. * @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
@ -51,7 +52,7 @@ $card_counter = 0;
$query_args = array( $query_args = array(
'fictioneer_query_name' => 'latest_chapters_compact', 'fictioneer_query_name' => 'latest_chapters_compact',
'post_type' => 'fcn_chapter', 'post_type' => 'fcn_chapter',
'post_status' => 'publish', 'post_status' => $args['post_status'] ?? 'publish',
'post__in' => $args['post_ids'], // May be empty! 'post__in' => $args['post_ids'], // May be empty!
'order' => $args['order'], 'order' => $args['order'],
'orderby' => $args['orderby'], 'orderby' => $args['orderby'],

View File

@ -16,6 +16,7 @@
* @internal $args['orderby'] Sorting of posts. Default 'date'. * @internal $args['orderby'] Sorting of posts. Default 'date'.
* @internal $args['spoiler'] Whether to obscure or show chapter excerpt. * @internal $args['spoiler'] Whether to obscure or show chapter excerpt.
* @internal $args['post_ids'] Array of post IDs. Default empty. * @internal $args['post_ids'] Array of post IDs. Default empty.
* @internal $args['post_status'] Queried post status. Default 'publish'.
* @internal $args['author_ids'] Array of author IDs. Default empty. * @internal $args['author_ids'] Array of author IDs. Default empty.
* @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty. * @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty. * @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
@ -56,7 +57,7 @@ $content_list_style = get_theme_mod( 'content_list_style', 'default' );
$query_args = array( $query_args = array(
'fictioneer_query_name' => 'latest_chapters_list', 'fictioneer_query_name' => 'latest_chapters_list',
'post_type' => 'fcn_chapter', 'post_type' => 'fcn_chapter',
'post_status' => 'publish', 'post_status' => $args['post_status'] ?? 'publish',
'post__in' => $args['post_ids'], // May be empty! 'post__in' => $args['post_ids'], // May be empty!
'orderby' => $args['orderby'], 'orderby' => $args['orderby'],
'order' => $args['order'], 'order' => $args['order'],

View File

@ -16,6 +16,7 @@
* @internal $args['orderby'] Sorting of posts. Default 'date'. * @internal $args['orderby'] Sorting of posts. Default 'date'.
* @internal $args['spoiler'] Whether to obscure or show chapter excerpt. * @internal $args['spoiler'] Whether to obscure or show chapter excerpt.
* @internal $args['post_ids'] Array of post IDs. Default empty. * @internal $args['post_ids'] Array of post IDs. Default empty.
* @internal $args['post_status'] Queried post status. Default 'publish'.
* @internal $args['author_ids'] Array of author IDs. Default empty. * @internal $args['author_ids'] Array of author IDs. Default empty.
* @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty. * @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty. * @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
@ -56,7 +57,7 @@ $card_counter = 0;
$query_args = array( $query_args = array(
'fictioneer_query_name' => 'latest_chapters', 'fictioneer_query_name' => 'latest_chapters',
'post_type' => 'fcn_chapter', 'post_type' => 'fcn_chapter',
'post_status' => 'publish', 'post_status' => $args['post_status'] ?? 'publish',
'post__in' => $args['post_ids'], // May be empty! 'post__in' => $args['post_ids'], // May be empty!
'orderby' => $args['orderby'], 'orderby' => $args['orderby'],
'order' => $args['order'], 'order' => $args['order'],

View File

@ -13,6 +13,7 @@
* @internal $args['author'] The author provided by the shortcode. Default false. * @internal $args['author'] The author provided by the shortcode. Default false.
* @internal $args['count'] The number of posts provided by the shortcode. Default 1. * @internal $args['count'] The number of posts provided by the shortcode. Default 1.
* @internal $args['post_ids'] Array of post IDs. Default empty. * @internal $args['post_ids'] Array of post IDs. Default empty.
* @internal $args['post_status'] Queried post status. Default 'publish'.
* @internal $args['author_ids'] Array of author IDs. Default empty. * @internal $args['author_ids'] Array of author IDs. Default empty.
* @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty. * @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty. * @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
@ -32,7 +33,7 @@ defined( 'ABSPATH' ) OR exit;
$query_args = array( $query_args = array(
'fictioneer_query_name' => 'latest_posts', 'fictioneer_query_name' => 'latest_posts',
'post_type' => 'post', 'post_type' => 'post',
'post_status' => 'publish', 'post_status' => $args['post_status'] ?? 'publish',
'post__in' => $args['post_ids'], // May be empty! 'post__in' => $args['post_ids'], // May be empty!
'order' => 'DESC', 'order' => 'DESC',
'orderby' => 'date', 'orderby' => 'date',

View File

@ -15,6 +15,7 @@
* @internal $args['order'] Order of posts. Default 'DESC'. * @internal $args['order'] Order of posts. Default 'DESC'.
* @internal $args['orderby'] Sorting of posts. Default 'date'. * @internal $args['orderby'] Sorting of posts. Default 'date'.
* @internal $args['post_ids'] Array of post IDs. Default empty. * @internal $args['post_ids'] Array of post IDs. Default empty.
* @internal $args['post_status'] Queried post status. Default 'publish'.
* @internal $args['author_ids'] Array of author IDs. Default empty. * @internal $args['author_ids'] Array of author IDs. Default empty.
* @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty. * @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty. * @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
@ -48,7 +49,7 @@ $show_terms = ! in_array( $args['terms'], ['none', 'false'] ) &&
$query_args = array ( $query_args = array (
'fictioneer_query_name' => 'latest_recommendations_compact', 'fictioneer_query_name' => 'latest_recommendations_compact',
'post_type' => 'fcn_recommendation', 'post_type' => 'fcn_recommendation',
'post_status' => 'publish', 'post_status' => $args['post_status'] ?? 'publish',
'post__in' => $args['post_ids'], // May be empty! 'post__in' => $args['post_ids'], // May be empty!
'order' => $args['order'], 'order' => $args['order'],
'orderby' => $args['orderby'], 'orderby' => $args['orderby'],

View File

@ -15,6 +15,7 @@
* @internal $args['order'] Order of posts. Default 'DESC'. * @internal $args['order'] Order of posts. Default 'DESC'.
* @internal $args['orderby'] Sorting of posts. Default 'date'. * @internal $args['orderby'] Sorting of posts. Default 'date'.
* @internal $args['post_ids'] Array of post IDs. Default empty. * @internal $args['post_ids'] Array of post IDs. Default empty.
* @internal $args['post_status'] Queried post status. Default 'publish'.
* @internal $args['author_ids'] Array of author IDs. Default empty. * @internal $args['author_ids'] Array of author IDs. Default empty.
* @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.s * @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.s
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty. * @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
@ -46,7 +47,7 @@ $show_terms = ! get_option( 'fictioneer_hide_taxonomies_on_recommendation_cards'
$query_args = array ( $query_args = array (
'fictioneer_query_name' => 'latest_recommendations', 'fictioneer_query_name' => 'latest_recommendations',
'post_type' => 'fcn_recommendation', 'post_type' => 'fcn_recommendation',
'post_status' => 'publish', 'post_status' => $args['post_status'] ?? 'publish',
'post__in' => $args['post_ids'], // May be empty! 'post__in' => $args['post_ids'], // May be empty!
'order' => $args['order'], 'order' => $args['order'],
'orderby' => $args['orderby'], 'orderby' => $args['orderby'],

View File

@ -16,6 +16,7 @@
* @internal $args['order'] Order of posts. Default 'DESC'. * @internal $args['order'] Order of posts. Default 'DESC'.
* @internal $args['orderby'] Sorting of posts. Default 'date'. * @internal $args['orderby'] Sorting of posts. Default 'date'.
* @internal $args['post_ids'] Array of post IDs. Default empty. * @internal $args['post_ids'] Array of post IDs. Default empty.
* @internal $args['post_status'] Queried post status. Default 'publish'.
* @internal $args['author_ids'] Array of author IDs. Default empty. * @internal $args['author_ids'] Array of author IDs. Default empty.
* @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty. * @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty. * @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
@ -56,7 +57,7 @@ $show_terms = ! in_array( $args['terms'], ['none', 'false'] ) &&
$query_args = array( $query_args = array(
'fictioneer_query_name' => 'latest_stories_compact', 'fictioneer_query_name' => 'latest_stories_compact',
'post_type' => 'fcn_story', 'post_type' => 'fcn_story',
'post_status' => 'publish', 'post_status' => $args['post_status'] ?? 'publish',
'post__in' => $args['post_ids'], // May be empty! 'post__in' => $args['post_ids'], // May be empty!
'order' => $args['order'], 'order' => $args['order'],
'orderby' => $args['orderby'], 'orderby' => $args['orderby'],

View File

@ -16,6 +16,7 @@
* @internal $args['order'] Order of posts. Default 'DESC'. * @internal $args['order'] Order of posts. Default 'DESC'.
* @internal $args['orderby'] Sorting of posts. Default 'date'. * @internal $args['orderby'] Sorting of posts. Default 'date'.
* @internal $args['post_ids'] Array of post IDs. Default empty. * @internal $args['post_ids'] Array of post IDs. Default empty.
* @internal $args['post_status'] Queried post status. Default 'publish'.
* @internal $args['author_ids'] Array of author IDs. Default empty. * @internal $args['author_ids'] Array of author IDs. Default empty.
* @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty. * @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty. * @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
@ -57,7 +58,7 @@ $content_list_style = get_theme_mod( 'content_list_style', 'default' );
$query_args = array( $query_args = array(
'fictioneer_query_name' => 'latest_stories_list', 'fictioneer_query_name' => 'latest_stories_list',
'post_type' => 'fcn_story', 'post_type' => 'fcn_story',
'post_status' => 'publish', 'post_status' => $args['post_status'] ?? 'publish',
'post__in' => $args['post_ids'], // May be empty! 'post__in' => $args['post_ids'], // May be empty!
'order' => $args['order'], 'order' => $args['order'],
'orderby' => $args['orderby'], 'orderby' => $args['orderby'],

View File

@ -16,6 +16,7 @@
* @internal $args['order'] Order of posts. Default 'DESC'. * @internal $args['order'] Order of posts. Default 'DESC'.
* @internal $args['orderby'] Sorting of posts. Default 'date'. * @internal $args['orderby'] Sorting of posts. Default 'date'.
* @internal $args['post_ids'] Array of post IDs. Default empty. * @internal $args['post_ids'] Array of post IDs. Default empty.
* @internal $args['post_status'] Queried post status. Default 'publish'.
* @internal $args['author_ids'] Array of author IDs. Default empty. * @internal $args['author_ids'] Array of author IDs. Default empty.
* @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty. * @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty. * @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
@ -57,7 +58,7 @@ $show_terms = ! in_array( $args['terms'], ['none', 'false'] ) &&
$query_args = array( $query_args = array(
'fictioneer_query_name' => 'latest_stories', 'fictioneer_query_name' => 'latest_stories',
'post_type' => 'fcn_story', 'post_type' => 'fcn_story',
'post_status' => 'publish', 'post_status' => $args['post_status'] ?? 'publish',
'post__in' => $args['post_ids'], // May be empty! 'post__in' => $args['post_ids'], // May be empty!
'order' => $args['order'], 'order' => $args['order'],
'orderby' => $args['orderby'], 'orderby' => $args['orderby'],

View File

@ -18,6 +18,7 @@
* @internal $args['author'] Author provided by the shortcode. * @internal $args['author'] Author provided by the shortcode.
* @internal $args['order'] Order of posts. Default 'DESC'. * @internal $args['order'] Order of posts. Default 'DESC'.
* @internal $args['post_ids'] Array of post IDs. Default empty. * @internal $args['post_ids'] Array of post IDs. Default empty.
* @internal $args['post_status'] Queried post status. Default 'publish'.
* @internal $args['author_ids'] Array of author IDs. Default empty. * @internal $args['author_ids'] Array of author IDs. Default empty.
* @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty. * @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty. * @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
@ -59,7 +60,7 @@ $card_counter = 0;
$query_args = array( $query_args = array(
'fictioneer_query_name' => 'latest_updates_compact', 'fictioneer_query_name' => 'latest_updates_compact',
'post_type' => 'fcn_story', 'post_type' => 'fcn_story',
'post_status' => 'publish', 'post_status' => $args['post_status'] ?? 'publish',
'post__in' => $args['post_ids'], // May be empty! 'post__in' => $args['post_ids'], // May be empty!
'order' => $args['order'], 'order' => $args['order'],
'orderby' => 'meta_value', 'orderby' => 'meta_value',

View File

@ -18,6 +18,7 @@
* @internal $args['author'] Author provided by the shortcode. * @internal $args['author'] Author provided by the shortcode.
* @internal $args['order'] Order of posts. Default 'DESC'. * @internal $args['order'] Order of posts. Default 'DESC'.
* @internal $args['post_ids'] Array of post IDs. Default empty. * @internal $args['post_ids'] Array of post IDs. Default empty.
* @internal $args['post_status'] Queried post status. Default 'publish'.
* @internal $args['author_ids'] Array of author IDs. Default empty. * @internal $args['author_ids'] Array of author IDs. Default empty.
* @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty. * @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty. * @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
@ -62,7 +63,7 @@ $content_list_style = get_theme_mod( 'content_list_style', 'default' );
$query_args = array( $query_args = array(
'fictioneer_query_name' => 'latest_updates_list', 'fictioneer_query_name' => 'latest_updates_list',
'post_type' => 'fcn_story', 'post_type' => 'fcn_story',
'post_status' => 'publish', 'post_status' => $args['post_status'] ?? 'publish',
'post__in' => $args['post_ids'], // May be empty! 'post__in' => $args['post_ids'], // May be empty!
'order' => $args['order'], 'order' => $args['order'],
'orderby' => 'meta_value', 'orderby' => 'meta_value',

View File

@ -19,6 +19,7 @@
* @internal $args['author'] Author provided by the shortcode. * @internal $args['author'] Author provided by the shortcode.
* @internal $args['order'] Order of posts. Default 'DESC'. * @internal $args['order'] Order of posts. Default 'DESC'.
* @internal $args['post_ids'] Array of post IDs. Default empty. * @internal $args['post_ids'] Array of post IDs. Default empty.
* @internal $args['post_status'] Queried post status. Default 'publish'.
* @internal $args['author_ids'] Array of author IDs. Default empty. * @internal $args['author_ids'] Array of author IDs. Default empty.
* @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty. * @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty. * @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
@ -65,7 +66,7 @@ $show_terms = ! get_option( 'fictioneer_hide_taxonomies_on_story_cards' ) &&
$query_args = array( $query_args = array(
'fictioneer_query_name' => 'latest_updates', 'fictioneer_query_name' => 'latest_updates',
'post_type' => 'fcn_story', 'post_type' => 'fcn_story',
'post_status' => 'publish', 'post_status' => $args['post_status'] ?? 'publish',
'post__in' => $args['post_ids'], // May be empty! 'post__in' => $args['post_ids'], // May be empty!
'order' => $args['order'], 'order' => $args['order'],
'orderby' => 'meta_value', 'orderby' => 'meta_value',

View File

@ -18,6 +18,7 @@
* @internal $args['orderby'] Order argument. Default 'date'. * @internal $args['orderby'] Order argument. Default 'date'.
* @internal $args['author'] Author provided by the shortcode. * @internal $args['author'] Author provided by the shortcode.
* @internal $args['post_ids'] Array of post IDs. Default empty. * @internal $args['post_ids'] Array of post IDs. Default empty.
* @internal $args['post_status'] Queried post status. Default 'publish'.
* @internal $args['author_ids'] Array of author IDs. Default empty. * @internal $args['author_ids'] Array of author IDs. Default empty.
* @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty. * @internal $args['excluded_authors'] Array of author IDs to exclude. Default empty.
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty. * @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
@ -46,7 +47,7 @@ $splide = $args['splide'] ?? 0;
$query_args = array ( $query_args = array (
'fictioneer_query_name' => 'showcase', 'fictioneer_query_name' => 'showcase',
'post_type' => $args['post_type'], 'post_type' => $args['post_type'],
'post_status' => 'publish', 'post_status' => $args['post_status'] ?? 'publish',
'post__in' => $args['post_ids'], // May be empty! 'post__in' => $args['post_ids'], // May be empty!
'order' => $args['order'], 'order' => $args['order'],
'orderby' => $args['orderby'], 'orderby' => $args['orderby'],