@@ -17,14 +17,14 @@ discard block |
||
| 17 | 17 | * @return array |
| 18 | 18 | */ |
| 19 | 19 | function get_options() { |
| 20 | - $options = get_option( 'wetu_importer_settings', array() ); |
|
| 21 | - if ( empty( $options ) ) { |
|
| 20 | + $options = get_option('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['wetu-importer'] ) && ! empty( $temp_options['wetu-importer'] ) ) { |
|
| 23 | + $temp_options = get_option('_lsx-to_settings', false); |
|
| 24 | + if (false !== $temp_options && isset($temp_options['wetu-importer']) && !empty($temp_options['wetu-importer'])) { |
|
| 25 | 25 | $options = $temp_options['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 | |
@@ -39,16 +39,16 @@ discard block |
||
| 39 | 39 | * @param string $post_status |
| 40 | 40 | * @return void |
| 41 | 41 | */ |
| 42 | -function get_post_count( $post_type = '', $post_status = '' ) { |
|
| 42 | +function get_post_count($post_type = '', $post_status = '') { |
|
| 43 | 43 | global $wpdb; |
| 44 | 44 | $count = '0'; |
| 45 | - if ( '' !== $post_type && '' !== $post_status ) { |
|
| 45 | + if ('' !== $post_type && '' !== $post_status) { |
|
| 46 | 46 | $result = $wpdb->get_var(" |
| 47 | 47 | SELECT COUNT(`ID`) |
| 48 | 48 | FROM `{$wpdb->posts}` |
| 49 | 49 | WHERE `post_status` = '{$post_status}' AND `post_type` = '{$post_type}' |
| 50 | 50 | "); |
| 51 | - if ( false !== $result && '' !== $result ) { |
|
| 51 | + if (false !== $result && '' !== $result) { |
|
| 52 | 52 | $count = $result; |
| 53 | 53 | } |
| 54 | 54 | } |
@@ -61,11 +61,11 @@ discard block |
||
| 61 | 61 | * @param string $post_type |
| 62 | 62 | * @return void |
| 63 | 63 | */ |
| 64 | -function get_wetu_queue_count( $post_type = '' ) { |
|
| 64 | +function get_wetu_queue_count($post_type = '') { |
|
| 65 | 65 | $count = '0'; |
| 66 | - $queued_imports = get_option( 'wetu_importer_que', array() ); |
|
| 67 | - if ( isset( $queued_imports[ $post_type ] ) ) { |
|
| 68 | - $count = count( $queued_imports[ $post_type ] ); |
|
| 66 | + $queued_imports = get_option('wetu_importer_que', array()); |
|
| 67 | + if (isset($queued_imports[$post_type])) { |
|
| 68 | + $count = count($queued_imports[$post_type]); |
|
| 69 | 69 | } |
| 70 | 70 | return $count; |
| 71 | 71 | } |
@@ -76,11 +76,11 @@ discard block |
||
| 76 | 76 | * @param string $post_type |
| 77 | 77 | * @return void |
| 78 | 78 | */ |
| 79 | -function get_wetu_tour_count( $post_type = '' ) { |
|
| 79 | +function get_wetu_tour_count($post_type = '') { |
|
| 80 | 80 | $count = '0'; |
| 81 | - $wetu_tours = get_transient( 'lsx_ti_tours', array() ); |
|
| 82 | - if ( ! empty( $wetu_tours ) ) { |
|
| 83 | - $count = count( $wetu_tours ); |
|
| 81 | + $wetu_tours = get_transient('lsx_ti_tours', array()); |
|
| 82 | + if (!empty($wetu_tours)) { |
|
| 83 | + $count = count($wetu_tours); |
|
| 84 | 84 | } |
| 85 | 85 | return $count; |
| 86 | 86 | } |