@@ -202,14 +202,14 @@ discard block |
||
202 | 202 | // Add marker cluster |
203 | 203 | if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) { |
204 | 204 | $map_args['enable_marker_cluster'] = true; |
205 | - if(get_option('geodir_marker_cluster_type')) { |
|
205 | + if (get_option('geodir_marker_cluster_type')) { |
|
206 | 206 | if ($map_args['autozoom']) { |
207 | 207 | $map_args['enable_marker_cluster_no_reposition'] = false; |
208 | 208 | } else { |
209 | 209 | $map_args['enable_marker_cluster_no_reposition'] = true; |
210 | 210 | } |
211 | 211 | |
212 | - $map_args['enable_marker_cluster_server'] = true ; |
|
212 | + $map_args['enable_marker_cluster_server'] = true; |
|
213 | 213 | |
214 | 214 | } |
215 | 215 | } else { |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | } |
218 | 218 | |
219 | 219 | // if lat and long set in shortcode, hack it so the map is not repositioned |
220 | - if(!empty($params['latitude']) && !empty($params['longitude']) ){ |
|
220 | + if (!empty($params['latitude']) && !empty($params['longitude'])) { |
|
221 | 221 | $map_args['enable_marker_cluster_no_reposition'] = true; |
222 | 222 | } |
223 | 223 | |
@@ -890,7 +890,7 @@ discard block |
||
890 | 890 | |
891 | 891 | $show_adv_search = isset($params['show_adv_search']) && in_array($params['show_adv_search'], array('default', 'always', 'searched')) ? $params['show_adv_search'] : ''; |
892 | 892 | |
893 | - if ($show_adv_search != '' ) { |
|
893 | + if ($show_adv_search != '') { |
|
894 | 894 | $show_adv_class = 'geodir-advance-search-' . $show_adv_search . ' '; |
895 | 895 | if ($show_adv_search == 'searched' && geodir_is_page('search')) { |
896 | 896 | $show_adv_search = 'search'; |
@@ -903,7 +903,7 @@ discard block |
||
903 | 903 | ob_start(); |
904 | 904 | |
905 | 905 | //geodir_get_template_part('listing', 'filter-form'); |
906 | - the_widget('geodir_advance_search_widget', $params, $params ); |
|
906 | + the_widget('geodir_advance_search_widget', $params, $params); |
|
907 | 907 | |
908 | 908 | $output = ob_get_contents(); |
909 | 909 | ob_end_clean(); |
@@ -1100,7 +1100,7 @@ discard block |
||
1100 | 1100 | |
1101 | 1101 | // Validate character_count |
1102 | 1102 | //todo: is this necessary? |
1103 | - $params['character_count'] = $params['character_count']; |
|
1103 | + $params['character_count'] = $params['character_count']; |
|
1104 | 1104 | |
1105 | 1105 | // Validate our layout choice |
1106 | 1106 | // Outside of the norm, I added some more simple terms to match the existing |
@@ -1112,7 +1112,7 @@ discard block |
||
1112 | 1112 | |
1113 | 1113 | // Validate Listing width, used in the template widget-listing-listview.php |
1114 | 1114 | // The context is in width=$listing_width% - So we need a positive number between 0 & 100 |
1115 | - $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']); |
|
1115 | + $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']); |
|
1116 | 1116 | |
1117 | 1117 | // Validate the checkboxes used on the widget |
1118 | 1118 | $params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']); |
@@ -1135,7 +1135,7 @@ discard block |
||
1135 | 1135 | $params['pageno'] = $atts['pageno']; |
1136 | 1136 | unset($atts['pageno']); |
1137 | 1137 | } |
1138 | - $params['shortcode_atts'] = $atts; |
|
1138 | + $params['shortcode_atts'] = $atts; |
|
1139 | 1139 | |
1140 | 1140 | $output = geodir_sc_gd_listings_output($params); |
1141 | 1141 | |
@@ -1202,8 +1202,8 @@ discard block |
||
1202 | 1202 | // Validate the checkboxes used on the widget |
1203 | 1203 | $params['hide_empty'] = gdsc_to_bool_val($params['hide_empty']); |
1204 | 1204 | $params['show_count'] = gdsc_to_bool_val($params['show_count']); |
1205 | - $params['hide_icon'] = gdsc_to_bool_val($params['hide_icon']); |
|
1206 | - $params['cpt_left'] = gdsc_to_bool_val($params['cpt_left']); |
|
1205 | + $params['hide_icon'] = gdsc_to_bool_val($params['hide_icon']); |
|
1206 | + $params['cpt_left'] = gdsc_to_bool_val($params['cpt_left']); |
|
1207 | 1207 | |
1208 | 1208 | if ($params['max_count'] != 'all') { |
1209 | 1209 | $params['max_count'] = absint($params['max_count']); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | |
157 | 157 | $add_listing_link = get_page_link(geodir_add_listing_page_id()); |
158 | 158 | |
159 | - return esc_url( add_query_arg(array('listing_type' => $post_type), $add_listing_link) ); |
|
159 | + return esc_url(add_query_arg(array('listing_type' => $post_type), $add_listing_link)); |
|
160 | 160 | } else |
161 | 161 | return get_bloginfo('url'); |
162 | 162 | } |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | function geodir_is_page($gdpage = '') |
249 | 249 | { |
250 | 250 | |
251 | - global $wp_query, $post,$wp; |
|
251 | + global $wp_query, $post, $wp; |
|
252 | 252 | //if(!is_admin()): |
253 | 253 | |
254 | 254 | switch ($gdpage): |
@@ -304,8 +304,8 @@ discard block |
||
304 | 304 | if (is_author() && isset($_REQUEST['geodir_dashbord'])) |
305 | 305 | return true; |
306 | 306 | |
307 | - if (function_exists('bp_loggedin_user_id') && function_exists('bp_displayed_user_id') && $my_id = (int)bp_loggedin_user_id()) { |
|
308 | - if (((bool)bp_is_current_component('listings') || (bool)bp_is_current_component('favorites')) && $my_id > 0 && $my_id == (int)bp_displayed_user_id()) { |
|
307 | + if (function_exists('bp_loggedin_user_id') && function_exists('bp_displayed_user_id') && $my_id = (int) bp_loggedin_user_id()) { |
|
308 | + if (((bool) bp_is_current_component('listings') || (bool) bp_is_current_component('favorites')) && $my_id > 0 && $my_id == (int) bp_displayed_user_id()) { |
|
309 | 309 | return true; |
310 | 310 | } |
311 | 311 | } |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | if (empty($wp->query_vars) || !array_diff(array_keys($wp->query_vars), array('preview', 'page', 'paged', 'cpage'))) { |
359 | 359 | if (get_option('geodir_set_as_home')) |
360 | 360 | $wp->query_vars['gd_is_geodir_page'] = true; |
361 | - if(geodir_is_page('home')){ |
|
361 | + if (geodir_is_page('home')) { |
|
362 | 362 | $wp->query_vars['gd_is_geodir_page'] = true; |
363 | 363 | } |
364 | 364 | |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | |
411 | 411 | if (!isset($wp->query_vars['gd_is_geodir_page'])) { |
412 | 412 | $geodir_taxonomis = geodir_get_taxonomies('', true); |
413 | - if(!empty($geodir_taxonomis)){ |
|
413 | + if (!empty($geodir_taxonomis)) { |
|
414 | 414 | foreach ($geodir_taxonomis as $taxonomy) { |
415 | 415 | if (array_key_exists($taxonomy, $wp->query_vars)) { |
416 | 416 | $wp->query_vars['gd_is_geodir_page'] = true; |
@@ -430,10 +430,10 @@ discard block |
||
430 | 430 | |
431 | 431 | |
432 | 432 | //check if homepage |
433 | - if(!isset($wp->query_vars['gd_is_geodir_page']) |
|
433 | + if (!isset($wp->query_vars['gd_is_geodir_page']) |
|
434 | 434 | && !isset($wp->query_vars['page_id']) |
435 | 435 | && !isset($wp->query_vars['pagename']) |
436 | - && is_page_geodir_home()){ |
|
436 | + && is_page_geodir_home()) { |
|
437 | 437 | $wp->query_vars['gd_is_geodir_page'] = true; |
438 | 438 | } |
439 | 439 | //echo $wp->query_vars['gd_is_geodir_page'] ; |
@@ -534,7 +534,7 @@ discard block |
||
534 | 534 | function createRandomString() |
535 | 535 | { |
536 | 536 | $chars = "abcdefghijkmlnopqrstuvwxyz1023456789"; |
537 | - srand((double)microtime() * 1000000); |
|
537 | + srand((double) microtime() * 1000000); |
|
538 | 538 | $i = 0; |
539 | 539 | $rstring = ''; |
540 | 540 | while ($i <= 25) { |
@@ -668,11 +668,11 @@ discard block |
||
668 | 668 | } |
669 | 669 | |
670 | 670 | if (!empty($subject)) { |
671 | - $subject = __(stripslashes_deep($subject),'geodirectory'); |
|
671 | + $subject = __(stripslashes_deep($subject), 'geodirectory'); |
|
672 | 672 | } |
673 | 673 | |
674 | 674 | if (!empty($message)) { |
675 | - $message = __(stripslashes_deep($message),'geodirectory'); |
|
675 | + $message = __(stripslashes_deep($message), 'geodirectory'); |
|
676 | 676 | } |
677 | 677 | |
678 | 678 | $to_message = nl2br($to_message); |
@@ -707,12 +707,12 @@ discard block |
||
707 | 707 | $fromEmailName = get_option('site_email_name'); |
708 | 708 | } |
709 | 709 | |
710 | - $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]','[#from_email#]','[#user_login#]','[#username#]'); |
|
711 | - $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date,$fromEmail, $user_login, $user_login); |
|
710 | + $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]', '[#from_email#]', '[#user_login#]', '[#username#]'); |
|
711 | + $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date, $fromEmail, $user_login, $user_login); |
|
712 | 712 | $message = str_replace($search_array, $replace_array, $message); |
713 | 713 | |
714 | - $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]','[#from_email#]','[#user_login#]','[#username#]'); |
|
715 | - $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date,$fromEmail, $user_login, $user_login); |
|
714 | + $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]', '[#from_email#]', '[#user_login#]', '[#username#]'); |
|
715 | + $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date, $fromEmail, $user_login, $user_login); |
|
716 | 716 | $subject = str_replace($search_array, $replace_array, $subject); |
717 | 717 | |
718 | 718 | $headers = 'MIME-Version: 1.0' . "\r\n"; |
@@ -723,18 +723,18 @@ discard block |
||
723 | 723 | $to = $toEmail; |
724 | 724 | $sent = wp_mail($to, $subject, $message, $headers); |
725 | 725 | |
726 | - if( ! $sent ) { |
|
727 | - if ( is_array( $to ) ) { |
|
728 | - $to = implode( ',', $to ); |
|
726 | + if (!$sent) { |
|
727 | + if (is_array($to)) { |
|
728 | + $to = implode(',', $to); |
|
729 | 729 | } |
730 | 730 | $log_message = sprintf( |
731 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
731 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
732 | 732 | $message_type, |
733 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
733 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
734 | 734 | $to, |
735 | 735 | $subject |
736 | 736 | ); |
737 | - geodir_error_log( $log_message ); |
|
737 | + geodir_error_log($log_message); |
|
738 | 738 | } |
739 | 739 | |
740 | 740 | ///////// ADMIN BCC EMIALS |
@@ -746,11 +746,11 @@ discard block |
||
746 | 746 | $subject = __(stripslashes_deep(get_option('geodir_post_submited_success_email_subject_admin')), 'geodirectory'); |
747 | 747 | $message = __(stripslashes_deep(get_option('geodir_post_submited_success_email_content_admin')), 'geodirectory'); |
748 | 748 | |
749 | - $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]','[#user_login#]','[#username#]'); |
|
749 | + $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]', '[#user_login#]', '[#username#]'); |
|
750 | 750 | $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date, $user_login, $user_login); |
751 | 751 | $message = str_replace($search_array, $replace_array, $message); |
752 | 752 | |
753 | - $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]','[#user_login#]','[#username#]'); |
|
753 | + $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]', '[#user_login#]', '[#username#]'); |
|
754 | 754 | $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date, $user_login, $user_login); |
755 | 755 | $subject = str_replace($search_array, $replace_array, $subject); |
756 | 756 | |
@@ -775,21 +775,21 @@ discard block |
||
775 | 775 | $admin_bcc = true; |
776 | 776 | } |
777 | 777 | |
778 | - if($admin_bcc===true){ |
|
778 | + if ($admin_bcc === true) { |
|
779 | 779 | $sent = wp_mail($to, $subject, $message, $headers); |
780 | 780 | |
781 | - if( ! $sent ) { |
|
782 | - if ( is_array( $to ) ) { |
|
783 | - $to = implode( ',', $to ); |
|
781 | + if (!$sent) { |
|
782 | + if (is_array($to)) { |
|
783 | + $to = implode(',', $to); |
|
784 | 784 | } |
785 | 785 | $log_message = sprintf( |
786 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
786 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
787 | 787 | $message_type, |
788 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
788 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
789 | 789 | $to, |
790 | 790 | $subject |
791 | 791 | ); |
792 | - geodir_error_log( $log_message ); |
|
792 | + geodir_error_log($log_message); |
|
793 | 793 | } |
794 | 794 | } |
795 | 795 | |
@@ -884,7 +884,7 @@ discard block |
||
884 | 884 | $location_manager = defined('POST_LOCATION_TABLE') ? true : false; |
885 | 885 | $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false; |
886 | 886 | |
887 | - if(geodir_is_page('detail') && isset($post->country_slug)){ |
|
887 | + if (geodir_is_page('detail') && isset($post->country_slug)) { |
|
888 | 888 | $location_terms = array( |
889 | 889 | 'gd_country' => $post->country_slug, |
890 | 890 | 'gd_region' => $post->region_slug, |
@@ -1139,7 +1139,7 @@ discard block |
||
1139 | 1139 | $breadcrumb .= stripslashes_deep($page_title); |
1140 | 1140 | $breadcrumb .= '</li>'; |
1141 | 1141 | } else if (is_tag()) { |
1142 | - $breadcrumb .= "<li> " . $separator . single_tag_title('',false) . '</li>'; |
|
1142 | + $breadcrumb .= "<li> " . $separator . single_tag_title('', false) . '</li>'; |
|
1143 | 1143 | } else if (is_day()) { |
1144 | 1144 | $breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " "; |
1145 | 1145 | the_time('F jS, Y'); |
@@ -1231,7 +1231,7 @@ discard block |
||
1231 | 1231 | return new WP_Error('upload_dir_error', $upload['error']); |
1232 | 1232 | |
1233 | 1233 | // fetch the remote url and write it to the placeholder file |
1234 | - $headers = wp_remote_get($url, array('stream' => true,'filename' => $upload['file'])); |
|
1234 | + $headers = wp_remote_get($url, array('stream' => true, 'filename' => $upload['file'])); |
|
1235 | 1235 | |
1236 | 1236 | $log_message = ''; |
1237 | 1237 | $filesize = filesize($upload['file']); |
@@ -1244,16 +1244,16 @@ discard block |
||
1244 | 1244 | $log_message = sprintf(__('Remote server returned error response %1$d %2$s', 'geodirectory'), esc_html($headers['response']), get_status_header_desc($headers['response'])); |
1245 | 1245 | } |
1246 | 1246 | elseif (isset($headers['headers']['content-length']) && $filesize != $headers['headers']['content-length']) { |
1247 | - $log_message = __('Remote file is incorrect size', 'geodirectory'); |
|
1247 | + $log_message = __('Remote file is incorrect size', 'geodirectory'); |
|
1248 | 1248 | } |
1249 | 1249 | elseif (0 == $filesize) { |
1250 | 1250 | $log_message = __('Zero size file downloaded', 'geodirectory'); |
1251 | 1251 | } |
1252 | 1252 | |
1253 | - if($log_message){ |
|
1253 | + if ($log_message) { |
|
1254 | 1254 | $del = unlink($upload['file']); |
1255 | - if(!$del){geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory'));} |
|
1256 | - return new WP_Error('import_file_error',$log_message ); |
|
1255 | + if (!$del) {geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory')); } |
|
1256 | + return new WP_Error('import_file_error', $log_message); |
|
1257 | 1257 | } |
1258 | 1258 | |
1259 | 1259 | |
@@ -1269,10 +1269,10 @@ discard block |
||
1269 | 1269 | */ |
1270 | 1270 | function geodir_max_upload_size() |
1271 | 1271 | { |
1272 | - $max_filesize = (float)get_option('geodir_upload_max_filesize', 2); |
|
1272 | + $max_filesize = (float) get_option('geodir_upload_max_filesize', 2); |
|
1273 | 1273 | |
1274 | 1274 | if ($max_filesize > 0 && $max_filesize < 1) { |
1275 | - $max_filesize = (int)($max_filesize * 1024) . 'kb'; |
|
1275 | + $max_filesize = (int) ($max_filesize * 1024) . 'kb'; |
|
1276 | 1276 | } else { |
1277 | 1277 | $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb'; |
1278 | 1278 | } |
@@ -1341,35 +1341,35 @@ discard block |
||
1341 | 1341 | { |
1342 | 1342 | global $wpdb; |
1343 | 1343 | if ($message_type == 'expiration') { |
1344 | - $subject = stripslashes(__(get_option('renew_email_subject'),'geodirectory')); |
|
1345 | - $client_message = stripslashes(__(get_option('renew_email_content'),'geodirectory')); |
|
1344 | + $subject = stripslashes(__(get_option('renew_email_subject'), 'geodirectory')); |
|
1345 | + $client_message = stripslashes(__(get_option('renew_email_content'), 'geodirectory')); |
|
1346 | 1346 | } elseif ($message_type == 'post_submited') { |
1347 | - $subject = __(get_option('post_submited_success_email_subject_admin'),'geodirectory'); |
|
1348 | - $client_message = __(get_option('post_submited_success_email_content_admin'),'geodirectory'); |
|
1347 | + $subject = __(get_option('post_submited_success_email_subject_admin'), 'geodirectory'); |
|
1348 | + $client_message = __(get_option('post_submited_success_email_content_admin'), 'geodirectory'); |
|
1349 | 1349 | } elseif ($message_type == 'renew') { |
1350 | - $subject = __(get_option('post_renew_success_email_subject_admin'),'geodirectory'); |
|
1351 | - $client_message = __(get_option('post_renew_success_email_content_admin'),'geodirectory'); |
|
1350 | + $subject = __(get_option('post_renew_success_email_subject_admin'), 'geodirectory'); |
|
1351 | + $client_message = __(get_option('post_renew_success_email_content_admin'), 'geodirectory'); |
|
1352 | 1352 | } elseif ($message_type == 'upgrade') { |
1353 | - $subject = __(get_option('post_upgrade_success_email_subject_admin'),'geodirectory'); |
|
1354 | - $client_message = __(get_option('post_upgrade_success_email_content_admin'),'geodirectory'); |
|
1353 | + $subject = __(get_option('post_upgrade_success_email_subject_admin'), 'geodirectory'); |
|
1354 | + $client_message = __(get_option('post_upgrade_success_email_content_admin'), 'geodirectory'); |
|
1355 | 1355 | } elseif ($message_type == 'claim_approved') { |
1356 | - $subject = __(get_option('claim_approved_email_subject'),'geodirectory'); |
|
1357 | - $client_message = __(get_option('claim_approved_email_content'),'geodirectory'); |
|
1356 | + $subject = __(get_option('claim_approved_email_subject'), 'geodirectory'); |
|
1357 | + $client_message = __(get_option('claim_approved_email_content'), 'geodirectory'); |
|
1358 | 1358 | } elseif ($message_type == 'claim_rejected') { |
1359 | - $subject = __(get_option('claim_rejected_email_subject'),'geodirectory'); |
|
1360 | - $client_message = __(get_option('claim_rejected_email_content'),'geodirectory'); |
|
1359 | + $subject = __(get_option('claim_rejected_email_subject'), 'geodirectory'); |
|
1360 | + $client_message = __(get_option('claim_rejected_email_content'), 'geodirectory'); |
|
1361 | 1361 | } elseif ($message_type == 'claim_requested') { |
1362 | - $subject = __(get_option('claim_email_subject_admin'),'geodirectory'); |
|
1363 | - $client_message = __(get_option('claim_email_content_admin'),'geodirectory'); |
|
1362 | + $subject = __(get_option('claim_email_subject_admin'), 'geodirectory'); |
|
1363 | + $client_message = __(get_option('claim_email_content_admin'), 'geodirectory'); |
|
1364 | 1364 | } elseif ($message_type == 'auto_claim') { |
1365 | - $subject = __(get_option('auto_claim_email_subject'),'geodirectory'); |
|
1366 | - $client_message = __(get_option('auto_claim_email_content'),'geodirectory'); |
|
1365 | + $subject = __(get_option('auto_claim_email_subject'), 'geodirectory'); |
|
1366 | + $client_message = __(get_option('auto_claim_email_content'), 'geodirectory'); |
|
1367 | 1367 | } elseif ($message_type == 'payment_success') { |
1368 | - $subject = __(get_option('post_payment_success_admin_email_subject'),'geodirectory'); |
|
1369 | - $client_message = __(get_option('post_payment_success_admin_email_content'),'geodirectory'); |
|
1368 | + $subject = __(get_option('post_payment_success_admin_email_subject'), 'geodirectory'); |
|
1369 | + $client_message = __(get_option('post_payment_success_admin_email_content'), 'geodirectory'); |
|
1370 | 1370 | } elseif ($message_type == 'payment_fail') { |
1371 | - $subject = __(get_option('post_payment_fail_admin_email_subject'),'geodirectory'); |
|
1372 | - $client_message = __(get_option('post_payment_fail_admin_email_content'),'geodirectory'); |
|
1371 | + $subject = __(get_option('post_payment_fail_admin_email_subject'), 'geodirectory'); |
|
1372 | + $client_message = __(get_option('post_payment_fail_admin_email_content'), 'geodirectory'); |
|
1373 | 1373 | } |
1374 | 1374 | $transaction_details = $custom_1; |
1375 | 1375 | $fromEmail = get_option('site_email'); |
@@ -1410,18 +1410,18 @@ discard block |
||
1410 | 1410 | $to = $fromEmail; |
1411 | 1411 | $message = $client_message; |
1412 | 1412 | $sent = wp_mail($to, $subject, $message, $headers); |
1413 | - if( ! $sent ) { |
|
1414 | - if ( is_array( $to ) ) { |
|
1415 | - $to = implode( ',', $to ); |
|
1413 | + if (!$sent) { |
|
1414 | + if (is_array($to)) { |
|
1415 | + $to = implode(',', $to); |
|
1416 | 1416 | } |
1417 | 1417 | $log_message = sprintf( |
1418 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
1418 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
1419 | 1419 | $message_type, |
1420 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
1420 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
1421 | 1421 | $to, |
1422 | 1422 | $subject |
1423 | 1423 | ); |
1424 | - geodir_error_log( $log_message ); |
|
1424 | + geodir_error_log($log_message); |
|
1425 | 1425 | } |
1426 | 1426 | } |
1427 | 1427 | } |
@@ -1447,18 +1447,18 @@ discard block |
||
1447 | 1447 | { |
1448 | 1448 | $login_details = ''; |
1449 | 1449 | if ($message_type == 'send_friend') { |
1450 | - $subject = stripslashes(__(get_option('email_friend_subject'),'geodirectory')); |
|
1451 | - $message = stripslashes(__(get_option('email_friend_content'),'geodirectory')); |
|
1450 | + $subject = stripslashes(__(get_option('email_friend_subject'), 'geodirectory')); |
|
1451 | + $message = stripslashes(__(get_option('email_friend_content'), 'geodirectory')); |
|
1452 | 1452 | } elseif ($message_type == 'send_enquiry') { |
1453 | - $subject = __(get_option('email_enquiry_subject'),'geodirectory'); |
|
1454 | - $message = __(get_option('email_enquiry_content'),'geodirectory'); |
|
1453 | + $subject = __(get_option('email_enquiry_subject'), 'geodirectory'); |
|
1454 | + $message = __(get_option('email_enquiry_content'), 'geodirectory'); |
|
1455 | 1455 | } elseif ($message_type == 'forgot_password') { |
1456 | - $subject = __(get_option('forgot_password_subject'),'geodirectory'); |
|
1457 | - $message = __(get_option('forgot_password_content'),'geodirectory'); |
|
1456 | + $subject = __(get_option('forgot_password_subject'), 'geodirectory'); |
|
1457 | + $message = __(get_option('forgot_password_content'), 'geodirectory'); |
|
1458 | 1458 | $login_details = $to_message; |
1459 | 1459 | } elseif ($message_type == 'registration') { |
1460 | - $subject = __(get_option('registration_success_email_subject'),'geodirectory'); |
|
1461 | - $message = __(get_option('registration_success_email_content'),'geodirectory'); |
|
1460 | + $subject = __(get_option('registration_success_email_subject'), 'geodirectory'); |
|
1461 | + $message = __(get_option('registration_success_email_content'), 'geodirectory'); |
|
1462 | 1462 | $login_details = $to_message; |
1463 | 1463 | } |
1464 | 1464 | $to_message = nl2br($to_message); |
@@ -1492,18 +1492,18 @@ discard block |
||
1492 | 1492 | $to = $toEmail; |
1493 | 1493 | |
1494 | 1494 | $sent = wp_mail($to, $subject, $message, $headers); |
1495 | - if( ! $sent ) { |
|
1496 | - if ( is_array( $to ) ) { |
|
1497 | - $to = implode( ',', $to ); |
|
1495 | + if (!$sent) { |
|
1496 | + if (is_array($to)) { |
|
1497 | + $to = implode(',', $to); |
|
1498 | 1498 | } |
1499 | 1499 | $log_message = sprintf( |
1500 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
1500 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
1501 | 1501 | $message_type, |
1502 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
1502 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
1503 | 1503 | $to, |
1504 | 1504 | $subject |
1505 | 1505 | ); |
1506 | - geodir_error_log( $log_message ); |
|
1506 | + geodir_error_log($log_message); |
|
1507 | 1507 | } |
1508 | 1508 | |
1509 | 1509 | ///////// ADMIN BCC EMIALS |
@@ -1529,20 +1529,20 @@ discard block |
||
1529 | 1529 | $admin_bcc = true; |
1530 | 1530 | } |
1531 | 1531 | |
1532 | - if($admin_bcc === true){ |
|
1532 | + if ($admin_bcc === true) { |
|
1533 | 1533 | $sent = wp_mail($to, $subject, $message, $headers); |
1534 | - if( ! $sent ) { |
|
1535 | - if ( is_array( $to ) ) { |
|
1536 | - $to = implode( ',', $to ); |
|
1534 | + if (!$sent) { |
|
1535 | + if (is_array($to)) { |
|
1536 | + $to = implode(',', $to); |
|
1537 | 1537 | } |
1538 | 1538 | $log_message = sprintf( |
1539 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
1539 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
1540 | 1540 | $message_type, |
1541 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
1541 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
1542 | 1542 | $to, |
1543 | 1543 | $subject |
1544 | 1544 | ); |
1545 | - geodir_error_log( $log_message ); |
|
1545 | + geodir_error_log($log_message); |
|
1546 | 1546 | } |
1547 | 1547 | } |
1548 | 1548 | |
@@ -1590,7 +1590,7 @@ discard block |
||
1590 | 1590 | function geodir_custom_posts_body_class($classes) { |
1591 | 1591 | global $wpdb, $wp; |
1592 | 1592 | $post_types = geodir_get_posttypes('object'); |
1593 | - if (!empty($post_types) && count((array)$post_types) > 1) { |
|
1593 | + if (!empty($post_types) && count((array) $post_types) > 1) { |
|
1594 | 1594 | $classes[] = 'geodir_custom_posts'; |
1595 | 1595 | } |
1596 | 1596 | |
@@ -1884,7 +1884,7 @@ discard block |
||
1884 | 1884 | $sql = "SELECT COUNT(" . $wpdb->posts . ".ID) AS total FROM " . $wpdb->posts . " |
1885 | 1885 | " . $join . " |
1886 | 1886 | " . $where; |
1887 | - $rows = (int)$wpdb->get_var($sql); |
|
1887 | + $rows = (int) $wpdb->get_var($sql); |
|
1888 | 1888 | } else { |
1889 | 1889 | $orderby = geodir_widget_listings_get_order($query_args); |
1890 | 1890 | /** |
@@ -1910,10 +1910,10 @@ discard block |
||
1910 | 1910 | $limit = apply_filters('geodir_filter_widget_listings_limit', $limit, $post_type); |
1911 | 1911 | |
1912 | 1912 | $page = !empty($query_args['pageno']) ? absint($query_args['pageno']) : 1; |
1913 | - if ( !$page ) |
|
1913 | + if (!$page) |
|
1914 | 1914 | $page = 1; |
1915 | 1915 | |
1916 | - $limit = (int)$limit > 0 ? " LIMIT " . absint( ( $page - 1 ) * (int)$limit ) . ", " . (int)$limit : ""; |
|
1916 | + $limit = (int) $limit > 0 ? " LIMIT " . absint(($page - 1) * (int) $limit) . ", " . (int) $limit : ""; |
|
1917 | 1917 | |
1918 | 1918 | $sql = "SELECT SQL_CALC_FOUND_ROWS " . $fields . " FROM " . $wpdb->posts . " |
1919 | 1919 | " . $join . " |
@@ -2028,7 +2028,7 @@ discard block |
||
2028 | 2028 | } |
2029 | 2029 | |
2030 | 2030 | if (!empty($query_args['post_author'])) { |
2031 | - $where .= " AND " . $wpdb->posts . ".post_author = " . (int)$query_args['post_author']; |
|
2031 | + $where .= " AND " . $wpdb->posts . ".post_author = " . (int) $query_args['post_author']; |
|
2032 | 2032 | } |
2033 | 2033 | |
2034 | 2034 | if (!empty($query_args['show_featured_only'])) { |
@@ -2114,7 +2114,7 @@ discard block |
||
2114 | 2114 | } |
2115 | 2115 | |
2116 | 2116 | if (!empty($query_args) && !empty($query_args['posts_per_page'])) { |
2117 | - $limit = (int)$query_args['posts_per_page']; |
|
2117 | + $limit = (int) $query_args['posts_per_page']; |
|
2118 | 2118 | } |
2119 | 2119 | |
2120 | 2120 | return $limit; |
@@ -2257,9 +2257,9 @@ discard block |
||
2257 | 2257 | add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
2258 | 2258 | } |
2259 | 2259 | $home_url = str_replace("www.", "", $home_url); |
2260 | - if ( (strpos($home_url, $cur_url) !== false || strpos($home_url . '/', $cur_url) !== false) && ('page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front')==get_option('geodir_home_page')) ) { |
|
2260 | + if ((strpos($home_url, $cur_url) !== false || strpos($home_url . '/', $cur_url) !== false) && ('page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page'))) { |
|
2261 | 2261 | return true; |
2262 | - }elseif(get_query_var('page_id') == get_option('page_on_front') && 'page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front')==get_option('geodir_home_page')){ |
|
2262 | + }elseif (get_query_var('page_id') == get_option('page_on_front') && 'page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page')) { |
|
2263 | 2263 | return true; |
2264 | 2264 | } else { |
2265 | 2265 | return false; |
@@ -2342,7 +2342,7 @@ discard block |
||
2342 | 2342 | |
2343 | 2343 | $gd_post_type = geodir_get_current_posttype(); |
2344 | 2344 | |
2345 | - $category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int)$instance['category_limit'] : 15; |
|
2345 | + $category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int) $instance['category_limit'] : 15; |
|
2346 | 2346 | $default_post_type = !empty($gd_post_type) ? $gd_post_type : (isset($instance['default_post_type']) && gdsc_is_post_type_valid($instance['default_post_type']) ? $instance['default_post_type'] : ''); |
2347 | 2347 | |
2348 | 2348 | $taxonomy = array(); |
@@ -2375,14 +2375,14 @@ discard block |
||
2375 | 2375 | foreach ($b_terms as $key => $val) { |
2376 | 2376 | $ptype = get_post_type_object(str_replace("category", "", $key)); |
2377 | 2377 | $cpt_name = __($ptype->labels->singular_name, 'geodirectory'); |
2378 | - $tax_change_output .= "<option value='$key' ". selected($key, $default_taxonomy, false) .">" . sprintf(__('%s Categories', 'geodirectory'),$cpt_name) . "</option>"; |
|
2378 | + $tax_change_output .= "<option value='$key' " . selected($key, $default_taxonomy, false) . ">" . sprintf(__('%s Categories', 'geodirectory'), $cpt_name) . "</option>"; |
|
2379 | 2379 | } |
2380 | 2380 | $tax_change_output .= "</select>"; |
2381 | 2381 | } |
2382 | 2382 | |
2383 | 2383 | if (!empty($b_terms)) { |
2384 | - $terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms);// get the first array |
|
2385 | - global $cat_count;//make global so we can change via function |
|
2384 | + $terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms); // get the first array |
|
2385 | + global $cat_count; //make global so we can change via function |
|
2386 | 2386 | $cat_count = 0; |
2387 | 2387 | ?> |
2388 | 2388 | <div class="geodir-category-list-in clearfix"> |
@@ -2446,7 +2446,7 @@ discard block |
||
2446 | 2446 | $class_row = $cat_count > $category_limit ? 'geodir-pcat-hide geodir-hide' : 'geodir-pcat-show'; |
2447 | 2447 | $total_post = $cat->count; |
2448 | 2448 | |
2449 | - $term_link = get_term_link( $cat, $cat->taxonomy ); |
|
2449 | + $term_link = get_term_link($cat, $cat->taxonomy); |
|
2450 | 2450 | /** |
2451 | 2451 | * Filer the category term link. |
2452 | 2452 | * |
@@ -2455,7 +2455,7 @@ discard block |
||
2455 | 2455 | * @param int $cat->term_id The term id. |
2456 | 2456 | * @param string $post_type Wordpress post type. |
2457 | 2457 | */ |
2458 | - $term_link = apply_filters( 'geodir_category_term_link', $term_link, $cat->term_id, $post_type ); |
|
2458 | + $term_link = apply_filters('geodir_category_term_link', $term_link, $cat->term_id, $post_type); |
|
2459 | 2459 | |
2460 | 2460 | echo '<li class="' . $class_row . '"><a href="' . $term_link . '">'; |
2461 | 2461 | echo '<img alt="' . esc_attr($cat->name) . ' icon" style="height:20px;vertical-align:middle;" src="' . $term_icon_url . '"/> <span class="cat-link">'; echo $cat->name . '</span> <span class="geodir_term_class geodir_link_span geodir_category_class_' . $post_type . '_' . $cat->term_id . '">(' . $total_post . ')</span> '; |
@@ -2589,29 +2589,29 @@ discard block |
||
2589 | 2589 | itemWidth: 75, |
2590 | 2590 | itemMargin: 5, |
2591 | 2591 | asNavFor: '#geodir_widget_slider', |
2592 | - rtl: <?php echo ( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?> |
|
2592 | + rtl: <?php echo (is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?> |
|
2593 | 2593 | }); |
2594 | 2594 | |
2595 | 2595 | jQuery('#geodir_widget_slider').flexslider({ |
2596 | - animation: "<?php echo $animation;?>", |
|
2596 | + animation: "<?php echo $animation; ?>", |
|
2597 | 2597 | selector: ".geodir-slides > li", |
2598 | 2598 | namespace: "geodir-", |
2599 | 2599 | controlNav: true, |
2600 | - animationLoop: <?php echo $animationLoop;?>, |
|
2601 | - slideshow: <?php echo $slideshow;?>, |
|
2602 | - slideshowSpeed: <?php echo $slideshowSpeed;?>, |
|
2603 | - animationSpeed: <?php echo $animationSpeed;?>, |
|
2604 | - directionNav: <?php echo $directionNav;?>, |
|
2605 | - maxItems: <?php echo $max_show;?>, |
|
2600 | + animationLoop: <?php echo $animationLoop; ?>, |
|
2601 | + slideshow: <?php echo $slideshow; ?>, |
|
2602 | + slideshowSpeed: <?php echo $slideshowSpeed; ?>, |
|
2603 | + animationSpeed: <?php echo $animationSpeed; ?>, |
|
2604 | + directionNav: <?php echo $directionNav; ?>, |
|
2605 | + maxItems: <?php echo $max_show; ?>, |
|
2606 | 2606 | move: 1, |
2607 | - <?php if($slide_width){ echo "itemWidth: ".$slide_width.",";}?> |
|
2607 | + <?php if ($slide_width) { echo "itemWidth: " . $slide_width . ","; }?> |
|
2608 | 2608 | sync: "#geodir_widget_carousel", |
2609 | 2609 | start: function (slider) { |
2610 | 2610 | jQuery('.geodir-listing-flex-loader').hide(); |
2611 | 2611 | jQuery('#geodir_widget_slider').css({'visibility': 'visible'}); |
2612 | 2612 | jQuery('#geodir_widget_carousel').css({'visibility': 'visible'}); |
2613 | 2613 | }, |
2614 | - rtl: <?php echo ( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?> |
|
2614 | + rtl: <?php echo (is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?> |
|
2615 | 2615 | }); |
2616 | 2616 | }); |
2617 | 2617 | </script> |
@@ -2652,7 +2652,7 @@ discard block |
||
2652 | 2652 | |
2653 | 2653 | global $post; |
2654 | 2654 | |
2655 | - $current_post = $post;// keep current post info |
|
2655 | + $current_post = $post; // keep current post info |
|
2656 | 2656 | |
2657 | 2657 | $widget_main_slides = ''; |
2658 | 2658 | $nav_slides = ''; |
@@ -3095,7 +3095,7 @@ discard block |
||
3095 | 3095 | $geodir_add_location_url = '1'; |
3096 | 3096 | } |
3097 | 3097 | |
3098 | - $viewall_url = get_term_link((int)$category[0], $post_type . 'category'); |
|
3098 | + $viewall_url = get_term_link((int) $category[0], $post_type . 'category'); |
|
3099 | 3099 | |
3100 | 3100 | $geodir_add_location_url = NULL; |
3101 | 3101 | } |
@@ -3103,7 +3103,7 @@ discard block |
||
3103 | 3103 | $gd_session->set('gd_multi_location', 1); |
3104 | 3104 | } |
3105 | 3105 | |
3106 | - if(is_wp_error( $viewall_url )){$viewall_url = '';} |
|
3106 | + if (is_wp_error($viewall_url)) {$viewall_url = ''; } |
|
3107 | 3107 | |
3108 | 3108 | $query_args = array( |
3109 | 3109 | 'posts_per_page' => $post_number, |
@@ -3341,14 +3341,14 @@ discard block |
||
3341 | 3341 | * @package GeoDirectory |
3342 | 3342 | * @return bool |
3343 | 3343 | */ |
3344 | -function geodir_term_review_count_force_update($new_status, $old_status='', $post='') |
|
3344 | +function geodir_term_review_count_force_update($new_status, $old_status = '', $post = '') |
|
3345 | 3345 | { |
3346 | - if(isset($_REQUEST['action']) && $_REQUEST['action']=='geodir_import_export'){return;}//do not run if importing listings |
|
3346 | + if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'geodir_import_export') {return; }//do not run if importing listings |
|
3347 | 3347 | |
3348 | - if(isset($post->post_type) && ($post->post_type=='nav_menu_item' || $post->post_type=='page' || $post->post_type=='post')){ |
|
3348 | + if (isset($post->post_type) && ($post->post_type == 'nav_menu_item' || $post->post_type == 'page' || $post->post_type == 'post')) { |
|
3349 | 3349 | return; |
3350 | 3350 | } |
3351 | - if($new_status!=$old_status) { |
|
3351 | + if ($new_status != $old_status) { |
|
3352 | 3352 | geodir_count_reviews_by_terms(true); |
3353 | 3353 | } |
3354 | 3354 | return true; |
@@ -3513,7 +3513,7 @@ discard block |
||
3513 | 3513 | */ |
3514 | 3514 | try { |
3515 | 3515 | require_once($language_file); |
3516 | - } catch(Exception $e) { |
|
3516 | + } catch (Exception $e) { |
|
3517 | 3517 | error_log('Language Error: ' . $e->getMessage()); |
3518 | 3518 | } |
3519 | 3519 | } |
@@ -3531,18 +3531,18 @@ discard block |
||
3531 | 3531 | */ |
3532 | 3532 | function geodirectory_load_db_language() { |
3533 | 3533 | global $wp_filesystem; |
3534 | - if( empty( $wp_filesystem ) ) { |
|
3535 | - require_once( ABSPATH .'/wp-admin/includes/file.php' ); |
|
3534 | + if (empty($wp_filesystem)) { |
|
3535 | + require_once(ABSPATH . '/wp-admin/includes/file.php'); |
|
3536 | 3536 | WP_Filesystem(); |
3537 | 3537 | global $wp_filesystem; |
3538 | 3538 | } |
3539 | 3539 | |
3540 | 3540 | $language_file = geodir_plugin_path() . '/db-language.php'; |
3541 | 3541 | |
3542 | - if(is_file($language_file) && !is_writable($language_file)) |
|
3542 | + if (is_file($language_file) && !is_writable($language_file)) |
|
3543 | 3543 | return false; // Not possible to create. |
3544 | 3544 | |
3545 | - if(!is_file($language_file) && !is_writable(dirname($language_file))) |
|
3545 | + if (!is_file($language_file) && !is_writable(dirname($language_file))) |
|
3546 | 3546 | return false; // Not possible to create. |
3547 | 3547 | |
3548 | 3548 | $contents_strings = array(); |
@@ -3576,7 +3576,7 @@ discard block |
||
3576 | 3576 | $contents = implode(PHP_EOL, $contents_head); |
3577 | 3577 | |
3578 | 3578 | if (!empty($contents_strings)) { |
3579 | - foreach ( $contents_strings as $string ) { |
|
3579 | + foreach ($contents_strings as $string) { |
|
3580 | 3580 | if (is_scalar($string) && $string != '') { |
3581 | 3581 | $string = str_replace("'", "\'", $string); |
3582 | 3582 | $contents .= PHP_EOL . "__('" . $string . "', 'geodirectory');"; |
@@ -3586,7 +3586,7 @@ discard block |
||
3586 | 3586 | |
3587 | 3587 | $contents .= implode(PHP_EOL, $contents_foot); |
3588 | 3588 | |
3589 | - if($wp_filesystem->put_contents( $language_file, $contents, FS_CHMOD_FILE)) |
|
3589 | + if ($wp_filesystem->put_contents($language_file, $contents, FS_CHMOD_FILE)) |
|
3590 | 3590 | return false; // Failure; could not write file. |
3591 | 3591 | |
3592 | 3592 | return true; |
@@ -3612,7 +3612,7 @@ discard block |
||
3612 | 3612 | $rows = $wpdb->get_results($sql); |
3613 | 3613 | |
3614 | 3614 | if (!empty($rows)) { |
3615 | - foreach($rows as $row) { |
|
3615 | + foreach ($rows as $row) { |
|
3616 | 3616 | if (!empty($row->admin_title)) |
3617 | 3617 | $translation_texts[] = stripslashes_deep($row->admin_title); |
3618 | 3618 | |
@@ -3650,7 +3650,7 @@ discard block |
||
3650 | 3650 | $rows = $wpdb->get_results($sql); |
3651 | 3651 | |
3652 | 3652 | if (!empty($rows)) { |
3653 | - foreach($rows as $row) { |
|
3653 | + foreach ($rows as $row) { |
|
3654 | 3654 | if (!empty($row->site_title)) |
3655 | 3655 | $translation_texts[] = stripslashes_deep($row->site_title); |
3656 | 3656 | |
@@ -3668,7 +3668,7 @@ discard block |
||
3668 | 3668 | $rows = $wpdb->get_results($sql); |
3669 | 3669 | |
3670 | 3670 | if (!empty($rows)) { |
3671 | - foreach($rows as $row) { |
|
3671 | + foreach ($rows as $row) { |
|
3672 | 3672 | if (!empty($row->field_site_name)) |
3673 | 3673 | $translation_texts[] = stripslashes_deep($row->field_site_name); |
3674 | 3674 | |
@@ -3703,7 +3703,7 @@ discard block |
||
3703 | 3703 | * |
3704 | 3704 | * @param array $geodir_allowed_mime_types and file extensions. |
3705 | 3705 | */ |
3706 | - return apply_filters( 'geodir_allowed_mime_types', array( |
|
3706 | + return apply_filters('geodir_allowed_mime_types', array( |
|
3707 | 3707 | 'Image' => array( // Image formats. |
3708 | 3708 | 'jpg' => 'image/jpeg', |
3709 | 3709 | 'jpe' => 'image/jpeg', |
@@ -3792,13 +3792,13 @@ discard block |
||
3792 | 3792 | |
3793 | 3793 | |
3794 | 3794 | |
3795 | -add_filter('wpseo_replacements','geodir_wpseo_replacements',10,1); |
|
3795 | +add_filter('wpseo_replacements', 'geodir_wpseo_replacements', 10, 1); |
|
3796 | 3796 | /* |
3797 | 3797 | * Add location variables to wpseo replacements. |
3798 | 3798 | * |
3799 | 3799 | * @since 1.5.4 |
3800 | 3800 | */ |
3801 | -function geodir_wpseo_replacements($vars){ |
|
3801 | +function geodir_wpseo_replacements($vars) { |
|
3802 | 3802 | |
3803 | 3803 | global $wp; |
3804 | 3804 | $title = ''; |
@@ -3813,12 +3813,12 @@ discard block |
||
3813 | 3813 | * @param array $location_array The array of location variables. |
3814 | 3814 | * @param array $vars The page title variables. |
3815 | 3815 | */ |
3816 | - $location_array = apply_filters('geodir_filter_title_variables_location_arr_seo',$location_array, $vars); |
|
3816 | + $location_array = apply_filters('geodir_filter_title_variables_location_arr_seo', $location_array, $vars); |
|
3817 | 3817 | $location_titles = array(); |
3818 | - if(get_query_var( 'gd_country_full' )){ |
|
3819 | - if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );} |
|
3820 | - if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );} |
|
3821 | - if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );} |
|
3818 | + if (get_query_var('gd_country_full')) { |
|
3819 | + if (get_query_var('gd_country_full')) {$location_array['gd_country'] = get_query_var('gd_country_full'); } |
|
3820 | + if (get_query_var('gd_region_full')) {$location_array['gd_region'] = get_query_var('gd_region_full'); } |
|
3821 | + if (get_query_var('gd_city_full')) {$location_array['gd_city'] = get_query_var('gd_city_full'); } |
|
3822 | 3822 | } |
3823 | 3823 | $location_single = ''; |
3824 | 3824 | $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
@@ -3890,23 +3890,23 @@ discard block |
||
3890 | 3890 | } |
3891 | 3891 | |
3892 | 3892 | |
3893 | - if(!empty($location_titles)) { |
|
3893 | + if (!empty($location_titles)) { |
|
3894 | 3894 | $vars['%%location%%'] = implode(", ", $location_titles); |
3895 | 3895 | } |
3896 | 3896 | |
3897 | 3897 | |
3898 | - if(!empty($location_titles)) { |
|
3898 | + if (!empty($location_titles)) { |
|
3899 | 3899 | $vars['%%in_location%%'] = __('in ', 'geodirectory') . implode(", ", $location_titles); |
3900 | 3900 | } |
3901 | 3901 | |
3902 | 3902 | |
3903 | 3903 | |
3904 | - if($location_single) { |
|
3905 | - $vars['%%in_location_single%%'] = __('in', 'geodirectory') . ' ' .$location_single; |
|
3904 | + if ($location_single) { |
|
3905 | + $vars['%%in_location_single%%'] = __('in', 'geodirectory') . ' ' . $location_single; |
|
3906 | 3906 | } |
3907 | 3907 | |
3908 | 3908 | |
3909 | - if($location_single) { |
|
3909 | + if ($location_single) { |
|
3910 | 3910 | $vars['%%location_single%%'] = $location_single; |
3911 | 3911 | } |
3912 | 3912 | |
@@ -3918,17 +3918,17 @@ discard block |
||
3918 | 3918 | * @param string $vars The title with variables. |
3919 | 3919 | * @param array $location_array The array of location variables. |
3920 | 3920 | */ |
3921 | - return apply_filters('geodir_wpseo_replacements_vars',$vars,$location_array); |
|
3921 | + return apply_filters('geodir_wpseo_replacements_vars', $vars, $location_array); |
|
3922 | 3922 | } |
3923 | 3923 | |
3924 | 3924 | |
3925 | -add_filter('geodir_seo_meta_title','geodir_filter_title_variables',10,3); |
|
3926 | -add_filter('geodir_seo_page_title','geodir_filter_title_variables',10,2); |
|
3927 | -add_filter('geodir_seo_meta_description_pre','geodir_filter_title_variables',10,3); |
|
3928 | -function geodir_filter_title_variables($title, $gd_page, $sep=''){ |
|
3925 | +add_filter('geodir_seo_meta_title', 'geodir_filter_title_variables', 10, 3); |
|
3926 | +add_filter('geodir_seo_page_title', 'geodir_filter_title_variables', 10, 2); |
|
3927 | +add_filter('geodir_seo_meta_description_pre', 'geodir_filter_title_variables', 10, 3); |
|
3928 | +function geodir_filter_title_variables($title, $gd_page, $sep = '') { |
|
3929 | 3929 | |
3930 | 3930 | |
3931 | - if(!$gd_page || !$title){return $title;}// if no a GD page then bail. |
|
3931 | + if (!$gd_page || !$title) {return $title; }// if no a GD page then bail. |
|
3932 | 3932 | global $post; |
3933 | 3933 | //print_r($post); |
3934 | 3934 | /* |
@@ -3970,119 +3970,119 @@ discard block |
||
3970 | 3970 | } |
3971 | 3971 | |
3972 | 3972 | |
3973 | - if(strpos($title,'%%title%%') !== false){ |
|
3974 | - $title = str_replace("%%title%%",$post->post_title,$title); |
|
3973 | + if (strpos($title, '%%title%%') !== false) { |
|
3974 | + $title = str_replace("%%title%%", $post->post_title, $title); |
|
3975 | 3975 | } |
3976 | 3976 | |
3977 | - if(strpos($title,'%%sitename%%') !== false){ |
|
3978 | - $title = str_replace("%%sitename%%",get_bloginfo('name'),$title); |
|
3977 | + if (strpos($title, '%%sitename%%') !== false) { |
|
3978 | + $title = str_replace("%%sitename%%", get_bloginfo('name'), $title); |
|
3979 | 3979 | } |
3980 | 3980 | |
3981 | - if(strpos($title,'%%sitedesc%%') !== false){ |
|
3982 | - $title = str_replace("%%sitedesc%%",get_bloginfo('description'),$title); |
|
3981 | + if (strpos($title, '%%sitedesc%%') !== false) { |
|
3982 | + $title = str_replace("%%sitedesc%%", get_bloginfo('description'), $title); |
|
3983 | 3983 | } |
3984 | 3984 | |
3985 | - if(strpos($title,'%%excerpt%%') !== false){ |
|
3986 | - $title = str_replace("%%excerpt%%",strip_tags(get_the_excerpt()),$title); |
|
3985 | + if (strpos($title, '%%excerpt%%') !== false) { |
|
3986 | + $title = str_replace("%%excerpt%%", strip_tags(get_the_excerpt()), $title); |
|
3987 | 3987 | } |
3988 | 3988 | |
3989 | - if(strpos($title,'%%pt_single%%') !== false){ |
|
3989 | + if (strpos($title, '%%pt_single%%') !== false) { |
|
3990 | 3990 | $single_name = ''; |
3991 | - if($gd_page=='search' || $gd_page=='author'){ |
|
3991 | + if ($gd_page == 'search' || $gd_page == 'author') { |
|
3992 | 3992 | $geodir_post_types = get_option('geodir_post_types'); |
3993 | 3993 | $spt = esc_attr($_REQUEST['stype']); |
3994 | - if(isset($geodir_post_types[$spt]['labels']['singular_name'])){ |
|
3995 | - $single_name = __($geodir_post_types[$spt]['labels']['singular_name'],'geodirectory'); |
|
3994 | + if (isset($geodir_post_types[$spt]['labels']['singular_name'])) { |
|
3995 | + $single_name = __($geodir_post_types[$spt]['labels']['singular_name'], 'geodirectory'); |
|
3996 | 3996 | } |
3997 | - }elseif($gd_page=='add-listing'){ |
|
3997 | + }elseif ($gd_page == 'add-listing') { |
|
3998 | 3998 | $geodir_post_types = get_option('geodir_post_types'); |
3999 | 3999 | $spt = isset($_REQUEST['listing_type']) ? esc_attr($_REQUEST['listing_type']) : ''; |
4000 | - if(!$spt && isset($_REQUEST['pid'])){ |
|
4001 | - $spt = get_post_type( $_REQUEST['pid'] ); |
|
4000 | + if (!$spt && isset($_REQUEST['pid'])) { |
|
4001 | + $spt = get_post_type($_REQUEST['pid']); |
|
4002 | 4002 | } |
4003 | - if(!$spt){$spt='gd_place';} |
|
4004 | - if(isset($geodir_post_types[$spt]['labels']['singular_name'])){ |
|
4005 | - $single_name = __($geodir_post_types[$spt]['labels']['singular_name'],'geodirectory'); |
|
4003 | + if (!$spt) {$spt = 'gd_place'; } |
|
4004 | + if (isset($geodir_post_types[$spt]['labels']['singular_name'])) { |
|
4005 | + $single_name = __($geodir_post_types[$spt]['labels']['singular_name'], 'geodirectory'); |
|
4006 | 4006 | } |
4007 | 4007 | } |
4008 | - elseif($post->post_type){ |
|
4008 | + elseif ($post->post_type) { |
|
4009 | 4009 | $geodir_post_types = get_option('geodir_post_types'); |
4010 | - if(isset($geodir_post_types[$post->post_type]['labels']['singular_name'])){ |
|
4011 | - $single_name = __($geodir_post_types[$post->post_type]['labels']['singular_name'],'geodirectory'); |
|
4010 | + if (isset($geodir_post_types[$post->post_type]['labels']['singular_name'])) { |
|
4011 | + $single_name = __($geodir_post_types[$post->post_type]['labels']['singular_name'], 'geodirectory'); |
|
4012 | 4012 | } |
4013 | 4013 | |
4014 | 4014 | |
4015 | 4015 | } |
4016 | - $title = str_replace("%%pt_single%%",$single_name,$title); |
|
4016 | + $title = str_replace("%%pt_single%%", $single_name, $title); |
|
4017 | 4017 | } |
4018 | 4018 | |
4019 | - if(strpos($title,'%%pt_plural%%') !== false){ |
|
4019 | + if (strpos($title, '%%pt_plural%%') !== false) { |
|
4020 | 4020 | $plural_name = ''; |
4021 | - if($gd_page=='search' || $gd_page=='author'){ |
|
4021 | + if ($gd_page == 'search' || $gd_page == 'author') { |
|
4022 | 4022 | $geodir_post_types = get_option('geodir_post_types'); |
4023 | 4023 | $spt = esc_attr($_REQUEST['stype']); |
4024 | - if(isset($geodir_post_types[$spt]['labels']['name'])){ |
|
4025 | - $plural_name = __($geodir_post_types[$spt]['labels']['name'],'geodirectory'); |
|
4024 | + if (isset($geodir_post_types[$spt]['labels']['name'])) { |
|
4025 | + $plural_name = __($geodir_post_types[$spt]['labels']['name'], 'geodirectory'); |
|
4026 | 4026 | } |
4027 | - }elseif($gd_page=='add-listing'){ |
|
4027 | + }elseif ($gd_page == 'add-listing') { |
|
4028 | 4028 | $geodir_post_types = get_option('geodir_post_types'); |
4029 | 4029 | $spt = sanitize_text_field($_REQUEST['listing_type']); |
4030 | - if(!$spt){$spt='gd_place';} |
|
4031 | - if(isset($geodir_post_types[$spt]['labels']['name'])){ |
|
4032 | - $plural_name = __($geodir_post_types[$spt]['labels']['name'],'geodirectory'); |
|
4030 | + if (!$spt) {$spt = 'gd_place'; } |
|
4031 | + if (isset($geodir_post_types[$spt]['labels']['name'])) { |
|
4032 | + $plural_name = __($geodir_post_types[$spt]['labels']['name'], 'geodirectory'); |
|
4033 | 4033 | } |
4034 | 4034 | } |
4035 | - elseif(isset($post->post_type) && $post->post_type){ |
|
4035 | + elseif (isset($post->post_type) && $post->post_type) { |
|
4036 | 4036 | $geodir_post_types = get_option('geodir_post_types'); |
4037 | - if(isset($geodir_post_types[$post->post_type]['labels']['name'])){ |
|
4038 | - $plural_name = __($geodir_post_types[$post->post_type]['labels']['name'],'geodirectory'); |
|
4037 | + if (isset($geodir_post_types[$post->post_type]['labels']['name'])) { |
|
4038 | + $plural_name = __($geodir_post_types[$post->post_type]['labels']['name'], 'geodirectory'); |
|
4039 | 4039 | } |
4040 | 4040 | |
4041 | 4041 | } |
4042 | - $title = str_replace("%%pt_plural%%",$plural_name,$title); |
|
4042 | + $title = str_replace("%%pt_plural%%", $plural_name, $title); |
|
4043 | 4043 | } |
4044 | 4044 | |
4045 | 4045 | |
4046 | 4046 | |
4047 | - if(strpos($title,'%%category%%') !== false){ |
|
4047 | + if (strpos($title, '%%category%%') !== false) { |
|
4048 | 4048 | $cat_name = ''; |
4049 | 4049 | |
4050 | - if($gd_page=='detail') { |
|
4050 | + if ($gd_page == 'detail') { |
|
4051 | 4051 | if ($post->default_category) { |
4052 | 4052 | $cat = get_term($post->default_category, $post->post_type . 'category'); |
4053 | 4053 | $cat_name = (isset($cat->name)) ? $cat->name : ''; |
4054 | 4054 | } |
4055 | - }elseif($gd_page=='listing'){ |
|
4055 | + }elseif ($gd_page == 'listing') { |
|
4056 | 4056 | $queried_object = get_queried_object(); |
4057 | - if(isset($queried_object->name)){ |
|
4057 | + if (isset($queried_object->name)) { |
|
4058 | 4058 | $cat_name = $queried_object->name; |
4059 | 4059 | } |
4060 | 4060 | } |
4061 | - $title = str_replace("%%category%%",$cat_name,$title); |
|
4061 | + $title = str_replace("%%category%%", $cat_name, $title); |
|
4062 | 4062 | } |
4063 | 4063 | |
4064 | - if(strpos($title,'%%tag%%') !== false){ |
|
4064 | + if (strpos($title, '%%tag%%') !== false) { |
|
4065 | 4065 | $cat_name = ''; |
4066 | 4066 | |
4067 | - if($gd_page=='detail') { |
|
4067 | + if ($gd_page == 'detail') { |
|
4068 | 4068 | if ($post->default_category) { |
4069 | 4069 | $cat = get_term($post->default_category, $post->post_type . 'category'); |
4070 | 4070 | $cat_name = (isset($cat->name)) ? $cat->name : ''; |
4071 | 4071 | } |
4072 | - }elseif($gd_page=='listing'){ |
|
4072 | + }elseif ($gd_page == 'listing') { |
|
4073 | 4073 | $queried_object = get_queried_object(); |
4074 | - if(isset($queried_object->name)){ |
|
4074 | + if (isset($queried_object->name)) { |
|
4075 | 4075 | $cat_name = $queried_object->name; |
4076 | 4076 | } |
4077 | 4077 | } |
4078 | - $title = str_replace("%%tag%%",$cat_name,$title); |
|
4078 | + $title = str_replace("%%tag%%", $cat_name, $title); |
|
4079 | 4079 | } |
4080 | 4080 | |
4081 | 4081 | |
4082 | 4082 | |
4083 | - if(strpos($title,'%%id%%') !== false){ |
|
4083 | + if (strpos($title, '%%id%%') !== false) { |
|
4084 | 4084 | $ID = (isset($post->ID)) ? $post->ID : ''; |
4085 | - $title = str_replace("%%id%%",$ID,$title); |
|
4085 | + $title = str_replace("%%id%%", $ID, $title); |
|
4086 | 4086 | } |
4087 | 4087 | |
4088 | 4088 | /* |
@@ -4095,8 +4095,8 @@ discard block |
||
4095 | 4095 | } |
4096 | 4096 | */ |
4097 | 4097 | |
4098 | - if(strpos($title,'%%sep%%') !== false){ |
|
4099 | - $title = str_replace("%%sep%%",$sep,$title); |
|
4098 | + if (strpos($title, '%%sep%%') !== false) { |
|
4099 | + $title = str_replace("%%sep%%", $sep, $title); |
|
4100 | 4100 | } |
4101 | 4101 | |
4102 | 4102 | |
@@ -4114,12 +4114,12 @@ discard block |
||
4114 | 4114 | * @param string $gd_page The page being filtered. |
4115 | 4115 | * @param string $sep The separator, default: `|`. |
4116 | 4116 | */ |
4117 | - $location_array = apply_filters('geodir_filter_title_variables_location_arr',$location_array,$title, $gd_page, $sep); |
|
4117 | + $location_array = apply_filters('geodir_filter_title_variables_location_arr', $location_array, $title, $gd_page, $sep); |
|
4118 | 4118 | $location_titles = array(); |
4119 | - if($gd_page=='location' && get_query_var( 'gd_country_full' )){ |
|
4120 | - if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );} |
|
4121 | - if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );} |
|
4122 | - if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );} |
|
4119 | + if ($gd_page == 'location' && get_query_var('gd_country_full')) { |
|
4120 | + if (get_query_var('gd_country_full')) {$location_array['gd_country'] = get_query_var('gd_country_full'); } |
|
4121 | + if (get_query_var('gd_region_full')) {$location_array['gd_region'] = get_query_var('gd_region_full'); } |
|
4122 | + if (get_query_var('gd_city_full')) {$location_array['gd_city'] = get_query_var('gd_city_full'); } |
|
4123 | 4123 | } |
4124 | 4124 | $location_single = ''; |
4125 | 4125 | $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
@@ -4191,65 +4191,65 @@ discard block |
||
4191 | 4191 | } |
4192 | 4192 | |
4193 | 4193 | |
4194 | - if(strpos($title,'%%location%%') !== false){ |
|
4194 | + if (strpos($title, '%%location%%') !== false) { |
|
4195 | 4195 | $location = ''; |
4196 | - if($location_titles) { |
|
4196 | + if ($location_titles) { |
|
4197 | 4197 | $location = implode(", ", $location_titles); |
4198 | 4198 | } |
4199 | - $title = str_replace("%%location%%",$location,$title); |
|
4199 | + $title = str_replace("%%location%%", $location, $title); |
|
4200 | 4200 | } |
4201 | 4201 | |
4202 | - if(strpos($title,'%%in_location%%') !== false){ |
|
4202 | + if (strpos($title, '%%in_location%%') !== false) { |
|
4203 | 4203 | $location = ''; |
4204 | - if($location_titles) { |
|
4204 | + if ($location_titles) { |
|
4205 | 4205 | $location = __('in ', 'geodirectory') . implode(", ", $location_titles); |
4206 | 4206 | } |
4207 | - $title = str_replace("%%in_location%%",$location,$title); |
|
4207 | + $title = str_replace("%%in_location%%", $location, $title); |
|
4208 | 4208 | } |
4209 | 4209 | |
4210 | - if(strpos($title,'%%in_location_single%%') !== false){ |
|
4211 | - if($location_single) { |
|
4212 | - $location_single = __('in', 'geodirectory') . ' ' .$location_single; |
|
4210 | + if (strpos($title, '%%in_location_single%%') !== false) { |
|
4211 | + if ($location_single) { |
|
4212 | + $location_single = __('in', 'geodirectory') . ' ' . $location_single; |
|
4213 | 4213 | } |
4214 | - $title = str_replace("%%in_location_single%%",$location_single,$title); |
|
4214 | + $title = str_replace("%%in_location_single%%", $location_single, $title); |
|
4215 | 4215 | } |
4216 | 4216 | |
4217 | - if(strpos($title,'%%location_single%%') !== false){ |
|
4218 | - $title = str_replace("%%location_single%%",$location_single,$title); |
|
4217 | + if (strpos($title, '%%location_single%%') !== false) { |
|
4218 | + $title = str_replace("%%location_single%%", $location_single, $title); |
|
4219 | 4219 | } |
4220 | 4220 | |
4221 | 4221 | |
4222 | - if(strpos($title,'%%search_term%%') !== false){ |
|
4222 | + if (strpos($title, '%%search_term%%') !== false) { |
|
4223 | 4223 | $search_term = ''; |
4224 | - if(isset($_REQUEST['s'])){ |
|
4224 | + if (isset($_REQUEST['s'])) { |
|
4225 | 4225 | $search_term = esc_attr($_REQUEST['s']); |
4226 | 4226 | } |
4227 | - $title = str_replace("%%search_term%%",$search_term,$title); |
|
4227 | + $title = str_replace("%%search_term%%", $search_term, $title); |
|
4228 | 4228 | } |
4229 | 4229 | |
4230 | - if(strpos($title,'%%search_near%%') !== false){ |
|
4230 | + if (strpos($title, '%%search_near%%') !== false) { |
|
4231 | 4231 | $search_term = ''; |
4232 | - if(isset($_REQUEST['snear'])){ |
|
4232 | + if (isset($_REQUEST['snear'])) { |
|
4233 | 4233 | $search_term = esc_attr($_REQUEST['snear']); |
4234 | 4234 | } |
4235 | - $title = str_replace("%%search_near%%",$search_term,$title); |
|
4235 | + $title = str_replace("%%search_near%%", $search_term, $title); |
|
4236 | 4236 | } |
4237 | 4237 | |
4238 | - if(strpos($title,'%%name%%') !== false){ |
|
4238 | + if (strpos($title, '%%name%%') !== false) { |
|
4239 | 4239 | $author_name = ''; |
4240 | - if($author_name = get_the_author()){} |
|
4241 | - else{ |
|
4240 | + if ($author_name = get_the_author()) {} |
|
4241 | + else { |
|
4242 | 4242 | $queried_object = get_queried_object(); |
4243 | - if(isset($queried_object->data->user_nicename)){ |
|
4243 | + if (isset($queried_object->data->user_nicename)) { |
|
4244 | 4244 | $author_name = $queried_object->data->user_nicename; |
4245 | 4245 | } |
4246 | 4246 | } |
4247 | - $title = str_replace("%%name%%",$author_name,$title); |
|
4247 | + $title = str_replace("%%name%%", $author_name, $title); |
|
4248 | 4248 | } |
4249 | 4249 | |
4250 | - $title = wptexturize( $title ); |
|
4251 | - $title = convert_chars( $title ); |
|
4252 | - $title = esc_html( $title ); |
|
4250 | + $title = wptexturize($title); |
|
4251 | + $title = convert_chars($title); |
|
4252 | + $title = esc_html($title); |
|
4253 | 4253 | |
4254 | 4254 | /** |
4255 | 4255 | * Filter the title variables after standard ones have been filtered. |
@@ -4262,7 +4262,7 @@ discard block |
||
4262 | 4262 | * @param string $sep The separator, default: `|`. |
4263 | 4263 | */ |
4264 | 4264 | |
4265 | - return apply_filters('geodir_filter_title_variables_vars',$title,$location_array, $gd_page, $sep); |
|
4265 | + return apply_filters('geodir_filter_title_variables_vars', $title, $location_array, $gd_page, $sep); |
|
4266 | 4266 | } |
4267 | 4267 | |
4268 | 4268 | /** |