PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / 1.1.5
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel v1.1.5
trunk 0.9.0 0.9.1 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0
wp-all-export / src / App / Service / VariationOptions / VariationOptions.php
wp-all-export / src / App / Service / VariationOptions Last commit date
VariationOptions.php 8 years ago VariationOptionsFactory.php 8 years ago VariationOptionsInterface.php 8 years ago
VariationOptions.php
52 lines
1 <?php
2
3 namespace Wpae\App\Service\VariationOptions;
4
5
6 class VariationOptions implements VariationOptionsInterface
7 {
8 public function getQueryWhere($wpdb, $where, $join, $closeBracket = false)
9 {
10 return $this->defaultQuery($wpdb, $where, $join, $closeBracket);
11 }
12
13 public function preProcessPost(\WP_Post $entry)
14 {
15 return $entry;
16 }
17
18 /**
19 * @param $wpdb
20 * @param $where
21 * @param $join
22 * @param $closeBracket
23 * @return string
24 *
25 * TODO: Remove $closeBracket flag
26 */
27 protected function defaultQuery($wpdb, $where, $join, $closeBracket)
28 {
29 if($closeBracket) {
30 return " AND $wpdb->posts.post_type = 'product' AND $wpdb->posts.ID NOT IN (SELECT o.ID FROM $wpdb->posts o
31 LEFT OUTER JOIN $wpdb->posts r
32 ON o.post_parent = r.ID
33 WHERE r.post_status = 'trash' AND o.post_type = 'product_variation'))
34 OR ($wpdb->posts.post_type = 'product_variation' AND $wpdb->posts.post_parent IN (
35 SELECT DISTINCT $wpdb->posts.ID
36 FROM $wpdb->posts $join
37 WHERE $where
38 ))";
39 } else {
40 return " AND $wpdb->posts.post_type = 'product' AND $wpdb->posts.ID NOT IN (SELECT o.ID FROM $wpdb->posts o
41 LEFT OUTER JOIN $wpdb->posts r
42 ON o.post_parent = r.ID
43 WHERE r.post_status = 'trash' AND o.post_type = 'product_variation')
44 OR ($wpdb->posts.post_type = 'product_variation' AND $wpdb->posts.post_parent IN (
45 SELECT DISTINCT $wpdb->posts.ID
46 FROM $wpdb->posts $join
47 WHERE $where
48 ))";
49 }
50
51 }
52 }