Passed
Push — master ( 68be65...efef45 )
by Warwick
07:41
created
includes/helpers.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
  * @return array
18 18
  */
19 19
 function get_options() {
20
-	$options = get_option( 'lsx_wetu_importer_settings', array() );
21
-	if ( empty( $options ) ) {
20
+	$options = get_option('lsx_wetu_importer_settings', array());
21
+	if (empty($options)) {
22 22
 		// Check for any previous options.
23
-		$temp_options = get_option( '_lsx-to_settings', false );
24
-		if ( false !== $temp_options && isset( $temp_options['lsx-wetu-importer'] ) && ! empty( $temp_options['lsx-wetu-importer'] ) ) {
23
+		$temp_options = get_option('_lsx-to_settings', false);
24
+		if (false !== $temp_options && isset($temp_options['lsx-wetu-importer']) && !empty($temp_options['lsx-wetu-importer'])) {
25 25
 			$options = $temp_options['lsx-wetu-importer'];
26 26
 		}
27
-		if ( false !== $temp_options && isset( $temp_options['api']['wetu_api_key'] ) && '' !== $temp_options['api']['wetu_api_key'] ) {
27
+		if (false !== $temp_options && isset($temp_options['api']['wetu_api_key']) && '' !== $temp_options['api']['wetu_api_key']) {
28 28
 			$options['api_key'] = $temp_options['api']['wetu_api_key'];
29 29
 		}
30 30
 	}
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
  * @param string $post_status
39 39
  * @return void
40 40
  */
41
-function get_post_count( $post_type = '', $post_status = '' ) {
41
+function get_post_count($post_type = '', $post_status = '') {
42 42
 	global $wpdb;
43 43
 	$count = '0';
44
-	if ( '' !== $post_type && '' !== $post_status ) {
45
-		$result = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(`ID`) FROM $wpdb->posts WHERE `post_status` = '%s' AND `post_type` = '%s'", array( trim( $post_status ), $post_type ) ) );
46
-		if ( false !== $result && '' !== $result ) {
44
+	if ('' !== $post_type && '' !== $post_status) {
45
+		$result = $wpdb->get_var($wpdb->prepare("SELECT COUNT(`ID`) FROM $wpdb->posts WHERE `post_status` = '%s' AND `post_type` = '%s'", array(trim($post_status), $post_type)));
46
+		if (false !== $result && '' !== $result) {
47 47
 			$count = $result;
48 48
 		}
49 49
 	}
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
  * @param string $post_type
57 57
  * @return void
58 58
  */
59
-function get_wetu_queue_count( $post_type = '' ) {
59
+function get_wetu_queue_count($post_type = '') {
60 60
 	$count = '0';
61
-	$queued_imports = get_option( 'lsx_wetu_importer_que', array() );
62
-	if ( isset( $queued_imports[ $post_type ] ) ) {
63
-		$count = count( $queued_imports[ $post_type ] );
61
+	$queued_imports = get_option('lsx_wetu_importer_que', array());
62
+	if (isset($queued_imports[$post_type])) {
63
+		$count = count($queued_imports[$post_type]);
64 64
 	}
65 65
 	return $count;
66 66
 }
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
  * @param string $post_type
72 72
  * @return void
73 73
  */
74
-function get_wetu_tour_count( $post_type = '' ) {
74
+function get_wetu_tour_count($post_type = '') {
75 75
 	$count = '0';
76
-	$wetu_tours = get_transient( 'lsx_ti_tours', array() );
77
-	if ( ! empty( $wetu_tours ) ) {
78
-		$count = count( $wetu_tours );
76
+	$wetu_tours = get_transient('lsx_ti_tours', array());
77
+	if (!empty($wetu_tours)) {
78
+		$count = count($wetu_tours);
79 79
 	}
80 80
 	return $count;
81 81
 }
Please login to merge, or discard this patch.