Skip to content

Commit

Permalink
Merge pull request #1908 from vektor-inc/change/add-pagedlock
Browse files Browse the repository at this point in the history
【確認待ち(一人でいいかな)】2ページ以降でも1ページにロックする設定を追加
  • Loading branch information
drill-lancer authored Feb 1, 2024
2 parents 77bb77f + 6d2e8d6 commit 674675d
Show file tree
Hide file tree
Showing 13 changed files with 420 additions and 323 deletions.
5 changes: 3 additions & 2 deletions inc/vk-blocks/view/class-vk-blocks-postlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,13 @@ public static function get_loop_query( $attributes ) {
global $wp_query;
// とりあえず1を入れつつ2ページ目の情報があったら上書き
$paged = 1;
if ( is_singular() && isset( $wp_query->query_vars['page'] ) ) {
if ( ! empty( $attributes['pagedlock'] ) ) {
$paged = 1;
} elseif ( is_singular() && isset( $wp_query->query_vars['page'] ) ) {
$paged = $wp_query->query_vars['page'];
} elseif ( isset( $wp_query->query_vars['paged'] ) ) {
$paged = $wp_query->query_vars['paged'];
}

$args = array(
'post_type' => $is_checked_post_type,
'tax_query' => self::format_terms( $tax_query_relation, $is_checked_terms ),
Expand Down
14 changes: 6 additions & 8 deletions inc/vk-components/package/class-vk-component-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,12 @@ public static function get_loop( $wp_query, $options, $loop_options = array() )
$loop_outer_class_post_types = array();
if ( ! isset( $wp_query->query['post_type'] ) ) {
$loop_outer_class_post_types[] = 'vk_posts-postType-post';
} else {
if ( is_array( $wp_query->query['post_type'] ) ) {
foreach ( $wp_query->query['post_type'] as $key => $value ) {
$loop_outer_class_post_types[] = 'vk_posts-postType-' . $value;
}
} else {
$loop_outer_class_post_types[] = 'vk_posts-postType-' . $wp_query->query['post_type'];
} elseif ( is_array( $wp_query->query['post_type'] ) ) {
foreach ( $wp_query->query['post_type'] as $key => $value ) {
$loop_outer_class_post_types[] = 'vk_posts-postType-' . $value;
}
} else {
$loop_outer_class_post_types[] = 'vk_posts-postType-' . $wp_query->query['post_type'];
}

$loop_outer_class_post_types[] = 'vk_posts-layout-' . $options['layout'];
Expand Down Expand Up @@ -207,7 +205,7 @@ public static function get_loop( $wp_query, $options, $loop_options = array() )
$vk_posts_loop_item_count = 0;

while ( $wp_query->have_posts() ) {
$vk_posts_loop_item_count++;
++$vk_posts_loop_item_count;

$wp_query->the_post();
global $post;
Expand Down
2 changes: 1 addition & 1 deletion languages/vk-blocks-pro-ja-vk-blocks-admin-js.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion languages/vk-blocks-pro-ja-vk-blocks-build-js.json

Large diffs are not rendered by default.

Binary file modified languages/vk-blocks-pro-ja.mo
Binary file not shown.
Loading

0 comments on commit 674675d

Please sign in to comment.