Completed
Push — develop ( 293794...7da125 )
by David
02:51
created
src/wordlift/mappings/class-taxonomy-option.php 2 patches
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -14,60 +14,60 @@
 block discarded – undo
14 14
  */
15 15
 class Taxonomy_Option {
16 16
 
17
-	/**
18
-	 * This value is used in rule field one and rule field two
19
-	 * options are linked to one by this value
20
-	 */
21
-	const PARENT_VALUE = 'taxonomy';
17
+    /**
18
+     * This value is used in rule field one and rule field two
19
+     * options are linked to one by this value
20
+     */
21
+    const PARENT_VALUE = 'taxonomy';
22 22
 
23
-	public function add_taxonomy_option() {
24
-		$this->add_rule_field_one_options();
25
-		$this->add_rule_field_two_options();
26
-	}
23
+    public function add_taxonomy_option() {
24
+        $this->add_rule_field_one_options();
25
+        $this->add_rule_field_two_options();
26
+    }
27 27
 
28
-	private function add_rule_field_one_options() {
28
+    private function add_rule_field_one_options() {
29 29
 
30
-		debug_print_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 10 );
30
+        debug_print_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 10 );
31 31
 
32
-		add_filter( 'wl_mappings_rule_field_one_options', function ( $rule_field_one_options ) {
32
+        add_filter( 'wl_mappings_rule_field_one_options', function ( $rule_field_one_options ) {
33 33
 
34
-			$rule_field_one_options[] = array(
35
-				'label'      => __( 'Taxonomy', 'wordlift' ),
36
-				'value'      => Taxonomy_Option::PARENT_VALUE,
37
-				// Left empty since these values are provided locally, not needed to be fetched from
38
-				// api.
39
-				'api_source' => ''
40
-			);
34
+            $rule_field_one_options[] = array(
35
+                'label'      => __( 'Taxonomy', 'wordlift' ),
36
+                'value'      => Taxonomy_Option::PARENT_VALUE,
37
+                // Left empty since these values are provided locally, not needed to be fetched from
38
+                // api.
39
+                'api_source' => ''
40
+            );
41 41
 
42
-			return $rule_field_one_options;
42
+            return $rule_field_one_options;
43 43
 
44
-		} );
45
-	}
44
+        } );
45
+    }
46 46
 
47
-	private function add_rule_field_two_options() {
47
+    private function add_rule_field_two_options() {
48 48
 
49
-		add_filter( 'wl_mappings_rule_field_two_options', function ( $rule_field_two_options ) {
49
+        add_filter( 'wl_mappings_rule_field_two_options', function ( $rule_field_two_options ) {
50 50
 
51
-			$taxonomies = get_object_taxonomies( 'post', 'objects' );
51
+            $taxonomies = get_object_taxonomies( 'post', 'objects' );
52 52
 
53
-			$taxonomy_options = array();
53
+            $taxonomy_options = array();
54 54
 
55
-			foreach ( $taxonomies as $item ) {
56
-				/**
57
-				 * $item Taxonomy
58
-				 */
59
-				$taxonomy_options[] = array(
60
-					'label'        => __( $item->label, 'wordlift' ),
61
-					'value'        => $item->name,
62
-					// The value of parent option on rule field one.
63
-					'parent_value' => Taxonomy_Option::PARENT_VALUE
64
-				);
65
-			}
55
+            foreach ( $taxonomies as $item ) {
56
+                /**
57
+                 * $item Taxonomy
58
+                 */
59
+                $taxonomy_options[] = array(
60
+                    'label'        => __( $item->label, 'wordlift' ),
61
+                    'value'        => $item->name,
62
+                    // The value of parent option on rule field one.
63
+                    'parent_value' => Taxonomy_Option::PARENT_VALUE
64
+                );
65
+            }
66 66
 
67
-			return array_merge( $rule_field_two_options, $taxonomy_options );
67
+            return array_merge( $rule_field_two_options, $taxonomy_options );
68 68
 
69
-		} );
69
+        } );
70 70
 
71
-	}
71
+    }
72 72
 
73 73
 }
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
 
28 28
 	private function add_rule_field_one_options() {
29 29
 
30
-		debug_print_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 10 );
30
+		debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10);
31 31
 
32
-		add_filter( 'wl_mappings_rule_field_one_options', function ( $rule_field_one_options ) {
32
+		add_filter('wl_mappings_rule_field_one_options', function($rule_field_one_options) {
33 33
 
34 34
 			$rule_field_one_options[] = array(
35
-				'label'      => __( 'Taxonomy', 'wordlift' ),
35
+				'label'      => __('Taxonomy', 'wordlift'),
36 36
 				'value'      => Taxonomy_Option::PARENT_VALUE,
37 37
 				// Left empty since these values are provided locally, not needed to be fetched from
38 38
 				// api.
@@ -46,25 +46,25 @@  discard block
 block discarded – undo
46 46
 
47 47
 	private function add_rule_field_two_options() {
48 48
 
49
-		add_filter( 'wl_mappings_rule_field_two_options', function ( $rule_field_two_options ) {
49
+		add_filter('wl_mappings_rule_field_two_options', function($rule_field_two_options) {
50 50
 
51
-			$taxonomies = get_object_taxonomies( 'post', 'objects' );
51
+			$taxonomies = get_object_taxonomies('post', 'objects');
52 52
 
53 53
 			$taxonomy_options = array();
54 54
 
55
-			foreach ( $taxonomies as $item ) {
55
+			foreach ($taxonomies as $item) {
56 56
 				/**
57 57
 				 * $item Taxonomy
58 58
 				 */
59 59
 				$taxonomy_options[] = array(
60
-					'label'        => __( $item->label, 'wordlift' ),
60
+					'label'        => __($item->label, 'wordlift'),
61 61
 					'value'        => $item->name,
62 62
 					// The value of parent option on rule field one.
63 63
 					'parent_value' => Taxonomy_Option::PARENT_VALUE
64 64
 				);
65 65
 			}
66 66
 
67
-			return array_merge( $rule_field_two_options, $taxonomy_options );
67
+			return array_merge($rule_field_two_options, $taxonomy_options);
68 68
 
69 69
 		} );
70 70
 
Please login to merge, or discard this patch.