@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * @package GeoDirectory |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -defined( 'ABSPATH' ) || exit; |
|
| 9 | +defined('ABSPATH') || exit; |
|
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * GeoDir_Privacy_Exporters Class. |
@@ -23,32 +23,32 @@ discard block |
||
| 23 | 23 | * @param int $page Page. |
| 24 | 24 | * @return array An array of personal data in name value pairs |
| 25 | 25 | */ |
| 26 | - public static function post_data_exporter( $email_address, $page ) { |
|
| 27 | - $post_type = GeoDir_Privacy::exporter_post_type(); |
|
| 26 | + public static function post_data_exporter($email_address, $page) { |
|
| 27 | + $post_type = GeoDir_Privacy::exporter_post_type(); |
|
| 28 | 28 | |
| 29 | 29 | $done = false; |
| 30 | 30 | $page = (int) $page; |
| 31 | 31 | $data_to_export = array(); |
| 32 | 32 | |
| 33 | - $posts = self::posts_by_author( $email_address, $post_type, $page ); |
|
| 33 | + $posts = self::posts_by_author($email_address, $post_type, $page); |
|
| 34 | 34 | |
| 35 | - if ( 0 < count( $posts ) ) { |
|
| 36 | - $obj_post_type = get_post_type_object( $post_type ); |
|
| 35 | + if (0 < count($posts)) { |
|
| 36 | + $obj_post_type = get_post_type_object($post_type); |
|
| 37 | 37 | |
| 38 | - foreach ( $posts as $post_ID ) { |
|
| 39 | - $gd_post = geodir_get_post_info( $post_ID ); |
|
| 40 | - if ( empty( $gd_post ) ) { |
|
| 38 | + foreach ($posts as $post_ID) { |
|
| 39 | + $gd_post = geodir_get_post_info($post_ID); |
|
| 40 | + if (empty($gd_post)) { |
|
| 41 | 41 | continue; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $data_to_export[] = array( |
| 45 | - 'group_id' => 'geodirectory-post-' . $post_type, |
|
| 46 | - 'group_label' => __( $obj_post_type->labels->name, 'geodirectory' ), |
|
| 47 | - 'item_id' => 'post-' . $post_ID, |
|
| 48 | - 'data' => self::get_post_personal_data( $gd_post ), |
|
| 45 | + 'group_id' => 'geodirectory-post-'.$post_type, |
|
| 46 | + 'group_label' => __($obj_post_type->labels->name, 'geodirectory'), |
|
| 47 | + 'item_id' => 'post-'.$post_ID, |
|
| 48 | + 'data' => self::get_post_personal_data($gd_post), |
|
| 49 | 49 | ); |
| 50 | 50 | } |
| 51 | - $done = 10 > count( $posts ); |
|
| 51 | + $done = 10 > count($posts); |
|
| 52 | 52 | } else { |
| 53 | 53 | $done = true; |
| 54 | 54 | } |
@@ -66,24 +66,24 @@ discard block |
||
| 66 | 66 | * @param WP_Post $gd_post The post object. |
| 67 | 67 | * @return array |
| 68 | 68 | */ |
| 69 | - protected static function get_post_personal_data( $gd_post ) { |
|
| 69 | + protected static function get_post_personal_data($gd_post) { |
|
| 70 | 70 | $post_categories = array(); |
| 71 | 71 | $post_tags = array(); |
| 72 | 72 | $default_category = ''; |
| 73 | 73 | |
| 74 | - $cat_taxonomy = $gd_post->post_type . 'category'; |
|
| 75 | - $tag_taxonomy = $gd_post->post_type . '_tags'; |
|
| 74 | + $cat_taxonomy = $gd_post->post_type.'category'; |
|
| 75 | + $tag_taxonomy = $gd_post->post_type.'_tags'; |
|
| 76 | 76 | |
| 77 | - $post_terms = wp_get_post_terms( $gd_post->ID, array( $cat_taxonomy, $tag_taxonomy ) ); |
|
| 78 | - if ( ! empty( $post_terms ) && ! is_wp_error( $post_terms ) ) { |
|
| 79 | - foreach ( $post_terms as $term ) { |
|
| 80 | - if ( $term->taxonomy == $cat_taxonomy ) { |
|
| 77 | + $post_terms = wp_get_post_terms($gd_post->ID, array($cat_taxonomy, $tag_taxonomy)); |
|
| 78 | + if (!empty($post_terms) && !is_wp_error($post_terms)) { |
|
| 79 | + foreach ($post_terms as $term) { |
|
| 80 | + if ($term->taxonomy == $cat_taxonomy) { |
|
| 81 | 81 | $post_categories[] = $term->name; |
| 82 | 82 | } else { |
| 83 | 83 | $post_tags[] = $term->name; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - if ( $gd_post->default_category == $term->term_id ) { |
|
| 86 | + if ($gd_post->default_category == $term->term_id) { |
|
| 87 | 87 | $default_category = $term->name; |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -91,189 +91,189 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | $personal_data = array(); |
| 93 | 93 | $personal_data[] = array( |
| 94 | - 'name' => __( 'Post ID', 'geodirectory' ), |
|
| 94 | + 'name' => __('Post ID', 'geodirectory'), |
|
| 95 | 95 | 'value' => $gd_post->ID, |
| 96 | 96 | ); |
| 97 | 97 | $personal_data[] = array( |
| 98 | - 'name' => __( 'Post Title', 'geodirectory' ), |
|
| 98 | + 'name' => __('Post Title', 'geodirectory'), |
|
| 99 | 99 | 'value' => $gd_post->post_title, |
| 100 | 100 | ); |
| 101 | 101 | $personal_data[] = array( |
| 102 | - 'name' => __( 'Post Description', 'geodirectory' ), |
|
| 102 | + 'name' => __('Post Description', 'geodirectory'), |
|
| 103 | 103 | 'value' => $gd_post->post_content, |
| 104 | 104 | ); |
| 105 | 105 | $personal_data[] = array( |
| 106 | - 'name' => __( 'Post Date', 'geodirectory' ), |
|
| 106 | + 'name' => __('Post Date', 'geodirectory'), |
|
| 107 | 107 | 'value' => $gd_post->post_date, |
| 108 | 108 | ); |
| 109 | - if ( ! empty( $gd_post->post_modified ) && $gd_post->post_modified != '0000-00-00 00:00:00' ) { |
|
| 109 | + if (!empty($gd_post->post_modified) && $gd_post->post_modified != '0000-00-00 00:00:00') { |
|
| 110 | 110 | $personal_data[] = array( |
| 111 | - 'name' => __( 'Post Modified Date', 'geodirectory' ), |
|
| 111 | + 'name' => __('Post Modified Date', 'geodirectory'), |
|
| 112 | 112 | 'value' => $gd_post->post_modified, |
| 113 | 113 | ); |
| 114 | 114 | } |
| 115 | 115 | $personal_data[] = array( |
| 116 | - 'name' => __( 'Post Status', 'geodirectory' ), |
|
| 116 | + 'name' => __('Post Status', 'geodirectory'), |
|
| 117 | 117 | 'value' => $gd_post->post_status, |
| 118 | 118 | ); |
| 119 | - if ( ! empty( $gd_post->submit_ip ) ) { |
|
| 119 | + if (!empty($gd_post->submit_ip)) { |
|
| 120 | 120 | $personal_data[] = array( |
| 121 | - 'name' => __( 'Submit IP', 'geodirectory' ), |
|
| 121 | + 'name' => __('Submit IP', 'geodirectory'), |
|
| 122 | 122 | 'value' => $gd_post->submit_ip, |
| 123 | 123 | ); |
| 124 | 124 | } |
| 125 | 125 | $personal_data[] = array( |
| 126 | - 'name' => __( 'Post Categories', 'geodirectory' ), |
|
| 127 | - 'value' => ( ! empty( $post_categories ) ? implode( ', ', $post_categories ) : '' ), |
|
| 126 | + 'name' => __('Post Categories', 'geodirectory'), |
|
| 127 | + 'value' => (!empty($post_categories) ? implode(', ', $post_categories) : ''), |
|
| 128 | 128 | ); |
| 129 | - if ( $default_category ) { |
|
| 129 | + if ($default_category) { |
|
| 130 | 130 | $personal_data[] = array( |
| 131 | - 'name' => __( 'Default Category', 'geodirectory' ), |
|
| 131 | + 'name' => __('Default Category', 'geodirectory'), |
|
| 132 | 132 | 'value' => $default_category, |
| 133 | 133 | ); |
| 134 | 134 | } |
| 135 | - if ( ! empty( $post_tags ) ) { |
|
| 135 | + if (!empty($post_tags)) { |
|
| 136 | 136 | $personal_data[] = array( |
| 137 | - 'name' => __( 'Post Tags', 'geodirectory' ), |
|
| 138 | - 'value' => implode( ', ', $post_tags ), |
|
| 137 | + 'name' => __('Post Tags', 'geodirectory'), |
|
| 138 | + 'value' => implode(', ', $post_tags), |
|
| 139 | 139 | ); |
| 140 | 140 | } |
| 141 | 141 | $personal_data[] = array( |
| 142 | - 'name' => __( 'Post URL', 'geodirectory' ), |
|
| 143 | - 'value' => get_permalink( $gd_post->ID ), |
|
| 142 | + 'name' => __('Post URL', 'geodirectory'), |
|
| 143 | + 'value' => get_permalink($gd_post->ID), |
|
| 144 | 144 | ); |
| 145 | 145 | |
| 146 | 146 | // Post Images |
| 147 | - $post_images = geodir_get_images( $gd_post->ID ); |
|
| 148 | - if ( ! empty( $post_images ) ) { |
|
| 147 | + $post_images = geodir_get_images($gd_post->ID); |
|
| 148 | + if (!empty($post_images)) { |
|
| 149 | 149 | $images = array(); |
| 150 | - foreach ( $post_images as $key => $post_image ) { |
|
| 151 | - if ( ! empty( $post_image->src ) ) { |
|
| 150 | + foreach ($post_images as $key => $post_image) { |
|
| 151 | + if (!empty($post_image->src)) { |
|
| 152 | 152 | $images[] = $post_image->src; |
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - if ( ! empty( $images ) ) { |
|
| 156 | + if (!empty($images)) { |
|
| 157 | 157 | $personal_data[] = array( |
| 158 | - 'name' => __( 'Post Images', 'geodirectory' ), |
|
| 159 | - 'value' => self::parse_files_value( $images ), |
|
| 158 | + 'name' => __('Post Images', 'geodirectory'), |
|
| 159 | + 'value' => self::parse_files_value($images), |
|
| 160 | 160 | ); |
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | // Post Rating |
| 165 | - $post_rating = geodir_get_post_rating( $gd_post->ID ); |
|
| 166 | - if ( $post_rating > 0 ) { |
|
| 167 | - $post_rating = ( is_float( $post_rating) || ( strpos( $post_rating, ".", 1 ) == 1 && strlen( $post_rating ) > 3 ) ) ? number_format( $post_rating, 1, '.', '' ) : $post_rating; |
|
| 165 | + $post_rating = geodir_get_post_rating($gd_post->ID); |
|
| 166 | + if ($post_rating > 0) { |
|
| 167 | + $post_rating = (is_float($post_rating) || (strpos($post_rating, ".", 1) == 1 && strlen($post_rating) > 3)) ? number_format($post_rating, 1, '.', '') : $post_rating; |
|
| 168 | 168 | $personal_data[] = array( |
| 169 | - 'name' => __( 'Post Rating', 'geodirectory' ), |
|
| 170 | - 'value' => $post_rating . ' / 5', |
|
| 169 | + 'name' => __('Post Rating', 'geodirectory'), |
|
| 170 | + 'value' => $post_rating.' / 5', |
|
| 171 | 171 | ); |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | // Post Reviews |
| 175 | - $post_reviews = geodir_get_review_count_total( $gd_post->ID ); |
|
| 176 | - if ( $post_reviews > 0 ) { |
|
| 175 | + $post_reviews = geodir_get_review_count_total($gd_post->ID); |
|
| 176 | + if ($post_reviews > 0) { |
|
| 177 | 177 | $personal_data[] = array( |
| 178 | - 'name' => __( 'Post Reviews', 'geodirectory' ), |
|
| 178 | + 'name' => __('Post Reviews', 'geodirectory'), |
|
| 179 | 179 | 'value' => $post_reviews, |
| 180 | 180 | ); |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - if ( ! empty( $gd_post->is_featured ) ) { |
|
| 183 | + if (!empty($gd_post->is_featured)) { |
|
| 184 | 184 | $personal_data[] = array( |
| 185 | - 'name' => __( 'Post Featured', 'geodirectory' ), |
|
| 186 | - 'value' => __( 'Yes', 'geodirectory' ), |
|
| 185 | + 'name' => __('Post Featured', 'geodirectory'), |
|
| 186 | + 'value' => __('Yes', 'geodirectory'), |
|
| 187 | 187 | ); |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - $custom_fields = geodir_post_custom_fields( $gd_post->package_id, 'all', $gd_post->post_type ); |
|
| 191 | - $post_fields = array_keys( (array) $gd_post ); |
|
| 190 | + $custom_fields = geodir_post_custom_fields($gd_post->package_id, 'all', $gd_post->post_type); |
|
| 191 | + $post_fields = array_keys((array) $gd_post); |
|
| 192 | 192 | |
| 193 | - foreach ( $custom_fields as $key => $field ) { |
|
| 194 | - $field_name = ! empty( $field['htmlvar_name'] ) ? $field['htmlvar_name'] : ''; |
|
| 195 | - if ( empty( $field_name ) ) { |
|
| 193 | + foreach ($custom_fields as $key => $field) { |
|
| 194 | + $field_name = !empty($field['htmlvar_name']) ? $field['htmlvar_name'] : ''; |
|
| 195 | + if (empty($field_name)) { |
|
| 196 | 196 | continue; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - $field = stripslashes_deep( $field ); |
|
| 199 | + $field = stripslashes_deep($field); |
|
| 200 | 200 | |
| 201 | - $extra_fields = ! empty( $field['extra_fields'] ) ? $field['extra_fields'] : array(); |
|
| 201 | + $extra_fields = !empty($field['extra_fields']) ? $field['extra_fields'] : array(); |
|
| 202 | 202 | $data_type = $field['data_type']; |
| 203 | 203 | $field_type = $field['field_type']; |
| 204 | - $field_title = $field['site_title']; |
|
| 205 | - if ( $field_name == 'post' ) { |
|
| 204 | + $field_title = $field['site_title']; |
|
| 205 | + if ($field_name == 'post') { |
|
| 206 | 206 | $field_name = 'post_address'; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - if ( ! in_array( $field_name, $post_fields ) ) { |
|
| 209 | + if (!in_array($field_name, $post_fields)) { |
|
| 210 | 210 | continue; |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | $name = $field_title; |
| 214 | 214 | $value = ''; |
| 215 | - switch ( $field_type ) { |
|
| 215 | + switch ($field_type) { |
|
| 216 | 216 | case 'address': |
| 217 | - $location_allowed = function_exists( 'geodir_cpt_no_location' ) && geodir_cpt_no_location( $gd_post->post_type ) ? false : true; |
|
| 218 | - if ( $location_allowed && ! empty( $gd_post->post_country ) && ! empty( $gd_post->post_region ) && ! empty( $gd_post->post_city ) ) { |
|
| 217 | + $location_allowed = function_exists('geodir_cpt_no_location') && geodir_cpt_no_location($gd_post->post_type) ? false : true; |
|
| 218 | + if ($location_allowed && !empty($gd_post->post_country) && !empty($gd_post->post_region) && !empty($gd_post->post_city)) { |
|
| 219 | 219 | $personal_data[] = array( |
| 220 | - 'name' => __( 'Post Address', 'geodirectory' ), |
|
| 220 | + 'name' => __('Post Address', 'geodirectory'), |
|
| 221 | 221 | 'value' => $gd_post->post_address, |
| 222 | 222 | ); |
| 223 | 223 | $personal_data[] = array( |
| 224 | - 'name' => __( 'Post City', 'geodirectory' ), |
|
| 224 | + 'name' => __('Post City', 'geodirectory'), |
|
| 225 | 225 | 'value' => $gd_post->post_city, |
| 226 | 226 | ); |
| 227 | 227 | $personal_data[] = array( |
| 228 | - 'name' => __( 'Post Region', 'geodirectory' ), |
|
| 228 | + 'name' => __('Post Region', 'geodirectory'), |
|
| 229 | 229 | 'value' => $gd_post->post_region, |
| 230 | 230 | ); |
| 231 | 231 | $personal_data[] = array( |
| 232 | - 'name' => __( 'Post Country', 'geodirectory' ), |
|
| 232 | + 'name' => __('Post Country', 'geodirectory'), |
|
| 233 | 233 | 'value' => $gd_post->post_country, |
| 234 | 234 | ); |
| 235 | 235 | $personal_data[] = array( |
| 236 | - 'name' => __( 'Post Zip', 'geodirectory' ), |
|
| 236 | + 'name' => __('Post Zip', 'geodirectory'), |
|
| 237 | 237 | 'value' => $gd_post->post_zip, |
| 238 | 238 | ); |
| 239 | 239 | $personal_data[] = array( |
| 240 | - 'name' => __( 'Post Latitude', 'geodirectory' ), |
|
| 240 | + 'name' => __('Post Latitude', 'geodirectory'), |
|
| 241 | 241 | 'value' => $gd_post->post_latitude, |
| 242 | 242 | ); |
| 243 | 243 | $personal_data[] = array( |
| 244 | - 'name' => __( 'Post Longitude', 'geodirectory' ), |
|
| 244 | + 'name' => __('Post Longitude', 'geodirectory'), |
|
| 245 | 245 | 'value' => $gd_post->post_longitude, |
| 246 | 246 | ); |
| 247 | - if ( ! empty( $gd_post->post_neighbourhood ) ) { |
|
| 247 | + if (!empty($gd_post->post_neighbourhood)) { |
|
| 248 | 248 | $personal_data[] = array( |
| 249 | - 'name' => __( 'Post Neighbourhood', 'geodirectory' ), |
|
| 249 | + 'name' => __('Post Neighbourhood', 'geodirectory'), |
|
| 250 | 250 | 'value' => $gd_post->post_neighbourhood, |
| 251 | 251 | ); |
| 252 | 252 | } |
| 253 | 253 | } |
| 254 | 254 | break; |
| 255 | 255 | case 'checkbox': |
| 256 | - if ( ! empty( $gd_post->{$field_name} ) ) { |
|
| 257 | - $value = __( 'Yes', 'geodirectory' ); |
|
| 256 | + if (!empty($gd_post->{$field_name} )) { |
|
| 257 | + $value = __('Yes', 'geodirectory'); |
|
| 258 | 258 | } else { |
| 259 | - $value = __( 'No', 'geodirectory' ); |
|
| 259 | + $value = __('No', 'geodirectory'); |
|
| 260 | 260 | } |
| 261 | 261 | break; |
| 262 | 262 | case 'datepicker': |
| 263 | 263 | $value = $gd_post->{$field_name} != '0000-00-00' ? $gd_post->{$field_name} : ''; |
| 264 | 264 | break; |
| 265 | 265 | case 'radio': |
| 266 | - if ( $gd_post->{$field_name} !== '' ) { |
|
| 267 | - if ( $gd_post->{$field_name} == 'f' || $gd_post->{$field_name} == '0') { |
|
| 268 | - $value = __( 'No', 'geodirectory' ); |
|
| 269 | - } else if ( $gd_post->{$field_name} == 't' || $gd_post->{$field_name} == '1') { |
|
| 270 | - $value = __( 'Yes', 'geodirectory' ); |
|
| 266 | + if ($gd_post->{$field_name} !== '') { |
|
| 267 | + if ($gd_post->{$field_name} == 'f' || $gd_post->{$field_name} == '0') { |
|
| 268 | + $value = __('No', 'geodirectory'); |
|
| 269 | + } else if ($gd_post->{$field_name} == 't' || $gd_post->{$field_name} == '1') { |
|
| 270 | + $value = __('Yes', 'geodirectory'); |
|
| 271 | 271 | } else { |
| 272 | - if ( !empty( $field['option_values'] ) ) { |
|
| 273 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep( $field['option_values'] ), true ); |
|
| 274 | - if ( ! empty( $cf_option_values ) ) { |
|
| 275 | - foreach ( $cf_option_values as $cf_option_value ) { |
|
| 276 | - if ( isset( $cf_option_value['value'] ) && $cf_option_value['value'] == $gd_post->{$field_name} ) { |
|
| 272 | + if (!empty($field['option_values'])) { |
|
| 273 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($field['option_values']), true); |
|
| 274 | + if (!empty($cf_option_values)) { |
|
| 275 | + foreach ($cf_option_values as $cf_option_value) { |
|
| 276 | + if (isset($cf_option_value['value']) && $cf_option_value['value'] == $gd_post->{$field_name} ) { |
|
| 277 | 277 | $value = $cf_option_value['label']; |
| 278 | 278 | } |
| 279 | 279 | } |
@@ -283,12 +283,12 @@ discard block |
||
| 283 | 283 | } |
| 284 | 284 | break; |
| 285 | 285 | case 'select': |
| 286 | - $value = __( $gd_post->{$field_name}, 'geodirectory'); |
|
| 287 | - if ( !empty( $field['option_values'] ) ) { |
|
| 288 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep( $field['option_values'] ), true ); |
|
| 289 | - if ( ! empty( $cf_option_values ) ) { |
|
| 290 | - foreach ( $cf_option_values as $cf_option_value ) { |
|
| 291 | - if ( isset( $cf_option_value['value'] ) && $cf_option_value['value'] == $gd_post->{$field_name} ) { |
|
| 286 | + $value = __($gd_post->{$field_name}, 'geodirectory'); |
|
| 287 | + if (!empty($field['option_values'])) { |
|
| 288 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($field['option_values']), true); |
|
| 289 | + if (!empty($cf_option_values)) { |
|
| 290 | + foreach ($cf_option_values as $cf_option_value) { |
|
| 291 | + if (isset($cf_option_value['value']) && $cf_option_value['value'] == $gd_post->{$field_name} ) { |
|
| 292 | 292 | $value = $cf_option_value['label']; |
| 293 | 293 | } |
| 294 | 294 | } |
@@ -296,23 +296,23 @@ discard block |
||
| 296 | 296 | } |
| 297 | 297 | break; |
| 298 | 298 | case 'multiselect': |
| 299 | - $field_values = explode( ',', trim( $gd_post->{$field_name}, "," ) ); |
|
| 300 | - if ( is_array( $field_values ) ) { |
|
| 301 | - $field_values = array_map( 'trim', $field_values ); |
|
| 299 | + $field_values = explode(',', trim($gd_post->{$field_name}, ",")); |
|
| 300 | + if (is_array($field_values)) { |
|
| 301 | + $field_values = array_map('trim', $field_values); |
|
| 302 | 302 | } |
| 303 | 303 | $values = array(); |
| 304 | - if ( ! empty( $field['option_values'] ) ) { |
|
| 305 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep( $field['option_values'] ), true ); |
|
| 304 | + if (!empty($field['option_values'])) { |
|
| 305 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($field['option_values']), true); |
|
| 306 | 306 | |
| 307 | - if ( ! empty( $cf_option_values ) ) { |
|
| 308 | - foreach ( $cf_option_values as $cf_option_value ) { |
|
| 309 | - if ( isset( $cf_option_value['value'] ) && in_array( $cf_option_value['value'], $field_values ) ) { |
|
| 307 | + if (!empty($cf_option_values)) { |
|
| 308 | + foreach ($cf_option_values as $cf_option_value) { |
|
| 309 | + if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) { |
|
| 310 | 310 | $values[] = $cf_option_value['label']; |
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 | } |
| 314 | 314 | } |
| 315 | - $value = ! empty( $values ) ? implode( ', ', $values ) : ''; |
|
| 315 | + $value = !empty($values) ? implode(', ', $values) : ''; |
|
| 316 | 316 | break; |
| 317 | 317 | case 'time': |
| 318 | 318 | $value = $gd_post->{$field_name} != '00:00:00' ? $gd_post->{$field_name} : ''; |
@@ -326,70 +326,70 @@ discard block |
||
| 326 | 326 | $value = $gd_post->{$field_name} ? $gd_post->{$field_name} : ''; |
| 327 | 327 | break; |
| 328 | 328 | case 'file': |
| 329 | - $files = explode( ",", $gd_post->{$field_name} ); |
|
| 330 | - if ( ! empty( $files ) ) { |
|
| 331 | - $allowed_file_types = !empty( $extra_fields['gd_file_types'] ) && is_array( $extra_fields['gd_file_types'] ) && !in_array( "*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : ''; |
|
| 329 | + $files = explode(",", $gd_post->{$field_name} ); |
|
| 330 | + if (!empty($files)) { |
|
| 331 | + $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : ''; |
|
| 332 | 332 | |
| 333 | 333 | $file_urls = array(); |
| 334 | - foreach ( $files as $file ) { |
|
| 335 | - if ( ! empty( $file ) ) { |
|
| 336 | - $image_name_arr = explode( '/', $file ); |
|
| 337 | - $curr_img_dir = $image_name_arr[ count( $image_name_arr ) - 2]; |
|
| 334 | + foreach ($files as $file) { |
|
| 335 | + if (!empty($file)) { |
|
| 336 | + $image_name_arr = explode('/', $file); |
|
| 337 | + $curr_img_dir = $image_name_arr[count($image_name_arr) - 2]; |
|
| 338 | 338 | $filename = end($image_name_arr); |
| 339 | 339 | $img_name_arr = explode('.', $filename); |
| 340 | 340 | |
| 341 | - $arr_file_type = wp_check_filetype( $filename ); |
|
| 342 | - if ( empty( $arr_file_type['ext'] ) || empty( $arr_file_type['type'] ) ) { |
|
| 341 | + $arr_file_type = wp_check_filetype($filename); |
|
| 342 | + if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) { |
|
| 343 | 343 | continue; |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | $uploaded_file_type = $arr_file_type['type']; |
| 347 | 347 | $uploaded_file_ext = $arr_file_type['ext']; |
| 348 | 348 | |
| 349 | - if ( ! empty( $allowed_file_types ) && !in_array( $uploaded_file_ext, $allowed_file_types ) ) { |
|
| 349 | + if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) { |
|
| 350 | 350 | continue; // Invalid file type. |
| 351 | 351 | } |
| 352 | - $image_file_types = array( 'image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon' ); |
|
| 353 | - $audio_file_types = array( 'audio/mpeg', 'audio/ogg', 'audio/mp4', 'audio/vnd.wav', 'audio/basic', 'audio/mid' ); |
|
| 352 | + $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon'); |
|
| 353 | + $audio_file_types = array('audio/mpeg', 'audio/ogg', 'audio/mp4', 'audio/vnd.wav', 'audio/basic', 'audio/mid'); |
|
| 354 | 354 | |
| 355 | 355 | // If the uploaded file is image |
| 356 | - if ( in_array( $uploaded_file_type, $image_file_types ) ) { |
|
| 356 | + if (in_array($uploaded_file_type, $image_file_types)) { |
|
| 357 | 357 | $file_urls[] = $file; |
| 358 | 358 | } |
| 359 | 359 | } |
| 360 | 360 | } |
| 361 | - $value = ! empty( $file_urls ) ? self::parse_files_value( $file_urls ) : ''; |
|
| 361 | + $value = !empty($file_urls) ? self::parse_files_value($file_urls) : ''; |
|
| 362 | 362 | } |
| 363 | 363 | break; |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | - if ( ! empty( $name ) && $value !== '' ) { |
|
| 366 | + if (!empty($name) && $value !== '') { |
|
| 367 | 367 | $personal_data[] = array( |
| 368 | - 'name' => __( $name, 'geodirectory' ), |
|
| 368 | + 'name' => __($name, 'geodirectory'), |
|
| 369 | 369 | 'value' => $value, |
| 370 | 370 | ); |
| 371 | 371 | } |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | - if ( ! empty( $gd_post->geodir_link_business ) && ( $post_type = get_post_type( (int)$gd_post->geodir_link_business ) ) ) { |
|
| 374 | + if (!empty($gd_post->geodir_link_business) && ($post_type = get_post_type((int) $gd_post->geodir_link_business))) { |
|
| 375 | 375 | $personal_data[] = array( |
| 376 | - 'name' => __( 'Link Business Title', 'geodirectory' ), |
|
| 377 | - 'value' => get_the_title( (int)$gd_post->geodir_link_business ), |
|
| 376 | + 'name' => __('Link Business Title', 'geodirectory'), |
|
| 377 | + 'value' => get_the_title((int) $gd_post->geodir_link_business), |
|
| 378 | 378 | ); |
| 379 | 379 | $personal_data[] = array( |
| 380 | - 'name' => __( 'Link Business URL', 'geodirectory' ), |
|
| 381 | - 'value' => get_permalink( (int)$gd_post->geodir_link_business ), |
|
| 380 | + 'name' => __('Link Business URL', 'geodirectory'), |
|
| 381 | + 'value' => get_permalink((int) $gd_post->geodir_link_business), |
|
| 382 | 382 | ); |
| 383 | 383 | } |
| 384 | - if ( defined( 'GEODIR_FRANCHISE_VERSION' ) ) { |
|
| 385 | - if ( ! empty( $gd_post->franchise ) && ( $post_type = get_post_type( (int)$gd_post->franchise ) ) ) { |
|
| 384 | + if (defined('GEODIR_FRANCHISE_VERSION')) { |
|
| 385 | + if (!empty($gd_post->franchise) && ($post_type = get_post_type((int) $gd_post->franchise))) { |
|
| 386 | 386 | $personal_data[] = array( |
| 387 | - 'name' => __( 'Main Listing Title', 'geodirectory' ), |
|
| 388 | - 'value' => get_the_title( (int)$gd_post->franchise ), |
|
| 387 | + 'name' => __('Main Listing Title', 'geodirectory'), |
|
| 388 | + 'value' => get_the_title((int) $gd_post->franchise), |
|
| 389 | 389 | ); |
| 390 | 390 | $personal_data[] = array( |
| 391 | - 'name' => __( 'Main Listing URL', 'geodirectory' ), |
|
| 392 | - 'value' => get_permalink( (int)$gd_post->franchise ), |
|
| 391 | + 'name' => __('Main Listing URL', 'geodirectory'), |
|
| 392 | + 'value' => get_permalink((int) $gd_post->franchise), |
|
| 393 | 393 | ); |
| 394 | 394 | } |
| 395 | 395 | } |
@@ -401,28 +401,28 @@ discard block |
||
| 401 | 401 | * @param array $personal_data Array of name value pairs to expose in the export. |
| 402 | 402 | * @param WP_Post $gd_post The post object. |
| 403 | 403 | */ |
| 404 | - $personal_data = apply_filters( 'geodir_privacy_export_post_personal_data', $personal_data, $gd_post ); |
|
| 404 | + $personal_data = apply_filters('geodir_privacy_export_post_personal_data', $personal_data, $gd_post); |
|
| 405 | 405 | |
| 406 | 406 | return $personal_data; |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | - public static function posts_by_author( $email_address, $post_type, $page ) { |
|
| 410 | - if ( empty( $email_address ) || empty( $post_type ) || empty( $page ) ) { |
|
| 409 | + public static function posts_by_author($email_address, $post_type, $page) { |
|
| 410 | + if (empty($email_address) || empty($post_type) || empty($page)) { |
|
| 411 | 411 | return array(); |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | - $user = get_user_by( 'email', $email_address ); |
|
| 415 | - if ( empty( $user ) ) { |
|
| 414 | + $user = get_user_by('email', $email_address); |
|
| 415 | + if (empty($user)) { |
|
| 416 | 416 | return array(); |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | - $statuses = array_keys( get_post_statuses() ); |
|
| 419 | + $statuses = array_keys(get_post_statuses()); |
|
| 420 | 420 | $skip_statuses = geodir_imex_export_skip_statuses(); |
| 421 | - if ( ! empty( $skip_statuses ) ) { |
|
| 422 | - $statuses = array_diff( $statuses, $skip_statuses ); |
|
| 421 | + if (!empty($skip_statuses)) { |
|
| 422 | + $statuses = array_diff($statuses, $skip_statuses); |
|
| 423 | 423 | } |
| 424 | 424 | |
| 425 | - $query_args = array( |
|
| 425 | + $query_args = array( |
|
| 426 | 426 | 'post_type' => $post_type, |
| 427 | 427 | 'post_status' => $statuses, |
| 428 | 428 | 'fields' => 'ids', |
@@ -433,66 +433,66 @@ discard block |
||
| 433 | 433 | 'order' => 'ASC' |
| 434 | 434 | ); |
| 435 | 435 | |
| 436 | - $query_args = apply_filters( 'geodir_privacy_post_data_exporter_post_query', $query_args, $post_type, $email_address, $page ); |
|
| 436 | + $query_args = apply_filters('geodir_privacy_post_data_exporter_post_query', $query_args, $post_type, $email_address, $page); |
|
| 437 | 437 | |
| 438 | - $posts = get_posts( $query_args ); |
|
| 438 | + $posts = get_posts($query_args); |
|
| 439 | 439 | |
| 440 | - return apply_filters( 'geodir_privacy_post_data_exporter_posts', $posts, $query_args, $post_type, $email_address, $page ); |
|
| 440 | + return apply_filters('geodir_privacy_post_data_exporter_posts', $posts, $query_args, $post_type, $email_address, $page); |
|
| 441 | 441 | } |
| 442 | 442 | |
| 443 | - public static function review_data_exporter( $response, $exporter_index, $email_address, $page, $request_id, $send_as_email, $exporter_key ) { |
|
| 443 | + public static function review_data_exporter($response, $exporter_index, $email_address, $page, $request_id, $send_as_email, $exporter_key) { |
|
| 444 | 444 | global $wpdb; |
| 445 | 445 | |
| 446 | 446 | $exporter_key = GeoDir_Privacy::personal_data_exporter_key(); |
| 447 | 447 | |
| 448 | - if ( $exporter_key == 'wordpress-comments' && ! empty( $response['data'] ) ) { |
|
| 449 | - foreach ( $response['data'] as $key => $item ) { |
|
| 450 | - $comment_id = str_replace( 'comment-', '', $item['item_id'] ); |
|
| 448 | + if ($exporter_key == 'wordpress-comments' && !empty($response['data'])) { |
|
| 449 | + foreach ($response['data'] as $key => $item) { |
|
| 450 | + $comment_id = str_replace('comment-', '', $item['item_id']); |
|
| 451 | 451 | $data = $item['data']; |
| 452 | 452 | |
| 453 | - $review = geodir_get_review( $comment_id ); |
|
| 454 | - if ( ! empty( $review ) ) { |
|
| 455 | - if ( ! empty( $review->overall_rating ) ) { |
|
| 453 | + $review = geodir_get_review($comment_id); |
|
| 454 | + if (!empty($review)) { |
|
| 455 | + if (!empty($review->overall_rating)) { |
|
| 456 | 456 | $data[] = array( |
| 457 | - 'name' => __( 'Rating (Overall)', 'geodirectory' ), |
|
| 458 | - 'value' => (float)$review->overall_rating . ' / 5', |
|
| 457 | + 'name' => __('Rating (Overall)', 'geodirectory'), |
|
| 458 | + 'value' => (float) $review->overall_rating.' / 5', |
|
| 459 | 459 | ); |
| 460 | 460 | } |
| 461 | - if ( ! empty( $review->post_city ) ) { |
|
| 461 | + if (!empty($review->post_city)) { |
|
| 462 | 462 | $data[] = array( |
| 463 | - 'name' => __( 'Review City', 'geodirectory' ), |
|
| 463 | + 'name' => __('Review City', 'geodirectory'), |
|
| 464 | 464 | 'value' => $review->post_city, |
| 465 | 465 | ); |
| 466 | 466 | } |
| 467 | - if ( ! empty( $review->post_region ) ) { |
|
| 467 | + if (!empty($review->post_region)) { |
|
| 468 | 468 | $data[] = array( |
| 469 | - 'name' => __( 'Review Region', 'geodirectory' ), |
|
| 469 | + 'name' => __('Review Region', 'geodirectory'), |
|
| 470 | 470 | 'value' => $review->post_region, |
| 471 | 471 | ); |
| 472 | 472 | } |
| 473 | - if ( ! empty( $review->post_country ) ) { |
|
| 473 | + if (!empty($review->post_country)) { |
|
| 474 | 474 | $data[] = array( |
| 475 | - 'name' => __( 'Review Country', 'geodirectory' ), |
|
| 475 | + 'name' => __('Review Country', 'geodirectory'), |
|
| 476 | 476 | 'value' => $review->post_country, |
| 477 | 477 | ); |
| 478 | 478 | } |
| 479 | - if ( ! empty( $review->post_latitude ) ) { |
|
| 479 | + if (!empty($review->post_latitude)) { |
|
| 480 | 480 | $data[] = array( |
| 481 | - 'name' => __( 'Review Latitude', 'geodirectory' ), |
|
| 481 | + 'name' => __('Review Latitude', 'geodirectory'), |
|
| 482 | 482 | 'value' => $review->post_latitude, |
| 483 | 483 | ); |
| 484 | 484 | } |
| 485 | - if ( ! empty( $review->post_longitude ) ) { |
|
| 485 | + if (!empty($review->post_longitude)) { |
|
| 486 | 486 | $data[] = array( |
| 487 | - 'name' => __( 'Review Longitude', 'geodirectory' ), |
|
| 487 | + 'name' => __('Review Longitude', 'geodirectory'), |
|
| 488 | 488 | 'value' => $review->post_longitude, |
| 489 | 489 | ); |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | - $data = apply_filters( 'geodir_privacy_export_review_data', $data, $review, $email_address ); |
|
| 492 | + $data = apply_filters('geodir_privacy_export_review_data', $data, $review, $email_address); |
|
| 493 | 493 | |
| 494 | - if ( ! empty( $data ) ) { |
|
| 495 | - $response['data'][ $key ]['data'] = $data; |
|
| 494 | + if (!empty($data)) { |
|
| 495 | + $response['data'][$key]['data'] = $data; |
|
| 496 | 496 | } |
| 497 | 497 | } |
| 498 | 498 | } |
@@ -508,36 +508,36 @@ discard block |
||
| 508 | 508 | * @param int $page Page. |
| 509 | 509 | * @return array An array of personal data in name value pairs |
| 510 | 510 | */ |
| 511 | - public static function favorites_data_exporter( $email_address, $page ) { |
|
| 511 | + public static function favorites_data_exporter($email_address, $page) { |
|
| 512 | 512 | $done = true; |
| 513 | 513 | $page = (int) $page; |
| 514 | 514 | $data_to_export = array(); |
| 515 | 515 | |
| 516 | - $items = GeoDir_Privacy::favorites_by_user( $email_address, $page ); |
|
| 516 | + $items = GeoDir_Privacy::favorites_by_user($email_address, $page); |
|
| 517 | 517 | |
| 518 | - if ( 0 < count( $items ) ) { |
|
| 519 | - foreach ( $items as $item ) { |
|
| 520 | - $gd_post = geodir_get_post_info( $item ); |
|
| 521 | - if ( empty( $gd_post ) ) { |
|
| 518 | + if (0 < count($items)) { |
|
| 519 | + foreach ($items as $item) { |
|
| 520 | + $gd_post = geodir_get_post_info($item); |
|
| 521 | + if (empty($gd_post)) { |
|
| 522 | 522 | continue; |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | 525 | $data_to_export[] = array( |
| 526 | 526 | 'group_id' => 'geodirectory-post-favorites', |
| 527 | - 'group_label' => __( 'GeoDirectory Favorite Listings', 'geodirectory' ), |
|
| 528 | - 'item_id' => 'gd-favorite-' . $gd_post->ID, |
|
| 527 | + 'group_label' => __('GeoDirectory Favorite Listings', 'geodirectory'), |
|
| 528 | + 'item_id' => 'gd-favorite-'.$gd_post->ID, |
|
| 529 | 529 | 'data' => array( |
| 530 | 530 | array( |
| 531 | - 'name' => __( 'Post ID', 'geodirectory' ), |
|
| 531 | + 'name' => __('Post ID', 'geodirectory'), |
|
| 532 | 532 | 'value' => $gd_post->ID, |
| 533 | 533 | ), |
| 534 | 534 | array( |
| 535 | - 'name' => __( 'Post Title', 'geodirectory' ), |
|
| 535 | + 'name' => __('Post Title', 'geodirectory'), |
|
| 536 | 536 | 'value' => $gd_post->post_title, |
| 537 | 537 | ), |
| 538 | 538 | array( |
| 539 | - 'name' => __( 'Post URL', 'geodirectory' ), |
|
| 540 | - 'value' => get_permalink( $gd_post->ID ), |
|
| 539 | + 'name' => __('Post URL', 'geodirectory'), |
|
| 540 | + 'value' => get_permalink($gd_post->ID), |
|
| 541 | 541 | ) |
| 542 | 542 | ), |
| 543 | 543 | ); |
@@ -550,27 +550,27 @@ discard block |
||
| 550 | 550 | ); |
| 551 | 551 | } |
| 552 | 552 | |
| 553 | - public static function parse_files_value( $files ) { |
|
| 554 | - if ( empty( $files ) ) { |
|
| 553 | + public static function parse_files_value($files) { |
|
| 554 | + if (empty($files)) { |
|
| 555 | 555 | return ''; |
| 556 | 556 | } |
| 557 | 557 | |
| 558 | - if ( ! is_array( $files ) ) { |
|
| 558 | + if (!is_array($files)) { |
|
| 559 | 559 | return $files; |
| 560 | 560 | } |
| 561 | 561 | |
| 562 | - if ( count( $files ) == 1 ) { |
|
| 562 | + if (count($files) == 1) { |
|
| 563 | 563 | return $files[0]; |
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | $links = array(); |
| 567 | - foreach ( $files as $file ) { |
|
| 568 | - if ( false === strpos( $file, ' ' ) && ( 0 === strpos( $file, 'http://' ) || 0 === strpos( $file, 'https://' ) ) ) { |
|
| 569 | - $file = '<a href="' . esc_url( $file ) . '">' . esc_html( $file ) . '</a>'; |
|
| 567 | + foreach ($files as $file) { |
|
| 568 | + if (false === strpos($file, ' ') && (0 === strpos($file, 'http://') || 0 === strpos($file, 'https://'))) { |
|
| 569 | + $file = '<a href="'.esc_url($file).'">'.esc_html($file).'</a>'; |
|
| 570 | 570 | } |
| 571 | 571 | $links[] = $file; |
| 572 | 572 | } |
| 573 | - $links = ! empty( $links ) ? implode( ' <br> ', $links ) : ''; |
|
| 573 | + $links = !empty($links) ? implode(' <br> ', $links) : ''; |
|
| 574 | 574 | |
| 575 | 575 | return $links; |
| 576 | 576 | } |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | /* ON TEMPLATE INCLUDE */ |
| 137 | 137 | ///////////////////////// |
| 138 | 138 | |
| 139 | -add_filter('template_include', 'geodir_template_loader',9);
|
|
| 139 | +add_filter('template_include', 'geodir_template_loader', 9);
|
|
| 140 | 140 | |
| 141 | 141 | ///////////////////////// |
| 142 | 142 | /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */ |
@@ -176,9 +176,9 @@ discard block |
||
| 176 | 176 | /* WP REVIEW COUNT ACTIONS */ |
| 177 | 177 | //////////////////////// |
| 178 | 178 | |
| 179 | -add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100,1);
|
|
| 179 | +add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100, 1);
|
|
| 180 | 180 | //add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100);
|
| 181 | -add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3);
|
|
| 181 | +add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3);
|
|
| 182 | 182 | //add_action('created_term', 'geodir_term_review_count_force_update', 100);
|
| 183 | 183 | add_action('edited_term', 'geodir_term_review_count_force_update', 100);
|
| 184 | 184 | add_action('delete_term', 'geodir_term_review_count_force_update', 100);
|
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | function geodir_unset_prev_theme_nav_location($newname) |
| 225 | 225 | {
|
| 226 | - $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
|
|
| 226 | + $geodir_theme_location = get_option('geodir_theme_location_nav_'.$newname);
|
|
| 227 | 227 | if ($geodir_theme_location) {
|
| 228 | 228 | update_option('geodir_theme_location_nav', $geodir_theme_location);
|
| 229 | 229 | } else {
|
@@ -258,13 +258,13 @@ discard block |
||
| 258 | 258 | include_once('geodirectory-functions/listing_filters.php');
|
| 259 | 259 | |
| 260 | 260 | // Theme My Login compatibility fix |
| 261 | - if ( isset( $_REQUEST['geodir_search'] ) && class_exists( 'Theme_My_Login' ) ) {
|
|
| 262 | - remove_action( 'pre_get_posts', array( Theme_My_Login::get_object(), 'pre_get_posts' ) ); |
|
| 261 | + if (isset($_REQUEST['geodir_search']) && class_exists('Theme_My_Login')) {
|
|
| 262 | + remove_action('pre_get_posts', array(Theme_My_Login::get_object(), 'pre_get_posts'));
|
|
| 263 | 263 | } |
| 264 | 264 | |
| 265 | - if ( isset( $_REQUEST['geodir_search'] ) ) {
|
|
| 266 | - add_filter( 'geodir_filter_widget_listings_fields', 'geodir_search_widget_location_filter_fields', 100, 3 ); |
|
| 267 | - add_filter( 'geodir_filter_widget_listings_orderby', 'geodir_search_widget_location_filter_orderby', 100, 3 ); |
|
| 265 | + if (isset($_REQUEST['geodir_search'])) {
|
|
| 266 | + add_filter('geodir_filter_widget_listings_fields', 'geodir_search_widget_location_filter_fields', 100, 3);
|
|
| 267 | + add_filter('geodir_filter_widget_listings_orderby', 'geodir_search_widget_location_filter_orderby', 100, 3);
|
|
| 268 | 268 | } |
| 269 | 269 | } |
| 270 | 270 | |
@@ -331,8 +331,8 @@ discard block |
||
| 331 | 331 | |
| 332 | 332 | /////// GEO DIRECOTORY CUSTOM HOOKS /// |
| 333 | 333 | |
| 334 | -add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
|
|
| 335 | -add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
|
|
| 334 | +add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
|
|
| 335 | +add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
|
|
| 336 | 336 | |
| 337 | 337 | // Detail page sidebar content |
| 338 | 338 | add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1);
|
@@ -432,8 +432,8 @@ discard block |
||
| 432 | 432 | do_action('geodir_after_social_sharing_buttons');
|
| 433 | 433 | $content_html = ob_get_clean(); |
| 434 | 434 | if (trim($content_html) != '') |
| 435 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>'; |
|
| 436 | - if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
|
|
| 435 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">'.$content_html.'</div>'; |
|
| 436 | + if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) {
|
|
| 437 | 437 | /** |
| 438 | 438 | * Filter the geodir_social_sharing_buttons() function content. |
| 439 | 439 | * |
@@ -473,12 +473,12 @@ discard block |
||
| 473 | 473 | $post_id = $post->ID; |
| 474 | 474 | |
| 475 | 475 | if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
| 476 | - $post_id = (int)$_REQUEST['pid']; |
|
| 476 | + $post_id = (int) $_REQUEST['pid']; |
|
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | $postlink = get_permalink(geodir_add_listing_page_id()); |
| 480 | 480 | $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
|
| 481 | - echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
|
|
| 481 | + echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="'.esc_url($editlink).'">'.__('Edit this Post', 'geodirectory').'</a></p>';
|
|
| 482 | 482 | } |
| 483 | 483 | }// end of if, if its a preview or not |
| 484 | 484 | /** |
@@ -489,8 +489,8 @@ discard block |
||
| 489 | 489 | do_action('geodir_after_edit_post_link');
|
| 490 | 490 | $content_html = ob_get_clean(); |
| 491 | 491 | if (trim($content_html) != '') |
| 492 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>'; |
|
| 493 | - if ((int)get_option('geodir_disable_user_links_section') != 1) {
|
|
| 492 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">'.$content_html.'</div>'; |
|
| 493 | + if ((int) get_option('geodir_disable_user_links_section') != 1) {
|
|
| 494 | 494 | /** |
| 495 | 495 | * Filter the geodir_edit_post_link() function content. |
| 496 | 496 | * |
@@ -511,11 +511,11 @@ discard block |
||
| 511 | 511 | */ |
| 512 | 512 | function geodir_detail_page_google_analytics() |
| 513 | 513 | {
|
| 514 | - if ( ! get_option( 'geodir_ga_stats' ) ) {
|
|
| 514 | + if (!get_option('geodir_ga_stats')) {
|
|
| 515 | 515 | return; |
| 516 | 516 | } |
| 517 | - global $post,$preview; |
|
| 518 | - if($preview){return '';}
|
|
| 517 | + global $post, $preview; |
|
| 518 | + if ($preview) {return ''; }
|
|
| 519 | 519 | $package_info = array(); |
| 520 | 520 | $package_info = geodir_post_package_info($package_info, $post); |
| 521 | 521 | |
@@ -547,14 +547,14 @@ discard block |
||
| 547 | 547 | $hide_refresh = get_option('geodir_ga_auto_refresh');
|
| 548 | 548 | |
| 549 | 549 | $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0; |
| 550 | - if (is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
|
|
| 550 | + if (is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id() == $post->post_author || current_user_can('manage_options'))) {
|
|
| 551 | 551 | $page_url = urlencode($_SERVER['REQUEST_URI']); |
| 552 | 552 | ?> |
| 553 | 553 | <script type="text/javascript"> |
| 554 | 554 | var gd_gaTimeOut; |
| 555 | - var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
|
|
| 556 | - var gd_gaHideRefresh = <?php echo (int)$hide_refresh;?>; |
|
| 557 | - var gd_gaAutoRefresh = <?php echo $auto_refresh;?>; |
|
| 555 | + var gd_gaTime = parseInt('<?php echo $refresh_time; ?>');
|
|
| 556 | + var gd_gaHideRefresh = <?php echo (int) $hide_refresh; ?>; |
|
| 557 | + var gd_gaAutoRefresh = <?php echo $auto_refresh; ?>; |
|
| 558 | 558 | ga_data1 = false; |
| 559 | 559 | ga_data2 = false; |
| 560 | 560 | ga_data3 = false; |
@@ -695,7 +695,7 @@ discard block |
||
| 695 | 695 | } |
| 696 | 696 | |
| 697 | 697 | function gdga_noResults() {
|
| 698 | - jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>');
|
|
| 698 | + jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>');
|
|
| 699 | 699 | jQuery('#gdga-legend-container').html('');
|
| 700 | 700 | } |
| 701 | 701 | |
@@ -727,18 +727,18 @@ discard block |
||
| 727 | 727 | var data2 = results[1].rows.map(function(row) { return +row[2]; });
|
| 728 | 728 | //var labelsN = results[0].rows.map(function(row) { return +row[1]; });
|
| 729 | 729 | |
| 730 | - var labels = ['<?php _e('Jan', 'geodirectory');?>',
|
|
| 731 | - '<?php _e('Feb', 'geodirectory');?>',
|
|
| 732 | - '<?php _e('Mar', 'geodirectory');?>',
|
|
| 733 | - '<?php _e('Apr', 'geodirectory');?>',
|
|
| 734 | - '<?php _e('May', 'geodirectory');?>',
|
|
| 735 | - '<?php _e('Jun', 'geodirectory');?>',
|
|
| 736 | - '<?php _e('Jul', 'geodirectory');?>',
|
|
| 737 | - '<?php _e('Aug', 'geodirectory');?>',
|
|
| 738 | - '<?php _e('Sep', 'geodirectory');?>',
|
|
| 739 | - '<?php _e('Oct', 'geodirectory');?>',
|
|
| 740 | - '<?php _e('Nov', 'geodirectory');?>',
|
|
| 741 | - '<?php _e('Dec', 'geodirectory');?>'];
|
|
| 730 | + var labels = ['<?php _e('Jan', 'geodirectory'); ?>',
|
|
| 731 | + '<?php _e('Feb', 'geodirectory'); ?>',
|
|
| 732 | + '<?php _e('Mar', 'geodirectory'); ?>',
|
|
| 733 | + '<?php _e('Apr', 'geodirectory'); ?>',
|
|
| 734 | + '<?php _e('May', 'geodirectory'); ?>',
|
|
| 735 | + '<?php _e('Jun', 'geodirectory'); ?>',
|
|
| 736 | + '<?php _e('Jul', 'geodirectory'); ?>',
|
|
| 737 | + '<?php _e('Aug', 'geodirectory'); ?>',
|
|
| 738 | + '<?php _e('Sep', 'geodirectory'); ?>',
|
|
| 739 | + '<?php _e('Oct', 'geodirectory'); ?>',
|
|
| 740 | + '<?php _e('Nov', 'geodirectory'); ?>',
|
|
| 741 | + '<?php _e('Dec', 'geodirectory'); ?>'];
|
|
| 742 | 742 | |
| 743 | 743 | // Ensure the data arrays are at least as long as the labels array. |
| 744 | 744 | // Chart.js bar charts don't (yet) accept sparse datasets. |
@@ -751,13 +751,13 @@ discard block |
||
| 751 | 751 | labels : labels, |
| 752 | 752 | datasets : [ |
| 753 | 753 | {
|
| 754 | - label: '<?php _e('Last Year', 'geodirectory');?>',
|
|
| 754 | + label: '<?php _e('Last Year', 'geodirectory'); ?>',
|
|
| 755 | 755 | fillColor : "rgba(220,220,220,0.5)", |
| 756 | 756 | strokeColor : "rgba(220,220,220,1)", |
| 757 | 757 | data : data2 |
| 758 | 758 | }, |
| 759 | 759 | {
|
| 760 | - label: '<?php _e('This Year', 'geodirectory');?>',
|
|
| 760 | + label: '<?php _e('This Year', 'geodirectory'); ?>',
|
|
| 761 | 761 | fillColor : "rgba(151,187,205,0.5)", |
| 762 | 762 | strokeColor : "rgba(151,187,205,1)", |
| 763 | 763 | data : data1 |
@@ -802,30 +802,30 @@ discard block |
||
| 802 | 802 | |
| 803 | 803 | <?php |
| 804 | 804 | // Here we list the shorthand days of the week so it can be used in translation. |
| 805 | - __("Mon",'geodirectory');
|
|
| 806 | - __("Tue",'geodirectory');
|
|
| 807 | - __("Wed",'geodirectory');
|
|
| 808 | - __("Thu",'geodirectory');
|
|
| 809 | - __("Fri",'geodirectory');
|
|
| 810 | - __("Sat",'geodirectory');
|
|
| 811 | - __("Sun",'geodirectory');
|
|
| 805 | + __("Mon", 'geodirectory');
|
|
| 806 | + __("Tue", 'geodirectory');
|
|
| 807 | + __("Wed", 'geodirectory');
|
|
| 808 | + __("Thu", 'geodirectory');
|
|
| 809 | + __("Fri", 'geodirectory');
|
|
| 810 | + __("Sat", 'geodirectory');
|
|
| 811 | + __("Sun", 'geodirectory');
|
|
| 812 | 812 | ?> |
| 813 | 813 | |
| 814 | 814 | labels = [ |
| 815 | - "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
|
|
| 816 | - "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>",
|
|
| 817 | - "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>",
|
|
| 818 | - "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>",
|
|
| 819 | - "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>",
|
|
| 820 | - "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>",
|
|
| 821 | - "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>"
|
|
| 815 | + "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>",
|
|
| 816 | + "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>",
|
|
| 817 | + "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>",
|
|
| 818 | + "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>",
|
|
| 819 | + "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>",
|
|
| 820 | + "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>",
|
|
| 821 | + "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>"
|
|
| 822 | 822 | ]; |
| 823 | 823 | |
| 824 | 824 | var data = {
|
| 825 | 825 | labels : labels, |
| 826 | 826 | datasets : [ |
| 827 | 827 | {
|
| 828 | - label: '<?php _e('Last Week', 'geodirectory');?>',
|
|
| 828 | + label: '<?php _e('Last Week', 'geodirectory'); ?>',
|
|
| 829 | 829 | fillColor : "rgba(220,220,220,0.5)", |
| 830 | 830 | strokeColor : "rgba(220,220,220,1)", |
| 831 | 831 | pointColor : "rgba(220,220,220,1)", |
@@ -833,7 +833,7 @@ discard block |
||
| 833 | 833 | data : data2 |
| 834 | 834 | }, |
| 835 | 835 | {
|
| 836 | - label: '<?php _e('This Week', 'geodirectory');?>',
|
|
| 836 | + label: '<?php _e('This Week', 'geodirectory'); ?>',
|
|
| 837 | 837 | fillColor : "rgba(151,187,205,0.5)", |
| 838 | 838 | strokeColor : "rgba(151,187,205,1)", |
| 839 | 839 | pointColor : "rgba(151,187,205,1)", |
@@ -1040,18 +1040,18 @@ discard block |
||
| 1040 | 1040 | </style> |
| 1041 | 1041 | <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script> |
| 1042 | 1042 | <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script> |
| 1043 | - <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory');?></button>
|
|
| 1043 | + <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory'); ?></button>
|
|
| 1044 | 1044 | <span id="ga_stats" class="gdga-analytics-box" style="display:none"> |
| 1045 | - <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div>
|
|
| 1045 | + <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div>
|
|
| 1046 | 1046 | <div id="gd-active-users-container"> |
| 1047 | - <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory');?>"></i><?php _e("Active Users:", 'geodirectory');?>
|
|
| 1047 | + <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory'); ?>"></i><?php _e("Active Users:", 'geodirectory'); ?>
|
|
| 1048 | 1048 | <b class="gd-ActiveUsers-value">0</b> |
| 1049 | 1049 | </div> |
| 1050 | 1050 | </div> |
| 1051 | 1051 | <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;"> |
| 1052 | - <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option>
|
|
| 1053 | - <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option>
|
|
| 1054 | - <option value="country"><?php _e("Top Countries", 'geodirectory');?></option>
|
|
| 1052 | + <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option>
|
|
| 1053 | + <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option>
|
|
| 1054 | + <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option>
|
|
| 1055 | 1055 | </select> |
| 1056 | 1056 | <div class="Chartjs-figure" id="gdga-chart-container"></div> |
| 1057 | 1057 | <ol class="Chartjs-legend" id="gdga-legend-container"></ol> |
@@ -1067,8 +1067,8 @@ discard block |
||
| 1067 | 1067 | do_action('geodir_after_google_analytics');
|
| 1068 | 1068 | $content_html = ob_get_clean(); |
| 1069 | 1069 | if (trim($content_html) != '') |
| 1070 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>'; |
|
| 1071 | - if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
|
|
| 1070 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">'.$content_html.'</div>'; |
|
| 1071 | + if ((int) get_option('geodir_disable_google_analytics_section') != 1) {
|
|
| 1072 | 1072 | /** |
| 1073 | 1073 | * Filter the geodir_edit_post_link() function content. |
| 1074 | 1074 | * |
@@ -1094,7 +1094,7 @@ discard block |
||
| 1094 | 1094 | {
|
| 1095 | 1095 | global $post, $preview, $post_images; |
| 1096 | 1096 | |
| 1097 | - if (!empty($post->ID) && geodir_cpt_has_rating_disabled((int)$post->ID)) {
|
|
| 1097 | + if (!empty($post->ID) && geodir_cpt_has_rating_disabled((int) $post->ID)) {
|
|
| 1098 | 1098 | return; |
| 1099 | 1099 | } |
| 1100 | 1100 | ob_start(); // Start buffering; |
@@ -1129,10 +1129,10 @@ discard block |
||
| 1129 | 1129 | |
| 1130 | 1130 | $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
|
| 1131 | 1131 | |
| 1132 | - $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
|
|
| 1132 | + $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="'.$post_avgratings.'">'.$post_avgratings.'</span> / <span itemprop="best" content="5">5</span> '.__("based on", 'geodirectory').' </span><span class="count" itemprop="count" content="'.$comment_count.'">'.$comment_count.' '.$reviews_text.'</span><br />';
|
|
| 1133 | 1133 | |
| 1134 | 1134 | $html .= '<span class="item">'; |
| 1135 | - $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>'; |
|
| 1135 | + $html .= '<span class="fn" itemprop="itemreviewed">'.$post->post_title.'</span>'; |
|
| 1136 | 1136 | |
| 1137 | 1137 | if ($post_images) {
|
| 1138 | 1138 | foreach ($post_images as $img) {
|
@@ -1142,7 +1142,7 @@ discard block |
||
| 1142 | 1142 | } |
| 1143 | 1143 | |
| 1144 | 1144 | if (isset($post_img) && $post_img) {
|
| 1145 | - $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />'; |
|
| 1145 | + $html .= '<br /><img src="'.$post_img.'" class="photo" alt="'.esc_attr($post->post_title).'" itemprop="photo" content="'.$post_img.'" class="photo" />'; |
|
| 1146 | 1146 | } |
| 1147 | 1147 | |
| 1148 | 1148 | $html .= '</span>'; |
@@ -1169,9 +1169,9 @@ discard block |
||
| 1169 | 1169 | do_action('geodir_after_detail_page_review_rating');
|
| 1170 | 1170 | $content_html = ob_get_clean(); |
| 1171 | 1171 | if (trim($content_html) != '') {
|
| 1172 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>'; |
|
| 1172 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">'.$content_html.'</div>'; |
|
| 1173 | 1173 | } |
| 1174 | - if ((int)get_option('geodir_disable_rating_info_section') != 1) {
|
|
| 1174 | + if ((int) get_option('geodir_disable_rating_info_section') != 1) {
|
|
| 1175 | 1175 | /** |
| 1176 | 1176 | * Filter the geodir_detail_page_review_rating() function content. |
| 1177 | 1177 | * |
@@ -1210,8 +1210,8 @@ discard block |
||
| 1210 | 1210 | |
| 1211 | 1211 | $content_html = ob_get_clean(); |
| 1212 | 1212 | if (trim($content_html) != '') |
| 1213 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>'; |
|
| 1214 | - if ((int)get_option('geodir_disable_listing_info_section') != 1) {
|
|
| 1213 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">'.$content_html.'</div>'; |
|
| 1214 | + if ((int) get_option('geodir_disable_listing_info_section') != 1) {
|
|
| 1215 | 1215 | /** |
| 1216 | 1216 | * Filter the output html for function geodir_detail_page_more_info(). |
| 1217 | 1217 | * |
@@ -1312,7 +1312,7 @@ discard block |
||
| 1312 | 1312 | 'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
|
| 1313 | 1313 | 'geodir_txt_form_wait' => __('Wait...', 'geodirectory'),
|
| 1314 | 1314 | 'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
|
| 1315 | - 'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
|
|
| 1315 | + 'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
|
|
| 1316 | 1316 | 'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
|
| 1317 | 1317 | 'multirating' => defined('GEODIRREVIEWRATING_VERSION') && get_option('geodir_reviewrating_enable_rating') ? true : false,
|
| 1318 | 1318 | 'geodir_map_name' => geodir_map_name(), |
@@ -1342,10 +1342,10 @@ discard block |
||
| 1342 | 1342 | foreach ($arr_alert_msg as $key => $value) {
|
| 1343 | 1343 | if (!is_scalar($value)) |
| 1344 | 1344 | continue; |
| 1345 | - $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8'); |
|
| 1345 | + $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8'); |
|
| 1346 | 1346 | } |
| 1347 | 1347 | |
| 1348 | - $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';'; |
|
| 1348 | + $script = "var geodir_all_js_msg = ".json_encode($arr_alert_msg).';'; |
|
| 1349 | 1349 | echo '<script>'; |
| 1350 | 1350 | echo $script; |
| 1351 | 1351 | echo '</script>'; |
@@ -1435,7 +1435,7 @@ discard block |
||
| 1435 | 1435 | $geodir_old_sidebars = get_option('geodir_sidebars');
|
| 1436 | 1436 | if (is_array($geodir_old_sidebars)) {
|
| 1437 | 1437 | foreach ($geodir_old_sidebars as $key => $val) {
|
| 1438 | - if(0 === strpos($key, 'geodir_'))// if gd widget |
|
| 1438 | + if (0 === strpos($key, 'geodir_'))// if gd widget |
|
| 1439 | 1439 | {
|
| 1440 | 1440 | $sidebars_widgets[$key] = $geodir_old_sidebars[$key]; |
| 1441 | 1441 | } |
@@ -1514,7 +1514,7 @@ discard block |
||
| 1514 | 1514 | global $post; |
| 1515 | 1515 | $term_condition = ''; |
| 1516 | 1516 | if (isset($_REQUEST['backandedit'])) {
|
| 1517 | - $post = (object)$gd_session->get('listing');
|
|
| 1517 | + $post = (object) $gd_session->get('listing');
|
|
| 1518 | 1518 | $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : ''; |
| 1519 | 1519 | } |
| 1520 | 1520 | |
@@ -1528,7 +1528,7 @@ discard block |
||
| 1528 | 1528 | echo 'checked="checked"'; |
| 1529 | 1529 | } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition" |
| 1530 | 1530 | class="geodir_textfield" value="1" |
| 1531 | - style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
|
|
| 1531 | + style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if ($terms_page) { echo get_permalink($terms_page); }?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
|
|
| 1532 | 1532 | </span> |
| 1533 | 1533 | </div> |
| 1534 | 1534 | <span class="geodir_message_error"><?php if (isset($required_msg)) {
|
@@ -1568,7 +1568,7 @@ discard block |
||
| 1568 | 1568 | /** This action is documented in geodirectory_template_actions.php */ |
| 1569 | 1569 | $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
|
| 1570 | 1570 | |
| 1571 | - if (!($desc_limit === '' || (int)$desc_limit > 0)) {
|
|
| 1571 | + if (!($desc_limit === '' || (int) $desc_limit > 0)) {
|
|
| 1572 | 1572 | $is_display = false; |
| 1573 | 1573 | } |
| 1574 | 1574 | } |
@@ -1616,16 +1616,16 @@ discard block |
||
| 1616 | 1616 | global $wpdb, $plugin_prefix; |
| 1617 | 1617 | |
| 1618 | 1618 | // Remove unused virtual page |
| 1619 | - $listings_page_id = (int)get_option('geodir_listing_page');
|
|
| 1619 | + $listings_page_id = (int) get_option('geodir_listing_page');
|
|
| 1620 | 1620 | if ($listings_page_id) {
|
| 1621 | - $wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
|
|
| 1621 | + $wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->posts." WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
|
|
| 1622 | 1622 | delete_option('geodir_listing_page');
|
| 1623 | 1623 | } |
| 1624 | 1624 | |
| 1625 | 1625 | if (!get_option('geodir_changes_in_custom_fields_table')) {
|
| 1626 | 1626 | $wpdb->query( |
| 1627 | 1627 | $wpdb->prepare( |
| 1628 | - "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
| 1628 | + "UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
| 1629 | 1629 | array('1', '1', 'admin')
|
| 1630 | 1630 | ) |
| 1631 | 1631 | ); |
@@ -1633,9 +1633,9 @@ discard block |
||
| 1633 | 1633 | |
| 1634 | 1634 | /* --- terms meta value set --- */ |
| 1635 | 1635 | |
| 1636 | - update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
|
|
| 1636 | + update_option('geodir_default_marker_icon', geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png');
|
|
| 1637 | 1637 | |
| 1638 | - $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
|
|
| 1638 | + $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."options WHERE option_name LIKE %s", array('%tax_meta_%')));
|
|
| 1639 | 1639 | |
| 1640 | 1640 | if (!empty($options_data)) {
|
| 1641 | 1641 | |
@@ -1643,7 +1643,7 @@ discard block |
||
| 1643 | 1643 | |
| 1644 | 1644 | $option_val = str_replace('tax_meta_', '', $optobj->option_name);
|
| 1645 | 1645 | |
| 1646 | - $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
|
|
| 1646 | + $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM ".$wpdb->prefix."term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
|
|
| 1647 | 1647 | |
| 1648 | 1648 | if (!empty($taxonomies_data)) {
|
| 1649 | 1649 | |
@@ -1652,17 +1652,17 @@ discard block |
||
| 1652 | 1652 | $taxObject = get_taxonomy($taxobj->taxonomy); |
| 1653 | 1653 | $post_type = $taxObject->object_type[0]; |
| 1654 | 1654 | |
| 1655 | - $opt_value = 'tax_meta_' . $post_type . '_' . $option_val; |
|
| 1655 | + $opt_value = 'tax_meta_'.$post_type.'_'.$option_val; |
|
| 1656 | 1656 | |
| 1657 | - $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
|
|
| 1657 | + $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM ".$wpdb->prefix."options WHERE option_name=%s", array('tax_meta_'.$option_val)));
|
|
| 1658 | 1658 | |
| 1659 | 1659 | if ($duplicate_data) {
|
| 1660 | 1660 | |
| 1661 | - $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
|
|
| 1661 | + $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
|
|
| 1662 | 1662 | |
| 1663 | 1663 | } else {
|
| 1664 | 1664 | |
| 1665 | - $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
|
|
| 1665 | + $wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
|
|
| 1666 | 1666 | |
| 1667 | 1667 | } |
| 1668 | 1668 | |
@@ -1696,14 +1696,14 @@ discard block |
||
| 1696 | 1696 | |
| 1697 | 1697 | global $wpdb, $table_prefix; |
| 1698 | 1698 | |
| 1699 | - $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
|
|
| 1699 | + $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($slug)));
|
|
| 1700 | 1700 | |
| 1701 | 1701 | if ($slug_exists) {
|
| 1702 | 1702 | |
| 1703 | 1703 | $suffix = 1; |
| 1704 | 1704 | do {
|
| 1705 | - $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
| 1706 | - $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
|
|
| 1705 | + $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix"; |
|
| 1706 | + $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($alt_location_name)));
|
|
| 1707 | 1707 | $suffix++; |
| 1708 | 1708 | } while ($location_slug_check && $suffix < 100); |
| 1709 | 1709 | |
@@ -1757,7 +1757,7 @@ discard block |
||
| 1757 | 1757 | |
| 1758 | 1758 | $suffix = 1; |
| 1759 | 1759 | do {
|
| 1760 | - $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
| 1760 | + $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix"; |
|
| 1761 | 1761 | |
| 1762 | 1762 | /** This action is documented in geodirectory_hooks_actions.php */ |
| 1763 | 1763 | $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
|
@@ -1769,7 +1769,7 @@ discard block |
||
| 1769 | 1769 | |
| 1770 | 1770 | //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
|
| 1771 | 1771 | |
| 1772 | - $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
|
|
| 1772 | + $wpdb->query($wpdb->prepare("UPDATE ".$table_prefix."terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
|
|
| 1773 | 1773 | |
| 1774 | 1774 | } |
| 1775 | 1775 | |
@@ -1778,18 +1778,18 @@ discard block |
||
| 1778 | 1778 | $post_type = !empty($taxonomy_obj) ? $taxonomy_obj->object_type[0] : NULL; |
| 1779 | 1779 | |
| 1780 | 1780 | $post_types = geodir_get_posttypes(); |
| 1781 | - if ($post_type && in_array($post_type, $post_types) && $post_type . '_tags' == $taxonomy) {
|
|
| 1782 | - $posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM " . $wpdb->term_relationships . " WHERE term_taxonomy_id = %d", array($tt_id)));
|
|
| 1781 | + if ($post_type && in_array($post_type, $post_types) && $post_type.'_tags' == $taxonomy) {
|
|
| 1782 | + $posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM ".$wpdb->term_relationships." WHERE term_taxonomy_id = %d", array($tt_id)));
|
|
| 1783 | 1783 | |
| 1784 | 1784 | if (!empty($posts_obj)) {
|
| 1785 | 1785 | foreach ($posts_obj as $post_obj) {
|
| 1786 | 1786 | $post_id = $post_obj->object_id; |
| 1787 | 1787 | |
| 1788 | - $raw_tags = wp_get_object_terms($post_id, $post_type . '_tags', array('fields' => 'names'));
|
|
| 1788 | + $raw_tags = wp_get_object_terms($post_id, $post_type.'_tags', array('fields' => 'names'));
|
|
| 1789 | 1789 | $post_tags = !empty($raw_tags) ? implode(',', $raw_tags) : '';
|
| 1790 | 1790 | |
| 1791 | - $listing_table = $plugin_prefix . $post_type . '_detail'; |
|
| 1792 | - $wpdb->query($wpdb->prepare("UPDATE " . $listing_table . " SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
|
|
| 1791 | + $listing_table = $plugin_prefix.$post_type.'_detail'; |
|
| 1792 | + $wpdb->query($wpdb->prepare("UPDATE ".$listing_table." SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
|
|
| 1793 | 1793 | } |
| 1794 | 1794 | } |
| 1795 | 1795 | } |
@@ -1823,7 +1823,7 @@ discard block |
||
| 1823 | 1823 | if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug) |
| 1824 | 1824 | return $slug_exists = true; |
| 1825 | 1825 | |
| 1826 | - if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
|
|
| 1826 | + if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
|
|
| 1827 | 1827 | return $slug_exists = true; |
| 1828 | 1828 | |
| 1829 | 1829 | return $slug_exists; |
@@ -1864,43 +1864,43 @@ discard block |
||
| 1864 | 1864 | |
| 1865 | 1865 | |
| 1866 | 1866 | $gd_page = ''; |
| 1867 | - if(geodir_is_page('home')){
|
|
| 1867 | + if (geodir_is_page('home')) {
|
|
| 1868 | 1868 | $gd_page = 'home'; |
| 1869 | 1869 | $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
|
| 1870 | 1870 | } |
| 1871 | - elseif(geodir_is_page('detail')){
|
|
| 1871 | + elseif (geodir_is_page('detail')) {
|
|
| 1872 | 1872 | $gd_page = 'detail'; |
| 1873 | 1873 | $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
|
| 1874 | 1874 | } |
| 1875 | - elseif(geodir_is_page('pt')){
|
|
| 1875 | + elseif (geodir_is_page('pt')) {
|
|
| 1876 | 1876 | $gd_page = 'pt'; |
| 1877 | 1877 | $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
|
| 1878 | 1878 | } |
| 1879 | - elseif(geodir_is_page('listing')){
|
|
| 1879 | + elseif (geodir_is_page('listing')) {
|
|
| 1880 | 1880 | $gd_page = 'listing'; |
| 1881 | 1881 | $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
|
| 1882 | 1882 | } |
| 1883 | - elseif(geodir_is_page('location')){
|
|
| 1883 | + elseif (geodir_is_page('location')) {
|
|
| 1884 | 1884 | $gd_page = 'location'; |
| 1885 | 1885 | $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
|
| 1886 | 1886 | } |
| 1887 | - elseif(geodir_is_page('search')){
|
|
| 1887 | + elseif (geodir_is_page('search')) {
|
|
| 1888 | 1888 | $gd_page = 'search'; |
| 1889 | 1889 | $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
|
| 1890 | 1890 | } |
| 1891 | - elseif(geodir_is_page('add-listing')){
|
|
| 1891 | + elseif (geodir_is_page('add-listing')) {
|
|
| 1892 | 1892 | $gd_page = 'add-listing'; |
| 1893 | 1893 | $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
|
| 1894 | 1894 | } |
| 1895 | - elseif(geodir_is_page('author')){
|
|
| 1895 | + elseif (geodir_is_page('author')) {
|
|
| 1896 | 1896 | $gd_page = 'author'; |
| 1897 | 1897 | $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
|
| 1898 | 1898 | } |
| 1899 | - elseif(geodir_is_page('login')){
|
|
| 1899 | + elseif (geodir_is_page('login')) {
|
|
| 1900 | 1900 | $gd_page = 'login'; |
| 1901 | 1901 | $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
|
| 1902 | 1902 | } |
| 1903 | - elseif(geodir_is_page('listing-success')){
|
|
| 1903 | + elseif (geodir_is_page('listing-success')) {
|
|
| 1904 | 1904 | $gd_page = 'listing-success'; |
| 1905 | 1905 | $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
|
| 1906 | 1906 | } |
@@ -1932,12 +1932,12 @@ discard block |
||
| 1932 | 1932 | |
| 1933 | 1933 | if (!get_option('geodir_set_post_attachments')) {
|
| 1934 | 1934 | |
| 1935 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 1936 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
| 1935 | + require_once(ABSPATH.'wp-admin/includes/image.php'); |
|
| 1936 | + require_once(ABSPATH.'wp-admin/includes/file.php'); |
|
| 1937 | 1937 | |
| 1938 | 1938 | $all_postypes = geodir_get_posttypes(); |
| 1939 | 1939 | |
| 1940 | - foreach($all_postypes as $post_type){
|
|
| 1940 | + foreach ($all_postypes as $post_type) {
|
|
| 1941 | 1941 | $args = array( |
| 1942 | 1942 | 'posts_per_page' => -1, |
| 1943 | 1943 | 'post_type' => $post_type, |
@@ -2031,7 +2031,7 @@ discard block |
||
| 2031 | 2031 | {
|
| 2032 | 2032 | $user_id = get_current_user_id(); |
| 2033 | 2033 | |
| 2034 | - if(!$user_id){return $post;}
|
|
| 2034 | + if (!$user_id) {return $post; }
|
|
| 2035 | 2035 | |
| 2036 | 2036 | $gd_post_types = geodir_get_posttypes(); |
| 2037 | 2037 | |
@@ -2140,7 +2140,7 @@ discard block |
||
| 2140 | 2140 | |
| 2141 | 2141 | if (array_key_exists('post_video', $tabs_arr)) {
|
| 2142 | 2142 | |
| 2143 | - $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
|
|
| 2143 | + $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
|
|
| 2144 | 2144 | |
| 2145 | 2145 | if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '') |
| 2146 | 2146 | $tabs_arr['post_video']['heading_text'] = $field_title; |
@@ -2148,7 +2148,7 @@ discard block |
||
| 2148 | 2148 | |
| 2149 | 2149 | if (array_key_exists('special_offers', $tabs_arr)) {
|
| 2150 | 2150 | |
| 2151 | - $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
|
|
| 2151 | + $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
|
|
| 2152 | 2152 | |
| 2153 | 2153 | if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '') |
| 2154 | 2154 | $tabs_arr['special_offers']['heading_text'] = $field_title; |
@@ -2169,7 +2169,7 @@ discard block |
||
| 2169 | 2169 | */ |
| 2170 | 2170 | function geodir_remove_template_redirect_actions() |
| 2171 | 2171 | {
|
| 2172 | - if (geodir_is_page('login')){
|
|
| 2172 | + if (geodir_is_page('login')) {
|
|
| 2173 | 2173 | remove_all_actions('template_redirect');
|
| 2174 | 2174 | remove_action('init', 'avia_modify_front', 10);
|
| 2175 | 2175 | } |
@@ -2216,25 +2216,25 @@ discard block |
||
| 2216 | 2216 | $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : ''; |
| 2217 | 2217 | |
| 2218 | 2218 | $wpdb->query( |
| 2219 | - $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
|
|
| 2219 | + $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d AND file=%s ",
|
|
| 2220 | 2220 | array($post_id, $split_img_file_path) |
| 2221 | 2221 | ) |
| 2222 | 2222 | ); |
| 2223 | 2223 | |
| 2224 | 2224 | $attachment_data = $wpdb->get_row( |
| 2225 | - $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
|
|
| 2225 | + $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=%d",
|
|
| 2226 | 2226 | array($post_id) |
| 2227 | 2227 | ) |
| 2228 | 2228 | ); |
| 2229 | 2229 | |
| 2230 | 2230 | if (!empty($attachment_data)) {
|
| 2231 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
|
|
| 2231 | + $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
|
|
| 2232 | 2232 | } |
| 2233 | 2233 | |
| 2234 | 2234 | |
| 2235 | - $table_name = $plugin_prefix . $post_type . '_detail'; |
|
| 2235 | + $table_name = $plugin_prefix.$post_type.'_detail'; |
|
| 2236 | 2236 | |
| 2237 | - $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
|
|
| 2237 | + $wpdb->query("UPDATE ".$table_name." SET featured_image='' WHERE post_id =".$post_id);
|
|
| 2238 | 2238 | |
| 2239 | 2239 | geodir_set_wp_featured_image($post_id); |
| 2240 | 2240 | |
@@ -2262,9 +2262,9 @@ discard block |
||
| 2262 | 2262 | |
| 2263 | 2263 | foreach ($all_postypes as $posttype) {
|
| 2264 | 2264 | |
| 2265 | - $tablename = $plugin_prefix . $posttype . '_detail'; |
|
| 2265 | + $tablename = $plugin_prefix.$posttype.'_detail'; |
|
| 2266 | 2266 | |
| 2267 | - $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
|
|
| 2267 | + $get_post_data = $wpdb->get_results("SELECT post_id FROM ".$tablename);
|
|
| 2268 | 2268 | |
| 2269 | 2269 | if (!empty($get_post_data)) {
|
| 2270 | 2270 | |
@@ -2272,7 +2272,7 @@ discard block |
||
| 2272 | 2272 | |
| 2273 | 2273 | $post_id = $data->post_id; |
| 2274 | 2274 | |
| 2275 | - $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
|
|
| 2275 | + $attachment_data = $wpdb->get_results("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =".$post_id." AND file!=''");
|
|
| 2276 | 2276 | |
| 2277 | 2277 | if (!empty($attachment_data)) {
|
| 2278 | 2278 | |
@@ -2289,22 +2289,22 @@ discard block |
||
| 2289 | 2289 | |
| 2290 | 2290 | $file_name = $file_info['basename']; |
| 2291 | 2291 | |
| 2292 | - $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name; |
|
| 2292 | + $img_arr['path'] = $uploads_path.$sub_dir.'/'.$file_name; |
|
| 2293 | 2293 | |
| 2294 | 2294 | if (!file_exists($img_arr['path'])) {
|
| 2295 | 2295 | |
| 2296 | - $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
|
|
| 2296 | + $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ID=".$attach->ID);
|
|
| 2297 | 2297 | |
| 2298 | 2298 | } |
| 2299 | 2299 | |
| 2300 | 2300 | } |
| 2301 | 2301 | |
| 2302 | - $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
|
|
| 2302 | + $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=".$post_id." GROUP BY post_id");
|
|
| 2303 | 2303 | |
| 2304 | 2304 | if (!empty($attachment_data)) {
|
| 2305 | 2305 | |
| 2306 | 2306 | if ($attachment_data->ID) |
| 2307 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
|
|
| 2307 | + $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
|
|
| 2308 | 2308 | |
| 2309 | 2309 | } else {
|
| 2310 | 2310 | |
@@ -2318,7 +2318,7 @@ discard block |
||
| 2318 | 2318 | |
| 2319 | 2319 | } |
| 2320 | 2320 | |
| 2321 | - $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
|
|
| 2321 | + $wpdb->query("UPDATE ".$tablename." SET featured_image='' WHERE post_id =".$post_id);
|
|
| 2322 | 2322 | |
| 2323 | 2323 | geodir_set_wp_featured_image($post_id); |
| 2324 | 2324 | |
@@ -2347,7 +2347,7 @@ discard block |
||
| 2347 | 2347 | {
|
| 2348 | 2348 | |
| 2349 | 2349 | if (!get_option('geodir_default_rating_star_icon')) {
|
| 2350 | - update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
|
|
| 2350 | + update_option('geodir_default_rating_star_icon', geodir_plugin_url().'/geodirectory-assets/images/stars.png');
|
|
| 2351 | 2351 | } |
| 2352 | 2352 | |
| 2353 | 2353 | } |
@@ -2367,7 +2367,7 @@ discard block |
||
| 2367 | 2367 | function geodir_user_post_listing_count($user_id = 0) |
| 2368 | 2368 | {
|
| 2369 | 2369 | global $wpdb, $plugin_prefix, $current_user; |
| 2370 | - if(!$user_id){
|
|
| 2370 | + if (!$user_id) {
|
|
| 2371 | 2371 | $user_id = $current_user->ID; |
| 2372 | 2372 | } |
| 2373 | 2373 | |
@@ -2376,7 +2376,7 @@ discard block |
||
| 2376 | 2376 | $user_listing = array(); |
| 2377 | 2377 | if ($user_id && is_array($all_posts) && !empty($all_posts)) {
|
| 2378 | 2378 | foreach ($all_posts as $ptype) {
|
| 2379 | - $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' OR post_status = 'pending' )");
|
|
| 2379 | + $total_posts = $wpdb->get_var("SELECT count( ID ) FROM ".$wpdb->prefix."posts WHERE post_author=".$user_id." AND post_type='".$ptype."' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' OR post_status = 'pending' )");
|
|
| 2380 | 2380 | |
| 2381 | 2381 | if ($total_posts > 0) {
|
| 2382 | 2382 | $user_listing[$ptype] = $total_posts; |
@@ -2417,19 +2417,19 @@ discard block |
||
| 2417 | 2417 | |
| 2418 | 2418 | $custom_fields = geodir_post_custom_fields($post_package_id, 'all', $post_type, $fields_location); |
| 2419 | 2419 | //remove video and special offers if it is already set to show |
| 2420 | - if(isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']){
|
|
| 2420 | + if (isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']) {
|
|
| 2421 | 2421 | $unset_video = true; |
| 2422 | 2422 | } |
| 2423 | 2423 | |
| 2424 | - if(isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']){
|
|
| 2424 | + if (isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']) {
|
|
| 2425 | 2425 | $unset_special_offers = true; |
| 2426 | 2426 | } |
| 2427 | - if(isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)){
|
|
| 2428 | - foreach($custom_fields as $key => $custom_field){
|
|
| 2429 | - if($custom_field['name']=='geodir_video' && isset($unset_video)){
|
|
| 2427 | + if (isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)) {
|
|
| 2428 | + foreach ($custom_fields as $key => $custom_field) {
|
|
| 2429 | + if ($custom_field['name'] == 'geodir_video' && isset($unset_video)) {
|
|
| 2430 | 2430 | unset($custom_fields[$key]); |
| 2431 | 2431 | } |
| 2432 | - if($custom_field['name']=='geodir_special_offers' && isset($unset_special_offers)){
|
|
| 2432 | + if ($custom_field['name'] == 'geodir_special_offers' && isset($unset_special_offers)) {
|
|
| 2433 | 2433 | unset($custom_fields[$key]); |
| 2434 | 2434 | } |
| 2435 | 2435 | } |
@@ -2446,7 +2446,7 @@ discard block |
||
| 2446 | 2446 | $post->{$field_name} = $_REQUEST[$field_name];
|
| 2447 | 2447 | } |
| 2448 | 2448 | |
| 2449 | - if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
|
|
| 2449 | + if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file', 'address', 'taxonomy'))) {
|
|
| 2450 | 2450 | if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
|
| 2451 | 2451 | continue; |
| 2452 | 2452 | } |
@@ -2479,7 +2479,7 @@ discard block |
||
| 2479 | 2479 | $post->{$field_name} = $_REQUEST[$field_name];
|
| 2480 | 2480 | } |
| 2481 | 2481 | |
| 2482 | - if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
|
|
| 2482 | + if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset' || $field['type'] == 'address') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file', 'address', 'taxonomy'))) {
|
|
| 2483 | 2483 | $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title']; |
| 2484 | 2484 | $site_title = trim($field['site_title']); |
| 2485 | 2485 | $type = $field; |
@@ -2495,21 +2495,21 @@ discard block |
||
| 2495 | 2495 | $variables_array['label'] = __($type['site_title'], 'geodirectory'); |
| 2496 | 2496 | $variables_array['value'] = isset($post->{$type['htmlvar_name']}) ? $post->{$type['htmlvar_name']} : '';
|
| 2497 | 2497 | |
| 2498 | - }else{
|
|
| 2498 | + } else {
|
|
| 2499 | 2499 | $i = 0; |
| 2500 | 2500 | $fieldset_count++; |
| 2501 | 2501 | $field_set_start = 1; |
| 2502 | - $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count; |
|
| 2502 | + $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_'.$fieldset_count; |
|
| 2503 | 2503 | $fieldset_arr[$fieldset_count]['label'] = $label; |
| 2504 | 2504 | } |
| 2505 | 2505 | |
| 2506 | 2506 | |
| 2507 | - if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
|
|
| 2507 | + if (isset($type['extra_fields'])) {$extra_fields = $type['extra_fields']; }
|
|
| 2508 | 2508 | $type = stripslashes_deep($type); // strip slashes |
| 2509 | - if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
|
|
| 2509 | + if (isset($type['extra_fields'])) {$type['extra_fields'] = $extra_fields; }
|
|
| 2510 | 2510 | $html = ''; |
| 2511 | 2511 | $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : ''; |
| 2512 | - if($html_var=='post'){$html_var='post_address';}
|
|
| 2512 | + if ($html_var == 'post') {$html_var = 'post_address'; }
|
|
| 2513 | 2513 | $field_icon = geodir_field_icon_proccess($type); |
| 2514 | 2514 | $filed_type = $type['type']; |
| 2515 | 2515 | |
@@ -2522,7 +2522,7 @@ discard block |
||
| 2522 | 2522 | * @param string $fields_location The location the field is to be show. |
| 2523 | 2523 | * @param array $type The array of field values. |
| 2524 | 2524 | */ |
| 2525 | - $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
|
|
| 2525 | + $html = apply_filters("geodir_custom_field_output_{$filed_type}", $html, $fields_location, $type);
|
|
| 2526 | 2526 | |
| 2527 | 2527 | |
| 2528 | 2528 | /** |
@@ -2568,7 +2568,7 @@ discard block |
||
| 2568 | 2568 | * @param string $htmlvar_name The field HTML var name. |
| 2569 | 2569 | */ |
| 2570 | 2570 | 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
|
| 2571 | - 'tab_content' => '<div class="geodir-company_info field-group xxx">' . $fieldset_html . '</div>' |
|
| 2571 | + 'tab_content' => '<div class="geodir-company_info field-group xxx">'.$fieldset_html.'</div>' |
|
| 2572 | 2572 | ); |
| 2573 | 2573 | } |
| 2574 | 2574 | } else {
|
@@ -2632,7 +2632,7 @@ discard block |
||
| 2632 | 2632 | } |
| 2633 | 2633 | $status .= ")</strong>"; |
| 2634 | 2634 | |
| 2635 | - $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
|
|
| 2635 | + $html = '<span class="geodir-post-status">'.$status_icon.' <font class="geodir-status-label">'.__('Status: ', 'geodirectory').'</font>'.$status.'</span>';
|
|
| 2636 | 2636 | } |
| 2637 | 2637 | } |
| 2638 | 2638 | |
@@ -2701,7 +2701,7 @@ discard block |
||
| 2701 | 2701 | * @return array Modified class array. |
| 2702 | 2702 | */ |
| 2703 | 2703 | function geodir_body_class_active_map($classes = array()) {
|
| 2704 | - $classes[] = 'gd-map-' . geodir_map_name(); |
|
| 2704 | + $classes[] = 'gd-map-'.geodir_map_name(); |
|
| 2705 | 2705 | |
| 2706 | 2706 | return $classes; |
| 2707 | 2707 | } |
@@ -2716,7 +2716,7 @@ discard block |
||
| 2716 | 2716 | * @return string Modified class string. |
| 2717 | 2717 | */ |
| 2718 | 2718 | function geodir_admin_body_class_active_map($class = '') {
|
| 2719 | - $class .= ' gd-map-' . geodir_map_name(); |
|
| 2719 | + $class .= ' gd-map-'.geodir_map_name(); |
|
| 2720 | 2720 | |
| 2721 | 2721 | return $class; |
| 2722 | 2722 | } |
@@ -2736,7 +2736,7 @@ discard block |
||
| 2736 | 2736 | * @return array Translation texts. |
| 2737 | 2737 | */ |
| 2738 | 2738 | function geodir_load_gd_options_text_translation($translation_texts = array()) {
|
| 2739 | - $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array(); |
|
| 2739 | + $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array(); |
|
| 2740 | 2740 | |
| 2741 | 2741 | $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
|
| 2742 | 2742 | |
@@ -2802,17 +2802,17 @@ discard block |
||
| 2802 | 2802 | * @param array $args The array of menu arguments. |
| 2803 | 2803 | * @return array The modified arguments. |
| 2804 | 2804 | */ |
| 2805 | -function geodir_add_nav_menu_class( $args ) |
|
| 2805 | +function geodir_add_nav_menu_class($args) |
|
| 2806 | 2806 | {
|
| 2807 | 2807 | |
| 2808 | - if(isset($args['menu_class'])){
|
|
| 2808 | + if (isset($args['menu_class'])) {
|
|
| 2809 | 2809 | $args['menu_class'] = $args['menu_class']." gd-menu-z"; |
| 2810 | 2810 | } |
| 2811 | 2811 | |
| 2812 | 2812 | return $args; |
| 2813 | 2813 | } |
| 2814 | 2814 | |
| 2815 | -add_filter( 'wp_nav_menu_args', 'geodir_add_nav_menu_class' ); |
|
| 2815 | +add_filter('wp_nav_menu_args', 'geodir_add_nav_menu_class');
|
|
| 2816 | 2816 | |
| 2817 | 2817 | /** |
| 2818 | 2818 | * Filters WordPress locale ID. |
@@ -2852,10 +2852,10 @@ discard block |
||
| 2852 | 2852 | } |
| 2853 | 2853 | |
| 2854 | 2854 | add_action('geodir_after_save_listing', 'geodir_wpml_duplicate_listing', 100, 2);
|
| 2855 | - add_action( 'geodir_edit_post_link_html', 'geodir_wpml_frontend_duplicate_listing', 0, 1 ); |
|
| 2856 | - add_action( 'geodir_after_search_form', 'geodir_wpml_add_language_input_field' ); |
|
| 2855 | + add_action('geodir_edit_post_link_html', 'geodir_wpml_frontend_duplicate_listing', 0, 1);
|
|
| 2856 | + add_action('geodir_after_search_form', 'geodir_wpml_add_language_input_field');
|
|
| 2857 | 2857 | if (is_admin()) {
|
| 2858 | - add_filter( 'geodir_design_settings', 'geodir_wpml_duplicate_settings', 10, 1 ); |
|
| 2858 | + add_filter('geodir_design_settings', 'geodir_wpml_duplicate_settings', 10, 1);
|
|
| 2859 | 2859 | } |
| 2860 | 2860 | } |
| 2861 | 2861 | } |
@@ -2884,7 +2884,7 @@ discard block |
||
| 2884 | 2884 | } |
| 2885 | 2885 | |
| 2886 | 2886 | if (!empty($keep_vars)) {
|
| 2887 | - foreach ( $languages as $code => $url) {
|
|
| 2887 | + foreach ($languages as $code => $url) {
|
|
| 2888 | 2888 | $filter_url = $url['url']; |
| 2889 | 2889 | |
| 2890 | 2890 | foreach ($keep_vars as $var) {
|
@@ -2903,7 +2903,7 @@ discard block |
||
| 2903 | 2903 | |
| 2904 | 2904 | return $languages; |
| 2905 | 2905 | } |
| 2906 | -add_filter( 'icl_ls_languages', 'geodir_wpml_filter_ls_languages', 11, 1 ); |
|
| 2906 | +add_filter('icl_ls_languages', 'geodir_wpml_filter_ls_languages', 11, 1);
|
|
| 2907 | 2907 | |
| 2908 | 2908 | /** |
| 2909 | 2909 | * Remove Yoast SEO hook if disabled on GD pages. |
@@ -2911,18 +2911,18 @@ discard block |
||
| 2911 | 2911 | * @since 1.6.18 |
| 2912 | 2912 | * |
| 2913 | 2913 | */ |
| 2914 | -function geodir_remove_yoast_seo_metas(){
|
|
| 2915 | - if ( class_exists( 'WPSEO_Frontend' ) && geodir_is_geodir_page() && geodir_disable_yoast_seo_metas() ) {
|
|
| 2914 | +function geodir_remove_yoast_seo_metas() {
|
|
| 2915 | + if (class_exists('WPSEO_Frontend') && geodir_is_geodir_page() && geodir_disable_yoast_seo_metas()) {
|
|
| 2916 | 2916 | $wpseo = WPSEO_Frontend::get_instance(); |
| 2917 | 2917 | |
| 2918 | - remove_action( 'wp_head', array( $wpseo, 'metadesc' ), 6 ); |
|
| 2919 | - remove_action( 'wp_head', array( $wpseo, 'metakeywords' ), 11 ); |
|
| 2920 | - remove_filter( 'pre_get_document_title', array( $wpseo, 'title' ), 15 ); |
|
| 2921 | - remove_filter( 'wp_title', array( $wpseo, 'title' ), 15, 3 ); |
|
| 2922 | - remove_filter( 'thematic_doctitle', array( $wpseo, 'title' ), 15 ); |
|
| 2923 | - remove_filter( 'woo_title', array( $wpseo, 'fix_woo_title' ), 99 ); |
|
| 2918 | + remove_action('wp_head', array($wpseo, 'metadesc'), 6);
|
|
| 2919 | + remove_action('wp_head', array($wpseo, 'metakeywords'), 11);
|
|
| 2920 | + remove_filter('pre_get_document_title', array($wpseo, 'title'), 15);
|
|
| 2921 | + remove_filter('wp_title', array($wpseo, 'title'), 15, 3);
|
|
| 2922 | + remove_filter('thematic_doctitle', array($wpseo, 'title'), 15);
|
|
| 2923 | + remove_filter('woo_title', array($wpseo, 'fix_woo_title'), 99);
|
|
| 2924 | 2924 | |
| 2925 | - remove_action( 'template_redirect', 'wpseo_frontend_head_init', 999 ); |
|
| 2925 | + remove_action('template_redirect', 'wpseo_frontend_head_init', 999);
|
|
| 2926 | 2926 | } |
| 2927 | 2927 | } |
| 2928 | 2928 | |
@@ -2937,22 +2937,22 @@ discard block |
||
| 2937 | 2937 | * |
| 2938 | 2938 | */ |
| 2939 | 2939 | function geodir_wpml_ajax_set_guest_lang() {
|
| 2940 | - if ( geodir_is_wpml() && wpml_is_ajax() && !is_user_logged_in() ) {
|
|
| 2941 | - if ( empty( $_GET['lang'] ) && !( !empty( $_SERVER['REQUEST_URI'] ) && preg_match( '@\.(css|js|png|jpg|gif|jpeg|bmp)@i', basename( preg_replace( '@\?.*$@', '', $_SERVER['REQUEST_URI'] ) ) ) ) ) {
|
|
| 2940 | + if (geodir_is_wpml() && wpml_is_ajax() && !is_user_logged_in()) {
|
|
| 2941 | + if (empty($_GET['lang']) && !(!empty($_SERVER['REQUEST_URI']) && preg_match('@\.(css|js|png|jpg|gif|jpeg|bmp)@i', basename(preg_replace('@\?.*$@', '', $_SERVER['REQUEST_URI']))))) {
|
|
| 2942 | 2942 | global $sitepress; |
| 2943 | 2943 | |
| 2944 | 2944 | $referer = wp_get_referer(); |
| 2945 | 2945 | |
| 2946 | 2946 | $current_lang = $sitepress->get_current_language(); |
| 2947 | - $referrer_lang = $sitepress->get_language_from_url( $referer ); |
|
| 2947 | + $referrer_lang = $sitepress->get_language_from_url($referer); |
|
| 2948 | 2948 | |
| 2949 | - if ( $referrer_lang && $current_lang != $referrer_lang ) {
|
|
| 2949 | + if ($referrer_lang && $current_lang != $referrer_lang) {
|
|
| 2950 | 2950 | $_GET['lang'] = $referrer_lang; |
| 2951 | 2951 | } |
| 2952 | 2952 | } |
| 2953 | 2953 | } |
| 2954 | 2954 | } |
| 2955 | -add_action( 'plugins_loaded', 'geodir_wpml_ajax_set_guest_lang', -1 ); |
|
| 2955 | +add_action('plugins_loaded', 'geodir_wpml_ajax_set_guest_lang', -1);
|
|
| 2956 | 2956 | |
| 2957 | 2957 | /** |
| 2958 | 2958 | * Change country slug czech-republic to czechia and redirect. |
@@ -2973,18 +2973,18 @@ discard block |
||
| 2973 | 2973 | } |
| 2974 | 2974 | |
| 2975 | 2975 | $redirect = false; |
| 2976 | - if (strpos($current_url, '/' . $search . '/') !== false) {
|
|
| 2976 | + if (strpos($current_url, '/'.$search.'/') !== false) {
|
|
| 2977 | 2977 | $redirect = true; |
| 2978 | - $current_url = preg_replace('/\/' . $search . '\//', '/' . $replace . '/', $current_url, 1);
|
|
| 2978 | + $current_url = preg_replace('/\/'.$search.'\//', '/'.$replace.'/', $current_url, 1);
|
|
| 2979 | 2979 | } |
| 2980 | 2980 | |
| 2981 | 2981 | if ($has_slash != "/") {
|
| 2982 | 2982 | $current_url = trim($current_url, '/'); |
| 2983 | 2983 | } |
| 2984 | 2984 | |
| 2985 | - if (strpos($current_url, 'gd_country=' . $search) !== false) {
|
|
| 2985 | + if (strpos($current_url, 'gd_country='.$search) !== false) {
|
|
| 2986 | 2986 | $redirect = true; |
| 2987 | - $current_url = str_replace('gd_country=' . $search, 'gd_country=' . $replace, $current_url);
|
|
| 2987 | + $current_url = str_replace('gd_country='.$search, 'gd_country='.$replace, $current_url);
|
|
| 2988 | 2988 | } |
| 2989 | 2989 | |
| 2990 | 2990 | if ($redirect) {
|
@@ -3010,10 +3010,10 @@ discard block |
||
| 3010 | 3010 | * @param int $post_parent Post parent ID |
| 3011 | 3011 | * @param string $original_slug The original post slug. |
| 3012 | 3012 | */ |
| 3013 | -function geodir_check_post_to_term_slug( $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ) {
|
|
| 3013 | +function geodir_check_post_to_term_slug($slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug) {
|
|
| 3014 | 3014 | global $wpdb, $sitepress; |
| 3015 | 3015 | |
| 3016 | - if ( $post_type && strpos( $post_type, 'gd_' ) === 0 ) {
|
|
| 3016 | + if ($post_type && strpos($post_type, 'gd_') === 0) {
|
|
| 3017 | 3017 | $wpml_post_join = ""; |
| 3018 | 3018 | $wpml_post_where = ""; |
| 3019 | 3019 | $wpml_term_join = ""; |
@@ -3027,28 +3027,28 @@ discard block |
||
| 3027 | 3027 | } |
| 3028 | 3028 | |
| 3029 | 3029 | $wpml_post_join = " JOIN {$wpdb->prefix}icl_translations AS icl_t ON p.ID = icl_t.element_id AND icl_t.element_type = CONCAT('post_', p.post_type)";
|
| 3030 | - $wpml_post_where = " AND icl_t.language_code = '" . $post_language ."'"; |
|
| 3030 | + $wpml_post_where = " AND icl_t.language_code = '".$post_language."'"; |
|
| 3031 | 3031 | |
| 3032 | 3032 | $wpml_term_join = " JOIN {$wpdb->prefix}icl_translations AS icl_t ON icl_t.element_id = tt.term_taxonomy_id AND icl_t.element_type = CONCAT('tax_', tt.taxonomy)";
|
| 3033 | - $wpml_term_where = " AND icl_t.language_code = '" . $post_language ."'"; |
|
| 3033 | + $wpml_term_where = " AND icl_t.language_code = '".$post_language."'"; |
|
| 3034 | 3034 | } |
| 3035 | 3035 | |
| 3036 | - $term_slug_check = $wpdb->get_var( $wpdb->prepare( "SELECT t.slug FROM $wpdb->terms AS t LEFT JOIN $wpdb->term_taxonomy AS tt ON tt.term_id = t.term_id {$wpml_term_join} WHERE t.slug = '%s' AND ( tt.taxonomy = '" . $post_type . "category' OR tt.taxonomy = '" . $post_type . "_tags' ) {$wpml_term_where} LIMIT 1", $slug ) );
|
|
| 3036 | + $term_slug_check = $wpdb->get_var($wpdb->prepare("SELECT t.slug FROM $wpdb->terms AS t LEFT JOIN $wpdb->term_taxonomy AS tt ON tt.term_id = t.term_id {$wpml_term_join} WHERE t.slug = '%s' AND ( tt.taxonomy = '".$post_type."category' OR tt.taxonomy = '".$post_type."_tags' ) {$wpml_term_where} LIMIT 1", $slug));
|
|
| 3037 | 3037 | |
| 3038 | - if ( $term_slug_check ) {
|
|
| 3038 | + if ($term_slug_check) {
|
|
| 3039 | 3039 | $suffix = 1; |
| 3040 | 3040 | |
| 3041 | 3041 | do {
|
| 3042 | - $alt_slug = _truncate_post_slug( $original_slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix"; |
|
| 3042 | + $alt_slug = _truncate_post_slug($original_slug, 200 - (strlen($suffix) + 1))."-$suffix"; |
|
| 3043 | 3043 | |
| 3044 | - $term_check = $wpdb->get_var( $wpdb->prepare( "SELECT t.slug FROM $wpdb->terms AS t LEFT JOIN $wpdb->term_taxonomy AS tt ON tt.term_id = t.term_id {$wpml_term_join} WHERE t.slug = '%s' AND ( tt.taxonomy = '" . $post_type . "category' OR tt.taxonomy = '" . $post_type . "_tags' ) {$wpml_term_where} LIMIT 1", $alt_slug ) );
|
|
| 3044 | + $term_check = $wpdb->get_var($wpdb->prepare("SELECT t.slug FROM $wpdb->terms AS t LEFT JOIN $wpdb->term_taxonomy AS tt ON tt.term_id = t.term_id {$wpml_term_join} WHERE t.slug = '%s' AND ( tt.taxonomy = '".$post_type."category' OR tt.taxonomy = '".$post_type."_tags' ) {$wpml_term_where} LIMIT 1", $alt_slug));
|
|
| 3045 | 3045 | |
| 3046 | - $post_check = !$term_check && $wpdb->get_var( $wpdb->prepare( "SELECT p.post_name FROM $wpdb->posts p {$wpml_post_join} WHERE p.post_name = %s AND p.post_type = %s AND p.ID != %d {$wpml_term_where} LIMIT 1", $alt_slug, $post_type, $post_ID ) );
|
|
| 3046 | + $post_check = !$term_check && $wpdb->get_var($wpdb->prepare("SELECT p.post_name FROM $wpdb->posts p {$wpml_post_join} WHERE p.post_name = %s AND p.post_type = %s AND p.ID != %d {$wpml_term_where} LIMIT 1", $alt_slug, $post_type, $post_ID));
|
|
| 3047 | 3047 | |
| 3048 | 3048 | $term_slug_check = $term_check || $post_check; |
| 3049 | 3049 | |
| 3050 | 3050 | $suffix++; |
| 3051 | - } while ( $term_slug_check ); |
|
| 3051 | + } while ($term_slug_check); |
|
| 3052 | 3052 | |
| 3053 | 3053 | $slug = $alt_slug; |
| 3054 | 3054 | } |
@@ -3056,7 +3056,7 @@ discard block |
||
| 3056 | 3056 | |
| 3057 | 3057 | return $slug; |
| 3058 | 3058 | } |
| 3059 | -add_filter( 'wp_unique_post_slug', 'geodir_check_post_to_term_slug', 101, 6 ); |
|
| 3059 | +add_filter('wp_unique_post_slug', 'geodir_check_post_to_term_slug', 101, 6);
|
|
| 3060 | 3060 | |
| 3061 | 3061 | /** |
| 3062 | 3062 | * Check whether a post name with slug exists or not. |
@@ -3073,51 +3073,51 @@ discard block |
||
| 3073 | 3073 | * @param int $term_id The term ID. |
| 3074 | 3074 | * @return bool true when exists. false when not exists. |
| 3075 | 3075 | */ |
| 3076 | -function geodir_check_term_to_post_slug( $slug_exists, $slug, $term_id ) {
|
|
| 3076 | +function geodir_check_term_to_post_slug($slug_exists, $slug, $term_id) {
|
|
| 3077 | 3077 | global $wpdb, $gd_term_post_type, $gd_term_taxonomy, $sitepress; |
| 3078 | 3078 | |
| 3079 | - if ( $slug_exists ) {
|
|
| 3079 | + if ($slug_exists) {
|
|
| 3080 | 3080 | return $slug_exists; |
| 3081 | 3081 | } |
| 3082 | 3082 | |
| 3083 | - if ( !empty( $gd_term_taxonomy ) && isset($gd_term_taxonomy[$term_id]) ) {
|
|
| 3083 | + if (!empty($gd_term_taxonomy) && isset($gd_term_taxonomy[$term_id])) {
|
|
| 3084 | 3084 | $taxonomy = $gd_term_taxonomy[$term_id]; |
| 3085 | 3085 | } else {
|
| 3086 | - $taxonomy = $wpdb->get_var( $wpdb->prepare( "SELECT taxonomy FROM $wpdb->term_taxonomy WHERE term_id = %d LIMIT 1", $term_id ) ); |
|
| 3086 | + $taxonomy = $wpdb->get_var($wpdb->prepare("SELECT taxonomy FROM $wpdb->term_taxonomy WHERE term_id = %d LIMIT 1", $term_id));
|
|
| 3087 | 3087 | $gd_term_taxonomy[$term_id] = $taxonomy; |
| 3088 | 3088 | } |
| 3089 | 3089 | |
| 3090 | - if ( empty($taxonomy) ) {
|
|
| 3090 | + if (empty($taxonomy)) {
|
|
| 3091 | 3091 | return $slug_exists; |
| 3092 | 3092 | } |
| 3093 | 3093 | |
| 3094 | - if ( !empty( $gd_term_post_type ) && $gd_term_post_type[$term_id] ) {
|
|
| 3094 | + if (!empty($gd_term_post_type) && $gd_term_post_type[$term_id]) {
|
|
| 3095 | 3095 | $post_type = $gd_term_post_type[$term_id]; |
| 3096 | 3096 | } else {
|
| 3097 | - $taxonomy_obj = get_taxonomy( $taxonomy ); |
|
| 3098 | - $post_type = !empty( $taxonomy_obj->object_type ) ? $taxonomy_obj->object_type[0] : NULL; |
|
| 3097 | + $taxonomy_obj = get_taxonomy($taxonomy); |
|
| 3098 | + $post_type = !empty($taxonomy_obj->object_type) ? $taxonomy_obj->object_type[0] : NULL; |
|
| 3099 | 3099 | } |
| 3100 | 3100 | |
| 3101 | 3101 | $wpml_post_join = ""; |
| 3102 | 3102 | $wpml_post_where = ""; |
| 3103 | 3103 | |
| 3104 | 3104 | if (geodir_wpml_is_taxonomy_translated($taxonomy) || geodir_wpml_is_post_type_translated($post_type)) {
|
| 3105 | - $term_language = $term_id ? geodir_get_language_for_element($term_id, 'tax_' . $taxonomy) : $sitepress->get_current_language(); |
|
| 3105 | + $term_language = $term_id ? geodir_get_language_for_element($term_id, 'tax_'.$taxonomy) : $sitepress->get_current_language(); |
|
| 3106 | 3106 | if (!$term_language) {
|
| 3107 | 3107 | $term_language = $sitepress->get_current_language(); |
| 3108 | 3108 | } |
| 3109 | 3109 | |
| 3110 | 3110 | $wpml_post_join = " JOIN {$wpdb->prefix}icl_translations AS icl_t ON p.ID = icl_t.element_id AND icl_t.element_type = CONCAT('post_', p.post_type)";
|
| 3111 | - $wpml_post_where = " AND icl_t.language_code = '" . $term_language ."'"; |
|
| 3111 | + $wpml_post_where = " AND icl_t.language_code = '".$term_language."'"; |
|
| 3112 | 3112 | } |
| 3113 | 3113 | |
| 3114 | - if ( $post_type && $wpdb->get_var( $wpdb->prepare( "SELECT p.post_name FROM $wpdb->posts p {$wpml_post_join} WHERE p.post_name = %s AND p.post_type = %s {$wpml_post_where} LIMIT 1", $slug, $post_type ) ) ) {
|
|
| 3114 | + if ($post_type && $wpdb->get_var($wpdb->prepare("SELECT p.post_name FROM $wpdb->posts p {$wpml_post_join} WHERE p.post_name = %s AND p.post_type = %s {$wpml_post_where} LIMIT 1", $slug, $post_type))) {
|
|
| 3115 | 3115 | $slug_exists = true; |
| 3116 | 3116 | } |
| 3117 | 3117 | |
| 3118 | 3118 | return $slug_exists; |
| 3119 | 3119 | } |
| 3120 | -add_filter( 'geodir_term_slug_is_exists', 'geodir_check_term_to_post_slug', 10, 3 ); |
|
| 3120 | +add_filter('geodir_term_slug_is_exists', 'geodir_check_term_to_post_slug', 10, 3);
|
|
| 3121 | 3121 | |
| 3122 | 3122 | /** |
| 3123 | 3123 | * Add hidden WPML language input field. |
@@ -3131,7 +3131,7 @@ discard block |
||
| 3131 | 3131 | function geodir_wpml_add_language_input_field() {
|
| 3132 | 3132 | global $sitepress; |
| 3133 | 3133 | |
| 3134 | - if ( function_exists( 'wpml_add_language_form_field_action' ) && WPML_LANGUAGE_NEGOTIATION_TYPE_PARAMETER === (int) $sitepress->get_setting( 'language_negotiation_type' ) ) {
|
|
| 3134 | + if (function_exists('wpml_add_language_form_field_action') && WPML_LANGUAGE_NEGOTIATION_TYPE_PARAMETER === (int) $sitepress->get_setting('language_negotiation_type')) {
|
|
| 3135 | 3135 | wpml_add_language_form_field_action(); |
| 3136 | 3136 | } |
| 3137 | 3137 | } |
| 3138 | 3138 | \ No newline at end of file |
@@ -39,21 +39,21 @@ discard block |
||
| 39 | 39 | $is_detail_page = false; |
| 40 | 40 | $geodir_map_name = geodir_map_name(); |
| 41 | 41 | |
| 42 | - if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
|
|
| 42 | + if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
|
|
| 43 | 43 | $is_detail_page = true; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | wp_enqueue_script('jquery');
|
| 47 | 47 | |
| 48 | - wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 48 | + wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 49 | 49 | wp_enqueue_script('geodirectory-script');
|
| 50 | 50 | |
| 51 | 51 | $geodir_vars_data = array( |
| 52 | 52 | 'siteurl' => get_option('siteurl'),
|
| 53 | 53 | 'geodir_plugin_url' => geodir_plugin_url(), |
| 54 | - 'geodir_lazy_load' => get_option('geodir_lazy_load',1),
|
|
| 54 | + 'geodir_lazy_load' => get_option('geodir_lazy_load', 1),
|
|
| 55 | 55 | 'geodir_ajax_url' => geodir_get_ajax_url(), |
| 56 | - 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
|
|
| 56 | + 'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
|
|
| 57 | 57 | 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
| 58 | 58 | ); |
| 59 | 59 | |
@@ -74,24 +74,24 @@ discard block |
||
| 74 | 74 | * |
| 75 | 75 | * } |
| 76 | 76 | */ |
| 77 | - $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
|
|
| 77 | + $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
|
|
| 78 | 78 | |
| 79 | 79 | wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
|
| 80 | 80 | |
| 81 | - wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 82 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
|
|
| 81 | + wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 82 | + if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
|
|
| 83 | 83 | |
| 84 | - wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 84 | + wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 85 | 85 | wp_enqueue_script('geodirectory-lightbox-jquery');
|
| 86 | 86 | |
| 87 | - wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
| 87 | + wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 88 | 88 | if ($is_detail_page) {
|
| 89 | 89 | wp_enqueue_script('geodirectory-jquery-simplemodal');
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | if (in_array($geodir_map_name, array('auto', 'google'))) {
|
| 93 | - $map_lang = "&language=" . geodir_get_map_default_language(); |
|
| 94 | - $map_key = "&key=" . geodir_get_map_api_key(); |
|
| 93 | + $map_lang = "&language=".geodir_get_map_default_language(); |
|
| 94 | + $map_key = "&key=".geodir_get_map_api_key(); |
|
| 95 | 95 | /** |
| 96 | 96 | * Filter the variables that are added to the end of the google maps script call. |
| 97 | 97 | * |
@@ -101,55 +101,55 @@ discard block |
||
| 101 | 101 | * @param string $var The string to filter, default is empty string. |
| 102 | 102 | */ |
| 103 | 103 | $map_extra = apply_filters('geodir_googlemap_script_extra', '');
|
| 104 | - wp_enqueue_script('google-maps-api', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
|
|
| 104 | + wp_enqueue_script('google-maps-api', 'https://maps.google.com/maps/api/js?'.$map_lang.$map_key.$map_extra, '', NULL);
|
|
| 105 | 105 | |
| 106 | 106 | // Overlapping Marker Spiderfier |
| 107 | - wp_register_script('geodirectory-g-overlappingmarker-script', geodir_plugin_url() . '/geodirectory-assets/jawj/oms.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 107 | + wp_register_script('geodirectory-g-overlappingmarker-script', geodir_plugin_url().'/geodirectory-assets/jawj/oms.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 108 | 108 | wp_enqueue_script('geodirectory-g-overlappingmarker-script');
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | if ($geodir_map_name == 'osm') {
|
| 112 | 112 | // Leaflet OpenStreetMap |
| 113 | - wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
|
|
| 113 | + wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
|
|
| 114 | 114 | wp_enqueue_style('geodirectory-leaflet-style');
|
| 115 | 115 | |
| 116 | - wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 116 | + wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 117 | 117 | wp_enqueue_script('geodirectory-leaflet-script');
|
| 118 | 118 | |
| 119 | - wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 119 | + wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 120 | 120 | wp_enqueue_script('geodirectory-leaflet-geo-script');
|
| 121 | 121 | |
| 122 | 122 | if ($is_detail_page) {
|
| 123 | - wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
|
|
| 123 | + wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
|
|
| 124 | 124 | wp_enqueue_style('geodirectory-leaflet-routing-style');
|
| 125 | 125 | |
| 126 | - wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 126 | + wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 127 | 127 | wp_enqueue_script('geodirectory-leaflet-routing-script');
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | // Overlapping Marker Spiderfier Leaflet |
| 131 | - wp_register_script('geodirectory-o-overlappingmarker-script', geodir_plugin_url() . '/geodirectory-assets/jawj/oms-leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 131 | + wp_register_script('geodirectory-o-overlappingmarker-script', geodir_plugin_url().'/geodirectory-assets/jawj/oms-leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 132 | 132 | wp_enqueue_script('geodirectory-o-overlappingmarker-script');
|
| 133 | 133 | } |
| 134 | - wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 134 | + wp_enqueue_script('jquery-ui-autocomplete');
|
|
| 135 | 135 | |
| 136 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 136 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 137 | 137 | wp_enqueue_script('geodirectory-goMap-script');
|
| 138 | 138 | |
| 139 | - wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 139 | + wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 140 | 140 | wp_enqueue_script('chosen');
|
| 141 | 141 | |
| 142 | - wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 142 | + wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
|
|
| 143 | 143 | wp_enqueue_script('geodirectory-choose-ajax');
|
| 144 | 144 | |
| 145 | - wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
|
|
| 145 | + wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
|
|
| 146 | 146 | |
| 147 | 147 | if (is_page() && geodir_is_page('add-listing')) {
|
| 148 | 148 | // SCRIPT FOR UPLOAD |
| 149 | 149 | wp_enqueue_script('plupload-all');
|
| 150 | 150 | wp_enqueue_script('jquery-ui-sortable');
|
| 151 | 151 | |
| 152 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
|
|
| 152 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 153 | 153 | wp_enqueue_script('geodirectory-plupload-script');
|
| 154 | 154 | // SCRIPT FOR UPLOAD END |
| 155 | 155 | |
@@ -196,27 +196,27 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
|
| 198 | 198 | |
| 199 | - wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
|
|
| 199 | + wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
|
|
| 200 | 200 | } // End if for add place page |
| 201 | 201 | |
| 202 | - wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 202 | + wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 203 | 203 | if ($is_detail_page) {
|
| 204 | 204 | wp_enqueue_script('geodirectory-post-custom-js');
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | // font awesome rating script |
| 208 | 208 | if (get_option('geodir_reviewrating_enable_font_awesome')) {
|
| 209 | - wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 209 | + wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 210 | 210 | wp_enqueue_script('geodir-barrating-js');
|
| 211 | 211 | } else { // default rating script
|
| 212 | - wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 212 | + wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
| 213 | 213 | wp_enqueue_script('geodir-jRating-js');
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 216 | + wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 217 | 217 | wp_enqueue_script('geodir-on-document-load');
|
| 218 | 218 | |
| 219 | - wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 219 | + wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
| 220 | 220 | wp_enqueue_script('google-geometa');
|
| 221 | 221 | } |
| 222 | 222 | |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | function geodir_header_scripts() |
| 233 | 233 | {
|
| 234 | - echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
|
|
| 234 | + echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
|
|
| 235 | 235 | echo stripslashes(get_option('geodir_header_scripts'));
|
| 236 | 236 | } |
| 237 | 237 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | */ |
| 246 | 246 | function geodir_google_analytics_tracking_code() |
| 247 | 247 | {
|
| 248 | - if(get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')){?>
|
|
| 248 | + if (get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')) {?>
|
|
| 249 | 249 | |
| 250 | 250 | <script> |
| 251 | 251 | (function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
@@ -253,14 +253,14 @@ discard block |
||
| 253 | 253 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| 254 | 254 | })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
| 255 | 255 | |
| 256 | - ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id'));?>', 'auto');
|
|
| 257 | - <?php if(get_option('geodir_ga_anonymize_ip')){echo "ga('set', 'anonymizeIP', true);";}?>
|
|
| 256 | + ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id')); ?>', 'auto');
|
|
| 257 | + <?php if (get_option('geodir_ga_anonymize_ip')) {echo "ga('set', 'anonymizeIP', true);"; }?>
|
|
| 258 | 258 | ga('send', 'pageview');
|
| 259 | 259 | |
| 260 | 260 | </script> |
| 261 | 261 | |
| 262 | 262 | <?php |
| 263 | - }elseif( get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
|
|
| 263 | + }elseif (get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')) {
|
|
| 264 | 264 | echo stripslashes(get_option('geodir_ga_tracking_code'));
|
| 265 | 265 | } |
| 266 | 266 | } |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | * |
| 284 | 284 | * Flexbox wont wrap on ios for search form items |
| 285 | 285 | */ |
| 286 | - if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
|
|
| 286 | + if (!empty($_SERVER['HTTP_USER_AGENT']) && preg_match('/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'])) {
|
|
| 287 | 287 | echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
|
| 288 | 288 | } |
| 289 | 289 | } |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | */ |
| 300 | 300 | function geodir_add_async_forscript($url) |
| 301 | 301 | {
|
| 302 | - if (strpos($url, '#asyncload')===false) |
|
| 302 | + if (strpos($url, '#asyncload') === false) |
|
| 303 | 303 | return $url; |
| 304 | 304 | else if (is_admin()) |
| 305 | 305 | return str_replace('#asyncload', '', $url);
|
@@ -317,12 +317,12 @@ discard block |
||
| 317 | 317 | function geodir_templates_styles() |
| 318 | 318 | {
|
| 319 | 319 | |
| 320 | - wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 320 | + wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 321 | 321 | wp_enqueue_style('geodir-core-scss');
|
| 322 | - wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
|
|
| 322 | + wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
|
|
| 323 | 323 | |
| 324 | - if(is_rtl()){
|
|
| 325 | - wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 324 | + if (is_rtl()) {
|
|
| 325 | + wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
|
|
| 326 | 326 | wp_enqueue_style('geodirectory-frontend-rtl-style');
|
| 327 | 327 | } |
| 328 | 328 | |
@@ -396,18 +396,18 @@ discard block |
||
| 396 | 396 | $term_id = get_queried_object_id(); |
| 397 | 397 | $taxonomy = get_query_var('taxonomy');
|
| 398 | 398 | |
| 399 | - if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
|
|
| 400 | - $term = get_term($term_id, $post_type . 'category'); |
|
| 399 | + if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
|
|
| 400 | + $term = get_term($term_id, $post_type.'category'); |
|
| 401 | 401 | } |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | - if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
|
|
| 405 | - $taxonomy_search = $_REQUEST['s' . $post_type . 'category']; |
|
| 404 | + if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) {
|
|
| 405 | + $taxonomy_search = $_REQUEST['s'.$post_type.'category']; |
|
| 406 | 406 | |
| 407 | 407 | if (!is_array($taxonomy_search)) {
|
| 408 | - $term = get_term((int)$taxonomy_search, $post_type . 'category'); |
|
| 409 | - } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
|
|
| 410 | - $term = get_term((int)$taxonomy_search[0], $post_type . 'category'); |
|
| 408 | + $term = get_term((int) $taxonomy_search, $post_type.'category'); |
|
| 409 | + } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
|
|
| 410 | + $term = get_term((int) $taxonomy_search[0], $post_type.'category'); |
|
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 | |
@@ -419,7 +419,7 @@ discard block |
||
| 419 | 419 | if ($max_page > 1 || $always_show) {
|
| 420 | 420 | // Extra pagination info |
| 421 | 421 | $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
|
| 422 | - $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
| 422 | + $start_no = ($paged - 1) * $posts_per_page + 1; |
|
| 423 | 423 | $end_no = min($paged * $posts_per_page, $numposts); |
| 424 | 424 | |
| 425 | 425 | if ($geodir_pagination_more_info != '') {
|
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | } else {
|
| 430 | 430 | $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
|
| 431 | 431 | } |
| 432 | - $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>'; |
|
| 432 | + $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>'; |
|
| 433 | 433 | /** |
| 434 | 434 | * Adds an extra pagination info above/under pagination. |
| 435 | 435 | * |
@@ -445,15 +445,15 @@ discard block |
||
| 445 | 445 | $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
|
| 446 | 446 | |
| 447 | 447 | if ($geodir_pagination_more_info == 'before') {
|
| 448 | - $before = $before . $pagination_info; |
|
| 448 | + $before = $before.$pagination_info; |
|
| 449 | 449 | } else if ($geodir_pagination_more_info == 'after') {
|
| 450 | - $after = $pagination_info . $after; |
|
| 450 | + $after = $pagination_info.$after; |
|
| 451 | 451 | } |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | echo "$before <div class='Navi gd-navi'>"; |
| 455 | 455 | if ($paged >= ($pages_to_show - 1)) {
|
| 456 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>';
|
|
| 456 | + echo '<a href="'.str_replace('&paged', '&paged', get_pagenum_link()).'">«</a>';
|
|
| 457 | 457 | } |
| 458 | 458 | previous_posts_link($prelabel); |
| 459 | 459 | for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
|
@@ -461,13 +461,13 @@ discard block |
||
| 461 | 461 | if ($i == $paged) {
|
| 462 | 462 | echo "<strong class='on'>$i</strong>"; |
| 463 | 463 | } else {
|
| 464 | - echo ' <a href="' . str_replace('&paged', '&paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
|
|
| 464 | + echo ' <a href="'.str_replace('&paged', '&paged', get_pagenum_link($i)).'">'.$i.'</a> ';
|
|
| 465 | 465 | } |
| 466 | 466 | } |
| 467 | 467 | } |
| 468 | 468 | next_posts_link($nxtlabel, $max_page); |
| 469 | 469 | if (($paged + $half_pages_to_show) < ($max_page)) {
|
| 470 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link($max_page)) . '">»</a>';
|
|
| 470 | + echo '<a href="'.str_replace('&paged', '&paged', get_pagenum_link($max_page)).'">»</a>';
|
|
| 471 | 471 | } |
| 472 | 472 | echo "</div> $after"; |
| 473 | 473 | } |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | jQuery(function ($) {
|
| 506 | 506 | $("#distance_slider").slider({
|
| 507 | 507 | range: true, |
| 508 | - values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
| 508 | + values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
| 509 | 509 | min: 0, |
| 510 | 510 | max: <?php echo $dist; ?>, |
| 511 | 511 | step: <?php echo $dist_dif; ?>, |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | $city = !empty($search_location) ? addslashes(stripslashes($search_location->city)) : ''; |
| 573 | 573 | ?> |
| 574 | 574 | <script type="text/javascript"> |
| 575 | - var default_location = '<?php echo $city ;?>'; |
|
| 575 | + var default_location = '<?php echo $city; ?>'; |
|
| 576 | 576 | var latlng; |
| 577 | 577 | var address; |
| 578 | 578 | var dist = 0; |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | var $form = jQuery(this).closest('form');
|
| 589 | 589 | |
| 590 | 590 | if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
|
| 591 | - if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
|
|
| 591 | + if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
|
|
| 592 | 592 | |
| 593 | 593 | // Disable location based search for disabled location post type. |
| 594 | 594 | if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
|
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | } |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | - if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) {
|
|
| 605 | + if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) {
|
|
| 606 | 606 | geodir_setsearch($form); |
| 607 | 607 | } else {
|
| 608 | 608 | jQuery(".snear", $form).val('');
|
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | }); |
| 621 | 621 | |
| 622 | 622 | function geodir_setsearch($form) {
|
| 623 | - if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location);
|
|
| 623 | + if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location);
|
|
| 624 | 624 | geocodeAddress($form); |
| 625 | 625 | } |
| 626 | 626 | |
@@ -639,15 +639,15 @@ discard block |
||
| 639 | 639 | // Call the geocode function |
| 640 | 640 | Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null; |
| 641 | 641 | |
| 642 | - if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
|
|
| 643 | - if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
|
|
| 642 | + if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
|
|
| 643 | + if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
|
|
| 644 | 644 | jQuery(".snear", $form).val('');
|
| 645 | 645 | } |
| 646 | 646 | jQuery($form).submit(); |
| 647 | 647 | } else {
|
| 648 | 648 | var address = jQuery(".snear", $form).val();
|
| 649 | 649 | |
| 650 | - if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
|
|
| 650 | + if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
|
|
| 651 | 651 | initialise2(); |
| 652 | 652 | } else {
|
| 653 | 653 | <?php |
@@ -660,12 +660,12 @@ discard block |
||
| 660 | 660 | $near_add2 = apply_filters('geodir_search_near_addition', '');
|
| 661 | 661 | ?> |
| 662 | 662 | if (window.gdMaps === 'google') {
|
| 663 | - Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
|
|
| 663 | + Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>},
|
|
| 664 | 664 | function (results, status) {
|
| 665 | 665 | if (status == google.maps.GeocoderStatus.OK) {
|
| 666 | 666 | updateSearchPosition(results[0].geometry.location, $form); |
| 667 | 667 | } else {
|
| 668 | - alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory');?>" + status);
|
|
| 668 | + alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory'); ?>" + status);
|
|
| 669 | 669 | } |
| 670 | 670 | }); |
| 671 | 671 | } else if (window.gdMaps === 'osm') {
|
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
|
| 675 | 675 | updateSearchPosition(geo, $form); |
| 676 | 676 | } else {
|
| 677 | - alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>");
|
|
| 677 | + alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>");
|
|
| 678 | 678 | } |
| 679 | 679 | }); |
| 680 | 680 | } else {
|
@@ -720,19 +720,19 @@ discard block |
||
| 720 | 720 | var msg; |
| 721 | 721 | switch (err.code) {
|
| 722 | 722 | case err.UNKNOWN_ERROR: |
| 723 | - msg = "<?php _e('Unable to find your location','geodirectory');?>";
|
|
| 723 | + msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
|
|
| 724 | 724 | break; |
| 725 | 725 | case err.PERMISSION_DENINED: |
| 726 | - msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
|
|
| 726 | + msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
|
|
| 727 | 727 | break; |
| 728 | 728 | case err.POSITION_UNAVAILABLE: |
| 729 | - msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
|
|
| 729 | + msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
|
|
| 730 | 730 | break; |
| 731 | 731 | case err.BREAK: |
| 732 | - msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
|
|
| 732 | + msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
|
|
| 733 | 733 | break; |
| 734 | 734 | default: |
| 735 | - msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
|
|
| 735 | + msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
|
|
| 736 | 736 | } |
| 737 | 737 | jQuery('#info').html(msg);
|
| 738 | 738 | } |
@@ -782,7 +782,7 @@ discard block |
||
| 782 | 782 | * @param object $post The post object. |
| 783 | 783 | * @param string $link The link to the post. |
| 784 | 784 | */ |
| 785 | - $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link);
|
|
| 785 | + $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img"> </span></a>', $post, $link);
|
|
| 786 | 786 | break; |
| 787 | 787 | case 'new' : |
| 788 | 788 | /** |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | * @param object $post The post object. |
| 793 | 793 | * @param string $link The link to the post. |
| 794 | 794 | */ |
| 795 | - $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link);
|
|
| 795 | + $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing"> </span></a>', $post, $link);
|
|
| 796 | 796 | break; |
| 797 | 797 | |
| 798 | 798 | } |
@@ -806,8 +806,8 @@ discard block |
||
| 806 | 806 | * @since 1.6.22 |
| 807 | 807 | */ |
| 808 | 808 | function geodir_fix_script_conflict() {
|
| 809 | - if ( wp_script_is( 'flexslider', 'enqueued' ) && wp_script_is( 'geodirectory-jquery-flexslider-js', 'enqueued' ) ) {
|
|
| 810 | - wp_dequeue_script( 'flexslider' ); |
|
| 809 | + if (wp_script_is('flexslider', 'enqueued') && wp_script_is('geodirectory-jquery-flexslider-js', 'enqueued')) {
|
|
| 810 | + wp_dequeue_script('flexslider');
|
|
| 811 | 811 | } |
| 812 | 812 | } |
| 813 | -add_action( 'wp_enqueue_scripts', 'geodir_fix_script_conflict', 100 ); |
|
| 814 | 813 | \ No newline at end of file |
| 814 | +add_action('wp_enqueue_scripts', 'geodir_fix_script_conflict', 100); |
|
| 815 | 815 | \ No newline at end of file |