Add only_protected shortcode param

This commit is contained in:
Tetrakern 2024-09-20 23:41:37 +02:00
parent 329a067da0
commit 2cb8c114c5
16 changed files with 102 additions and 6 deletions

View File

@ -821,6 +821,7 @@ Renders a multi-column grid of paginated medium cards ordered by publishing date
* **orderby:** The default is `date`, but you can also use `modified` and [more](https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters).
* **ignore_sticky:** Whether sticky 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`.
* **author:** Only show recommendations by 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.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
@ -873,6 +874,7 @@ Renders paginated blog posts akin to the main blog page, but with options. Only
* **per_page:** Number of posts per page. Defaults to theme settings.
* **ignore_sticky:** Whether sticky 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`.
* **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.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
@ -997,6 +999,7 @@ Renders a multi-column grid of small cards, showing the latest four chapters ord
* **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.
* **ignore_protected:** Whether protected posts should be ignored 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.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
@ -1062,6 +1065,7 @@ Renders the last blog post or a list of blog posts, ignoring sticky posts, order
* **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.
* **ignore_protected:** Whether protected posts should be ignored 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.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
@ -1097,6 +1101,7 @@ Renders a multi-column grid of small cards, showing the latest four recommendati
* **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.
* **ignore_protected:** Whether protected posts should be ignored 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.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
@ -1149,6 +1154,7 @@ Renders a multi-column grid of small cards, showing the latest four stories orde
* **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.
* **ignore_protected:** Whether protected posts should be ignored 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.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
@ -1225,6 +1231,7 @@ Renders a multi-column grid of small cards, showing the latest four updated stor
* **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.
* **ignore_protected:** Whether protected posts should be ignored 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.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
@ -1337,6 +1344,7 @@ Renders dynamic grid of thumbnails with title, showing the latest eight posts of
* **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.
* **ignore_protected:** Whether protected posts should be ignored 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.
* **exclude_author_ids:** Comma-separated list of author IDs to exclude.
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.

View File

@ -154,11 +154,6 @@ if ( FICTIONEER_RELATIONSHIP_PURGE_ASSIST ) {
/**
* Returns sanitized arguments extracted from shortcode attributes
*
* Checks for 'count', 'offset', 'order', 'orderby', 'page', 'per_page', 'post_ids',
* 'author', 'author_ids', 'exclude_author_ids', 'exclude_tag_ids', 'exclude_cat_ids',
* 'rel', 'ignore_sticky', 'ignore_protected', 'class', and taxonomies with the
* fictioneer_get_shortcode_taxonomies() helper functions.
*
* @since 5.7.3
*
* @param array $attr Attributes passed to the shortcode.
@ -196,6 +191,7 @@ function fictioneer_get_default_shortcode_args( $attr, $def_count = -1 ) {
'relation' => strtolower( $attr['rel'] ?? 'and' ) === 'or' ? 'OR' : 'AND',
'ignore_sticky' => filter_var( $attr['ignore_sticky'] ?? 0, FILTER_VALIDATE_BOOLEAN ),
'ignore_protected' => filter_var( $attr['ignore_protected'] ?? 0, FILTER_VALIDATE_BOOLEAN ),
'only_protected' => filter_var( $attr['only_protected'] ?? 0, FILTER_VALIDATE_BOOLEAN ),
'vertical' => filter_var( $attr['vertical'] ?? 0, FILTER_VALIDATE_BOOLEAN ),
'seamless' => filter_var( $attr['seamless'] ?? $seamless_default, FILTER_VALIDATE_BOOLEAN ),
'aspect_ratio' => sanitize_css_aspect_ratio( $attr['aspect_ratio'] ?? '' ),
@ -389,6 +385,7 @@ function fictioneer_get_shortcode_tax_query( $args ) {
* @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['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['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_tag_ids'] Optional. Exclude posts with these tags.
@ -503,6 +500,7 @@ add_shortcode( 'fictioneer_showcase', 'fictioneer_shortcode_showcase' );
* @param string|null $attr['source'] Optional. Whether to show the author and story.
* @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['only_protected'] Optional. Whether to query only protected posts. Default false.
* @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_tag_ids'] Optional. Exclude posts with these tags.
@ -607,6 +605,7 @@ add_shortcode( 'fictioneer_chapter_cards', 'fictioneer_shortcode_latest_chapters
* @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['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['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_tag_ids'] Optional. Exclude posts with these tags.
@ -712,6 +711,7 @@ add_shortcode( 'fictioneer_story_cards', 'fictioneer_shortcode_latest_stories' )
* @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['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['exclude_tag_ids'] Optional. Exclude posts with these tags.
* @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.
@ -822,6 +822,7 @@ add_shortcode( 'fictioneer_update_cards', 'fictioneer_shortcode_latest_story_upd
* @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['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['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_tag_ids'] Optional. Exclude posts with these tags.
@ -911,6 +912,7 @@ add_shortcode( 'fictioneer_recommendation_cards', 'fictioneer_shortcode_latest_r
* @param string|null $attr['author'] Optional. Limit posts to a specific author.
* @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['only_protected'] Optional. Whether to query only protected posts. Default false.
* @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_tag_ids'] Optional. Exclude posts with these tags.
@ -1511,6 +1513,7 @@ add_shortcode( 'fictioneer_search', 'fictioneer_shortcode_search' );
* @param string|null $attr['per_page'] Optional. Number of posts per page.
* @param string|null $attr['ignore_sticky'] Optional. Whether to ignore sticky 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['author'] Optional. Limit posts to a specific author.
* @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.
@ -1661,6 +1664,7 @@ add_shortcode( 'fictioneer_blog', 'fictioneer_shortcode_blog' );
* @param string|null $attr['orderby'] Optional. Orderby argument. Default 'date'.
* @param string|null $attr['ignore_sticky'] Optional. Whether to ignore sticky 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['author'] Optional. Limit posts to a specific author.
* @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.

View File

@ -11,6 +11,7 @@
* @internal $args['post_type'] Array of post types to query. Default 'post'.
* @internal $args['ignore_sticky'] Whether to ignore sticky flags. Default false.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['count'] Number of posts to display. Default -1.
* @internal $args['author'] Author to query posts for. Default empty.
* @internal $args['order'] Order of posts. Default 'DESC'.
@ -96,13 +97,18 @@ if ( ! empty( $args['excluded_tags'] ) ) {
}
// Ignore protected?
if ( ! $args['ignore_protected'] ) {
if ( ! $args['ignore_protected'] || $args['only_protected'] ) {
$obfuscation = str_repeat( _x( '· ', 'Protected post content obfuscation character.', 'fictioneer' ), 256 );
$obfuscation = apply_filters( 'fictioneer_filter_obfuscation_string', $obfuscation, $post );
} else {
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
$query_args = apply_filters( 'fictioneer_filter_shortcode_article_cards_query_args', $query_args, $args );

View File

@ -21,6 +21,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['vertical'] Whether to show the vertical variant.
@ -111,6 +112,11 @@ if ( $args['ignore_protected'] ) {
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_chapters_query_args', $query_args, $args );

View File

@ -20,6 +20,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['spoiler'] Whether to obscure or show chapter excerpt.
@ -116,6 +117,11 @@ if ( $args['ignore_protected'] ) {
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_chapters_query_args', $query_args, $args );

View File

@ -20,6 +20,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['spoiler'] Whether to obscure or show chapter excerpt.
@ -116,6 +117,11 @@ if ( $args['ignore_protected'] ) {
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_chapters_query_args', $query_args, $args );

View File

@ -17,6 +17,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['classes'] Array of additional CSS classes. Default empty.
@ -75,6 +76,11 @@ if ( $args['ignore_protected'] ) {
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_posts_query_args', $query_args, $args );

View File

@ -19,6 +19,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['vertical'] Whether to show the vertical variant.
@ -90,6 +91,11 @@ if ( $args['ignore_protected'] ) {
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_recommendations_query_args', $query_args, $args );

View File

@ -19,6 +19,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['vertical'] Whether to show the vertical variant.
@ -87,6 +88,11 @@ if ( $args['ignore_protected'] ) {
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_recommendations_query_args', $query_args, $args );

View File

@ -20,6 +20,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['source'] Whether to show the author. Default true.
@ -115,6 +116,11 @@ if ( $args['ignore_protected'] ) {
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_stories_query_args', $query_args, $args );

View File

@ -20,6 +20,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['source'] Whether to show author and story. Default true.
@ -116,6 +117,11 @@ if ( $args['ignore_protected'] ) {
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_stories_query_args', $query_args, $args );

View File

@ -20,6 +20,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['source'] Whether to show the author. Default true.
@ -116,6 +117,11 @@ if ( $args['ignore_protected'] ) {
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_stories_query_args', $query_args, $args );

View File

@ -22,6 +22,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['source'] Whether to show author and story.
@ -124,6 +125,11 @@ if ( $args['ignore_protected'] ) {
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_updates_query_args', $query_args, $args );

View File

@ -22,6 +22,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['source'] Whether to show author and story.
@ -127,6 +128,11 @@ if ( $args['ignore_protected'] ) {
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_updates_query_args', $query_args, $args );

View File

@ -23,6 +23,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['source'] Whether to show author and story.
@ -130,6 +131,11 @@ if ( $args['ignore_protected'] ) {
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_updates_query_args', $query_args, $args );

View File

@ -22,6 +22,7 @@
* @internal $args['excluded_cats'] Array of category IDs to exclude. Default empty.
* @internal $args['excluded_tags'] Array of tag IDs to exclude. Default empty.
* @internal $args['ignore_protected'] Whether to ignore protected posts. Default false.
* @internal $args['only_protected'] Whether to query only protected posts. Default false.
* @internal $args['taxonomies'] Array of taxonomy arrays. Default empty.
* @internal $args['relation'] Relationship between taxonomies.
* @internal $args['classes'] String of additional CSS classes. Default empty.
@ -87,6 +88,11 @@ if ( $args['ignore_protected'] ) {
$query_args['has_password'] = false;
}
// Only protected?
if ( $args['only_protected'] ) {
$query_args['has_password'] = true;
}
// Apply filters
$query_args = apply_filters( 'fictioneer_filter_shortcode_showcase_query_args', $query_args, $args );