Skip to content

Commit

Permalink
Merge pull request #65 from DogByteMarketing/main
Browse files Browse the repository at this point in the history
Bugfix: Possibility to get non published posts
  • Loading branch information
crftwrk committed Nov 28, 2023
2 parents ac94a12 + 5a0539d commit ff2738b
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 81 deletions.
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

0 comments on commit ff2738b

Please sign in to comment.