Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Possibility to get non published posts #65

Merged
merged 1 commit into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions templates/related-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ function bootscore_related_posts() {
$query_args = array(
'category__in' => $cat_ids,
'post_type' => $current_post_type,
'post__not_in' => array($post_id),
'posts_per_page' => '12',
'post_status' => 'publish',
'post__not_in' => array($post_id),
'posts_per_page' => '12',
);

$related_cats_post = new WP_Query($query_args);
Expand Down
35 changes: 18 additions & 17 deletions templates/sc-swiper-card-autoplay.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,28 @@ function bootscore_swiper_autoplay($atts) {

ob_start();
$atts = shortcode_atts(array(
'type' => 'post',
'order' => 'date',
'orderby' => 'date',
'posts' => -1,
'category' => '',
'post_parent' => '',
'tax' => '',
'terms' => '',
'id' => '',
'excerpt' => 'true',
'tags' => 'true',
'categories' => 'true',
'type' => 'post',
'post_status' => 'publish',
'order' => 'date',
'orderby' => 'date',
'posts' => -1,
'category' => '',
'post_parent' => '',
'tax' => '',
'terms' => '',
'id' => '',
'excerpt' => 'true',
'tags' => 'true',
'categories' => 'true',
), $atts);

$options = array(
'post_type' => sanitize_text_field($atts['type']),
'order' => sanitize_text_field($atts['order']),
'orderby' => sanitize_text_field($atts['orderby']),
'post_type' => sanitize_text_field($atts['type']),
'order' => sanitize_text_field($atts['order']),
'orderby' => sanitize_text_field($atts['orderby']),
'posts_per_page' => is_numeric($atts['posts']) ? (int) $atts['posts'] : -1,
'category_name' => sanitize_text_field($atts['category']),
'post_parent' => is_numeric($atts['post_parent']) ? (int) $atts['post_parent'] : '',
'category_name' => sanitize_text_field($atts['category']),
'post_parent' => is_numeric($atts['post_parent']) ? (int) $atts['post_parent'] : '',
);

$tax = trim(sanitize_text_field($atts['tax']));
Expand Down
23 changes: 12 additions & 11 deletions templates/sc-swiper-card-product.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,18 @@ function bootscore_product_slider($atts) {

ob_start();
$atts = shortcode_atts(array(
'type' => 'product',
'order' => 'DESC',
'orderby' => 'date',
'posts' => -1,
'showhidden' => false,
'id' => '',
'category' => '',
'brand' => '',
'featured' => '',
'outofstock' => '',
'onsale' => '',
'type' => 'product',
'post_status' => 'publish',
'order' => 'DESC',
'orderby' => 'date',
'posts' => -1,
'showhidden' => false,
'id' => '',
'category' => '',
'brand' => '',
'featured' => '',
'outofstock' => '',
'onsale' => '',
), $atts);

$options = array(
Expand Down
35 changes: 18 additions & 17 deletions templates/sc-swiper-card.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,28 @@ function bootscore_swiper($atts) {

ob_start();
$atts = shortcode_atts(array(
'type' => 'post',
'order' => 'date',
'orderby' => 'date',
'posts' => -1,
'category' => '',
'post_parent' => '',
'tax' => '',
'terms' => '',
'id' => '',
'excerpt' => 'true',
'tags' => 'true',
'categories' => 'true',
'type' => 'post',
'post_status' => 'publish',
'order' => 'date',
'orderby' => 'date',
'posts' => -1,
'category' => '',
'post_parent' => '',
'tax' => '',
'terms' => '',
'id' => '',
'excerpt' => 'true',
'tags' => 'true',
'categories' => 'true',
), $atts);

$options = array(
'post_type' => sanitize_text_field($atts['type']),
'order' => sanitize_text_field($atts['order']),
'orderby' => sanitize_text_field($atts['orderby']),
'post_type' => sanitize_text_field($atts['type']),
'order' => sanitize_text_field($atts['order']),
'orderby' => sanitize_text_field($atts['orderby']),
'posts_per_page' => is_numeric($atts['posts']) ? (int) $atts['posts'] : -1,
'category_name' => sanitize_text_field($atts['category']),
'post_parent' => is_numeric($atts['post_parent']) ? (int) $atts['post_parent'] : '',
'category_name' => sanitize_text_field($atts['category']),
'post_parent' => is_numeric($atts['post_parent']) ? (int) $atts['post_parent'] : '',
);

$tax = trim(sanitize_text_field($atts['tax']));
Expand Down
35 changes: 18 additions & 17 deletions templates/sc-swiper-hero-fade.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,28 @@ function bootscore_swiper_hero_fade($atts) {

ob_start();
$atts = shortcode_atts(array(
'type' => 'post',
'order' => 'date',
'orderby' => 'date',
'posts' => -1,
'category' => '',
'post_parent' => '',
'tax' => '',
'terms' => '',
'id' => '',
'excerpt' => 'true',
'tags' => 'true',
'categories' => 'true',
'type' => 'post',
'post_status' => 'publish',
'order' => 'date',
'orderby' => 'date',
'posts' => -1,
'category' => '',
'post_parent' => '',
'tax' => '',
'terms' => '',
'id' => '',
'excerpt' => 'true',
'tags' => 'true',
'categories' => 'true',
), $atts);

$options = array(
'post_type' => sanitize_text_field($atts['type']),
'order' => sanitize_text_field($atts['order']),
'orderby' => sanitize_text_field($atts['orderby']),
'post_type' => sanitize_text_field($atts['type']),
'order' => sanitize_text_field($atts['order']),
'orderby' => sanitize_text_field($atts['orderby']),
'posts_per_page' => is_numeric($atts['posts']) ? (int) $atts['posts'] : -1,
'category_name' => sanitize_text_field($atts['category']),
'post_parent' => is_numeric($atts['post_parent']) ? (int) $atts['post_parent'] : '',
'category_name' => sanitize_text_field($atts['category']),
'post_parent' => is_numeric($atts['post_parent']) ? (int) $atts['post_parent'] : '',
);

$tax = trim(sanitize_text_field($atts['tax']));
Expand Down
35 changes: 18 additions & 17 deletions templates/sc-swiper-hero.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,28 @@ function bootscore_swiper_hero($atts) {

ob_start();
$atts = shortcode_atts(array(
'type' => 'post',
'order' => 'date',
'orderby' => 'date',
'posts' => -1,
'category' => '',
'post_parent' => '',
'tax' => '',
'terms' => '',
'id' => '',
'excerpt' => 'true',
'tags' => 'true',
'categories' => 'true',
'type' => 'post',
'post_status' => 'publish',
'order' => 'date',
'orderby' => 'date',
'posts' => -1,
'category' => '',
'post_parent' => '',
'tax' => '',
'terms' => '',
'id' => '',
'excerpt' => 'true',
'tags' => 'true',
'categories' => 'true',
), $atts);

$options = array(
'post_type' => sanitize_text_field($atts['type']),
'order' => sanitize_text_field($atts['order']),
'orderby' => sanitize_text_field($atts['orderby']),
'post_type' => sanitize_text_field($atts['type']),
'order' => sanitize_text_field($atts['order']),
'orderby' => sanitize_text_field($atts['orderby']),
'posts_per_page' => is_numeric($atts['posts']) ? (int) $atts['posts'] : -1,
'category_name' => sanitize_text_field($atts['category']),
'post_parent' => is_numeric($atts['post_parent']) ? (int) $atts['post_parent'] : '',
'category_name' => sanitize_text_field($atts['category']),
'post_parent' => is_numeric($atts['post_parent']) ? (int) $atts['post_parent'] : '',
);

$tax = trim(sanitize_text_field($atts['tax']));
Expand Down