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

【確認待ち(一人でいいかな)】2ページ以降でも1ページにロックする設定を追加 #1908

Merged
merged 10 commits into from
Feb 1, 2024
Merged
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
Loading