@@ -4,9 +4,9 @@ |
||
4 | 4 | |
5 | 5 | class Preconditions { |
6 | 6 | |
7 | - public function pass() { |
|
8 | - // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
|
9 | - return apply_filters( 'wl_feature__enable__gardening-kg', false ); |
|
10 | - } |
|
7 | + public function pass() { |
|
8 | + // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
|
9 | + return apply_filters( 'wl_feature__enable__gardening-kg', false ); |
|
10 | + } |
|
11 | 11 | |
12 | 12 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | public function pass() { |
8 | 8 | // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
9 | - return apply_filters( 'wl_feature__enable__gardening-kg', false ); |
|
9 | + return apply_filters('wl_feature__enable__gardening-kg', false); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | } |
@@ -9,115 +9,115 @@ |
||
9 | 9 | |
10 | 10 | class Gardening_Kg_Main_Entity_Runner implements Runner { |
11 | 11 | |
12 | - /** |
|
13 | - * @var Store $store |
|
14 | - */ |
|
15 | - private $store; |
|
16 | - |
|
17 | - /** |
|
18 | - * @var Api_Service |
|
19 | - */ |
|
20 | - private $api_service; |
|
21 | - |
|
22 | - /** |
|
23 | - * @param Store $store |
|
24 | - * @param Api_Service $api_service |
|
25 | - */ |
|
26 | - public function __construct( Store $store, Api_Service $api_service ) { |
|
27 | - $this->store = $store; |
|
28 | - $this->api_service = $api_service; |
|
29 | - } |
|
30 | - |
|
31 | - public function run( $last_id ) { |
|
32 | - $batch_size = 100; |
|
33 | - $items = (array) $this->store->list_items( $last_id, $batch_size ); |
|
34 | - |
|
35 | - foreach ( $items as $item ) { |
|
36 | - $this->process( $item ); |
|
37 | - } |
|
38 | - |
|
39 | - // Count the processed items. |
|
40 | - $count_items = count( $items ); |
|
41 | - |
|
42 | - // We're done, since the number of items is less than the requested qty. |
|
43 | - if ( $count_items < $batch_size ) { |
|
44 | - return array( $count_items, null ); |
|
45 | - } |
|
46 | - |
|
47 | - // Get the last ID. |
|
48 | - $last_id = end( $items ); |
|
49 | - |
|
50 | - // Finally return the count. |
|
51 | - return array( $count_items, $last_id ); |
|
52 | - } |
|
53 | - |
|
54 | - // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
|
55 | - private function process( $item ) { |
|
56 | - global $wpdb; |
|
57 | - |
|
58 | - // Get the entity data for non lifted abouts. |
|
59 | - $id = $wpdb->get_var( |
|
60 | - $wpdb->prepare( |
|
61 | - "SELECT id FROM {$wpdb->prefix}wl_entities WHERE content_id = %d AND content_type = %d AND about_jsonld IS NULL", |
|
62 | - $item, |
|
63 | - Object_Type_Enum::POST |
|
64 | - ) |
|
65 | - ); |
|
66 | - |
|
67 | - // Exit if not found. |
|
68 | - if ( ! isset( $id ) ) { |
|
69 | - return; |
|
70 | - } |
|
71 | - |
|
72 | - // Lift. |
|
73 | - $post = get_post( $item ); |
|
74 | - |
|
75 | - // Skip if this post must not be processed, e.g. it's not the right post_type, it's not `publish`, ... |
|
76 | - if ( ! $this->should_process( $post ) ) { |
|
77 | - return; |
|
78 | - } |
|
79 | - |
|
80 | - $title = wp_strip_all_tags( $post->post_title ); |
|
81 | - |
|
82 | - $response = $this->api_service->request( |
|
83 | - 'POST', |
|
84 | - '/thirdparty/cafemedia/gardening-kg/abouts', |
|
85 | - array( |
|
86 | - 'accept' => 'text/plain', |
|
87 | - 'content-type' => 'text/plain', |
|
88 | - ), |
|
89 | - $title |
|
90 | - ); |
|
91 | - |
|
92 | - $response_body = trim( $response->get_body() ); |
|
93 | - $lines = explode( "\n", $response_body ); |
|
94 | - $fields = explode( "\t", $lines[0] ); |
|
95 | - $jsonld = isset( $fields[1] ) ? trim( $fields[1] ) : ''; |
|
96 | - // No results. |
|
97 | - if ( empty( $jsonld ) ) { |
|
98 | - return; |
|
99 | - } |
|
100 | - |
|
101 | - // Store the results in the database |
|
102 | - $wpdb->query( |
|
103 | - $wpdb->prepare( |
|
104 | - "UPDATE {$wpdb->prefix}wl_entities SET about_jsonld = %s WHERE id = %d", |
|
105 | - $fields[1], |
|
106 | - $item |
|
107 | - ) |
|
108 | - ); |
|
109 | - } |
|
110 | - |
|
111 | - private function should_process( $post ) { |
|
112 | - return is_a( $post, 'WP_Post' ) && |
|
113 | - 'publish' === $post->post_status && |
|
114 | - in_array( $post->post_type, array( 'post', 'page' ), true ); |
|
115 | - } |
|
116 | - |
|
117 | - public function get_total() { |
|
118 | - global $wpdb; |
|
119 | - |
|
120 | - return intval( $wpdb->get_var( "SELECT COUNT(1) FROM $wpdb->posts WHERE post_status = 'publish'" ) ); |
|
121 | - } |
|
12 | + /** |
|
13 | + * @var Store $store |
|
14 | + */ |
|
15 | + private $store; |
|
16 | + |
|
17 | + /** |
|
18 | + * @var Api_Service |
|
19 | + */ |
|
20 | + private $api_service; |
|
21 | + |
|
22 | + /** |
|
23 | + * @param Store $store |
|
24 | + * @param Api_Service $api_service |
|
25 | + */ |
|
26 | + public function __construct( Store $store, Api_Service $api_service ) { |
|
27 | + $this->store = $store; |
|
28 | + $this->api_service = $api_service; |
|
29 | + } |
|
30 | + |
|
31 | + public function run( $last_id ) { |
|
32 | + $batch_size = 100; |
|
33 | + $items = (array) $this->store->list_items( $last_id, $batch_size ); |
|
34 | + |
|
35 | + foreach ( $items as $item ) { |
|
36 | + $this->process( $item ); |
|
37 | + } |
|
38 | + |
|
39 | + // Count the processed items. |
|
40 | + $count_items = count( $items ); |
|
41 | + |
|
42 | + // We're done, since the number of items is less than the requested qty. |
|
43 | + if ( $count_items < $batch_size ) { |
|
44 | + return array( $count_items, null ); |
|
45 | + } |
|
46 | + |
|
47 | + // Get the last ID. |
|
48 | + $last_id = end( $items ); |
|
49 | + |
|
50 | + // Finally return the count. |
|
51 | + return array( $count_items, $last_id ); |
|
52 | + } |
|
53 | + |
|
54 | + // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
|
55 | + private function process( $item ) { |
|
56 | + global $wpdb; |
|
57 | + |
|
58 | + // Get the entity data for non lifted abouts. |
|
59 | + $id = $wpdb->get_var( |
|
60 | + $wpdb->prepare( |
|
61 | + "SELECT id FROM {$wpdb->prefix}wl_entities WHERE content_id = %d AND content_type = %d AND about_jsonld IS NULL", |
|
62 | + $item, |
|
63 | + Object_Type_Enum::POST |
|
64 | + ) |
|
65 | + ); |
|
66 | + |
|
67 | + // Exit if not found. |
|
68 | + if ( ! isset( $id ) ) { |
|
69 | + return; |
|
70 | + } |
|
71 | + |
|
72 | + // Lift. |
|
73 | + $post = get_post( $item ); |
|
74 | + |
|
75 | + // Skip if this post must not be processed, e.g. it's not the right post_type, it's not `publish`, ... |
|
76 | + if ( ! $this->should_process( $post ) ) { |
|
77 | + return; |
|
78 | + } |
|
79 | + |
|
80 | + $title = wp_strip_all_tags( $post->post_title ); |
|
81 | + |
|
82 | + $response = $this->api_service->request( |
|
83 | + 'POST', |
|
84 | + '/thirdparty/cafemedia/gardening-kg/abouts', |
|
85 | + array( |
|
86 | + 'accept' => 'text/plain', |
|
87 | + 'content-type' => 'text/plain', |
|
88 | + ), |
|
89 | + $title |
|
90 | + ); |
|
91 | + |
|
92 | + $response_body = trim( $response->get_body() ); |
|
93 | + $lines = explode( "\n", $response_body ); |
|
94 | + $fields = explode( "\t", $lines[0] ); |
|
95 | + $jsonld = isset( $fields[1] ) ? trim( $fields[1] ) : ''; |
|
96 | + // No results. |
|
97 | + if ( empty( $jsonld ) ) { |
|
98 | + return; |
|
99 | + } |
|
100 | + |
|
101 | + // Store the results in the database |
|
102 | + $wpdb->query( |
|
103 | + $wpdb->prepare( |
|
104 | + "UPDATE {$wpdb->prefix}wl_entities SET about_jsonld = %s WHERE id = %d", |
|
105 | + $fields[1], |
|
106 | + $item |
|
107 | + ) |
|
108 | + ); |
|
109 | + } |
|
110 | + |
|
111 | + private function should_process( $post ) { |
|
112 | + return is_a( $post, 'WP_Post' ) && |
|
113 | + 'publish' === $post->post_status && |
|
114 | + in_array( $post->post_type, array( 'post', 'page' ), true ); |
|
115 | + } |
|
116 | + |
|
117 | + public function get_total() { |
|
118 | + global $wpdb; |
|
119 | + |
|
120 | + return intval( $wpdb->get_var( "SELECT COUNT(1) FROM $wpdb->posts WHERE post_status = 'publish'" ) ); |
|
121 | + } |
|
122 | 122 | |
123 | 123 | } |
@@ -23,36 +23,36 @@ discard block |
||
23 | 23 | * @param Store $store |
24 | 24 | * @param Api_Service $api_service |
25 | 25 | */ |
26 | - public function __construct( Store $store, Api_Service $api_service ) { |
|
26 | + public function __construct(Store $store, Api_Service $api_service) { |
|
27 | 27 | $this->store = $store; |
28 | 28 | $this->api_service = $api_service; |
29 | 29 | } |
30 | 30 | |
31 | - public function run( $last_id ) { |
|
31 | + public function run($last_id) { |
|
32 | 32 | $batch_size = 100; |
33 | - $items = (array) $this->store->list_items( $last_id, $batch_size ); |
|
33 | + $items = (array) $this->store->list_items($last_id, $batch_size); |
|
34 | 34 | |
35 | - foreach ( $items as $item ) { |
|
36 | - $this->process( $item ); |
|
35 | + foreach ($items as $item) { |
|
36 | + $this->process($item); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | // Count the processed items. |
40 | - $count_items = count( $items ); |
|
40 | + $count_items = count($items); |
|
41 | 41 | |
42 | 42 | // We're done, since the number of items is less than the requested qty. |
43 | - if ( $count_items < $batch_size ) { |
|
44 | - return array( $count_items, null ); |
|
43 | + if ($count_items < $batch_size) { |
|
44 | + return array($count_items, null); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // Get the last ID. |
48 | - $last_id = end( $items ); |
|
48 | + $last_id = end($items); |
|
49 | 49 | |
50 | 50 | // Finally return the count. |
51 | - return array( $count_items, $last_id ); |
|
51 | + return array($count_items, $last_id); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
55 | - private function process( $item ) { |
|
55 | + private function process($item) { |
|
56 | 56 | global $wpdb; |
57 | 57 | |
58 | 58 | // Get the entity data for non lifted abouts. |
@@ -65,19 +65,19 @@ discard block |
||
65 | 65 | ); |
66 | 66 | |
67 | 67 | // Exit if not found. |
68 | - if ( ! isset( $id ) ) { |
|
68 | + if ( ! isset($id)) { |
|
69 | 69 | return; |
70 | 70 | } |
71 | 71 | |
72 | 72 | // Lift. |
73 | - $post = get_post( $item ); |
|
73 | + $post = get_post($item); |
|
74 | 74 | |
75 | 75 | // Skip if this post must not be processed, e.g. it's not the right post_type, it's not `publish`, ... |
76 | - if ( ! $this->should_process( $post ) ) { |
|
76 | + if ( ! $this->should_process($post)) { |
|
77 | 77 | return; |
78 | 78 | } |
79 | 79 | |
80 | - $title = wp_strip_all_tags( $post->post_title ); |
|
80 | + $title = wp_strip_all_tags($post->post_title); |
|
81 | 81 | |
82 | 82 | $response = $this->api_service->request( |
83 | 83 | 'POST', |
@@ -89,12 +89,12 @@ discard block |
||
89 | 89 | $title |
90 | 90 | ); |
91 | 91 | |
92 | - $response_body = trim( $response->get_body() ); |
|
93 | - $lines = explode( "\n", $response_body ); |
|
94 | - $fields = explode( "\t", $lines[0] ); |
|
95 | - $jsonld = isset( $fields[1] ) ? trim( $fields[1] ) : ''; |
|
92 | + $response_body = trim($response->get_body()); |
|
93 | + $lines = explode("\n", $response_body); |
|
94 | + $fields = explode("\t", $lines[0]); |
|
95 | + $jsonld = isset($fields[1]) ? trim($fields[1]) : ''; |
|
96 | 96 | // No results. |
97 | - if ( empty( $jsonld ) ) { |
|
97 | + if (empty($jsonld)) { |
|
98 | 98 | return; |
99 | 99 | } |
100 | 100 | |
@@ -108,16 +108,16 @@ discard block |
||
108 | 108 | ); |
109 | 109 | } |
110 | 110 | |
111 | - private function should_process( $post ) { |
|
112 | - return is_a( $post, 'WP_Post' ) && |
|
111 | + private function should_process($post) { |
|
112 | + return is_a($post, 'WP_Post') && |
|
113 | 113 | 'publish' === $post->post_status && |
114 | - in_array( $post->post_type, array( 'post', 'page' ), true ); |
|
114 | + in_array($post->post_type, array('post', 'page'), true); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | public function get_total() { |
118 | 118 | global $wpdb; |
119 | 119 | |
120 | - return intval( $wpdb->get_var( "SELECT COUNT(1) FROM $wpdb->posts WHERE post_status = 'publish'" ) ); |
|
120 | + return intval($wpdb->get_var("SELECT COUNT(1) FROM $wpdb->posts WHERE post_status = 'publish'")); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | } |
@@ -6,21 +6,21 @@ |
||
6 | 6 | |
7 | 7 | class Gardening_Kg_Post_Store implements Store { |
8 | 8 | |
9 | - public function list_items( $id_greater_than, $batch_size ) { |
|
10 | - global $wpdb; |
|
9 | + public function list_items( $id_greater_than, $batch_size ) { |
|
10 | + global $wpdb; |
|
11 | 11 | |
12 | - return array_map( |
|
13 | - function ( $value ) { |
|
14 | - return (int) $value; |
|
15 | - }, |
|
16 | - $wpdb->get_col( |
|
17 | - $wpdb->prepare( |
|
18 | - "SELECT ID FROM $wpdb->posts WHERE ID > %d ORDER BY ID ASC LIMIT %d", |
|
19 | - $id_greater_than, |
|
20 | - $batch_size |
|
21 | - ) |
|
22 | - ) |
|
23 | - ); |
|
24 | - } |
|
12 | + return array_map( |
|
13 | + function ( $value ) { |
|
14 | + return (int) $value; |
|
15 | + }, |
|
16 | + $wpdb->get_col( |
|
17 | + $wpdb->prepare( |
|
18 | + "SELECT ID FROM $wpdb->posts WHERE ID > %d ORDER BY ID ASC LIMIT %d", |
|
19 | + $id_greater_than, |
|
20 | + $batch_size |
|
21 | + ) |
|
22 | + ) |
|
23 | + ); |
|
24 | + } |
|
25 | 25 | |
26 | 26 | } |
@@ -6,11 +6,11 @@ |
||
6 | 6 | |
7 | 7 | class Gardening_Kg_Post_Store implements Store { |
8 | 8 | |
9 | - public function list_items( $id_greater_than, $batch_size ) { |
|
9 | + public function list_items($id_greater_than, $batch_size) { |
|
10 | 10 | global $wpdb; |
11 | 11 | |
12 | 12 | return array_map( |
13 | - function ( $value ) { |
|
13 | + function($value) { |
|
14 | 14 | return (int) $value; |
15 | 15 | }, |
16 | 16 | $wpdb->get_col( |
@@ -6,21 +6,21 @@ |
||
6 | 6 | |
7 | 7 | class Gardening_Kg_Term_Store implements Store { |
8 | 8 | |
9 | - // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
|
10 | - public function list_items( $id_greater_than, $batch_size ) { |
|
11 | - global $wpdb; |
|
9 | + // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
|
10 | + public function list_items( $id_greater_than, $batch_size ) { |
|
11 | + global $wpdb; |
|
12 | 12 | |
13 | - return array_map( |
|
14 | - function ( $value ) { |
|
15 | - return (int) $value; |
|
16 | - }, |
|
17 | - $wpdb->get_col( |
|
18 | - $wpdb->prepare( |
|
19 | - "SELECT term_id FROM $wpdb->terms WHERE term_id > %d LIMIT %d", |
|
20 | - $id_greater_than, |
|
21 | - $batch_size |
|
22 | - ) |
|
23 | - ) |
|
24 | - ); |
|
25 | - } |
|
13 | + return array_map( |
|
14 | + function ( $value ) { |
|
15 | + return (int) $value; |
|
16 | + }, |
|
17 | + $wpdb->get_col( |
|
18 | + $wpdb->prepare( |
|
19 | + "SELECT term_id FROM $wpdb->terms WHERE term_id > %d LIMIT %d", |
|
20 | + $id_greater_than, |
|
21 | + $batch_size |
|
22 | + ) |
|
23 | + ) |
|
24 | + ); |
|
25 | + } |
|
26 | 26 | } |
@@ -7,11 +7,11 @@ |
||
7 | 7 | class Gardening_Kg_Term_Store implements Store { |
8 | 8 | |
9 | 9 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
10 | - public function list_items( $id_greater_than, $batch_size ) { |
|
10 | + public function list_items($id_greater_than, $batch_size) { |
|
11 | 11 | global $wpdb; |
12 | 12 | |
13 | 13 | return array_map( |
14 | - function ( $value ) { |
|
14 | + function($value) { |
|
15 | 15 | return (int) $value; |
16 | 16 | }, |
17 | 17 | $wpdb->get_col( |
@@ -3,14 +3,14 @@ discard block |
||
3 | 3 | // autoload.php @generated by Composer |
4 | 4 | |
5 | 5 | if (PHP_VERSION_ID < 50600) { |
6 | - if (!headers_sent()) { |
|
6 | + if ( ! headers_sent()) { |
|
7 | 7 | header('HTTP/1.1 500 Internal Server Error'); |
8 | 8 | } |
9 | 9 | $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; |
10 | - if (!ini_get('display_errors')) { |
|
10 | + if ( ! ini_get('display_errors')) { |
|
11 | 11 | if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { |
12 | 12 | fwrite(STDERR, $err); |
13 | - } elseif (!headers_sent()) { |
|
13 | + } elseif ( ! headers_sent()) { |
|
14 | 14 | echo $err; |
15 | 15 | } |
16 | 16 | } |
@@ -20,6 +20,6 @@ discard block |
||
20 | 20 | ); |
21 | 21 | } |
22 | 22 | |
23 | -require_once __DIR__ . '/composer/autoload_real.php'; |
|
23 | +require_once __DIR__.'/composer/autoload_real.php'; |
|
24 | 24 | |
25 | 25 | return ComposerAutoloaderInit718e370ed095fd597a1f1d468c2b59f4::getLoader(); |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | 'version' => 'dev-develop', |
6 | 6 | 'reference' => 'd3f9e8ce81c31d9fd7975f50641aac26c7ea934a', |
7 | 7 | 'type' => 'wordpress-plugin', |
8 | - 'install_path' => __DIR__ . '/../../', |
|
8 | + 'install_path' => __DIR__.'/../../', |
|
9 | 9 | 'aliases' => array(), |
10 | 10 | 'dev' => true, |
11 | 11 | ), |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | 'version' => 'dev-develop', |
16 | 16 | 'reference' => 'd3f9e8ce81c31d9fd7975f50641aac26c7ea934a', |
17 | 17 | 'type' => 'wordpress-plugin', |
18 | - 'install_path' => __DIR__ . '/../../', |
|
18 | + 'install_path' => __DIR__.'/../../', |
|
19 | 19 | 'aliases' => array(), |
20 | 20 | 'dev_requirement' => false, |
21 | 21 | ), |
@@ -6,26 +6,26 @@ |
||
6 | 6 | $baseDir = dirname($vendorDir); |
7 | 7 | |
8 | 8 | return array( |
9 | - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', |
|
10 | - 'Wordlift\\Modules\\Food_Kg\\Admin\\Meta_Box' => $baseDir . '/includes/admin/Meta_Box.php', |
|
11 | - 'Wordlift\\Modules\\Food_Kg\\Api\\Cursor' => $baseDir . '/includes/Api/Cursor.php', |
|
12 | - 'Wordlift\\Modules\\Food_Kg\\Api\\Cursor_Page' => $baseDir . '/includes/Api/Cursor_Page.php', |
|
13 | - 'Wordlift\\Modules\\Food_Kg\\Ingredients' => $baseDir . '/includes/Ingredients.php', |
|
14 | - 'Wordlift\\Modules\\Food_Kg\\Ingredients_API' => $baseDir . '/includes/Ingredients_API.php', |
|
15 | - 'Wordlift\\Modules\\Food_Kg\\Ingredients_Client' => $baseDir . '/includes/Ingredients_Client.php', |
|
16 | - 'Wordlift\\Modules\\Food_Kg\\Ingredients_Taxonomy_Recipe_Lift_Strategy' => $baseDir . '/includes/Ingredients_Taxonomy_Recipe_Lift_Strategy.php', |
|
17 | - 'Wordlift\\Modules\\Food_Kg\\Jsonld' => $baseDir . '/includes/Jsonld.php', |
|
18 | - 'Wordlift\\Modules\\Food_Kg\\Main_Entity\\Food_Kg_Main_Entity_Runner' => $baseDir . '/includes/Main_Entity/Food_Kg_Main_Entity_Runner.php', |
|
19 | - 'Wordlift\\Modules\\Food_Kg\\Main_Entity\\Food_Kg_Recipe_Post_Store' => $baseDir . '/includes/Main_Entity/Food_Kg_Recipe_Post_Store.php', |
|
20 | - 'Wordlift\\Modules\\Food_Kg\\Main_Entity\\Food_Kg_Recipe_Stats' => $baseDir . '/includes/Main_Entity/Food_Kg_Recipe_Stats.php', |
|
21 | - 'Wordlift\\Modules\\Food_Kg\\Main_Ingredient_Jsonld' => $baseDir . '/includes/Main_Ingredient_Jsonld.php', |
|
22 | - 'Wordlift\\Modules\\Food_Kg\\Main_Ingredient_Recipe_Lift_Strategy' => $baseDir . '/includes/Main_Ingredient_Recipe_Lift_Strategy.php', |
|
23 | - 'Wordlift\\Modules\\Food_Kg\\Module' => $baseDir . '/includes/Module.php', |
|
24 | - 'Wordlift\\Modules\\Food_Kg\\Notices' => $baseDir . '/includes/Notices.php', |
|
25 | - 'Wordlift\\Modules\\Food_Kg\\Preconditions' => $baseDir . '/includes/Preconditions.php', |
|
26 | - 'Wordlift\\Modules\\Food_Kg\\Recipe_Lift_Strategy' => $baseDir . '/includes/Recipe_Lift_Strategy.php', |
|
27 | - 'Wordlift\\Modules\\Food_Kg\\Services\\Ingredients' => $baseDir . '/includes/services/Ingredients.php', |
|
28 | - 'Wordlift\\Modules\\Food_Kg\\Term_Entity\\Food_Kg_Ingredient_Stats' => $baseDir . '/includes/Term_Entity/Food_Kg_Ingredient_Stats.php', |
|
29 | - 'Wordlift\\Modules\\Food_Kg\\Term_Entity\\Food_Kg_Ingredients_Term_Store' => $baseDir . '/includes/Term_Entity/Food_Kg_Ingredients_Term_Store.php', |
|
30 | - 'Wordlift\\Modules\\Food_Kg\\Term_Entity\\Food_Kg_Term_Entity_Runner' => $baseDir . '/includes/Term_Entity/Food_Kg_Term_Entity_Runner.php', |
|
9 | + 'Composer\\InstalledVersions' => $vendorDir.'/composer/InstalledVersions.php', |
|
10 | + 'Wordlift\\Modules\\Food_Kg\\Admin\\Meta_Box' => $baseDir.'/includes/admin/Meta_Box.php', |
|
11 | + 'Wordlift\\Modules\\Food_Kg\\Api\\Cursor' => $baseDir.'/includes/Api/Cursor.php', |
|
12 | + 'Wordlift\\Modules\\Food_Kg\\Api\\Cursor_Page' => $baseDir.'/includes/Api/Cursor_Page.php', |
|
13 | + 'Wordlift\\Modules\\Food_Kg\\Ingredients' => $baseDir.'/includes/Ingredients.php', |
|
14 | + 'Wordlift\\Modules\\Food_Kg\\Ingredients_API' => $baseDir.'/includes/Ingredients_API.php', |
|
15 | + 'Wordlift\\Modules\\Food_Kg\\Ingredients_Client' => $baseDir.'/includes/Ingredients_Client.php', |
|
16 | + 'Wordlift\\Modules\\Food_Kg\\Ingredients_Taxonomy_Recipe_Lift_Strategy' => $baseDir.'/includes/Ingredients_Taxonomy_Recipe_Lift_Strategy.php', |
|
17 | + 'Wordlift\\Modules\\Food_Kg\\Jsonld' => $baseDir.'/includes/Jsonld.php', |
|
18 | + 'Wordlift\\Modules\\Food_Kg\\Main_Entity\\Food_Kg_Main_Entity_Runner' => $baseDir.'/includes/Main_Entity/Food_Kg_Main_Entity_Runner.php', |
|
19 | + 'Wordlift\\Modules\\Food_Kg\\Main_Entity\\Food_Kg_Recipe_Post_Store' => $baseDir.'/includes/Main_Entity/Food_Kg_Recipe_Post_Store.php', |
|
20 | + 'Wordlift\\Modules\\Food_Kg\\Main_Entity\\Food_Kg_Recipe_Stats' => $baseDir.'/includes/Main_Entity/Food_Kg_Recipe_Stats.php', |
|
21 | + 'Wordlift\\Modules\\Food_Kg\\Main_Ingredient_Jsonld' => $baseDir.'/includes/Main_Ingredient_Jsonld.php', |
|
22 | + 'Wordlift\\Modules\\Food_Kg\\Main_Ingredient_Recipe_Lift_Strategy' => $baseDir.'/includes/Main_Ingredient_Recipe_Lift_Strategy.php', |
|
23 | + 'Wordlift\\Modules\\Food_Kg\\Module' => $baseDir.'/includes/Module.php', |
|
24 | + 'Wordlift\\Modules\\Food_Kg\\Notices' => $baseDir.'/includes/Notices.php', |
|
25 | + 'Wordlift\\Modules\\Food_Kg\\Preconditions' => $baseDir.'/includes/Preconditions.php', |
|
26 | + 'Wordlift\\Modules\\Food_Kg\\Recipe_Lift_Strategy' => $baseDir.'/includes/Recipe_Lift_Strategy.php', |
|
27 | + 'Wordlift\\Modules\\Food_Kg\\Services\\Ingredients' => $baseDir.'/includes/services/Ingredients.php', |
|
28 | + 'Wordlift\\Modules\\Food_Kg\\Term_Entity\\Food_Kg_Ingredient_Stats' => $baseDir.'/includes/Term_Entity/Food_Kg_Ingredient_Stats.php', |
|
29 | + 'Wordlift\\Modules\\Food_Kg\\Term_Entity\\Food_Kg_Ingredients_Term_Store' => $baseDir.'/includes/Term_Entity/Food_Kg_Ingredients_Term_Store.php', |
|
30 | + 'Wordlift\\Modules\\Food_Kg\\Term_Entity\\Food_Kg_Term_Entity_Runner' => $baseDir.'/includes/Term_Entity/Food_Kg_Term_Entity_Runner.php', |
|
31 | 31 | ); |
@@ -6,34 +6,34 @@ |
||
6 | 6 | |
7 | 7 | class ComposerStaticInit718e370ed095fd597a1f1d468c2b59f4 |
8 | 8 | { |
9 | - public static $classMap = array ( |
|
10 | - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', |
|
11 | - 'Wordlift\\Modules\\Food_Kg\\Admin\\Meta_Box' => __DIR__ . '/../..' . '/includes/admin/Meta_Box.php', |
|
12 | - 'Wordlift\\Modules\\Food_Kg\\Api\\Cursor' => __DIR__ . '/../..' . '/includes/Api/Cursor.php', |
|
13 | - 'Wordlift\\Modules\\Food_Kg\\Api\\Cursor_Page' => __DIR__ . '/../..' . '/includes/Api/Cursor_Page.php', |
|
14 | - 'Wordlift\\Modules\\Food_Kg\\Ingredients' => __DIR__ . '/../..' . '/includes/Ingredients.php', |
|
15 | - 'Wordlift\\Modules\\Food_Kg\\Ingredients_API' => __DIR__ . '/../..' . '/includes/Ingredients_API.php', |
|
16 | - 'Wordlift\\Modules\\Food_Kg\\Ingredients_Client' => __DIR__ . '/../..' . '/includes/Ingredients_Client.php', |
|
17 | - 'Wordlift\\Modules\\Food_Kg\\Ingredients_Taxonomy_Recipe_Lift_Strategy' => __DIR__ . '/../..' . '/includes/Ingredients_Taxonomy_Recipe_Lift_Strategy.php', |
|
18 | - 'Wordlift\\Modules\\Food_Kg\\Jsonld' => __DIR__ . '/../..' . '/includes/Jsonld.php', |
|
19 | - 'Wordlift\\Modules\\Food_Kg\\Main_Entity\\Food_Kg_Main_Entity_Runner' => __DIR__ . '/../..' . '/includes/Main_Entity/Food_Kg_Main_Entity_Runner.php', |
|
20 | - 'Wordlift\\Modules\\Food_Kg\\Main_Entity\\Food_Kg_Recipe_Post_Store' => __DIR__ . '/../..' . '/includes/Main_Entity/Food_Kg_Recipe_Post_Store.php', |
|
21 | - 'Wordlift\\Modules\\Food_Kg\\Main_Entity\\Food_Kg_Recipe_Stats' => __DIR__ . '/../..' . '/includes/Main_Entity/Food_Kg_Recipe_Stats.php', |
|
22 | - 'Wordlift\\Modules\\Food_Kg\\Main_Ingredient_Jsonld' => __DIR__ . '/../..' . '/includes/Main_Ingredient_Jsonld.php', |
|
23 | - 'Wordlift\\Modules\\Food_Kg\\Main_Ingredient_Recipe_Lift_Strategy' => __DIR__ . '/../..' . '/includes/Main_Ingredient_Recipe_Lift_Strategy.php', |
|
24 | - 'Wordlift\\Modules\\Food_Kg\\Module' => __DIR__ . '/../..' . '/includes/Module.php', |
|
25 | - 'Wordlift\\Modules\\Food_Kg\\Notices' => __DIR__ . '/../..' . '/includes/Notices.php', |
|
26 | - 'Wordlift\\Modules\\Food_Kg\\Preconditions' => __DIR__ . '/../..' . '/includes/Preconditions.php', |
|
27 | - 'Wordlift\\Modules\\Food_Kg\\Recipe_Lift_Strategy' => __DIR__ . '/../..' . '/includes/Recipe_Lift_Strategy.php', |
|
28 | - 'Wordlift\\Modules\\Food_Kg\\Services\\Ingredients' => __DIR__ . '/../..' . '/includes/services/Ingredients.php', |
|
29 | - 'Wordlift\\Modules\\Food_Kg\\Term_Entity\\Food_Kg_Ingredient_Stats' => __DIR__ . '/../..' . '/includes/Term_Entity/Food_Kg_Ingredient_Stats.php', |
|
30 | - 'Wordlift\\Modules\\Food_Kg\\Term_Entity\\Food_Kg_Ingredients_Term_Store' => __DIR__ . '/../..' . '/includes/Term_Entity/Food_Kg_Ingredients_Term_Store.php', |
|
31 | - 'Wordlift\\Modules\\Food_Kg\\Term_Entity\\Food_Kg_Term_Entity_Runner' => __DIR__ . '/../..' . '/includes/Term_Entity/Food_Kg_Term_Entity_Runner.php', |
|
9 | + public static $classMap = array( |
|
10 | + 'Composer\\InstalledVersions' => __DIR__.'/..'.'/composer/InstalledVersions.php', |
|
11 | + 'Wordlift\\Modules\\Food_Kg\\Admin\\Meta_Box' => __DIR__.'/../..'.'/includes/admin/Meta_Box.php', |
|
12 | + 'Wordlift\\Modules\\Food_Kg\\Api\\Cursor' => __DIR__.'/../..'.'/includes/Api/Cursor.php', |
|
13 | + 'Wordlift\\Modules\\Food_Kg\\Api\\Cursor_Page' => __DIR__.'/../..'.'/includes/Api/Cursor_Page.php', |
|
14 | + 'Wordlift\\Modules\\Food_Kg\\Ingredients' => __DIR__.'/../..'.'/includes/Ingredients.php', |
|
15 | + 'Wordlift\\Modules\\Food_Kg\\Ingredients_API' => __DIR__.'/../..'.'/includes/Ingredients_API.php', |
|
16 | + 'Wordlift\\Modules\\Food_Kg\\Ingredients_Client' => __DIR__.'/../..'.'/includes/Ingredients_Client.php', |
|
17 | + 'Wordlift\\Modules\\Food_Kg\\Ingredients_Taxonomy_Recipe_Lift_Strategy' => __DIR__.'/../..'.'/includes/Ingredients_Taxonomy_Recipe_Lift_Strategy.php', |
|
18 | + 'Wordlift\\Modules\\Food_Kg\\Jsonld' => __DIR__.'/../..'.'/includes/Jsonld.php', |
|
19 | + 'Wordlift\\Modules\\Food_Kg\\Main_Entity\\Food_Kg_Main_Entity_Runner' => __DIR__.'/../..'.'/includes/Main_Entity/Food_Kg_Main_Entity_Runner.php', |
|
20 | + 'Wordlift\\Modules\\Food_Kg\\Main_Entity\\Food_Kg_Recipe_Post_Store' => __DIR__.'/../..'.'/includes/Main_Entity/Food_Kg_Recipe_Post_Store.php', |
|
21 | + 'Wordlift\\Modules\\Food_Kg\\Main_Entity\\Food_Kg_Recipe_Stats' => __DIR__.'/../..'.'/includes/Main_Entity/Food_Kg_Recipe_Stats.php', |
|
22 | + 'Wordlift\\Modules\\Food_Kg\\Main_Ingredient_Jsonld' => __DIR__.'/../..'.'/includes/Main_Ingredient_Jsonld.php', |
|
23 | + 'Wordlift\\Modules\\Food_Kg\\Main_Ingredient_Recipe_Lift_Strategy' => __DIR__.'/../..'.'/includes/Main_Ingredient_Recipe_Lift_Strategy.php', |
|
24 | + 'Wordlift\\Modules\\Food_Kg\\Module' => __DIR__.'/../..'.'/includes/Module.php', |
|
25 | + 'Wordlift\\Modules\\Food_Kg\\Notices' => __DIR__.'/../..'.'/includes/Notices.php', |
|
26 | + 'Wordlift\\Modules\\Food_Kg\\Preconditions' => __DIR__.'/../..'.'/includes/Preconditions.php', |
|
27 | + 'Wordlift\\Modules\\Food_Kg\\Recipe_Lift_Strategy' => __DIR__.'/../..'.'/includes/Recipe_Lift_Strategy.php', |
|
28 | + 'Wordlift\\Modules\\Food_Kg\\Services\\Ingredients' => __DIR__.'/../..'.'/includes/services/Ingredients.php', |
|
29 | + 'Wordlift\\Modules\\Food_Kg\\Term_Entity\\Food_Kg_Ingredient_Stats' => __DIR__.'/../..'.'/includes/Term_Entity/Food_Kg_Ingredient_Stats.php', |
|
30 | + 'Wordlift\\Modules\\Food_Kg\\Term_Entity\\Food_Kg_Ingredients_Term_Store' => __DIR__.'/../..'.'/includes/Term_Entity/Food_Kg_Ingredients_Term_Store.php', |
|
31 | + 'Wordlift\\Modules\\Food_Kg\\Term_Entity\\Food_Kg_Term_Entity_Runner' => __DIR__.'/../..'.'/includes/Term_Entity/Food_Kg_Term_Entity_Runner.php', |
|
32 | 32 | ); |
33 | 33 | |
34 | 34 | public static function getInitializer(ClassLoader $loader) |
35 | 35 | { |
36 | - return \Closure::bind(function () use ($loader) { |
|
36 | + return \Closure::bind(function() use ($loader) { |
|
37 | 37 | $loader->classMap = ComposerStaticInit718e370ed095fd597a1f1d468c2b59f4::$classMap; |
38 | 38 | |
39 | 39 | }, null, ClassLoader::class); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | use Wordlift\Modules\Food_Kg\Term_Entity\Food_Kg_Ingredient_Stats; |
19 | 19 | |
20 | 20 | if ( ! defined( 'ABSPATH' ) ) { |
21 | - exit; |
|
21 | + exit; |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | define( 'WL_FOOD_KG_FILE', __FILE__ ); |
@@ -26,68 +26,68 @@ discard block |
||
26 | 26 | |
27 | 27 | function __wl_foodkg__load() { |
28 | 28 | |
29 | - // Autoloader for plugin itself. |
|
30 | - if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { |
|
31 | - require __DIR__ . '/vendor/autoload.php'; |
|
32 | - } |
|
33 | - |
|
34 | - $container_builder = new ContainerBuilder(); |
|
35 | - $loader = new YamlFileLoader( $container_builder, new FileLocator( __DIR__ ) ); |
|
36 | - $loader->load( 'services.yml' ); |
|
37 | - $container_builder->compile(); |
|
38 | - |
|
39 | - $notices = $container_builder->get( 'Wordlift\Modules\Food_Kg\Notices' ); |
|
40 | - $notices->register_hooks(); |
|
41 | - |
|
42 | - /** |
|
43 | - * @var Preconditions $preconditions |
|
44 | - */ |
|
45 | - $preconditions = $container_builder->get( 'Wordlift\Modules\Food_Kg\Preconditions' ); |
|
46 | - if ( ! $preconditions->pass() ) { |
|
47 | - return; |
|
48 | - } |
|
49 | - |
|
50 | - // Meta Box. |
|
51 | - $meta_box = $container_builder->get( 'Wordlift\Modules\Food_Kg\Admin\Meta_Box' ); |
|
52 | - $meta_box->register_hooks(); |
|
53 | - |
|
54 | - $module = $container_builder->get( 'Wordlift\Modules\Food_Kg\Module' ); |
|
55 | - $module->register_hooks(); |
|
56 | - |
|
57 | - /** @var Jsonld $jsonld */ |
|
58 | - $jsonld = $container_builder->get( 'Wordlift\Modules\Food_Kg\Jsonld' ); |
|
59 | - $jsonld->register_hooks(); |
|
60 | - |
|
61 | - /** @var Main_Ingredient_Jsonld $jsonld */ |
|
62 | - $main_ingredient_jsonld = $container_builder->get( 'Wordlift\Modules\Food_Kg\Main_Ingredient_Jsonld' ); |
|
63 | - $main_ingredient_jsonld->register_hooks(); |
|
64 | - |
|
65 | - // Get the runners |
|
66 | - $main_entity_runner = $container_builder->get( 'Wordlift\Modules\Food_Kg\Main_Entity\Food_Kg_Main_Entity_Runner' ); |
|
67 | - $term_entity_runner = $container_builder->get( 'Wordlift\Modules\Food_Kg\Term_Entity\Food_Kg_Term_Entity_Runner' ); |
|
68 | - |
|
69 | - // Add the runners, this is called by the Dashboard Synchronization. |
|
70 | - add_filter( |
|
71 | - 'wl_dashboard__synchronization__runners', |
|
72 | - function ( $runners ) use ( $main_entity_runner, $term_entity_runner ) { |
|
73 | - $runners[] = $term_entity_runner; |
|
74 | - $runners[] = $main_entity_runner; |
|
75 | - |
|
76 | - return $runners; |
|
77 | - } |
|
78 | - ); |
|
79 | - |
|
80 | - /** |
|
81 | - * @var $recipe_stats Food_Kg_Recipe_Stats |
|
82 | - */ |
|
83 | - $recipe_stats = $container_builder->get( Food_Kg_Recipe_Stats::class ); |
|
84 | - $recipe_stats->register_hooks(); |
|
85 | - |
|
86 | - /** |
|
87 | - * @var $recipe_stats Food_Kg_Ingredient_Stats |
|
88 | - */ |
|
89 | - $recipe_stats = $container_builder->get( Food_Kg_Ingredient_Stats::class ); |
|
90 | - $recipe_stats->register_hooks(); |
|
29 | + // Autoloader for plugin itself. |
|
30 | + if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { |
|
31 | + require __DIR__ . '/vendor/autoload.php'; |
|
32 | + } |
|
33 | + |
|
34 | + $container_builder = new ContainerBuilder(); |
|
35 | + $loader = new YamlFileLoader( $container_builder, new FileLocator( __DIR__ ) ); |
|
36 | + $loader->load( 'services.yml' ); |
|
37 | + $container_builder->compile(); |
|
38 | + |
|
39 | + $notices = $container_builder->get( 'Wordlift\Modules\Food_Kg\Notices' ); |
|
40 | + $notices->register_hooks(); |
|
41 | + |
|
42 | + /** |
|
43 | + * @var Preconditions $preconditions |
|
44 | + */ |
|
45 | + $preconditions = $container_builder->get( 'Wordlift\Modules\Food_Kg\Preconditions' ); |
|
46 | + if ( ! $preconditions->pass() ) { |
|
47 | + return; |
|
48 | + } |
|
49 | + |
|
50 | + // Meta Box. |
|
51 | + $meta_box = $container_builder->get( 'Wordlift\Modules\Food_Kg\Admin\Meta_Box' ); |
|
52 | + $meta_box->register_hooks(); |
|
53 | + |
|
54 | + $module = $container_builder->get( 'Wordlift\Modules\Food_Kg\Module' ); |
|
55 | + $module->register_hooks(); |
|
56 | + |
|
57 | + /** @var Jsonld $jsonld */ |
|
58 | + $jsonld = $container_builder->get( 'Wordlift\Modules\Food_Kg\Jsonld' ); |
|
59 | + $jsonld->register_hooks(); |
|
60 | + |
|
61 | + /** @var Main_Ingredient_Jsonld $jsonld */ |
|
62 | + $main_ingredient_jsonld = $container_builder->get( 'Wordlift\Modules\Food_Kg\Main_Ingredient_Jsonld' ); |
|
63 | + $main_ingredient_jsonld->register_hooks(); |
|
64 | + |
|
65 | + // Get the runners |
|
66 | + $main_entity_runner = $container_builder->get( 'Wordlift\Modules\Food_Kg\Main_Entity\Food_Kg_Main_Entity_Runner' ); |
|
67 | + $term_entity_runner = $container_builder->get( 'Wordlift\Modules\Food_Kg\Term_Entity\Food_Kg_Term_Entity_Runner' ); |
|
68 | + |
|
69 | + // Add the runners, this is called by the Dashboard Synchronization. |
|
70 | + add_filter( |
|
71 | + 'wl_dashboard__synchronization__runners', |
|
72 | + function ( $runners ) use ( $main_entity_runner, $term_entity_runner ) { |
|
73 | + $runners[] = $term_entity_runner; |
|
74 | + $runners[] = $main_entity_runner; |
|
75 | + |
|
76 | + return $runners; |
|
77 | + } |
|
78 | + ); |
|
79 | + |
|
80 | + /** |
|
81 | + * @var $recipe_stats Food_Kg_Recipe_Stats |
|
82 | + */ |
|
83 | + $recipe_stats = $container_builder->get( Food_Kg_Recipe_Stats::class ); |
|
84 | + $recipe_stats->register_hooks(); |
|
85 | + |
|
86 | + /** |
|
87 | + * @var $recipe_stats Food_Kg_Ingredient_Stats |
|
88 | + */ |
|
89 | + $recipe_stats = $container_builder->get( Food_Kg_Ingredient_Stats::class ); |
|
90 | + $recipe_stats->register_hooks(); |
|
91 | 91 | |
92 | 92 | } |
93 | 93 |
@@ -17,59 +17,59 @@ discard block |
||
17 | 17 | use Wordlift\Modules\Food_Kg\Preconditions; |
18 | 18 | use Wordlift\Modules\Food_Kg\Term_Entity\Food_Kg_Ingredient_Stats; |
19 | 19 | |
20 | -if ( ! defined( 'ABSPATH' ) ) { |
|
20 | +if ( ! defined('ABSPATH')) { |
|
21 | 21 | exit; |
22 | 22 | } |
23 | 23 | |
24 | -define( 'WL_FOOD_KG_FILE', __FILE__ ); |
|
25 | -define( 'WL_FOOD_KG_DIR_PATH', dirname( WL_FOOD_KG_FILE ) ); |
|
24 | +define('WL_FOOD_KG_FILE', __FILE__); |
|
25 | +define('WL_FOOD_KG_DIR_PATH', dirname(WL_FOOD_KG_FILE)); |
|
26 | 26 | |
27 | 27 | function __wl_foodkg__load() { |
28 | 28 | |
29 | 29 | // Autoloader for plugin itself. |
30 | - if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { |
|
31 | - require __DIR__ . '/vendor/autoload.php'; |
|
30 | + if (file_exists(__DIR__.'/vendor/autoload.php')) { |
|
31 | + require __DIR__.'/vendor/autoload.php'; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | $container_builder = new ContainerBuilder(); |
35 | - $loader = new YamlFileLoader( $container_builder, new FileLocator( __DIR__ ) ); |
|
36 | - $loader->load( 'services.yml' ); |
|
35 | + $loader = new YamlFileLoader($container_builder, new FileLocator(__DIR__)); |
|
36 | + $loader->load('services.yml'); |
|
37 | 37 | $container_builder->compile(); |
38 | 38 | |
39 | - $notices = $container_builder->get( 'Wordlift\Modules\Food_Kg\Notices' ); |
|
39 | + $notices = $container_builder->get('Wordlift\Modules\Food_Kg\Notices'); |
|
40 | 40 | $notices->register_hooks(); |
41 | 41 | |
42 | 42 | /** |
43 | 43 | * @var Preconditions $preconditions |
44 | 44 | */ |
45 | - $preconditions = $container_builder->get( 'Wordlift\Modules\Food_Kg\Preconditions' ); |
|
46 | - if ( ! $preconditions->pass() ) { |
|
45 | + $preconditions = $container_builder->get('Wordlift\Modules\Food_Kg\Preconditions'); |
|
46 | + if ( ! $preconditions->pass()) { |
|
47 | 47 | return; |
48 | 48 | } |
49 | 49 | |
50 | 50 | // Meta Box. |
51 | - $meta_box = $container_builder->get( 'Wordlift\Modules\Food_Kg\Admin\Meta_Box' ); |
|
51 | + $meta_box = $container_builder->get('Wordlift\Modules\Food_Kg\Admin\Meta_Box'); |
|
52 | 52 | $meta_box->register_hooks(); |
53 | 53 | |
54 | - $module = $container_builder->get( 'Wordlift\Modules\Food_Kg\Module' ); |
|
54 | + $module = $container_builder->get('Wordlift\Modules\Food_Kg\Module'); |
|
55 | 55 | $module->register_hooks(); |
56 | 56 | |
57 | 57 | /** @var Jsonld $jsonld */ |
58 | - $jsonld = $container_builder->get( 'Wordlift\Modules\Food_Kg\Jsonld' ); |
|
58 | + $jsonld = $container_builder->get('Wordlift\Modules\Food_Kg\Jsonld'); |
|
59 | 59 | $jsonld->register_hooks(); |
60 | 60 | |
61 | 61 | /** @var Main_Ingredient_Jsonld $jsonld */ |
62 | - $main_ingredient_jsonld = $container_builder->get( 'Wordlift\Modules\Food_Kg\Main_Ingredient_Jsonld' ); |
|
62 | + $main_ingredient_jsonld = $container_builder->get('Wordlift\Modules\Food_Kg\Main_Ingredient_Jsonld'); |
|
63 | 63 | $main_ingredient_jsonld->register_hooks(); |
64 | 64 | |
65 | 65 | // Get the runners |
66 | - $main_entity_runner = $container_builder->get( 'Wordlift\Modules\Food_Kg\Main_Entity\Food_Kg_Main_Entity_Runner' ); |
|
67 | - $term_entity_runner = $container_builder->get( 'Wordlift\Modules\Food_Kg\Term_Entity\Food_Kg_Term_Entity_Runner' ); |
|
66 | + $main_entity_runner = $container_builder->get('Wordlift\Modules\Food_Kg\Main_Entity\Food_Kg_Main_Entity_Runner'); |
|
67 | + $term_entity_runner = $container_builder->get('Wordlift\Modules\Food_Kg\Term_Entity\Food_Kg_Term_Entity_Runner'); |
|
68 | 68 | |
69 | 69 | // Add the runners, this is called by the Dashboard Synchronization. |
70 | 70 | add_filter( |
71 | 71 | 'wl_dashboard__synchronization__runners', |
72 | - function ( $runners ) use ( $main_entity_runner, $term_entity_runner ) { |
|
72 | + function($runners) use ($main_entity_runner, $term_entity_runner) { |
|
73 | 73 | $runners[] = $term_entity_runner; |
74 | 74 | $runners[] = $main_entity_runner; |
75 | 75 | |
@@ -80,16 +80,16 @@ discard block |
||
80 | 80 | /** |
81 | 81 | * @var $recipe_stats Food_Kg_Recipe_Stats |
82 | 82 | */ |
83 | - $recipe_stats = $container_builder->get( Food_Kg_Recipe_Stats::class ); |
|
83 | + $recipe_stats = $container_builder->get(Food_Kg_Recipe_Stats::class); |
|
84 | 84 | $recipe_stats->register_hooks(); |
85 | 85 | |
86 | 86 | /** |
87 | 87 | * @var $recipe_stats Food_Kg_Ingredient_Stats |
88 | 88 | */ |
89 | - $recipe_stats = $container_builder->get( Food_Kg_Ingredient_Stats::class ); |
|
89 | + $recipe_stats = $container_builder->get(Food_Kg_Ingredient_Stats::class); |
|
90 | 90 | $recipe_stats->register_hooks(); |
91 | 91 | |
92 | 92 | } |
93 | 93 | |
94 | -add_action( 'plugins_loaded', '__wl_foodkg__load' ); |
|
94 | +add_action('plugins_loaded', '__wl_foodkg__load'); |
|
95 | 95 |