Add ignore_protected to other shortcodes
This commit is contained in:
parent
dc19a409b3
commit
633255ba10
@ -386,7 +386,7 @@ The custom HTML block is the best way to add special elements to the content, su
|
||||
|
||||
### Blog
|
||||
|
||||
Renders paginated blog posts akin to the default blog page, but with options. Makes use of the main query pagination variable, so only use this once per page. Optional parameters are **per_page**, **author**, **exclude_cat_ids**, **exclude_tag_ids**, **categories**, **tags**, **rel**, and **class**.
|
||||
Renders paginated blog posts akin to the default blog page, but with options. Makes use of the main query pagination variable, so only use this once per page. Optional parameters are **per_page**, **author**, **ignore_protected**, **exclude_cat_ids**, **exclude_tag_ids**, **categories**, **tags**, **rel**, and **class**.
|
||||
|
||||
* **per_page:** Number of posts per page. Defaults to theme settings.
|
||||
* **ignore_sticky:** Whether sticky posts should be ignored or not. Default `false`.
|
||||
@ -496,7 +496,7 @@ Renders two buttons to deal with cookies, "Reset Consent" and "Clear Cookies". B
|
||||
|
||||
### Latest Chapters
|
||||
|
||||
Renders a two-column grid of small cards, showing the latest four chapters ordered by publishing date, descending. Optional parameters are **count**, **type**, **author**, **order**, **orderby**, **spoiler**, **source**, **post_ids**, **exclude_cat_ids**, **exclude_tag_ids**, **categories**, **tags**, **fandoms**, **genres**, **characters**, **rel**, and **class**.
|
||||
Renders a two-column grid of small cards, showing the latest four chapters ordered by publishing date, descending. Optional parameters are **count**, **type**, **author**, **order**, **orderby**, **spoiler**, **source**, **post_ids**, **ignore_protected**, **exclude_cat_ids**, **exclude_tag_ids**, **categories**, **tags**, **fandoms**, **genres**, **characters**, **rel**, and **class**.
|
||||
|
||||
* **count:** Limit chapters to any positive number, although you should keep it reasonable. Default `4`.
|
||||
* **type:** Either `default`, `simple`, or `compact`. The other variants are smaller with less data.
|
||||
@ -506,6 +506,7 @@ Renders a two-column grid of small cards, showing the latest four chapters order
|
||||
* **spoiler:** The excerpt is obfuscated, set `true` if you want to reveal it. Default `false`.
|
||||
* **source:** Set `false` to hide the author and story nodes. Default `true`.
|
||||
* **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`.
|
||||
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
|
||||
* **exclude_tag_ids:** Comma-separated list of tag IDs to exclude.
|
||||
* **categories:** Comma-separated list of category names (case-insensitive), if you want to pick from a curated pool.
|
||||
@ -532,11 +533,12 @@ Renders a two-column grid of small cards, showing the latest four chapters order
|
||||
|
||||
### Latest Posts
|
||||
|
||||
Renders the last blog post or a list of blog posts, ignoring sticky posts, ordered by publishing date, descending. Optional parameters are **count**, **author**, **post_ids**, **exclude_cat_ids**, **exclude_tag_ids**, **categories**, **tags**, **rel**, and **class**.
|
||||
Renders the last blog post or a list of blog posts, ignoring sticky posts, ordered by publishing date, descending. Optional parameters are **count**, **author**, **post_ids**, **ignore_protected**, **exclude_cat_ids**, **exclude_tag_ids**, **categories**, **tags**, **rel**, and **class**.
|
||||
|
||||
* **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 write the name right.
|
||||
* **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`.
|
||||
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
|
||||
* **exclude_tag_ids:** Comma-separated list of tag IDs to exclude.
|
||||
* **categories:** Comma-separated list of category names (case-insensitive), if you want to pick from a curated pool.
|
||||
@ -560,7 +562,7 @@ Renders the last blog post or a list of blog posts, ignoring sticky posts, order
|
||||
|
||||
### Latest Recommendations
|
||||
|
||||
Renders a two-column grid of small cards, showing the latest four recommendations ordered by publishing date, descending. Optional parameters are **count**, **type**, **author**, **order**, **orderby**, **post_ids**, **exclude_cat_ids**, **exclude_tag_ids**, **categories**, **tags**, **fandoms**, **genres**, **characters**, **rel**, and **class**.
|
||||
Renders a two-column grid of small cards, showing the latest four recommendations ordered by publishing date, descending. Optional parameters are **count**, **type**, **author**, **order**, **orderby**, **post_ids**, **ignore_protected**, **exclude_cat_ids**, **exclude_tag_ids**, **categories**, **tags**, **fandoms**, **genres**, **characters**, **rel**, and **class**.
|
||||
|
||||
* **count:** Limit recommendations to any positive number, although you should keep it reasonable. Default `4`.
|
||||
* **type:** Either `default` or `compact`. The compact variant is smaller with less data.
|
||||
@ -568,6 +570,7 @@ Renders a two-column grid of small cards, showing the latest four recommendation
|
||||
* **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).
|
||||
* **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`.
|
||||
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
|
||||
* **exclude_tag_ids:** Comma-separated list of tag IDs to exclude.
|
||||
* **categories:** Comma-separated list of category names (case-insensitive), if you want to pick from a curated pool.
|
||||
@ -594,7 +597,7 @@ Renders a two-column grid of small cards, showing the latest four recommendation
|
||||
|
||||
### Latest Stories
|
||||
|
||||
Renders a two-column grid of small cards, showing the latest four stories ordered by publishing date, descending. Optional parameters are **count**, **type**, **author**, **order**, **orderby**, **post_ids**, **exclude_cat_ids**, **exclude_tag_ids**, **categories**, **tags**, **fandoms**, **genres**, **characters**, **rel**, and **class**.
|
||||
Renders a two-column grid of small cards, showing the latest four stories ordered by publishing date, descending. Optional parameters are **count**, **type**, **author**, **order**, **orderby**, **post_ids**, **ignore_protected**, **exclude_cat_ids**, **exclude_tag_ids**, **categories**, **tags**, **fandoms**, **genres**, **characters**, **rel**, and **class**.
|
||||
|
||||
* **count:** Limit stories to any positive number, although you should keep it reasonable. Default `4`.
|
||||
* **type:** Either `default` or `compact`. The compact variant is smaller with less data.
|
||||
@ -602,6 +605,7 @@ Renders a two-column grid of small cards, showing the latest four stories ordere
|
||||
* **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).
|
||||
* **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`.
|
||||
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
|
||||
* **exclude_tag_ids:** Comma-separated list of tag IDs to exclude.
|
||||
* **categories:** Comma-separated list of category names (case-insensitive), if you want to pick from a curated pool.
|
||||
@ -628,13 +632,14 @@ Renders a two-column grid of small cards, showing the latest four stories ordere
|
||||
|
||||
### Latest Updates
|
||||
|
||||
Renders a two-column grid of small cards, showing the latest four updated stories ordered by date of the last chapter change, descending. Optional parameters are **count**, **type**, **author**, **order**, **post_ids**, **exclude_cat_ids**, **exclude_tag_ids**, **categories**, **tags**, **fandoms**, **genres**, **characters**, **rel**, and **class**.
|
||||
Renders a two-column grid of small cards, showing the latest four updated stories ordered by date of the last chapter change, descending. Optional parameters are **count**, **type**, **author**, **order**, **post_ids**, **ignore_protected**, **exclude_cat_ids**, **exclude_tag_ids**, **categories**, **tags**, **fandoms**, **genres**, **characters**, **rel**, and **class**.
|
||||
|
||||
* **count:** Limit updates to any positive number, although you should keep it reasonable. Default `4`.
|
||||
* **type:** Either `default`, `simple`, or `compact`. The other variants are smaller with less data.
|
||||
* **author:** Only show updates of a specific author. Make sure to write the name right.
|
||||
* **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`.
|
||||
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
|
||||
* **exclude_tag_ids:** Comma-separated list of tag IDs to exclude.
|
||||
* **categories:** Comma-separated list of category names (case-insensitive), if you want to pick from a curated pool.
|
||||
@ -679,7 +684,7 @@ Renders the search form with advanced options (if not disabled in the settings).
|
||||
|
||||
### Showcase
|
||||
|
||||
Renders dynamic grid of thumbnails with title, showing the latest eight posts of the specified type ordered by publishing date, descending. Requires **for** parameter. Optional parameters are **count**, **author**, **order**, **orderby**, **post_ids**, **exclude_cat_ids**, **exclude_tag_ids**, **no_cap**, and **class**. The thumbnail is either the **Landscape Image** or **Cover Image** (if available), with chapters defaulting to the parent story.
|
||||
Renders dynamic grid of thumbnails with title, showing the latest eight posts of the specified type ordered by publishing date, descending. Requires **for** parameter. Optional parameters are **count**, **author**, **order**, **orderby**, **post_ids**, **ignore_protected**, **exclude_cat_ids**, **exclude_tag_ids**, **no_cap**, and **class**. The thumbnail is either the **Landscape Image** or **Cover Image** (if available), with chapters defaulting to the parent story.
|
||||
|
||||
* **for:** Desired post type, either `stories`, `chapters`, `collections`, or `recommendations`.
|
||||
* **count:** Limit posts to any positive number, although you should keep it reasonable. Default `8`.
|
||||
@ -687,6 +692,7 @@ Renders dynamic grid of thumbnails with title, showing the latest eight posts of
|
||||
* **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).
|
||||
* **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`.
|
||||
* **exclude_cat_ids:** Comma-separated list of category IDs to exclude.
|
||||
* **exclude_tag_ids:** Comma-separated list of tag IDs to exclude.
|
||||
* **no_cap:** Set `true` if you want to hide the caption.
|
||||
|
26
FILTERS.md
26
FILTERS.md
@ -653,6 +653,8 @@ Filters the query arguments in the `fictioneer_blog` shortcode.
|
||||
**$args:**
|
||||
* $per_page (string|null) – Optional. The number of posts per page.
|
||||
* $author (string|null) – Optional. The author provided by the shortcode.
|
||||
* $ignore_sticky (boolean) – Optional. Whether to ignore sticky posts. Default `false`.
|
||||
* $ignore_protected (boolean) – Optional. Whether to ignore protected posts. Default `false`.
|
||||
* $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.
|
||||
@ -702,10 +704,11 @@ Filters the query arguments in the `fictioneer_latest_chapters` shortcode. The o
|
||||
* $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'`.
|
||||
* $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.
|
||||
* $ignore_protected (boolean) – Optional. Whether to ignore protected posts. Default `false`.
|
||||
* $excluded_cats (\[string]) – Array of category IDs to exclude. Default empty.
|
||||
* $excluded_tags (\[string]) – Array of tag IDs to exclude. Default empty.
|
||||
* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty.
|
||||
@ -726,7 +729,7 @@ Filters the query arguments in the `fictioneer_latest_posts` shortcode. The opti
|
||||
* $author_name (string|null) – `$args['author']`
|
||||
* $has_password (boolean) – `false`
|
||||
* $orderby (string) – `'date'`
|
||||
* $order (string) – `'desc'`
|
||||
* $order (string) – `'DESC'`
|
||||
* $posts_per_page (int) – `$args['count']`
|
||||
* $ignore_sticky_posts (boolean) – `true`
|
||||
* $no_found_rows (boolean) – `true`
|
||||
@ -735,6 +738,7 @@ Filters the query arguments in the `fictioneer_latest_posts` shortcode. The opti
|
||||
* $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.
|
||||
* $ignore_protected (boolean) – Optional. Whether to ignore protected posts. Default `false`.
|
||||
* $excluded_cats (\[string]) – Array of category IDs to exclude. Default empty.
|
||||
* $excluded_tags (\[string]) – Array of tag IDs to exclude. Default empty.
|
||||
* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty.
|
||||
@ -762,8 +766,9 @@ Filters the query arguments in the `fictioneer_latest_recommendations` shortcode
|
||||
* $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'`.
|
||||
* $order (string) – Optional. Default `'DESC'`.
|
||||
* $post_ids (\[string]) – Array of post IDs. Default empty.
|
||||
* $ignore_protected (boolean) – Optional. Whether to ignore protected posts. Default `false`.
|
||||
* $excluded_cats (\[string]) – Array of category IDs to exclude. Default empty.
|
||||
* $excluded_tags (\[string]) – Array of tag IDs to exclude. Default empty.
|
||||
* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty.
|
||||
@ -809,8 +814,9 @@ Filters the query arguments in the `fictioneer_latest_stories` shortcode. The op
|
||||
* $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'`.
|
||||
* $order (string) – Optional. Default `'DESC'`.
|
||||
* $post_ids (\[string]) – Array of post IDs. Default empty.
|
||||
* $ignore_protected (boolean) – Optional. Whether to ignore protected posts. Default `false`.
|
||||
* $excluded_cats (\[string]) – Array of category IDs to exclude. Default empty.
|
||||
* $excluded_tags (\[string]) – Array of tag IDs to exclude. Default empty.
|
||||
* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty.
|
||||
@ -855,8 +861,9 @@ Filters the query arguments in the `fictioneer_latest_updates` shortcode. The op
|
||||
* $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'`.
|
||||
* $order (string) – Optional. Default `'DESC'`.
|
||||
* $post_ids (\[string]) – Array of post IDs. Default empty.
|
||||
* $ignore_protected (boolean) – Optional. Whether to ignore protected posts. Default `false`.
|
||||
* $excluded_cats (\[string]) – Array of category IDs to exclude. Default empty.
|
||||
* $excluded_tags (\[string]) – Array of tag IDs to exclude. Default empty.
|
||||
* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty.
|
||||
@ -886,8 +893,9 @@ Filters the query arguments in the `fictioneer_showcase` shortcode. The optional
|
||||
* $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'`.
|
||||
* $order (string) – Optional. Default `'DESC'`.
|
||||
* $post_ids (\[string]) – Array of post IDs. Default empty.
|
||||
* $ignore_protected (boolean) – Optional. Whether to ignore protected posts. Default `false`.
|
||||
* $excluded_cats (\[string]) – Array of category IDs to exclude. Default empty.
|
||||
* $excluded_tags (\[string]) – Array of tag IDs to exclude. Default empty.
|
||||
* $taxonomies (\[array]) – Array of taxonomy arrays (names). Default empty.
|
||||
@ -926,7 +934,7 @@ Filters the option array of URL/label tuples for the date popup menu in the `fic
|
||||
* $post_id (int) – Current post ID.
|
||||
* $queried_type (string) – Queried post type.
|
||||
* $query_args (array) – Query arguments used.
|
||||
* $order (string) – Current order. Defaults to `'desc'`.
|
||||
* $order (string) – Current order. Defaults to `'DESC'`.
|
||||
* $orderby (string) – Current orderby. Defaults to `'modified'` in list templates and `'date'` in archives.
|
||||
|
||||
---
|
||||
@ -947,7 +955,7 @@ Filters the option array of URL/label tuples for the orderby popup menu in the `
|
||||
* $post_id (int) – Current post ID.
|
||||
* $queried_type (string) – Queried post type.
|
||||
* $query_args (array) – Query arguments used.
|
||||
* $order (string) – Current order. Defaults to `'desc'`.
|
||||
* $order (string) – Current order. Defaults to `'DESC'`.
|
||||
* $orderby (string) – Current orderby. Defaults to `'modified'` in list templates and `'date'` in archives.
|
||||
|
||||
---
|
||||
@ -971,7 +979,7 @@ Filters the option array of URL/label tuples for the post type popup menu in the
|
||||
* $post_id (int) – Current post ID.
|
||||
* $queried_type (string) – Queried post type.
|
||||
* $query_args (array) – Query arguments used.
|
||||
* $order (string) – Current order. Defaults to `'desc'`.
|
||||
* $order (string) – Current order. Defaults to `'DESC'`.
|
||||
* $orderby (string) – Current orderby. Defaults to `'modified'` in list templates and `'date'` in archives.
|
||||
|
||||
---
|
||||
|
@ -248,22 +248,23 @@ function fictioneer_get_shortcode_tax_query( $args ) {
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @param string $attr['for'] What the showcase is for. Allowed are chapters,
|
||||
* collections, recommendations, and stories.
|
||||
* @param string|null $attr['count'] Optional. Maximum number of items. Default 9.
|
||||
* @param string|null $attr['author'] Optional. Limit items to a specific author.
|
||||
* @param string|null $attr['order'] Optional. Order direction. Default 'DESC'.
|
||||
* @param string|null $attr['orderby'] Optional. Order argument. Default 'date'.
|
||||
* @param string|null $attr['post_ids'] Optional. Limit items to specific post IDs.
|
||||
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
|
||||
* @param string|null $attr['exclude_cat_ids'] Optional. Exclude posts with these categories.
|
||||
* @param string|null $attr['categories'] Optional. Limit items to specific category names.
|
||||
* @param string|null $attr['tags'] Optional. Limit items to specific tag names.
|
||||
* @param string|null $attr['fandoms'] Optional. Limit items to specific fandom names.
|
||||
* @param string|null $attr['genres'] Optional. Limit items to specific genre names.
|
||||
* @param string|null $attr['characters'] Optional. Limit items to specific character names.
|
||||
* @param string|null $attr['rel'] Optional. Relationship between taxonomies. Default 'AND'.
|
||||
* @param string|null $attr['class'] Optional. Additional CSS classes, separated by whitespace.
|
||||
* @param string $attr['for'] What the showcase is for. Allowed are chapters,
|
||||
* collections, recommendations, and stories.
|
||||
* @param string|null $attr['count'] Optional. Maximum number of items. Default 9.
|
||||
* @param string|null $attr['author'] Optional. Limit items to a specific author.
|
||||
* @param string|null $attr['order'] Optional. Order direction. Default 'DESC'.
|
||||
* @param string|null $attr['orderby'] Optional. Order argument. Default 'date'.
|
||||
* @param string|null $attr['post_ids'] Optional. Limit items to specific post IDs.
|
||||
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
|
||||
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
|
||||
* @param string|null $attr['exclude_cat_ids'] Optional. Exclude posts with these categories.
|
||||
* @param string|null $attr['categories'] Optional. Limit items to specific category names.
|
||||
* @param string|null $attr['tags'] Optional. Limit items to specific tag names.
|
||||
* @param string|null $attr['fandoms'] Optional. Limit items to specific fandom names.
|
||||
* @param string|null $attr['genres'] Optional. Limit items to specific genre names.
|
||||
* @param string|null $attr['characters'] Optional. Limit items to specific character names.
|
||||
* @param string|null $attr['rel'] Optional. Relationship between taxonomies. Default 'AND'.
|
||||
* @param string|null $attr['class'] Optional. Additional CSS classes, separated by whitespace.
|
||||
*
|
||||
* @return string The rendered shortcode HTML.
|
||||
*/
|
||||
@ -308,6 +309,7 @@ function fictioneer_shortcode_showcase( $attr ) {
|
||||
'post_ids' => $post_ids,
|
||||
'excluded_tags' => fictioneer_explode_list( $attr['exclude_tag_ids'] ?? '' ),
|
||||
'excluded_cats' => fictioneer_explode_list( $attr['exclude_cat_ids'] ?? '' ),
|
||||
'ignore_protected' => filter_var( $attr['ignore_protected'] ?? 0, FILTER_VALIDATE_BOOLEAN ),
|
||||
'taxonomies' => fictioneer_get_shortcode_taxonomies( $attr ),
|
||||
'relation' => $rel,
|
||||
'no_cap' => $no_cap == 'true' || $no_cap == '1',
|
||||
@ -371,23 +373,24 @@ add_shortcode( 'fictioneer_showcase', 'fictioneer_shortcode_showcase' );
|
||||
*
|
||||
* @since 3.0
|
||||
*
|
||||
* @param string|null $attr['count'] Optional. Maximum number of items. Default 4.
|
||||
* @param string|null $attr['author'] Optional. Limit items to a specific author.
|
||||
* @param string|null $attr['type'] Optional. Choose between 'default', 'simple', and 'compact'.
|
||||
* @param string|null $attr['order'] Optional. Order argument. Default 'DESC'.
|
||||
* @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['source'] Optional. Whether to show author and story.
|
||||
* @param string|null $attr['post_ids'] Optional. Limit items to specific post IDs.
|
||||
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
|
||||
* @param string|null $attr['exclude_cat_ids'] Optional. Exclude posts with these categories.
|
||||
* @param string|null $attr['categories'] Optional. Limit items to specific category names.
|
||||
* @param string|null $attr['tags'] Optional. Limit items to specific tag names.
|
||||
* @param string|null $attr['fandoms'] Optional. Limit items to specific fandom names.
|
||||
* @param string|null $attr['genres'] Optional. Limit items to specific genre names.
|
||||
* @param string|null $attr['characters'] Optional. Limit items to specific character names.
|
||||
* @param string|null $attr['rel'] Optional. Relationship between taxonomies. Default 'AND'.
|
||||
* @param string|null $attr['class'] Optional. Additional CSS classes, separated by whitespace.
|
||||
* @param string|null $attr['count'] Optional. Maximum number of items. Default 4.
|
||||
* @param string|null $attr['author'] Optional. Limit items to a specific author.
|
||||
* @param string|null $attr['type'] Optional. Choose between 'default', 'simple', and 'compact'.
|
||||
* @param string|null $attr['order'] Optional. Order argument. Default 'DESC'.
|
||||
* @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['source'] Optional. Whether to show author and story.
|
||||
* @param string|null $attr['post_ids'] Optional. Limit items to specific post IDs.
|
||||
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
|
||||
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
|
||||
* @param string|null $attr['exclude_cat_ids'] Optional. Exclude posts with these categories.
|
||||
* @param string|null $attr['categories'] Optional. Limit items to specific category names.
|
||||
* @param string|null $attr['tags'] Optional. Limit items to specific tag names.
|
||||
* @param string|null $attr['fandoms'] Optional. Limit items to specific fandom names.
|
||||
* @param string|null $attr['genres'] Optional. Limit items to specific genre names.
|
||||
* @param string|null $attr['characters'] Optional. Limit items to specific character names.
|
||||
* @param string|null $attr['rel'] Optional. Relationship between taxonomies. Default 'AND'.
|
||||
* @param string|null $attr['class'] Optional. Additional CSS classes, separated by whitespace.
|
||||
*
|
||||
* @return string The rendered shortcode HTML.
|
||||
*/
|
||||
@ -433,6 +436,7 @@ function fictioneer_shortcode_latest_chapters( $attr ) {
|
||||
'post_ids' => $post_ids,
|
||||
'excluded_tags' => fictioneer_explode_list( $attr['exclude_tag_ids'] ?? '' ),
|
||||
'excluded_cats' => fictioneer_explode_list( $attr['exclude_cat_ids'] ?? '' ),
|
||||
'ignore_protected' => filter_var( $attr['ignore_protected'] ?? 0, FILTER_VALIDATE_BOOLEAN ),
|
||||
'taxonomies' => fictioneer_get_shortcode_taxonomies( $attr ),
|
||||
'relation' => $rel,
|
||||
'classes' => $classes
|
||||
@ -483,21 +487,22 @@ add_shortcode( 'fictioneer_chapter_cards', 'fictioneer_shortcode_latest_chapters
|
||||
*
|
||||
* @since 3.0
|
||||
*
|
||||
* @param string|null $attr['count'] Optional. Maximum number of items. Default 4.
|
||||
* @param string|null $attr['author'] Optional. Limit items to a specific author.
|
||||
* @param string|null $attr['type'] Optional. Choose between 'default' and 'compact'.
|
||||
* @param string|null $attr['order'] Optional. Order argument. Default 'DESC'.
|
||||
* @param string|null $attr['orderby'] Optional. Orderby argument. Default 'date'.
|
||||
* @param string|null $attr['post_ids'] Optional. Limit items to specific post IDs.
|
||||
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
|
||||
* @param string|null $attr['exclude_cat_ids'] Optional. Exclude posts with these categories.
|
||||
* @param string|null $attr['categories'] Optional. Limit items to specific category names.
|
||||
* @param string|null $attr['tags'] Optional. Limit items to specific tag names.
|
||||
* @param string|null $attr['fandoms'] Optional. Limit items to specific fandom names.
|
||||
* @param string|null $attr['genres'] Optional. Limit items to specific genre names.
|
||||
* @param string|null $attr['characters'] Optional. Limit items to specific character names.
|
||||
* @param string|null $attr['rel'] Optional. Relationship between taxonomies. Default 'AND'.
|
||||
* @param string|null $attr['class'] Optional. Additional CSS classes, separated by whitespace.
|
||||
* @param string|null $attr['count'] Optional. Maximum number of items. Default 4.
|
||||
* @param string|null $attr['author'] Optional. Limit items to a specific author.
|
||||
* @param string|null $attr['type'] Optional. Choose between 'default' and 'compact'.
|
||||
* @param string|null $attr['order'] Optional. Order argument. Default 'DESC'.
|
||||
* @param string|null $attr['orderby'] Optional. Orderby argument. Default 'date'.
|
||||
* @param string|null $attr['post_ids'] Optional. Limit items to specific post IDs.
|
||||
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
|
||||
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
|
||||
* @param string|null $attr['exclude_cat_ids'] Optional. Exclude posts with these categories.
|
||||
* @param string|null $attr['categories'] Optional. Limit items to specific category names.
|
||||
* @param string|null $attr['tags'] Optional. Limit items to specific tag names.
|
||||
* @param string|null $attr['fandoms'] Optional. Limit items to specific fandom names.
|
||||
* @param string|null $attr['genres'] Optional. Limit items to specific genre names.
|
||||
* @param string|null $attr['characters'] Optional. Limit items to specific character names.
|
||||
* @param string|null $attr['rel'] Optional. Relationship between taxonomies. Default 'AND'.
|
||||
* @param string|null $attr['class'] Optional. Additional CSS classes, separated by whitespace.
|
||||
*
|
||||
* @return string The rendered shortcode HTML.
|
||||
*/
|
||||
@ -538,6 +543,7 @@ function fictioneer_shortcode_latest_stories( $attr ) {
|
||||
'post_ids' => $post_ids,
|
||||
'excluded_tags' => fictioneer_explode_list( $attr['exclude_tag_ids'] ?? '' ),
|
||||
'excluded_cats' => fictioneer_explode_list( $attr['exclude_cat_ids'] ?? '' ),
|
||||
'ignore_protected' => filter_var( $attr['ignore_protected'] ?? 0, FILTER_VALIDATE_BOOLEAN ),
|
||||
'taxonomies' => fictioneer_get_shortcode_taxonomies( $attr ),
|
||||
'relation' => $rel,
|
||||
'classes' => $classes
|
||||
@ -587,19 +593,20 @@ add_shortcode( 'fictioneer_story_cards', 'fictioneer_shortcode_latest_stories' )
|
||||
*
|
||||
* @since 4.3
|
||||
*
|
||||
* @param string|null $attr['count'] Optional. Maximum number of items. Default 4.
|
||||
* @param string|null $attr['author'] Optional. Limit items to a specific author.
|
||||
* @param string|null $attr['type'] Optional. Choose between 'default', 'simple', and 'compact'.
|
||||
* @param string|null $attr['post_ids'] Optional. Limit items to specific post IDs.
|
||||
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
|
||||
* @param string|null $attr['exclude_cat_ids'] Optional. Exclude posts with these categories.
|
||||
* @param string|null $attr['categories'] Optional. Limit items to specific category names.
|
||||
* @param string|null $attr['tags'] Optional. Limit items to specific tag names.
|
||||
* @param string|null $attr['fandoms'] Optional. Limit items to specific fandom names.
|
||||
* @param string|null $attr['genres'] Optional. Limit items to specific genre names.
|
||||
* @param string|null $attr['characters'] Optional. Limit items to specific character names.
|
||||
* @param string|null $attr['rel'] Optional. Relationship between taxonomies. Default 'AND'.
|
||||
* @param string|null $attr['class'] Optional. Additional CSS classes, separated by whitespace.
|
||||
* @param string|null $attr['count'] Optional. Maximum number of items. Default 4.
|
||||
* @param string|null $attr['author'] Optional. Limit items to a specific author.
|
||||
* @param string|null $attr['type'] Optional. Choose between 'default', 'simple', and 'compact'.
|
||||
* @param string|null $attr['post_ids'] Optional. Limit items to specific post IDs.
|
||||
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
|
||||
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
|
||||
* @param string|null $attr['exclude_cat_ids'] Optional. Exclude posts with these categories.
|
||||
* @param string|null $attr['categories'] Optional. Limit items to specific category names.
|
||||
* @param string|null $attr['tags'] Optional. Limit items to specific tag names.
|
||||
* @param string|null $attr['fandoms'] Optional. Limit items to specific fandom names.
|
||||
* @param string|null $attr['genres'] Optional. Limit items to specific genre names.
|
||||
* @param string|null $attr['characters'] Optional. Limit items to specific character names.
|
||||
* @param string|null $attr['rel'] Optional. Relationship between taxonomies. Default 'AND'.
|
||||
* @param string|null $attr['class'] Optional. Additional CSS classes, separated by whitespace.
|
||||
*
|
||||
* @return string The rendered shortcode HTML.
|
||||
*/
|
||||
@ -638,6 +645,7 @@ function fictioneer_shortcode_latest_story_updates( $attr ) {
|
||||
'post_ids' => $post_ids,
|
||||
'excluded_tags' => fictioneer_explode_list( $attr['exclude_tag_ids'] ?? '' ),
|
||||
'excluded_cats' => fictioneer_explode_list( $attr['exclude_cat_ids'] ?? '' ),
|
||||
'ignore_protected' => filter_var( $attr['ignore_protected'] ?? 0, FILTER_VALIDATE_BOOLEAN ),
|
||||
'taxonomies' => fictioneer_get_shortcode_taxonomies( $attr ),
|
||||
'relation' => $rel,
|
||||
'classes' => $classes
|
||||
@ -688,21 +696,22 @@ add_shortcode( 'fictioneer_update_cards', 'fictioneer_shortcode_latest_story_upd
|
||||
*
|
||||
* @since 4.0
|
||||
*
|
||||
* @param string|null $attr['count'] Optional. Maximum number of items. Default 4.
|
||||
* @param string|null $attr['author'] Optional. Limit items to a specific author.
|
||||
* @param string|null $attr['type'] Optional. Choose between 'default' and 'compact'.
|
||||
* @param string|null $attr['order'] Optional. Order argument. Default 'DESC'.
|
||||
* @param string|null $attr['orderby'] Optional. Orderby argument. Default 'date'.
|
||||
* @param string|null $attr['post_ids'] Optional. Limit items to specific post IDs.
|
||||
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
|
||||
* @param string|null $attr['exclude_cat_ids'] Optional. Exclude posts with these categories.
|
||||
* @param string|null $attr['categories'] Optional. Limit items to specific category names.
|
||||
* @param string|null $attr['tags'] Optional. Limit items to specific tag names.
|
||||
* @param string|null $attr['fandoms'] Optional. Limit items to specific fandom names.
|
||||
* @param string|null $attr['genres'] Optional. Limit items to specific genre names.
|
||||
* @param string|null $attr['characters'] Optional. Limit items to specific character names.
|
||||
* @param string|null $attr['rel'] Optional. Relationship between taxonomies. Default 'AND'.
|
||||
* @param string|null $attr['class'] Optional. Additional CSS classes, separated by whitespace.
|
||||
* @param string|null $attr['count'] Optional. Maximum number of items. Default 4.
|
||||
* @param string|null $attr['author'] Optional. Limit items to a specific author.
|
||||
* @param string|null $attr['type'] Optional. Choose between 'default' and 'compact'.
|
||||
* @param string|null $attr['order'] Optional. Order argument. Default 'DESC'.
|
||||
* @param string|null $attr['orderby'] Optional. Orderby argument. Default 'date'.
|
||||
* @param string|null $attr['post_ids'] Optional. Limit items to specific post IDs.
|
||||
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
|
||||
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
|
||||
* @param string|null $attr['exclude_cat_ids'] Optional. Exclude posts with these categories.
|
||||
* @param string|null $attr['categories'] Optional. Limit items to specific category names.
|
||||
* @param string|null $attr['tags'] Optional. Limit items to specific tag names.
|
||||
* @param string|null $attr['fandoms'] Optional. Limit items to specific fandom names.
|
||||
* @param string|null $attr['genres'] Optional. Limit items to specific genre names.
|
||||
* @param string|null $attr['characters'] Optional. Limit items to specific character names.
|
||||
* @param string|null $attr['rel'] Optional. Relationship between taxonomies. Default 'AND'.
|
||||
* @param string|null $attr['class'] Optional. Additional CSS classes, separated by whitespace.
|
||||
*
|
||||
* @return string The rendered shortcode HTML.
|
||||
*/
|
||||
@ -743,6 +752,7 @@ function fictioneer_shortcode_latest_recommendations( $attr ) {
|
||||
'post_ids' => $post_ids,
|
||||
'excluded_tags' => fictioneer_explode_list( $attr['exclude_tag_ids'] ?? '' ),
|
||||
'excluded_cats' => fictioneer_explode_list( $attr['exclude_cat_ids'] ?? '' ),
|
||||
'ignore_protected' => filter_var( $attr['ignore_protected'] ?? 0, FILTER_VALIDATE_BOOLEAN ),
|
||||
'taxonomies' => fictioneer_get_shortcode_taxonomies( $attr ),
|
||||
'relation' => $rel,
|
||||
'classes' => $classes
|
||||
@ -792,15 +802,16 @@ add_shortcode( 'fictioneer_recommendation_cards', 'fictioneer_shortcode_latest_r
|
||||
*
|
||||
* @since 4.0
|
||||
*
|
||||
* @param string|null $attr['count'] Optional. Maximum number of items. Default 1.
|
||||
* @param string|null $attr['author'] Optional. Limit items to a specific author.
|
||||
* @param string|null $attr['post_ids'] Optional. Limit items to specific post IDs.
|
||||
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
|
||||
* @param string|null $attr['exclude_cat_ids'] Optional. Exclude posts with these categories.
|
||||
* @param string|null $attr['categories'] Optional. Limit items to specific category names.
|
||||
* @param string|null $attr['tags'] Optional. Limit items to specific tag names.
|
||||
* @param string|null $attr['rel'] Optional. Relationship between taxonomies. Default 'AND'.
|
||||
* @param string|null $attr['class'] Optional. Additional CSS classes, separated by whitespace.
|
||||
* @param string|null $attr['count'] Optional. Maximum number of items. Default 1.
|
||||
* @param string|null $attr['author'] Optional. Limit items to a specific author.
|
||||
* @param string|null $attr['post_ids'] Optional. Limit items to specific post IDs.
|
||||
* @param string|null $attr['ignore_protected'] Optional. Whether to ignore protected posts. Default false.
|
||||
* @param string|null $attr['exclude_tag_ids'] Optional. Exclude posts with these tags.
|
||||
* @param string|null $attr['exclude_cat_ids'] Optional. Exclude posts with these categories.
|
||||
* @param string|null $attr['categories'] Optional. Limit items to specific category names.
|
||||
* @param string|null $attr['tags'] Optional. Limit items to specific tag names.
|
||||
* @param string|null $attr['rel'] Optional. Relationship between taxonomies. Default 'AND'.
|
||||
* @param string|null $attr['class'] Optional. Additional CSS classes, separated by whitespace.
|
||||
*
|
||||
* @return string The rendered shortcode HTML.
|
||||
*/
|
||||
@ -836,6 +847,7 @@ function fictioneer_shortcode_latest_posts( $attr ) {
|
||||
'post_ids' => $post_ids,
|
||||
'excluded_tags' => fictioneer_explode_list( $attr['exclude_tag_ids'] ?? '' ),
|
||||
'excluded_cats' => fictioneer_explode_list( $attr['exclude_cat_ids'] ?? '' ),
|
||||
'ignore_protected' => filter_var( $attr['ignore_protected'] ?? 0, FILTER_VALIDATE_BOOLEAN ),
|
||||
'taxonomies' => fictioneer_get_shortcode_taxonomies( $attr ),
|
||||
'relation' => $rel,
|
||||
'classes' => $classes
|
||||
|
@ -8,18 +8,19 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 4.0
|
||||
*
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['orderby'] Sorting of posts. Default 'date'.
|
||||
* @internal $args['spoiler'] Whether to obscure or show chapter excerpt.
|
||||
* @internal $args['source'] Whether to show author and story.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['class'] Additional classes.
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['orderby'] Sorting of posts. Default 'date'.
|
||||
* @internal $args['spoiler'] Whether to obscure or show chapter excerpt.
|
||||
* @internal $args['source'] Whether to show author and story.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['class'] Additional classes.
|
||||
*/
|
||||
?>
|
||||
|
||||
@ -64,12 +65,20 @@ if ( ! empty( $args['excluded_cats'] ) ) {
|
||||
$query_args['category__not_in'] = $args['excluded_cats'];
|
||||
}
|
||||
|
||||
// Ignore protected?
|
||||
if ( $args['ignore_protected'] ) {
|
||||
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
}
|
||||
|
||||
// Apply filters
|
||||
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_chapters_query_args', $query_args, $args );
|
||||
|
||||
// Query chapters
|
||||
$entries = fictioneer_shortcode_query( $query_args );
|
||||
|
||||
// Remove temporary filters
|
||||
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
|
||||
?>
|
||||
|
||||
<section class="small-card-block latest-chapters _compact <?php echo implode( ' ', $args['classes'] ); ?>">
|
||||
|
@ -8,19 +8,20 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 4.0
|
||||
*
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['orderby'] Sorting of posts. Default 'date'.
|
||||
* @internal $args['spoiler'] Whether to obscure or show chapter excerpt.
|
||||
* @internal $args['source'] Whether to show author and story.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['simple'] Whether to show the simple variant.
|
||||
* @internal $args['class'] Additional classes.
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['orderby'] Sorting of posts. Default 'date'.
|
||||
* @internal $args['spoiler'] Whether to obscure or show chapter excerpt.
|
||||
* @internal $args['source'] Whether to show author and story.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['simple'] Whether to show the simple variant.
|
||||
* @internal $args['class'] Additional classes.
|
||||
*/
|
||||
?>
|
||||
|
||||
@ -67,12 +68,20 @@ if ( ! empty( $args['excluded_cats'] ) ) {
|
||||
$query_args['category__not_in'] = $args['excluded_cats'];
|
||||
}
|
||||
|
||||
// Ignore protected?
|
||||
if ( $args['ignore_protected'] ) {
|
||||
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
}
|
||||
|
||||
// Apply filters
|
||||
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_chapters_query_args', $query_args, $args );
|
||||
|
||||
// Query chapters
|
||||
$entries = fictioneer_shortcode_query( $query_args );
|
||||
|
||||
// Remove temporary filters
|
||||
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
|
||||
?>
|
||||
|
||||
<section class="small-card-block latest-chapters <?php echo implode( ' ', $args['classes'] ); ?>">
|
||||
|
@ -8,14 +8,15 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 4.0
|
||||
*
|
||||
* @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['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['classes'] Array of additional CSS classes. Default empty.
|
||||
* @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['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['classes'] Array of additional CSS classes. Default empty.
|
||||
*/
|
||||
?>
|
||||
|
||||
@ -30,7 +31,6 @@ $query_args = array(
|
||||
'post_type' => 'post',
|
||||
'post_status' => 'publish',
|
||||
'post__in' => $args['post_ids'], // May be empty!
|
||||
'has_password' => false,
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
'posts_per_page' => $args['count'],
|
||||
@ -57,12 +57,20 @@ if ( ! empty( $args['excluded_cats'] ) ) {
|
||||
$query_args['category__not_in'] = $args['excluded_cats'];
|
||||
}
|
||||
|
||||
// Ignore protected?
|
||||
if ( $args['ignore_protected'] ) {
|
||||
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
}
|
||||
|
||||
// Apply filters
|
||||
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_posts_query_args', $query_args, $args );
|
||||
|
||||
// Query post
|
||||
$latest_entries = fictioneer_shortcode_query( $query_args );
|
||||
|
||||
// Remove temporary filters
|
||||
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
|
||||
?>
|
||||
|
||||
<section class="latest-posts <?php echo implode( ' ', $args['classes'] ); ?>">
|
||||
|
@ -8,15 +8,16 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 4.0
|
||||
*
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['orderby'] Sorting of posts. Default 'date'.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['orderby'] Sorting of posts. Default 'date'.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
*/
|
||||
?>
|
||||
|
||||
@ -58,12 +59,20 @@ if ( ! empty( $args['excluded_cats'] ) ) {
|
||||
$query_args['category__not_in'] = $args['excluded_cats'];
|
||||
}
|
||||
|
||||
// Ignore protected?
|
||||
if ( $args['ignore_protected'] ) {
|
||||
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
}
|
||||
|
||||
// Apply filters
|
||||
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_recommendations_query_args', $query_args, $args );
|
||||
|
||||
// Query chapters
|
||||
$entries = fictioneer_shortcode_query( $query_args );
|
||||
|
||||
// Remove temporary filters
|
||||
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
|
||||
?>
|
||||
|
||||
<section class="small-card-block latest-recommendations _compact <?php echo implode( ' ', $args['classes'] ); ?>">
|
||||
|
@ -8,16 +8,17 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 4.0
|
||||
*
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['orderby'] Sorting of posts. Default 'date'.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['class'] Additional classes.
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['orderby'] Sorting of posts. Default 'date'.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['class'] Additional classes.
|
||||
*/
|
||||
?>
|
||||
|
||||
@ -59,12 +60,20 @@ if ( ! empty( $args['excluded_cats'] ) ) {
|
||||
$query_args['category__not_in'] = $args['excluded_cats'];
|
||||
}
|
||||
|
||||
// Ignore protected?
|
||||
if ( $args['ignore_protected'] ) {
|
||||
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
}
|
||||
|
||||
// Apply filters
|
||||
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_recommendations_query_args', $query_args, $args );
|
||||
|
||||
// Query recommendations
|
||||
$entries = fictioneer_shortcode_query( $query_args );
|
||||
|
||||
// Remove temporary filters
|
||||
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
|
||||
?>
|
||||
|
||||
<section class="small-card-block latest-recommendations <?php echo implode( ' ', $args['classes'] ); ?>">
|
||||
|
@ -8,16 +8,17 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 4.0
|
||||
*
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['orderby'] Sorting of posts. Default 'date'.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['classes'] Array of additional CSS classes. Default empty.
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['orderby'] Sorting of posts. Default 'date'.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['classes'] Array of additional CSS classes. Default empty.
|
||||
*/
|
||||
?>
|
||||
|
||||
@ -77,12 +78,20 @@ if ( ! empty( $args['excluded_cats'] ) ) {
|
||||
$query_args['category__not_in'] = $args['excluded_cats'];
|
||||
}
|
||||
|
||||
// Ignore protected?
|
||||
if ( $args['ignore_protected'] ) {
|
||||
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
}
|
||||
|
||||
// Apply filters
|
||||
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_stories_query_args', $query_args, $args );
|
||||
|
||||
// Query stories
|
||||
$entries = fictioneer_shortcode_query( $query_args );
|
||||
|
||||
// Remove temporary filters
|
||||
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
|
||||
?>
|
||||
|
||||
<section class="small-card-block latest-stories _compact <?php echo implode( ' ', $args['classes'] ); ?>">
|
||||
|
@ -8,16 +8,17 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 4.0
|
||||
*
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['orderby'] Sorting of posts. Default 'date'.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['classes'] Array of additional CSS classes. Default empty.
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['orderby'] Sorting of posts. Default 'date'.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['classes'] Array of additional CSS classes. Default empty.
|
||||
*/
|
||||
?>
|
||||
|
||||
@ -74,12 +75,20 @@ if ( ! empty( $args['excluded_cats'] ) ) {
|
||||
$query_args['category__not_in'] = $args['excluded_cats'];
|
||||
}
|
||||
|
||||
// Ignore protected?
|
||||
if ( $args['ignore_protected'] ) {
|
||||
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
}
|
||||
|
||||
// Apply filters
|
||||
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_stories_query_args', $query_args, $args );
|
||||
|
||||
// Query stories
|
||||
$entries = fictioneer_shortcode_query( $query_args );
|
||||
|
||||
// Remove temporary filters
|
||||
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
|
||||
?>
|
||||
|
||||
<section class="small-card-block latest-stories <?php echo implode( ' ', $args['classes'] ); ?>">
|
||||
|
@ -12,15 +12,16 @@
|
||||
* @since 4.3
|
||||
* @see fictioneer_remember_chapters_modified()
|
||||
*
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['class'] Additional classes.
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['class'] Additional classes.
|
||||
*/
|
||||
?>
|
||||
|
||||
@ -75,12 +76,20 @@ if ( ! empty( $args['excluded_cats'] ) ) {
|
||||
$query_args['category__not_in'] = $args['excluded_cats'];
|
||||
}
|
||||
|
||||
// Ignore protected?
|
||||
if ( $args['ignore_protected'] ) {
|
||||
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
}
|
||||
|
||||
// Apply filters
|
||||
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_updates_query_args', $query_args, $args );
|
||||
|
||||
// Query stories
|
||||
$entries = fictioneer_shortcode_query( $query_args );
|
||||
|
||||
// Remove temporary filters
|
||||
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
|
||||
?>
|
||||
|
||||
<section class="small-card-block latest-updates <?php echo implode( ' ', $args['classes'] ); ?>">
|
||||
|
@ -13,16 +13,17 @@
|
||||
* @since 4.3
|
||||
* @see fictioneer_remember_chapters_modified()
|
||||
*
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['simple'] Whether to show the simple variant.
|
||||
* @internal $args['class'] Additional classes.
|
||||
* @internal $args['count'] Number of posts provided by the shortcode.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['order'] Order of posts. Default 'DESC'.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['simple'] Whether to show the simple variant.
|
||||
* @internal $args['class'] Additional classes.
|
||||
*/
|
||||
?>
|
||||
|
||||
@ -76,12 +77,20 @@ if ( ! empty( $args['excluded_cats'] ) ) {
|
||||
$query_args['category__not_in'] = $args['excluded_cats'];
|
||||
}
|
||||
|
||||
// Ignore protected?
|
||||
if ( $args['ignore_protected'] ) {
|
||||
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
}
|
||||
|
||||
// Apply filters
|
||||
$query_args = apply_filters( 'fictioneer_filter_shortcode_latest_updates_query_args', $query_args, $args );
|
||||
|
||||
// Query stories
|
||||
$entries = fictioneer_shortcode_query( $query_args );
|
||||
|
||||
// Remove temporary filters
|
||||
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
|
||||
?>
|
||||
|
||||
<section class="small-card-block latest-updates <?php echo implode( ' ', $args['classes'] ); ?>">
|
||||
|
@ -11,17 +11,18 @@
|
||||
* @subpackage Fictioneer
|
||||
* @since 4.0
|
||||
*
|
||||
* @internal $args['type'] Post type if the showcase.
|
||||
* @internal $args['count'] Maximum number of items. Default 8.
|
||||
* @internal $args['order'] Order direction. Default 'DESC'.
|
||||
* @internal $args['orderby'] Order argument. Default 'date'.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['classes'] Additional classes.
|
||||
* @internal $args['type'] Post type if the showcase.
|
||||
* @internal $args['count'] Maximum number of items. Default 8.
|
||||
* @internal $args['order'] Order direction. Default 'DESC'.
|
||||
* @internal $args['orderby'] Order argument. Default 'date'.
|
||||
* @internal $args['author'] Author provided by the shortcode.
|
||||
* @internal $args['post_ids'] Array of post IDs. Default empty.
|
||||
* @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['taxonomies'] Array of taxonomy arrays. Default empty.
|
||||
* @internal $args['relation'] Relationship between taxonomies.
|
||||
* @internal $args['classes'] Additional classes.
|
||||
*/
|
||||
?>
|
||||
|
||||
@ -60,12 +61,20 @@ if ( ! empty( $args['excluded_cats'] ) ) {
|
||||
$query_args['category__not_in'] = $args['excluded_cats'];
|
||||
}
|
||||
|
||||
// Ignore protected?
|
||||
if ( $args['ignore_protected'] ) {
|
||||
add_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
}
|
||||
|
||||
// Apply filters
|
||||
$query_args = apply_filters( 'fictioneer_filter_shortcode_showcase_query_args', $query_args, $args );
|
||||
|
||||
// Query collections
|
||||
$query = fictioneer_shortcode_query( $query_args );
|
||||
|
||||
// Remove temporary filters
|
||||
remove_filter( 'posts_where', 'fictioneer_exclude_protected_posts' );
|
||||
|
||||
?>
|
||||
|
||||
<?php if ( $query->have_posts() ) : ?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user