PluginProbe
CSS & JavaScript Toolbox / 8.2
CSS & JavaScript Toolbox v8.2
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
← All changes | tables/pins-blocks-view.php +3 -34 108.2 View file →
@@ -63,15 +63,9 @@
63 63 *
64 64 */
65 65 public function __toString()
66 66 {
67 - # In case of Error at $this->makeBlocksQuery dont processed
68 - if ( $this->blocksQuery === FALSE )
69 - {
70 - return '';
71 - }
72 -
73 -
67 +
74 68 $filters = $this->query->filter;
75 69 $customPins = $this->customPins;
76 70
77 71 $customPins = implode( ' OR ', $customPins );
@@ -100,18 +94,10 @@
100 94 */
101 95 public function exec()
102 96 {
103 97
104 - $blocks = array();
105 - $query = ( string ) $this;
106 -
107 - # It will return empty query, in case of error
108 - if ( $query )
109 - {
110 - # Note: OBJECT_K get unique blocks as they will override each others
111 - $blocks = $this->driver->select( $query, OBJECT_K );
112 - }
113 -
98 + # Note: OBJECT_K get unique blocks as they will override each others
99 + $blocks = $this->driver->select( $this, OBJECT_K );
114 100
115 101 return $blocks;
116 102 }
117 103
@@ -173,29 +159,12 @@
173 159
174 160 // build custom pins filter.
175 161 $customPins = array();
176 162
177 - global $wp_query;
178 -
179 163 foreach ( $filters->customPins as $pinFilter )
180 164 {
181 -
182 165 $pinFilter = (object) $pinFilter;
183 166 $pins = implode( ',', $pinFilter->pins );
184 -
185 - // Scan Pins, sometime if happened to be empty
186 - // The Wordpress request that carry $pins to be empty is not yet
187 - // known, we simply now need to discard that request
188 - // as user's server error log file filled with this error
189 - // and users complains about it all the time
190 - if ( ! $pins )
191 - {
192 -
193 - $this->blocksQuery = FALSE;
194 -
195 - return $this;
196 - }
197 -
198 167 $customPins[ ] = "( ( blocks.`pinPoint` & {$pinFilter->flag} ) AND ( pins.pin = '{$pinFilter->pin}' ) AND ( pins.`value` IN ( {$pins} ) ) )";
199 168 }
200 169
201 170 $this->customPins = $customPins;