Set showcase default count to 8

This commit is contained in:
Tetrakern 2023-09-16 20:40:44 +02:00
parent 20268cde6e
commit ce0161eb9e
3 changed files with 5 additions and 5 deletions

View File

@ -724,10 +724,10 @@ Renders the search form with advanced options (if not disabled in the settings).
### Showcase
Renders dynamic grid of thumbnails with title, showing the latest nine posts of the specified type ordered by publishing date, descending. Requires **for** parameter. The thumbnail is either the **Landscape Image** (if available) or **Cover Image**, 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. The thumbnail is either the **Landscape Image** (if available) or **Cover Image**, 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 `9`.
* **count:** Limit posts to any positive number, although you should keep it reasonable. Default `8`.
* **author:** Only show posts for a specific author. Make sure to write the name right.
* **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).

View File

@ -250,7 +250,7 @@ function fictioneer_get_shortcode_tax_query( $args ) {
*
* @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['count'] Optional. Maximum number of items. Default 8.
* @param string|null $attr['author'] Optional. Limit posts to a specific author.
* @param string|null $attr['order'] Optional. Order direction. Default 'DESC'.
* @param string|null $attr['orderby'] Optional. Order argument. Default 'date'.
@ -279,7 +279,7 @@ function fictioneer_shortcode_showcase( $attr ) {
}
// Setup
$count = max( 1, intval( $attr['count'] ?? 9 ) );
$count = max( 1, intval( $attr['count'] ?? 8 ) );
$author = $attr['author'] ?? false;
$order = $attr['order'] ?? 'DESC';
$orderby = $attr['orderby'] ?? 'date';

View File

@ -12,7 +12,7 @@
* @since 4.0
*
* @internal $args['type'] Post type if the showcase.
* @internal $args['count'] Maximum number of items. Default 9.
* @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.