PluginProbe
Kubio AI Page Builder / 1.7.0
Kubio AI Page Builder v1.7.0
2.9.1 2.9.0 2.8.6 2.8.5 2.8.4 2.8.3 2.8.2 2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 All 70 releases
← All changes | lib/src/Core/Blocks/Query/QueryLoopBase.php +12 -16 trunk1.7.0 View file →
@@ -4,9 +4,9 @@
4 4
5 5 use Kubio\Core\Blocks\BlockContainerBase;
6 6 use Kubio\Core\Layout\LayoutHelper;
7 7 use Kubio\Core\LodashBasic;
8 -use IlluminateAgnostic\Arr\Support\Arr;
8 +use Kubio\Core\StyleManager\DynamicStyles;
9 9
10 10 class QueryLoopBase extends BlockContainerBase {
11 11 const CONTAINER = 'container';
12 12 const INNER = 'inner';
@@ -17,19 +17,19 @@
17 17
18 18
19 19
20 20 public function mapPropsToElements() {
21 - $layout_media = $this->getPropByMedia( 'layout' );
22 - $layout_helper = new LayoutHelper( $layout_media );
23 - $masonry = $this->getAttribute( 'masonry', false );
24 - $masonry_classes = array();
21 + $layout_media = $this->getPropByMedia( 'layout' );
22 + $layout_helper = new LayoutHelper( $layout_media );
23 + $masonry = $this->getAttribute( 'masonry', false );
24 + $masonryClasses = array();
25 25 if ( $masonry ) {
26 - $masonry_classes[] = 'kubio-query-loop--use-masonry';
26 + $masonryClasses[] = 'kubio-query-loop--use-masonry';
27 27 }
28 28 $map = array();
29 29 $map[ self::CONTAINER ] = array( 'className' => $layout_helper->getRowGapClasses() );
30 30 $map[ self::INNER ] = array(
31 - 'className' => LodashBasic::concat( $layout_helper->getRowGapInnerClasses(), $layout_helper->getRowAlignClasses(), $masonry_classes ),
31 + 'className' => LodashBasic::concat( $layout_helper->getRowGapInnerClasses(), $layout_helper->getRowAlignClasses(), $masonryClasses ),
32 32 'innerHTML' => $this->renderList(),
33 33 );
34 34
35 35 return $map;
@@ -49,9 +49,9 @@
49 49 if ( $not_found_text === null ) {
50 50 $not_found_text = __( 'No {post_title} found!', 'kubio' );
51 51 }
52 52
53 - $content .= '<h2 class="kubio-empty-query-result">' . str_replace( '{post_title}', $label, kubio_wpml_get_translated_string( $not_found_text ) ) . '</h2>';
53 + $content .= '<h2 class="kubio-empty-query-result">' . str_replace( '{post_title}', $label, $not_found_text ) . '</h2>';
54 54 } else {
55 55 foreach ( (array) $posts as $post ) {
56 56 foreach ( $this->block_data['innerBlocks'] as $inner_block ) {
57 57 $content .= (
@@ -103,11 +103,9 @@
103 103 'query' => array(
104 104 'postType' => 'post',
105 105 'sticky' => false,
106 106 'post__in' => array(),
107 - // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in
108 107 'post__not_in' => array(),
109 - // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
110 108 'exclude' => array(),
111 109 'categoryIds' => array(),
112 110 'perPage' => get_option( 'posts_per_page' ),
113 111 'offset' => 0,
@@ -122,17 +120,15 @@
122 120
123 121 public function getPostsQueryList() {
124 122 $context = $this->getQueryContext();
125 123 $page_key = isset( $context['queryId'] ) ? 'query-' . $context['queryId'] . '-page' : 'query-page';
126 - // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.MissingUnslash
127 - $page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT );
124 + $page = empty( $_GET[ $page_key ] ) ? 1 : filter_var( $_GET[ $page_key ], FILTER_VALIDATE_INT );
128 125
129 126 /** @noinspection PhpParamsInspection */
130 - $query_args = build_query_vars_from_query_block( (object) array( 'context' => $context ), $page );
131 - $query_args['ignore_sticky_posts'] = Arr::get( $context, 'query.sticky' ) ? false : true;
132 - $query = new \WP_Query( $query_args );
127 + $query_args = build_query_vars_from_query_block( (object) array( 'context' => $context ), $page );
128 + $query = new \WP_Query( $query_args );
129 + return $query->posts;
133 130
134 - return $query->posts;
135 131 }
136 132
137 133 public function getPostType() {
138 134