@@ -49,35 +49,35 @@ discard block |
||
49 | 49 | public function __construct() { |
50 | 50 | |
51 | 51 | /** Installs. */ |
52 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install.php'; |
|
53 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-1-0-0.php'; |
|
54 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-10-0.php'; |
|
55 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-12-0.php'; |
|
56 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-14-0.php'; |
|
57 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-15-0.php'; |
|
58 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-18-0.php'; |
|
59 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-18-3.php'; |
|
60 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-19-5.php'; |
|
61 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-20-0.php'; |
|
62 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-23-4.php'; |
|
63 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-24-2.php'; |
|
64 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-all-entity-types.php'; |
|
65 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-package-type.php'; |
|
66 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-25-0.php'; |
|
67 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-27-0.php'; |
|
68 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-27-1.php'; |
|
69 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-28-0.php'; |
|
70 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-32-0.php'; |
|
71 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-33-9.php'; |
|
72 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-36-0.php'; |
|
73 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-38-5.php'; |
|
74 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-39-1.php'; |
|
75 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-40-1.php'; |
|
76 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-40-2.php'; |
|
77 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-41-0.php'; |
|
78 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-42-0.php'; |
|
79 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-44-1.php'; |
|
80 | - require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-44-4.php'; |
|
52 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install.php'; |
|
53 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-1-0-0.php'; |
|
54 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-10-0.php'; |
|
55 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-12-0.php'; |
|
56 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-14-0.php'; |
|
57 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-15-0.php'; |
|
58 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-18-0.php'; |
|
59 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-18-3.php'; |
|
60 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-19-5.php'; |
|
61 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-20-0.php'; |
|
62 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-23-4.php'; |
|
63 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-24-2.php'; |
|
64 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-all-entity-types.php'; |
|
65 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-package-type.php'; |
|
66 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-25-0.php'; |
|
67 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-27-0.php'; |
|
68 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-27-1.php'; |
|
69 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-28-0.php'; |
|
70 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-32-0.php'; |
|
71 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-33-9.php'; |
|
72 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-36-0.php'; |
|
73 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-38-5.php'; |
|
74 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-39-1.php'; |
|
75 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-40-1.php'; |
|
76 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-40-2.php'; |
|
77 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-41-0.php'; |
|
78 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-42-0.php'; |
|
79 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-44-1.php'; |
|
80 | + require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-44-4.php'; |
|
81 | 81 | // Get the install services. |
82 | 82 | $this->installs = array( |
83 | 83 | new Wordlift_Install_1_0_0(), |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | ); |
125 | 125 | self::$instance = $this; |
126 | 126 | |
127 | - $this->log = Wordlift_Log_Service::get_logger( get_class() ); |
|
127 | + $this->log = Wordlift_Log_Service::get_logger(get_class()); |
|
128 | 128 | |
129 | - add_action( 'init', array( $this, 'install' ) ); |
|
129 | + add_action('init', array($this, 'install')); |
|
130 | 130 | |
131 | 131 | } |
132 | 132 | |
@@ -152,30 +152,30 @@ discard block |
||
152 | 152 | |
153 | 153 | $version = null; |
154 | 154 | |
155 | - if ( $this->install_required() && false === get_transient( '_wl_installing' ) ) { |
|
156 | - set_transient( '_wl_installing', true, 5 * MINUTE_IN_SECONDS ); |
|
155 | + if ($this->install_required() && false === get_transient('_wl_installing')) { |
|
156 | + set_transient('_wl_installing', true, 5 * MINUTE_IN_SECONDS); |
|
157 | 157 | /** @var Wordlift_Install $install */ |
158 | - foreach ( $this->installs as $install ) { |
|
158 | + foreach ($this->installs as $install) { |
|
159 | 159 | // Get the install version. |
160 | 160 | $version = $install->get_version(); |
161 | 161 | |
162 | - if ( version_compare( $version, $this->get_current_version(), '>' ) |
|
163 | - || $install->must_install() ) { |
|
164 | - $class_name = get_class( $install ); |
|
162 | + if (version_compare($version, $this->get_current_version(), '>') |
|
163 | + || $install->must_install()) { |
|
164 | + $class_name = get_class($install); |
|
165 | 165 | |
166 | - $this->log->info( "Current version is {$this->get_current_version()}, installing $class_name..." ); |
|
166 | + $this->log->info("Current version is {$this->get_current_version()}, installing $class_name..."); |
|
167 | 167 | // Install version. |
168 | 168 | $install->install(); |
169 | 169 | |
170 | - $this->log->info( "$class_name installed." ); |
|
170 | + $this->log->info("$class_name installed."); |
|
171 | 171 | |
172 | 172 | // Bump the version. |
173 | - update_option( 'wl_db_version', $version ); |
|
173 | + update_option('wl_db_version', $version); |
|
174 | 174 | } |
175 | 175 | } |
176 | 176 | |
177 | 177 | // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged |
178 | - @delete_transient( '_wl_installing' ); |
|
178 | + @delete_transient('_wl_installing'); |
|
179 | 179 | |
180 | 180 | } |
181 | 181 | |
@@ -184,12 +184,12 @@ discard block |
||
184 | 184 | private function install_required() { |
185 | 185 | |
186 | 186 | /** @var Wordlift_Install $install */ |
187 | - foreach ( $this->installs as $install ) { |
|
187 | + foreach ($this->installs as $install) { |
|
188 | 188 | // Get the install version. |
189 | 189 | $version = $install->get_version(); |
190 | 190 | |
191 | - if ( version_compare( $version, $this->get_current_version(), '>' ) |
|
192 | - || $install->must_install() ) { |
|
191 | + if (version_compare($version, $this->get_current_version(), '>') |
|
192 | + || $install->must_install()) { |
|
193 | 193 | return true; |
194 | 194 | } |
195 | 195 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * @return type |
204 | 204 | */ |
205 | 205 | private function get_current_version() { |
206 | - return get_option( 'wl_db_version', '0.0.0' ); |
|
206 | + return get_option('wl_db_version', '0.0.0'); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | } |
@@ -23,63 +23,63 @@ |
||
23 | 23 | |
24 | 24 | // Dashboard is available only for Food Kg and Gardening Kg atm |
25 | 25 | // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
26 | - if ( ! apply_filters( 'wl_feature__enable__food-kg', false ) && ! apply_filters( 'wl_feature__enable__gardening-kg', false ) ) { |
|
26 | + if ( ! apply_filters('wl_feature__enable__food-kg', false) && ! apply_filters('wl_feature__enable__gardening-kg', false)) { |
|
27 | 27 | return; |
28 | 28 | } |
29 | 29 | |
30 | 30 | // Autoloader for plugin itself. |
31 | - if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) { |
|
32 | - require_once __DIR__ . '/vendor/autoload.php'; |
|
31 | + if (file_exists(__DIR__.'/vendor/autoload.php')) { |
|
32 | + require_once __DIR__.'/vendor/autoload.php'; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | $container_builder = new ContainerBuilder(); |
36 | - $loader = new YamlFileLoader( $container_builder, new FileLocator( __DIR__ ) ); |
|
37 | - $loader->load( 'services.yml' ); |
|
36 | + $loader = new YamlFileLoader($container_builder, new FileLocator(__DIR__)); |
|
37 | + $loader->load('services.yml'); |
|
38 | 38 | $container_builder->compile(); |
39 | 39 | |
40 | 40 | /** |
41 | 41 | * @var $rest_controller Rest_Controller |
42 | 42 | */ |
43 | - $rest_controller = $container_builder->get( 'Wordlift\Modules\Dashboard\Synchronization\Rest_Controller' ); |
|
43 | + $rest_controller = $container_builder->get('Wordlift\Modules\Dashboard\Synchronization\Rest_Controller'); |
|
44 | 44 | $rest_controller->register_hooks(); |
45 | 45 | |
46 | 46 | /** |
47 | 47 | * @var $term_entity_match_rest_controller Term_Entity_Match_Rest_Controller |
48 | 48 | */ |
49 | - $term_entity_match_rest_controller = $container_builder->get( Term_Entity_Match_Rest_Controller::class ); |
|
49 | + $term_entity_match_rest_controller = $container_builder->get(Term_Entity_Match_Rest_Controller::class); |
|
50 | 50 | $term_entity_match_rest_controller->register_hooks(); |
51 | 51 | |
52 | 52 | /** |
53 | 53 | * @var $term_entity_match_rest_controller \Wordlift\Modules\Dashboard\Post_Entity_Match\Post_Entity_Match_Rest_Controller |
54 | 54 | */ |
55 | - $post_entity_match_rest_controller = $container_builder->get( \Wordlift\Modules\Dashboard\Post_Entity_Match\Post_Entity_Match_Rest_Controller::class ); |
|
55 | + $post_entity_match_rest_controller = $container_builder->get(\Wordlift\Modules\Dashboard\Post_Entity_Match\Post_Entity_Match_Rest_Controller::class); |
|
56 | 56 | $post_entity_match_rest_controller->register_hooks(); |
57 | 57 | |
58 | 58 | /** |
59 | 59 | * @var $synchronization_service Synchronization_Service |
60 | 60 | */ |
61 | - $synchronization_service = $container_builder->get( 'Wordlift\Modules\Dashboard\Synchronization\Synchronization_Service' ); |
|
61 | + $synchronization_service = $container_builder->get('Wordlift\Modules\Dashboard\Synchronization\Synchronization_Service'); |
|
62 | 62 | $synchronization_service->register_hooks(); |
63 | 63 | |
64 | - $app_settings = $container_builder->get( App_Settings::class ); |
|
64 | + $app_settings = $container_builder->get(App_Settings::class); |
|
65 | 65 | $app_settings->register_hooks(); |
66 | 66 | |
67 | 67 | /** Admin Menu */ |
68 | 68 | add_action( |
69 | 69 | 'admin_menu', |
70 | - function () { |
|
71 | - add_submenu_page( 'wl_admin_menu', __( 'Dashboard', 'wordlift' ), __( 'Dashboard', 'wordlift' ), 'manage_options', 'wl_admin_menu', '_wl_dashboard__main' ); |
|
70 | + function() { |
|
71 | + add_submenu_page('wl_admin_menu', __('Dashboard', 'wordlift'), __('Dashboard', 'wordlift'), 'manage_options', 'wl_admin_menu', '_wl_dashboard__main'); |
|
72 | 72 | }, |
73 | 73 | 9 |
74 | 74 | ); |
75 | 75 | |
76 | 76 | add_action( |
77 | 77 | '_wl_dashboard__main', |
78 | - function () { |
|
78 | + function() { |
|
79 | 79 | // why not wp_enqueue_script ? because the iframe will start loading and it won't find the |
80 | 80 | // settings in parent window if it's not printed before. |
81 | - wp_print_scripts( WL_ANGULAR_APP_SCRIPT_HANDLE ); |
|
82 | - $iframe_src = WL_ANGULAR_APP_URL . '#/admin/dashboard'; |
|
81 | + wp_print_scripts(WL_ANGULAR_APP_SCRIPT_HANDLE); |
|
82 | + $iframe_src = WL_ANGULAR_APP_URL.'#/admin/dashboard'; |
|
83 | 83 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
84 | 84 | echo " |
85 | 85 | <style> |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | * @return Match_Entry |
16 | 16 | * @throws \Exception Throw Exception if the jsonld cant be set. |
17 | 17 | */ |
18 | - public function set_jsonld( $content_id, $content_type, $match_id, $jsonld ) { |
|
18 | + public function set_jsonld($content_id, $content_type, $match_id, $jsonld) { |
|
19 | 19 | |
20 | 20 | global $wpdb; |
21 | 21 | |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * as `null` if we directly pass it to the prepare function(). So its necessary |
26 | 26 | * to make the query conditional based on the $value |
27 | 27 | */ |
28 | - if ( null === $jsonld ) { |
|
28 | + if (null === $jsonld) { |
|
29 | 29 | $wpdb->query( |
30 | 30 | $wpdb->prepare( |
31 | 31 | "UPDATE {$wpdb->prefix}wl_entities SET about_jsonld = NULL WHERE id = %d AND content_id = %d AND content_type = %d", |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $wpdb->query( |
39 | 39 | $wpdb->prepare( |
40 | 40 | "UPDATE {$wpdb->prefix}wl_entities SET about_jsonld = %s WHERE id = %d AND content_id = %d AND content_type = %d", |
41 | - wp_json_encode( $jsonld ), |
|
41 | + wp_json_encode($jsonld), |
|
42 | 42 | $match_id, |
43 | 43 | $content_id, |
44 | 44 | $content_type |
@@ -46,27 +46,27 @@ discard block |
||
46 | 46 | ); |
47 | 47 | } |
48 | 48 | |
49 | - if ( Object_Type_Enum::TERM === $content_type ) { |
|
49 | + if (Object_Type_Enum::TERM === $content_type) { |
|
50 | 50 | |
51 | 51 | $query = "SELECT e.content_id as match_id, e.about_jsonld as match_jsonld, t.name, e.id FROM {$wpdb->prefix}wl_entities e |
52 | 52 | LEFT JOIN {$wpdb->prefix}terms t ON e.content_id = t.term_id |
53 | 53 | WHERE e.id = %d AND e.content_id = %d AND e.content_type = %d"; |
54 | 54 | // `{$wpdb->prefix}` cant be escaped for preparing. |
55 | 55 | // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
56 | - $results = $wpdb->get_row( $wpdb->prepare( $query, $match_id, $content_id, $content_type ), ARRAY_A ); |
|
57 | - return Match_Entry::from( $results ); |
|
56 | + $results = $wpdb->get_row($wpdb->prepare($query, $match_id, $content_id, $content_type), ARRAY_A); |
|
57 | + return Match_Entry::from($results); |
|
58 | 58 | } |
59 | 59 | |
60 | - if ( Object_Type_Enum::POST === $content_type ) { |
|
60 | + if (Object_Type_Enum::POST === $content_type) { |
|
61 | 61 | |
62 | 62 | $query = "SELECT e.content_id as match_id, e.about_jsonld as match_jsonld, p.post_title AS name, e.id FROM {$wpdb->prefix}wl_entities e |
63 | 63 | LEFT JOIN {$wpdb->prefix}posts p ON e.content_id = p.ID |
64 | 64 | WHERE e.id = %d AND e.content_id = %d AND e.content_type = %d"; |
65 | 65 | // `{$wpdb->prefix}` cant be escaped for preparing. |
66 | 66 | // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared |
67 | - $results = $wpdb->get_row( $wpdb->prepare( $query, $match_id, $content_id, $content_type ), ARRAY_A ); |
|
67 | + $results = $wpdb->get_row($wpdb->prepare($query, $match_id, $content_id, $content_type), ARRAY_A); |
|
68 | 68 | |
69 | - return Match_Entry::from( $results ); |
|
69 | + return Match_Entry::from($results); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @throws \Exception Throw Exception if the entry is not found. |
78 | 78 | * @return int |
79 | 79 | */ |
80 | - public function get_id( $content_id, $content_type ) { |
|
80 | + public function get_id($content_id, $content_type) { |
|
81 | 81 | global $wpdb; |
82 | 82 | $result = $wpdb->get_var( |
83 | 83 | // `{$wpdb->prefix}` cant be escaped for preparing. |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | $content_type |
89 | 89 | ) |
90 | 90 | ); |
91 | - if ( null === $result ) { |
|
92 | - throw new \Exception( "Unable to find match id for {$content_id} and {$content_type}" ); |
|
91 | + if (null === $result) { |
|
92 | + throw new \Exception("Unable to find match id for {$content_id} and {$content_type}"); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | return $result; |
@@ -15,33 +15,33 @@ discard block |
||
15 | 15 | } |
16 | 16 | |
17 | 17 | protected function get_dataset_uri() { |
18 | - return trailingslashit( Wordlift_Configuration_Service::get_instance()->get_dataset_uri() ); |
|
18 | + return trailingslashit(Wordlift_Configuration_Service::get_instance()->get_dataset_uri()); |
|
19 | 19 | } |
20 | 20 | |
21 | - protected function is_absolute( $uri ) { |
|
22 | - return 1 === preg_match( '@^https?://@', $uri ); |
|
21 | + protected function is_absolute($uri) { |
|
22 | + return 1 === preg_match('@^https?://@', $uri); |
|
23 | 23 | } |
24 | 24 | |
25 | - protected function is_internal( $uri ) { |
|
25 | + protected function is_internal($uri) { |
|
26 | 26 | $dataset_uri = $this->get_dataset_uri(); |
27 | 27 | |
28 | - return ! empty( $dataset_uri ) && 0 === strpos( $uri, $dataset_uri ); |
|
28 | + return ! empty($dataset_uri) && 0 === strpos($uri, $dataset_uri); |
|
29 | 29 | } |
30 | 30 | |
31 | - protected function make_absolute( $uri ) { |
|
32 | - Assertions::not_empty( $this->get_dataset_uri(), '`dataset_uri` cannot be empty.' ); |
|
31 | + protected function make_absolute($uri) { |
|
32 | + Assertions::not_empty($this->get_dataset_uri(), '`dataset_uri` cannot be empty.'); |
|
33 | 33 | |
34 | - if ( 1 !== preg_match( '@^https?://@', $uri ) ) { |
|
35 | - return $this->get_dataset_uri() . $uri; |
|
34 | + if (1 !== preg_match('@^https?://@', $uri)) { |
|
35 | + return $this->get_dataset_uri().$uri; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | return $uri; |
39 | 39 | } |
40 | 40 | |
41 | - protected function make_relative( $uri ) { |
|
41 | + protected function make_relative($uri) { |
|
42 | 42 | $dataset_uri = $this->get_dataset_uri(); |
43 | - if ( 0 === strpos( $uri, $dataset_uri ) ) { |
|
44 | - return substr( $uri, strlen( $dataset_uri ) ); |
|
43 | + if (0 === strpos($uri, $dataset_uri)) { |
|
44 | + return substr($uri, strlen($dataset_uri)); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | return $uri; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @return string|null |
54 | 54 | */ |
55 | - public function get_about_jsonld( $content_id ) { |
|
55 | + public function get_about_jsonld($content_id) { |
|
56 | 56 | global $wpdb; |
57 | 57 | |
58 | 58 | return $wpdb->get_var( |
@@ -71,25 +71,25 @@ discard block |
||
71 | 71 | * @param Wordpress_Content_Id $content_id |
72 | 72 | * @param string $value |
73 | 73 | */ |
74 | - public function set_about_jsonld( $content_id, $value ) { |
|
74 | + public function set_about_jsonld($content_id, $value) { |
|
75 | 75 | global $wpdb; |
76 | 76 | |
77 | 77 | // Cleanup value. |
78 | - $value = ( is_string( $value ) && strlen( $value ) > 2 ) ? $value : null; |
|
78 | + $value = (is_string($value) && strlen($value) > 2) ? $value : null; |
|
79 | 79 | |
80 | 80 | // This `hack` is necessary to ensure the entity exists in the entities table, but we |
81 | 81 | // should revise how this works really. |
82 | 82 | // |
83 | 83 | // This is currently needed because rel_uri is required in the table. |
84 | - switch ( $content_id->get_type() ) { |
|
84 | + switch ($content_id->get_type()) { |
|
85 | 85 | case Object_Type_Enum::POST: |
86 | - Wordpress_Dataset_Content_Service_Hooks::insert_post( $content_id->get_id() ); |
|
86 | + Wordpress_Dataset_Content_Service_Hooks::insert_post($content_id->get_id()); |
|
87 | 87 | break; |
88 | 88 | case Object_Type_Enum::TERM: |
89 | - Wordpress_Dataset_Content_Service_Hooks::created_term( $content_id->get_id() ); |
|
89 | + Wordpress_Dataset_Content_Service_Hooks::created_term($content_id->get_id()); |
|
90 | 90 | break; |
91 | 91 | case Object_Type_Enum::USER: |
92 | - Wordpress_Dataset_Content_Service_Hooks::user_register( $content_id->get_id() ); |
|
92 | + Wordpress_Dataset_Content_Service_Hooks::user_register($content_id->get_id()); |
|
93 | 93 | break; |
94 | 94 | } |
95 | 95 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * as `null` if we directly pass it to the prepare function(). So its necessary |
100 | 100 | * to make the query conditional based on the $value |
101 | 101 | */ |
102 | - if ( null === $value ) { |
|
102 | + if (null === $value) { |
|
103 | 103 | return $wpdb->query( |
104 | 104 | $wpdb->prepare( |
105 | 105 | " |