@@ -559,11 +559,11 @@ discard block |
||
559 | 559 | $post_number = !empty($args['post_number']) ? $args['post_number'] : 10; |
560 | 560 | $add_location_filter = !empty($args['add_location_filter']) ? true : false; |
561 | 561 | $list_sort = !empty($args['list_sort']) ? $args['list_sort'] : 'latest'; |
562 | - $character_count = isset($args['character_count']) ? $args['character_count'] : ''; |
|
563 | - $layout = !empty($args['layout']) ? $args['layout'] : 'gridview_onehalf'; |
|
564 | - $with_pagination = !empty($args['with_pagination']) ? true : false; |
|
565 | - $event_type = !empty($args['event_type']) ? $args['event_type'] : ''; |
|
566 | - $shortcode_content = !empty($args['shortcode_content']) ? trim($args['shortcode_content']) : ''; |
|
562 | + $character_count = isset($args['character_count']) ? $args['character_count'] : ''; |
|
563 | + $layout = !empty($args['layout']) ? $args['layout'] : 'gridview_onehalf'; |
|
564 | + $with_pagination = !empty($args['with_pagination']) ? true : false; |
|
565 | + $event_type = !empty($args['event_type']) ? $args['event_type'] : ''; |
|
566 | + $shortcode_content = !empty($args['shortcode_content']) ? trim($args['shortcode_content']) : ''; |
|
567 | 567 | /** |
568 | 568 | * Filter the content text displayed when no listings found. |
569 | 569 | * |
@@ -575,13 +575,13 @@ discard block |
||
575 | 575 | $shortcode_content = apply_filters('geodir_sc_gd_listings_not_found_content', $shortcode_content, $args); |
576 | 576 | |
577 | 577 | $top_pagination = $with_pagination && !empty($args['top_pagination']) ? true : false; |
578 | - $bottom_pagination = $with_pagination && !empty($args['bottom_pagination']) ? true : false; |
|
578 | + $bottom_pagination = $with_pagination && !empty($args['bottom_pagination']) ? true : false; |
|
579 | 579 | |
580 | 580 | $shortcode_atts = !empty($args['shortcode_atts']) ? $args['shortcode_atts'] : array(); |
581 | 581 | |
582 | 582 | // ajax mode |
583 | - $geodir_ajax = !empty($args['geodir_ajax']) ? true : false; |
|
584 | - $pageno = $geodir_ajax && !empty($args['pageno']) ? $args['pageno'] : 1; |
|
583 | + $geodir_ajax = !empty($args['geodir_ajax']) ? true : false; |
|
584 | + $pageno = $geodir_ajax && !empty($args['pageno']) ? $args['pageno'] : 1; |
|
585 | 585 | |
586 | 586 | $query_args = array( |
587 | 587 | 'posts_per_page' => $post_number, |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | if(!pid > 0 || !(container && typeof container != 'undefined')) { |
741 | 741 | return false; |
742 | 742 | } |
743 | - var scatts = "<?php echo addslashes(json_encode($shortcode_atts));?>"; |
|
743 | + var scatts = "<?php echo addslashes(json_encode($shortcode_atts)); ?>"; |
|
744 | 744 | |
745 | 745 | var data = { |
746 | 746 | 'action': 'geodir_sclistings', |
@@ -820,7 +820,7 @@ discard block |
||
820 | 820 | if ($max_page > 1 || $always_show) { |
821 | 821 | // Extra pagination info |
822 | 822 | $geodir_pagination_more_info = get_option('geodir_pagination_advance_info'); |
823 | - $start_no = ( $pageno - 1 ) * $posts_per_page + 1; |
|
823 | + $start_no = ($pageno - 1) * $posts_per_page + 1; |
|
824 | 824 | $end_no = min($pageno * $posts_per_page, $numposts); |
825 | 825 | |
826 | 826 | if ($geodir_pagination_more_info != '') { |
@@ -839,7 +839,7 @@ discard block |
||
839 | 839 | } |
840 | 840 | |
841 | 841 | if (($pageno - 1) > 0) { |
842 | - echo '<a class="gd-page-sc-prev" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int)($pageno - 1) . ');">' . $prelabel . '</a> '; |
|
842 | + echo '<a class="gd-page-sc-prev" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int) ($pageno - 1) . ');">' . $prelabel . '</a> '; |
|
843 | 843 | } |
844 | 844 | |
845 | 845 | for ($i = $pageno - $half_pages_to_show; $i <= $pageno + $half_pages_to_show; $i++) { |
@@ -847,17 +847,17 @@ discard block |
||
847 | 847 | if ($i == $pageno) { |
848 | 848 | echo "<strong class='on' class='gd-page-sc-act'>$i</strong>"; |
849 | 849 | } else { |
850 | - echo ' <a class="gd-page-sc-no" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int)$i . ');">' . $i . '</a> '; |
|
850 | + echo ' <a class="gd-page-sc-no" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int) $i . ');">' . $i . '</a> '; |
|
851 | 851 | } |
852 | 852 | } |
853 | 853 | } |
854 | 854 | |
855 | 855 | if (($pageno + 1) <= $max_page) { |
856 | - echo ' <a class="gd-page-sc-nxt" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int)($pageno + 1) . ');">' . $nxtlabel . '</a>'; |
|
856 | + echo ' <a class="gd-page-sc-nxt" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int) ($pageno + 1) . ');">' . $nxtlabel . '</a>'; |
|
857 | 857 | } |
858 | 858 | |
859 | 859 | if ($pageno < $max_page) { |
860 | - echo ' <a class="gd-page-sc-lst" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int)$max_page . ');">»</a>'; |
|
860 | + echo ' <a class="gd-page-sc-lst" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int) $max_page . ');">»</a>'; |
|
861 | 861 | } |
862 | 862 | echo "</div> $after"; |
863 | 863 | } |
@@ -880,7 +880,7 @@ discard block |
||
880 | 880 | $scatts = isset($_POST['scatts']) ? $_POST['scatts'] : NULL; |
881 | 881 | $pageno = isset($_POST['pageno']) ? absint($_POST['pageno']) : 1; |
882 | 882 | |
883 | - $shortcode_atts = !empty($scatts) ? (array)json_decode(stripslashes_deep($scatts)) : NULL; |
|
883 | + $shortcode_atts = !empty($scatts) ? (array) json_decode(stripslashes_deep($scatts)) : NULL; |
|
884 | 884 | |
885 | 885 | if (!empty($shortcode_atts) && is_array($shortcode_atts)) { |
886 | 886 | $shortcode_atts['pageno'] = $pageno; |
@@ -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(); |
@@ -1101,7 +1101,7 @@ discard block |
||
1101 | 1101 | |
1102 | 1102 | // Validate character_count |
1103 | 1103 | //todo: is this necessary? |
1104 | - $params['character_count'] = $params['character_count']; |
|
1104 | + $params['character_count'] = $params['character_count']; |
|
1105 | 1105 | |
1106 | 1106 | // Validate our layout choice |
1107 | 1107 | // Outside of the norm, I added some more simple terms to match the existing |
@@ -1113,7 +1113,7 @@ discard block |
||
1113 | 1113 | |
1114 | 1114 | // Validate Listing width, used in the template widget-listing-listview.php |
1115 | 1115 | // The context is in width=$listing_width% - So we need a positive number between 0 & 100 |
1116 | - $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']); |
|
1116 | + $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']); |
|
1117 | 1117 | |
1118 | 1118 | // Validate the checkboxes used on the widget |
1119 | 1119 | $params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']); |
@@ -1137,13 +1137,13 @@ discard block |
||
1137 | 1137 | unset($atts['pageno']); |
1138 | 1138 | } |
1139 | 1139 | |
1140 | - if ( !empty($atts['shortcode_content']) ) { |
|
1140 | + if (!empty($atts['shortcode_content'])) { |
|
1141 | 1141 | $content = $atts['shortcode_content']; |
1142 | 1142 | } |
1143 | 1143 | $params['shortcode_content'] = trim($content); |
1144 | 1144 | $atts['shortcode_content'] = trim($content); |
1145 | 1145 | |
1146 | - $params['shortcode_atts'] = $atts; |
|
1146 | + $params['shortcode_atts'] = $atts; |
|
1147 | 1147 | |
1148 | 1148 | $output = geodir_sc_gd_listings_output($params); |
1149 | 1149 | |
@@ -1210,8 +1210,8 @@ discard block |
||
1210 | 1210 | // Validate the checkboxes used on the widget |
1211 | 1211 | $params['hide_empty'] = gdsc_to_bool_val($params['hide_empty']); |
1212 | 1212 | $params['show_count'] = gdsc_to_bool_val($params['show_count']); |
1213 | - $params['hide_icon'] = gdsc_to_bool_val($params['hide_icon']); |
|
1214 | - $params['cpt_left'] = gdsc_to_bool_val($params['cpt_left']); |
|
1213 | + $params['hide_icon'] = gdsc_to_bool_val($params['hide_icon']); |
|
1214 | + $params['cpt_left'] = gdsc_to_bool_val($params['cpt_left']); |
|
1215 | 1215 | |
1216 | 1216 | if ($params['max_count'] != 'all') { |
1217 | 1217 | $params['max_count'] = absint($params['max_count']); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | function geodir_plugin_path() |
49 | 49 | { |
50 | - if ( defined( 'GD_TESTING_MODE' ) && GD_TESTING_MODE ) { |
|
50 | + if (defined('GD_TESTING_MODE') && GD_TESTING_MODE) { |
|
51 | 51 | return dirname(dirname(__FILE__)); |
52 | 52 | } else { |
53 | 53 | return WP_PLUGIN_DIR . "/" . plugin_basename(dirname(dirname(__FILE__))); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | $add_listing_link = get_page_link(geodir_add_listing_page_id()); |
162 | 162 | |
163 | - return esc_url( add_query_arg(array('listing_type' => $post_type), $add_listing_link) ); |
|
163 | + return esc_url(add_query_arg(array('listing_type' => $post_type), $add_listing_link)); |
|
164 | 164 | } else |
165 | 165 | return get_bloginfo('url'); |
166 | 166 | } |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | function geodir_is_page($gdpage = '') |
253 | 253 | { |
254 | 254 | |
255 | - global $wp_query, $post,$wp; |
|
255 | + global $wp_query, $post, $wp; |
|
256 | 256 | //if(!is_admin()): |
257 | 257 | |
258 | 258 | switch ($gdpage): |
@@ -277,14 +277,14 @@ discard block |
||
277 | 277 | break; |
278 | 278 | case 'detail': |
279 | 279 | $post_type = get_query_var('post_type'); |
280 | - if(is_array($post_type)){$post_type = reset($post_type);} |
|
280 | + if (is_array($post_type)) {$post_type = reset($post_type); } |
|
281 | 281 | if (is_single() && in_array($post_type, geodir_get_posttypes())) |
282 | 282 | return true; |
283 | 283 | break; |
284 | 284 | case 'pt': |
285 | 285 | $post_type = get_query_var('post_type'); |
286 | - if(is_array($post_type)){$post_type = reset($post_type);} |
|
287 | - if (is_post_type_archive() && in_array($post_type , geodir_get_posttypes()) && !is_tax()) |
|
286 | + if (is_array($post_type)) {$post_type = reset($post_type); } |
|
287 | + if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes()) && !is_tax()) |
|
288 | 288 | return true; |
289 | 289 | |
290 | 290 | break; |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | return true; |
296 | 296 | } |
297 | 297 | $post_type = get_query_var('post_type'); |
298 | - if(is_array($post_type)){$post_type = reset($post_type);} |
|
298 | + if (is_array($post_type)) {$post_type = reset($post_type); } |
|
299 | 299 | if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes())) |
300 | 300 | return true; |
301 | 301 | |
@@ -314,8 +314,8 @@ discard block |
||
314 | 314 | if (is_author() && isset($_REQUEST['geodir_dashbord'])) |
315 | 315 | return true; |
316 | 316 | |
317 | - if (function_exists('bp_loggedin_user_id') && function_exists('bp_displayed_user_id') && $my_id = (int)bp_loggedin_user_id()) { |
|
318 | - if (((bool)bp_is_current_component('listings') || (bool)bp_is_current_component('favorites')) && $my_id > 0 && $my_id == (int)bp_displayed_user_id()) { |
|
317 | + if (function_exists('bp_loggedin_user_id') && function_exists('bp_displayed_user_id') && $my_id = (int) bp_loggedin_user_id()) { |
|
318 | + if (((bool) bp_is_current_component('listings') || (bool) bp_is_current_component('favorites')) && $my_id > 0 && $my_id == (int) bp_displayed_user_id()) { |
|
319 | 319 | return true; |
320 | 320 | } |
321 | 321 | } |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | if (empty($wp->query_vars) || !array_diff(array_keys($wp->query_vars), array('preview', 'page', 'paged', 'cpage'))) { |
369 | 369 | if (get_option('geodir_set_as_home')) |
370 | 370 | $wp->query_vars['gd_is_geodir_page'] = true; |
371 | - if(geodir_is_page('home')){ |
|
371 | + if (geodir_is_page('home')) { |
|
372 | 372 | $wp->query_vars['gd_is_geodir_page'] = true; |
373 | 373 | } |
374 | 374 | |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | |
421 | 421 | if (!isset($wp->query_vars['gd_is_geodir_page'])) { |
422 | 422 | $geodir_taxonomis = geodir_get_taxonomies('', true); |
423 | - if(!empty($geodir_taxonomis)){ |
|
423 | + if (!empty($geodir_taxonomis)) { |
|
424 | 424 | foreach ($geodir_taxonomis as $taxonomy) { |
425 | 425 | if (array_key_exists($taxonomy, $wp->query_vars)) { |
426 | 426 | $wp->query_vars['gd_is_geodir_page'] = true; |
@@ -440,10 +440,10 @@ discard block |
||
440 | 440 | |
441 | 441 | |
442 | 442 | //check if homepage |
443 | - if(!isset($wp->query_vars['gd_is_geodir_page']) |
|
443 | + if (!isset($wp->query_vars['gd_is_geodir_page']) |
|
444 | 444 | && !isset($wp->query_vars['page_id']) |
445 | 445 | && !isset($wp->query_vars['pagename']) |
446 | - && is_page_geodir_home()){ |
|
446 | + && is_page_geodir_home()) { |
|
447 | 447 | $wp->query_vars['gd_is_geodir_page'] = true; |
448 | 448 | } |
449 | 449 | //echo $wp->query_vars['gd_is_geodir_page'] ; |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | function createRandomString() |
545 | 545 | { |
546 | 546 | $chars = "abcdefghijkmlnopqrstuvwxyz1023456789"; |
547 | - srand((double)microtime() * 1000000); |
|
547 | + srand((double) microtime() * 1000000); |
|
548 | 548 | $i = 0; |
549 | 549 | $rstring = ''; |
550 | 550 | while ($i <= 25) { |
@@ -681,11 +681,11 @@ discard block |
||
681 | 681 | } |
682 | 682 | |
683 | 683 | if (!empty($subject)) { |
684 | - $subject = __(stripslashes_deep($subject),'geodirectory'); |
|
684 | + $subject = __(stripslashes_deep($subject), 'geodirectory'); |
|
685 | 685 | } |
686 | 686 | |
687 | 687 | if (!empty($message)) { |
688 | - $message = __(stripslashes_deep($message),'geodirectory'); |
|
688 | + $message = __(stripslashes_deep($message), 'geodirectory'); |
|
689 | 689 | } |
690 | 690 | |
691 | 691 | $to_message = nl2br($to_message); |
@@ -724,12 +724,12 @@ discard block |
||
724 | 724 | $fromEmailName = get_option('site_email_name'); |
725 | 725 | } |
726 | 726 | |
727 | - $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#]','[#post_author_id#]','[#post_author_name#]','[#current_date#]'); |
|
728 | - $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, $post_author_id, $post_author_name, $current_date); |
|
727 | + $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#]', '[#post_author_id#]', '[#post_author_name#]', '[#current_date#]'); |
|
728 | + $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, $post_author_id, $post_author_name, $current_date); |
|
729 | 729 | $message = str_replace($search_array, $replace_array, $message); |
730 | 730 | |
731 | - $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#]','[#post_author_id#]','[#post_author_name#]','[#current_date#]'); |
|
732 | - $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date,$fromEmail, $user_login, $user_login, $post_author_id, $post_author_name, $current_date); |
|
731 | + $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#]', '[#post_author_id#]', '[#post_author_name#]', '[#current_date#]'); |
|
732 | + $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date, $fromEmail, $user_login, $user_login, $post_author_id, $post_author_name, $current_date); |
|
733 | 733 | $subject = str_replace($search_array, $replace_array, $subject); |
734 | 734 | |
735 | 735 | $headers = 'MIME-Version: 1.0' . "\r\n"; |
@@ -740,18 +740,18 @@ discard block |
||
740 | 740 | $to = $toEmail; |
741 | 741 | $sent = wp_mail($to, $subject, $message, $headers); |
742 | 742 | |
743 | - if( ! $sent ) { |
|
744 | - if ( is_array( $to ) ) { |
|
745 | - $to = implode( ',', $to ); |
|
743 | + if (!$sent) { |
|
744 | + if (is_array($to)) { |
|
745 | + $to = implode(',', $to); |
|
746 | 746 | } |
747 | 747 | $log_message = sprintf( |
748 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
748 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
749 | 749 | $message_type, |
750 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
750 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
751 | 751 | $to, |
752 | 752 | $subject |
753 | 753 | ); |
754 | - geodir_error_log( $log_message ); |
|
754 | + geodir_error_log($log_message); |
|
755 | 755 | } |
756 | 756 | |
757 | 757 | ///////// ADMIN BCC EMIALS |
@@ -763,11 +763,11 @@ discard block |
||
763 | 763 | $subject = __(stripslashes_deep(get_option('geodir_post_submited_success_email_subject_admin')), 'geodirectory'); |
764 | 764 | $message = __(stripslashes_deep(get_option('geodir_post_submited_success_email_content_admin')), 'geodirectory'); |
765 | 765 | |
766 | - $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#]'); |
|
766 | + $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#]'); |
|
767 | 767 | $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); |
768 | 768 | $message = str_replace($search_array, $replace_array, $message); |
769 | 769 | |
770 | - $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]','[#user_login#]','[#username#]'); |
|
770 | + $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]', '[#user_login#]', '[#username#]'); |
|
771 | 771 | $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date, $user_login, $user_login); |
772 | 772 | $subject = str_replace($search_array, $replace_array, $subject); |
773 | 773 | |
@@ -792,21 +792,21 @@ discard block |
||
792 | 792 | $admin_bcc = true; |
793 | 793 | } |
794 | 794 | |
795 | - if($admin_bcc===true){ |
|
795 | + if ($admin_bcc === true) { |
|
796 | 796 | $sent = wp_mail($to, $subject, $message, $headers); |
797 | 797 | |
798 | - if( ! $sent ) { |
|
799 | - if ( is_array( $to ) ) { |
|
800 | - $to = implode( ',', $to ); |
|
798 | + if (!$sent) { |
|
799 | + if (is_array($to)) { |
|
800 | + $to = implode(',', $to); |
|
801 | 801 | } |
802 | 802 | $log_message = sprintf( |
803 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
803 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
804 | 804 | $message_type, |
805 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
805 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
806 | 806 | $to, |
807 | 807 | $subject |
808 | 808 | ); |
809 | - geodir_error_log( $log_message ); |
|
809 | + geodir_error_log($log_message); |
|
810 | 810 | } |
811 | 811 | } |
812 | 812 | |
@@ -901,7 +901,7 @@ discard block |
||
901 | 901 | $location_manager = defined('POST_LOCATION_TABLE') ? true : false; |
902 | 902 | $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false; |
903 | 903 | |
904 | - if(geodir_is_page('detail') && isset($post->country_slug)){ |
|
904 | + if (geodir_is_page('detail') && isset($post->country_slug)) { |
|
905 | 905 | $location_terms = array( |
906 | 906 | 'gd_country' => $post->country_slug, |
907 | 907 | 'gd_region' => $post->region_slug, |
@@ -1156,7 +1156,7 @@ discard block |
||
1156 | 1156 | $breadcrumb .= stripslashes_deep($page_title); |
1157 | 1157 | $breadcrumb .= '</li>'; |
1158 | 1158 | } else if (is_tag()) { |
1159 | - $breadcrumb .= "<li> " . $separator . single_tag_title('',false) . '</li>'; |
|
1159 | + $breadcrumb .= "<li> " . $separator . single_tag_title('', false) . '</li>'; |
|
1160 | 1160 | } else if (is_day()) { |
1161 | 1161 | $breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " "; |
1162 | 1162 | the_time('F jS, Y'); |
@@ -1248,7 +1248,7 @@ discard block |
||
1248 | 1248 | return new WP_Error('upload_dir_error', $upload['error']); |
1249 | 1249 | |
1250 | 1250 | // fetch the remote url and write it to the placeholder file |
1251 | - $headers = wp_remote_get($url, array('stream' => true,'filename' => $upload['file'])); |
|
1251 | + $headers = wp_remote_get($url, array('stream' => true, 'filename' => $upload['file'])); |
|
1252 | 1252 | |
1253 | 1253 | $log_message = ''; |
1254 | 1254 | $filesize = filesize($upload['file']); |
@@ -1261,16 +1261,16 @@ discard block |
||
1261 | 1261 | $log_message = sprintf(__('Remote server returned error response %1$d %2$s', 'geodirectory'), esc_html($headers['response']), get_status_header_desc($headers['response'])); |
1262 | 1262 | } |
1263 | 1263 | elseif (isset($headers['headers']['content-length']) && $filesize != $headers['headers']['content-length']) { |
1264 | - $log_message = __('Remote file is incorrect size', 'geodirectory'); |
|
1264 | + $log_message = __('Remote file is incorrect size', 'geodirectory'); |
|
1265 | 1265 | } |
1266 | 1266 | elseif (0 == $filesize) { |
1267 | 1267 | $log_message = __('Zero size file downloaded', 'geodirectory'); |
1268 | 1268 | } |
1269 | 1269 | |
1270 | - if($log_message){ |
|
1270 | + if ($log_message) { |
|
1271 | 1271 | $del = unlink($upload['file']); |
1272 | - if(!$del){geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory'));} |
|
1273 | - return new WP_Error('import_file_error',$log_message ); |
|
1272 | + if (!$del) {geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory')); } |
|
1273 | + return new WP_Error('import_file_error', $log_message); |
|
1274 | 1274 | } |
1275 | 1275 | |
1276 | 1276 | |
@@ -1286,10 +1286,10 @@ discard block |
||
1286 | 1286 | */ |
1287 | 1287 | function geodir_max_upload_size() |
1288 | 1288 | { |
1289 | - $max_filesize = (float)get_option('geodir_upload_max_filesize', 2); |
|
1289 | + $max_filesize = (float) get_option('geodir_upload_max_filesize', 2); |
|
1290 | 1290 | |
1291 | 1291 | if ($max_filesize > 0 && $max_filesize < 1) { |
1292 | - $max_filesize = (int)($max_filesize * 1024) . 'kb'; |
|
1292 | + $max_filesize = (int) ($max_filesize * 1024) . 'kb'; |
|
1293 | 1293 | } else { |
1294 | 1294 | $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb'; |
1295 | 1295 | } |
@@ -1358,35 +1358,35 @@ discard block |
||
1358 | 1358 | { |
1359 | 1359 | global $wpdb; |
1360 | 1360 | if ($message_type == 'expiration') { |
1361 | - $subject = stripslashes(__(get_option('renew_email_subject'),'geodirectory')); |
|
1362 | - $client_message = stripslashes(__(get_option('renew_email_content'),'geodirectory')); |
|
1361 | + $subject = stripslashes(__(get_option('renew_email_subject'), 'geodirectory')); |
|
1362 | + $client_message = stripslashes(__(get_option('renew_email_content'), 'geodirectory')); |
|
1363 | 1363 | } elseif ($message_type == 'post_submited') { |
1364 | - $subject = __(get_option('post_submited_success_email_subject_admin'),'geodirectory'); |
|
1365 | - $client_message = __(get_option('post_submited_success_email_content_admin'),'geodirectory'); |
|
1364 | + $subject = __(get_option('post_submited_success_email_subject_admin'), 'geodirectory'); |
|
1365 | + $client_message = __(get_option('post_submited_success_email_content_admin'), 'geodirectory'); |
|
1366 | 1366 | } elseif ($message_type == 'renew') { |
1367 | - $subject = __(get_option('post_renew_success_email_subject_admin'),'geodirectory'); |
|
1368 | - $client_message = __(get_option('post_renew_success_email_content_admin'),'geodirectory'); |
|
1367 | + $subject = __(get_option('post_renew_success_email_subject_admin'), 'geodirectory'); |
|
1368 | + $client_message = __(get_option('post_renew_success_email_content_admin'), 'geodirectory'); |
|
1369 | 1369 | } elseif ($message_type == 'upgrade') { |
1370 | - $subject = __(get_option('post_upgrade_success_email_subject_admin'),'geodirectory'); |
|
1371 | - $client_message = __(get_option('post_upgrade_success_email_content_admin'),'geodirectory'); |
|
1370 | + $subject = __(get_option('post_upgrade_success_email_subject_admin'), 'geodirectory'); |
|
1371 | + $client_message = __(get_option('post_upgrade_success_email_content_admin'), 'geodirectory'); |
|
1372 | 1372 | } elseif ($message_type == 'claim_approved') { |
1373 | - $subject = __(get_option('claim_approved_email_subject'),'geodirectory'); |
|
1374 | - $client_message = __(get_option('claim_approved_email_content'),'geodirectory'); |
|
1373 | + $subject = __(get_option('claim_approved_email_subject'), 'geodirectory'); |
|
1374 | + $client_message = __(get_option('claim_approved_email_content'), 'geodirectory'); |
|
1375 | 1375 | } elseif ($message_type == 'claim_rejected') { |
1376 | - $subject = __(get_option('claim_rejected_email_subject'),'geodirectory'); |
|
1377 | - $client_message = __(get_option('claim_rejected_email_content'),'geodirectory'); |
|
1376 | + $subject = __(get_option('claim_rejected_email_subject'), 'geodirectory'); |
|
1377 | + $client_message = __(get_option('claim_rejected_email_content'), 'geodirectory'); |
|
1378 | 1378 | } elseif ($message_type == 'claim_requested') { |
1379 | - $subject = __(get_option('claim_email_subject_admin'),'geodirectory'); |
|
1380 | - $client_message = __(get_option('claim_email_content_admin'),'geodirectory'); |
|
1379 | + $subject = __(get_option('claim_email_subject_admin'), 'geodirectory'); |
|
1380 | + $client_message = __(get_option('claim_email_content_admin'), 'geodirectory'); |
|
1381 | 1381 | } elseif ($message_type == 'auto_claim') { |
1382 | - $subject = __(get_option('auto_claim_email_subject'),'geodirectory'); |
|
1383 | - $client_message = __(get_option('auto_claim_email_content'),'geodirectory'); |
|
1382 | + $subject = __(get_option('auto_claim_email_subject'), 'geodirectory'); |
|
1383 | + $client_message = __(get_option('auto_claim_email_content'), 'geodirectory'); |
|
1384 | 1384 | } elseif ($message_type == 'payment_success') { |
1385 | - $subject = __(get_option('post_payment_success_admin_email_subject'),'geodirectory'); |
|
1386 | - $client_message = __(get_option('post_payment_success_admin_email_content'),'geodirectory'); |
|
1385 | + $subject = __(get_option('post_payment_success_admin_email_subject'), 'geodirectory'); |
|
1386 | + $client_message = __(get_option('post_payment_success_admin_email_content'), 'geodirectory'); |
|
1387 | 1387 | } elseif ($message_type == 'payment_fail') { |
1388 | - $subject = __(get_option('post_payment_fail_admin_email_subject'),'geodirectory'); |
|
1389 | - $client_message = __(get_option('post_payment_fail_admin_email_content'),'geodirectory'); |
|
1388 | + $subject = __(get_option('post_payment_fail_admin_email_subject'), 'geodirectory'); |
|
1389 | + $client_message = __(get_option('post_payment_fail_admin_email_content'), 'geodirectory'); |
|
1390 | 1390 | } |
1391 | 1391 | $transaction_details = $custom_1; |
1392 | 1392 | $fromEmail = get_option('site_email'); |
@@ -1427,18 +1427,18 @@ discard block |
||
1427 | 1427 | $to = $fromEmail; |
1428 | 1428 | $message = $client_message; |
1429 | 1429 | $sent = wp_mail($to, $subject, $message, $headers); |
1430 | - if( ! $sent ) { |
|
1431 | - if ( is_array( $to ) ) { |
|
1432 | - $to = implode( ',', $to ); |
|
1430 | + if (!$sent) { |
|
1431 | + if (is_array($to)) { |
|
1432 | + $to = implode(',', $to); |
|
1433 | 1433 | } |
1434 | 1434 | $log_message = sprintf( |
1435 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
1435 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
1436 | 1436 | $message_type, |
1437 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
1437 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
1438 | 1438 | $to, |
1439 | 1439 | $subject |
1440 | 1440 | ); |
1441 | - geodir_error_log( $log_message ); |
|
1441 | + geodir_error_log($log_message); |
|
1442 | 1442 | } |
1443 | 1443 | } |
1444 | 1444 | } |
@@ -1464,18 +1464,18 @@ discard block |
||
1464 | 1464 | { |
1465 | 1465 | $login_details = ''; |
1466 | 1466 | if ($message_type == 'send_friend') { |
1467 | - $subject = stripslashes(__(get_option('email_friend_subject'),'geodirectory')); |
|
1468 | - $message = stripslashes(__(get_option('email_friend_content'),'geodirectory')); |
|
1467 | + $subject = stripslashes(__(get_option('email_friend_subject'), 'geodirectory')); |
|
1468 | + $message = stripslashes(__(get_option('email_friend_content'), 'geodirectory')); |
|
1469 | 1469 | } elseif ($message_type == 'send_enquiry') { |
1470 | - $subject = __(get_option('email_enquiry_subject'),'geodirectory'); |
|
1471 | - $message = __(get_option('email_enquiry_content'),'geodirectory'); |
|
1470 | + $subject = __(get_option('email_enquiry_subject'), 'geodirectory'); |
|
1471 | + $message = __(get_option('email_enquiry_content'), 'geodirectory'); |
|
1472 | 1472 | } elseif ($message_type == 'forgot_password') { |
1473 | - $subject = __(get_option('forgot_password_subject'),'geodirectory'); |
|
1474 | - $message = __(get_option('forgot_password_content'),'geodirectory'); |
|
1473 | + $subject = __(get_option('forgot_password_subject'), 'geodirectory'); |
|
1474 | + $message = __(get_option('forgot_password_content'), 'geodirectory'); |
|
1475 | 1475 | $login_details = $to_message; |
1476 | 1476 | } elseif ($message_type == 'registration') { |
1477 | - $subject = __(get_option('registration_success_email_subject'),'geodirectory'); |
|
1478 | - $message = __(get_option('registration_success_email_content'),'geodirectory'); |
|
1477 | + $subject = __(get_option('registration_success_email_subject'), 'geodirectory'); |
|
1478 | + $message = __(get_option('registration_success_email_content'), 'geodirectory'); |
|
1479 | 1479 | $login_details = $to_message; |
1480 | 1480 | } |
1481 | 1481 | $to_message = nl2br($to_message); |
@@ -1509,18 +1509,18 @@ discard block |
||
1509 | 1509 | $to = $toEmail; |
1510 | 1510 | |
1511 | 1511 | $sent = wp_mail($to, $subject, $message, $headers); |
1512 | - if( ! $sent ) { |
|
1513 | - if ( is_array( $to ) ) { |
|
1514 | - $to = implode( ',', $to ); |
|
1512 | + if (!$sent) { |
|
1513 | + if (is_array($to)) { |
|
1514 | + $to = implode(',', $to); |
|
1515 | 1515 | } |
1516 | 1516 | $log_message = sprintf( |
1517 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
1517 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
1518 | 1518 | $message_type, |
1519 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
1519 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
1520 | 1520 | $to, |
1521 | 1521 | $subject |
1522 | 1522 | ); |
1523 | - geodir_error_log( $log_message ); |
|
1523 | + geodir_error_log($log_message); |
|
1524 | 1524 | } |
1525 | 1525 | |
1526 | 1526 | ///////// ADMIN BCC EMIALS |
@@ -1546,20 +1546,20 @@ discard block |
||
1546 | 1546 | $admin_bcc = true; |
1547 | 1547 | } |
1548 | 1548 | |
1549 | - if($admin_bcc === true){ |
|
1549 | + if ($admin_bcc === true) { |
|
1550 | 1550 | $sent = wp_mail($to, $subject, $message, $headers); |
1551 | - if( ! $sent ) { |
|
1552 | - if ( is_array( $to ) ) { |
|
1553 | - $to = implode( ',', $to ); |
|
1551 | + if (!$sent) { |
|
1552 | + if (is_array($to)) { |
|
1553 | + $to = implode(',', $to); |
|
1554 | 1554 | } |
1555 | 1555 | $log_message = sprintf( |
1556 | - __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ), |
|
1556 | + __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'), |
|
1557 | 1557 | $message_type, |
1558 | - date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ), |
|
1558 | + date_i18n('F j Y H:i:s', current_time('timestamp')), |
|
1559 | 1559 | $to, |
1560 | 1560 | $subject |
1561 | 1561 | ); |
1562 | - geodir_error_log( $log_message ); |
|
1562 | + geodir_error_log($log_message); |
|
1563 | 1563 | } |
1564 | 1564 | } |
1565 | 1565 | |
@@ -1607,7 +1607,7 @@ discard block |
||
1607 | 1607 | function geodir_custom_posts_body_class($classes) { |
1608 | 1608 | global $wpdb, $wp; |
1609 | 1609 | $post_types = geodir_get_posttypes('object'); |
1610 | - if (!empty($post_types) && count((array)$post_types) > 1) { |
|
1610 | + if (!empty($post_types) && count((array) $post_types) > 1) { |
|
1611 | 1611 | $classes[] = 'geodir_custom_posts'; |
1612 | 1612 | } |
1613 | 1613 | |
@@ -1900,7 +1900,7 @@ discard block |
||
1900 | 1900 | $sql = "SELECT COUNT(" . $wpdb->posts . ".ID) AS total FROM " . $wpdb->posts . " |
1901 | 1901 | " . $join . " |
1902 | 1902 | " . $where; |
1903 | - $rows = (int)$wpdb->get_var($sql); |
|
1903 | + $rows = (int) $wpdb->get_var($sql); |
|
1904 | 1904 | } else { |
1905 | 1905 | $orderby = geodir_widget_listings_get_order($query_args); |
1906 | 1906 | /** |
@@ -1926,10 +1926,10 @@ discard block |
||
1926 | 1926 | $limit = apply_filters('geodir_filter_widget_listings_limit', $limit, $post_type); |
1927 | 1927 | |
1928 | 1928 | $page = !empty($query_args['pageno']) ? absint($query_args['pageno']) : 1; |
1929 | - if ( !$page ) |
|
1929 | + if (!$page) |
|
1930 | 1930 | $page = 1; |
1931 | 1931 | |
1932 | - $limit = (int)$limit > 0 ? " LIMIT " . absint( ( $page - 1 ) * (int)$limit ) . ", " . (int)$limit : ""; |
|
1932 | + $limit = (int) $limit > 0 ? " LIMIT " . absint(($page - 1) * (int) $limit) . ", " . (int) $limit : ""; |
|
1933 | 1933 | |
1934 | 1934 | $sql = "SELECT SQL_CALC_FOUND_ROWS " . $fields . " FROM " . $wpdb->posts . " |
1935 | 1935 | " . $join . " |
@@ -2031,7 +2031,7 @@ discard block |
||
2031 | 2031 | } |
2032 | 2032 | |
2033 | 2033 | if (!empty($query_args['post_author'])) { |
2034 | - $where .= " AND " . $wpdb->posts . ".post_author = " . (int)$query_args['post_author']; |
|
2034 | + $where .= " AND " . $wpdb->posts . ".post_author = " . (int) $query_args['post_author']; |
|
2035 | 2035 | } |
2036 | 2036 | |
2037 | 2037 | if (!empty($query_args['show_featured_only'])) { |
@@ -2108,7 +2108,7 @@ discard block |
||
2108 | 2108 | } |
2109 | 2109 | |
2110 | 2110 | if (!empty($query_args) && !empty($query_args['posts_per_page'])) { |
2111 | - $limit = (int)$query_args['posts_per_page']; |
|
2111 | + $limit = (int) $query_args['posts_per_page']; |
|
2112 | 2112 | } |
2113 | 2113 | |
2114 | 2114 | return $limit; |
@@ -2251,9 +2251,9 @@ discard block |
||
2251 | 2251 | add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
2252 | 2252 | } |
2253 | 2253 | $home_url = str_replace("www.", "", $home_url); |
2254 | - 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')) ) { |
|
2254 | + 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'))) { |
|
2255 | 2255 | return true; |
2256 | - }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')){ |
|
2256 | + }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')) { |
|
2257 | 2257 | return true; |
2258 | 2258 | } else { |
2259 | 2259 | return false; |
@@ -2336,7 +2336,7 @@ discard block |
||
2336 | 2336 | |
2337 | 2337 | $gd_post_type = geodir_get_current_posttype(); |
2338 | 2338 | |
2339 | - $category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int)$instance['category_limit'] : 15; |
|
2339 | + $category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int) $instance['category_limit'] : 15; |
|
2340 | 2340 | $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'] : ''); |
2341 | 2341 | |
2342 | 2342 | $taxonomy = array(); |
@@ -2369,14 +2369,14 @@ discard block |
||
2369 | 2369 | foreach ($b_terms as $key => $val) { |
2370 | 2370 | $ptype = get_post_type_object(str_replace("category", "", $key)); |
2371 | 2371 | $cpt_name = __($ptype->labels->singular_name, 'geodirectory'); |
2372 | - $tax_change_output .= "<option value='$key' ". selected($key, $default_taxonomy, false) .">" . sprintf(__('%s Categories', 'geodirectory'),$cpt_name) . "</option>"; |
|
2372 | + $tax_change_output .= "<option value='$key' " . selected($key, $default_taxonomy, false) . ">" . sprintf(__('%s Categories', 'geodirectory'), $cpt_name) . "</option>"; |
|
2373 | 2373 | } |
2374 | 2374 | $tax_change_output .= "</select>"; |
2375 | 2375 | } |
2376 | 2376 | |
2377 | 2377 | if (!empty($b_terms)) { |
2378 | - $terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms);// get the first array |
|
2379 | - global $cat_count;//make global so we can change via function |
|
2378 | + $terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms); // get the first array |
|
2379 | + global $cat_count; //make global so we can change via function |
|
2380 | 2380 | $cat_count = 0; |
2381 | 2381 | ?> |
2382 | 2382 | <div class="geodir-category-list-in clearfix"> |
@@ -2440,7 +2440,7 @@ discard block |
||
2440 | 2440 | $class_row = $cat_count > $category_limit ? 'geodir-pcat-hide geodir-hide' : 'geodir-pcat-show'; |
2441 | 2441 | $total_post = $cat->count; |
2442 | 2442 | |
2443 | - $term_link = get_term_link( $cat, $cat->taxonomy ); |
|
2443 | + $term_link = get_term_link($cat, $cat->taxonomy); |
|
2444 | 2444 | /** |
2445 | 2445 | * Filer the category term link. |
2446 | 2446 | * |
@@ -2449,7 +2449,7 @@ discard block |
||
2449 | 2449 | * @param int $cat->term_id The term id. |
2450 | 2450 | * @param string $post_type Wordpress post type. |
2451 | 2451 | */ |
2452 | - $term_link = apply_filters( 'geodir_category_term_link', $term_link, $cat->term_id, $post_type ); |
|
2452 | + $term_link = apply_filters('geodir_category_term_link', $term_link, $cat->term_id, $post_type); |
|
2453 | 2453 | |
2454 | 2454 | echo '<li class="' . $class_row . '"><a href="' . $term_link . '">'; |
2455 | 2455 | 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> '; |
@@ -2583,29 +2583,29 @@ discard block |
||
2583 | 2583 | itemWidth: 75, |
2584 | 2584 | itemMargin: 5, |
2585 | 2585 | asNavFor: '#geodir_widget_slider', |
2586 | - rtl: <?php echo ( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?> |
|
2586 | + rtl: <?php echo (is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?> |
|
2587 | 2587 | }); |
2588 | 2588 | |
2589 | 2589 | jQuery('#geodir_widget_slider').flexslider({ |
2590 | - animation: "<?php echo $animation;?>", |
|
2590 | + animation: "<?php echo $animation; ?>", |
|
2591 | 2591 | selector: ".geodir-slides > li", |
2592 | 2592 | namespace: "geodir-", |
2593 | 2593 | controlNav: true, |
2594 | - animationLoop: <?php echo $animationLoop;?>, |
|
2595 | - slideshow: <?php echo $slideshow;?>, |
|
2596 | - slideshowSpeed: <?php echo $slideshowSpeed;?>, |
|
2597 | - animationSpeed: <?php echo $animationSpeed;?>, |
|
2598 | - directionNav: <?php echo $directionNav;?>, |
|
2599 | - maxItems: <?php echo $max_show;?>, |
|
2594 | + animationLoop: <?php echo $animationLoop; ?>, |
|
2595 | + slideshow: <?php echo $slideshow; ?>, |
|
2596 | + slideshowSpeed: <?php echo $slideshowSpeed; ?>, |
|
2597 | + animationSpeed: <?php echo $animationSpeed; ?>, |
|
2598 | + directionNav: <?php echo $directionNav; ?>, |
|
2599 | + maxItems: <?php echo $max_show; ?>, |
|
2600 | 2600 | move: 1, |
2601 | - <?php if($slide_width){ echo "itemWidth: ".$slide_width.",";}?> |
|
2601 | + <?php if ($slide_width) { echo "itemWidth: " . $slide_width . ","; }?> |
|
2602 | 2602 | sync: "#geodir_widget_carousel", |
2603 | 2603 | start: function (slider) { |
2604 | 2604 | jQuery('.geodir-listing-flex-loader').hide(); |
2605 | 2605 | jQuery('#geodir_widget_slider').css({'visibility': 'visible'}); |
2606 | 2606 | jQuery('#geodir_widget_carousel').css({'visibility': 'visible'}); |
2607 | 2607 | }, |
2608 | - rtl: <?php echo ( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?> |
|
2608 | + rtl: <?php echo (is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?> |
|
2609 | 2609 | }); |
2610 | 2610 | }); |
2611 | 2611 | </script> |
@@ -2646,7 +2646,7 @@ discard block |
||
2646 | 2646 | |
2647 | 2647 | global $post; |
2648 | 2648 | |
2649 | - $current_post = $post;// keep current post info |
|
2649 | + $current_post = $post; // keep current post info |
|
2650 | 2650 | |
2651 | 2651 | $widget_main_slides = ''; |
2652 | 2652 | $nav_slides = ''; |
@@ -3086,7 +3086,7 @@ discard block |
||
3086 | 3086 | $geodir_add_location_url = '1'; |
3087 | 3087 | } |
3088 | 3088 | |
3089 | - $viewall_url = get_term_link((int)$category[0], $post_type . 'category'); |
|
3089 | + $viewall_url = get_term_link((int) $category[0], $post_type . 'category'); |
|
3090 | 3090 | |
3091 | 3091 | $geodir_add_location_url = NULL; |
3092 | 3092 | } |
@@ -3094,7 +3094,7 @@ discard block |
||
3094 | 3094 | $gd_session->set('gd_multi_location', 1); |
3095 | 3095 | } |
3096 | 3096 | |
3097 | - if(is_wp_error( $viewall_url )){$viewall_url = '';} |
|
3097 | + if (is_wp_error($viewall_url)) {$viewall_url = ''; } |
|
3098 | 3098 | |
3099 | 3099 | $query_args = array( |
3100 | 3100 | 'posts_per_page' => $post_number, |
@@ -3332,14 +3332,14 @@ discard block |
||
3332 | 3332 | * @package GeoDirectory |
3333 | 3333 | * @return bool |
3334 | 3334 | */ |
3335 | -function geodir_term_review_count_force_update($new_status, $old_status='', $post='') |
|
3335 | +function geodir_term_review_count_force_update($new_status, $old_status = '', $post = '') |
|
3336 | 3336 | { |
3337 | - if(isset($_REQUEST['action']) && $_REQUEST['action']=='geodir_import_export'){return;}//do not run if importing listings |
|
3337 | + if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'geodir_import_export') {return; }//do not run if importing listings |
|
3338 | 3338 | |
3339 | - if(isset($post->post_type) && ($post->post_type=='nav_menu_item' || $post->post_type=='page' || $post->post_type=='post')){ |
|
3339 | + if (isset($post->post_type) && ($post->post_type == 'nav_menu_item' || $post->post_type == 'page' || $post->post_type == 'post')) { |
|
3340 | 3340 | return; |
3341 | 3341 | } |
3342 | - if($new_status!=$old_status) { |
|
3342 | + if ($new_status != $old_status) { |
|
3343 | 3343 | geodir_count_reviews_by_terms(true); |
3344 | 3344 | } |
3345 | 3345 | return true; |
@@ -3504,7 +3504,7 @@ discard block |
||
3504 | 3504 | */ |
3505 | 3505 | try { |
3506 | 3506 | require_once($language_file); |
3507 | - } catch(Exception $e) { |
|
3507 | + } catch (Exception $e) { |
|
3508 | 3508 | error_log('Language Error: ' . $e->getMessage()); |
3509 | 3509 | } |
3510 | 3510 | } |
@@ -3522,18 +3522,18 @@ discard block |
||
3522 | 3522 | */ |
3523 | 3523 | function geodirectory_load_db_language() { |
3524 | 3524 | global $wp_filesystem; |
3525 | - if( empty( $wp_filesystem ) ) { |
|
3526 | - require_once( ABSPATH .'/wp-admin/includes/file.php' ); |
|
3525 | + if (empty($wp_filesystem)) { |
|
3526 | + require_once(ABSPATH . '/wp-admin/includes/file.php'); |
|
3527 | 3527 | WP_Filesystem(); |
3528 | 3528 | global $wp_filesystem; |
3529 | 3529 | } |
3530 | 3530 | |
3531 | 3531 | $language_file = geodir_plugin_path() . '/db-language.php'; |
3532 | 3532 | |
3533 | - if(is_file($language_file) && !is_writable($language_file)) |
|
3533 | + if (is_file($language_file) && !is_writable($language_file)) |
|
3534 | 3534 | return false; // Not possible to create. |
3535 | 3535 | |
3536 | - if(!is_file($language_file) && !is_writable(dirname($language_file))) |
|
3536 | + if (!is_file($language_file) && !is_writable(dirname($language_file))) |
|
3537 | 3537 | return false; // Not possible to create. |
3538 | 3538 | |
3539 | 3539 | $contents_strings = array(); |
@@ -3567,7 +3567,7 @@ discard block |
||
3567 | 3567 | $contents = implode(PHP_EOL, $contents_head); |
3568 | 3568 | |
3569 | 3569 | if (!empty($contents_strings)) { |
3570 | - foreach ( $contents_strings as $string ) { |
|
3570 | + foreach ($contents_strings as $string) { |
|
3571 | 3571 | if (is_scalar($string) && $string != '') { |
3572 | 3572 | $string = str_replace("'", "\'", $string); |
3573 | 3573 | $contents .= PHP_EOL . "__('" . $string . "', 'geodirectory');"; |
@@ -3577,7 +3577,7 @@ discard block |
||
3577 | 3577 | |
3578 | 3578 | $contents .= implode(PHP_EOL, $contents_foot); |
3579 | 3579 | |
3580 | - if($wp_filesystem->put_contents( $language_file, $contents, FS_CHMOD_FILE)) |
|
3580 | + if ($wp_filesystem->put_contents($language_file, $contents, FS_CHMOD_FILE)) |
|
3581 | 3581 | return false; // Failure; could not write file. |
3582 | 3582 | |
3583 | 3583 | return true; |
@@ -3603,7 +3603,7 @@ discard block |
||
3603 | 3603 | $rows = $wpdb->get_results($sql); |
3604 | 3604 | |
3605 | 3605 | if (!empty($rows)) { |
3606 | - foreach($rows as $row) { |
|
3606 | + foreach ($rows as $row) { |
|
3607 | 3607 | if (!empty($row->admin_title)) |
3608 | 3608 | $translation_texts[] = stripslashes_deep($row->admin_title); |
3609 | 3609 | |
@@ -3641,7 +3641,7 @@ discard block |
||
3641 | 3641 | $rows = $wpdb->get_results($sql); |
3642 | 3642 | |
3643 | 3643 | if (!empty($rows)) { |
3644 | - foreach($rows as $row) { |
|
3644 | + foreach ($rows as $row) { |
|
3645 | 3645 | if (!empty($row->site_title)) |
3646 | 3646 | $translation_texts[] = stripslashes_deep($row->site_title); |
3647 | 3647 | |
@@ -3659,7 +3659,7 @@ discard block |
||
3659 | 3659 | $rows = $wpdb->get_results($sql); |
3660 | 3660 | |
3661 | 3661 | if (!empty($rows)) { |
3662 | - foreach($rows as $row) { |
|
3662 | + foreach ($rows as $row) { |
|
3663 | 3663 | if (!empty($row->field_site_name)) |
3664 | 3664 | $translation_texts[] = stripslashes_deep($row->field_site_name); |
3665 | 3665 | |
@@ -3694,7 +3694,7 @@ discard block |
||
3694 | 3694 | * |
3695 | 3695 | * @param array $geodir_allowed_mime_types and file extensions. |
3696 | 3696 | */ |
3697 | - return apply_filters( 'geodir_allowed_mime_types', array( |
|
3697 | + return apply_filters('geodir_allowed_mime_types', array( |
|
3698 | 3698 | 'Image' => array( // Image formats. |
3699 | 3699 | 'jpg' => 'image/jpeg', |
3700 | 3700 | 'jpe' => 'image/jpeg', |
@@ -3783,13 +3783,13 @@ discard block |
||
3783 | 3783 | |
3784 | 3784 | |
3785 | 3785 | |
3786 | -add_filter('wpseo_replacements','geodir_wpseo_replacements',10,1); |
|
3786 | +add_filter('wpseo_replacements', 'geodir_wpseo_replacements', 10, 1); |
|
3787 | 3787 | /* |
3788 | 3788 | * Add location variables to wpseo replacements. |
3789 | 3789 | * |
3790 | 3790 | * @since 1.5.4 |
3791 | 3791 | */ |
3792 | -function geodir_wpseo_replacements($vars){ |
|
3792 | +function geodir_wpseo_replacements($vars) { |
|
3793 | 3793 | |
3794 | 3794 | global $wp; |
3795 | 3795 | $title = ''; |
@@ -3804,12 +3804,12 @@ discard block |
||
3804 | 3804 | * @param array $location_array The array of location variables. |
3805 | 3805 | * @param array $vars The page title variables. |
3806 | 3806 | */ |
3807 | - $location_array = apply_filters('geodir_filter_title_variables_location_arr_seo',$location_array, $vars); |
|
3807 | + $location_array = apply_filters('geodir_filter_title_variables_location_arr_seo', $location_array, $vars); |
|
3808 | 3808 | $location_titles = array(); |
3809 | - if(get_query_var( 'gd_country_full' )){ |
|
3810 | - if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );} |
|
3811 | - if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );} |
|
3812 | - if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );} |
|
3809 | + if (get_query_var('gd_country_full')) { |
|
3810 | + if (get_query_var('gd_country_full')) {$location_array['gd_country'] = get_query_var('gd_country_full'); } |
|
3811 | + if (get_query_var('gd_region_full')) {$location_array['gd_region'] = get_query_var('gd_region_full'); } |
|
3812 | + if (get_query_var('gd_city_full')) {$location_array['gd_city'] = get_query_var('gd_city_full'); } |
|
3813 | 3813 | } |
3814 | 3814 | $location_single = ''; |
3815 | 3815 | $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
@@ -3881,23 +3881,23 @@ discard block |
||
3881 | 3881 | } |
3882 | 3882 | |
3883 | 3883 | |
3884 | - if(!empty($location_titles)) { |
|
3884 | + if (!empty($location_titles)) { |
|
3885 | 3885 | $vars['%%location%%'] = implode(", ", $location_titles); |
3886 | 3886 | } |
3887 | 3887 | |
3888 | 3888 | |
3889 | - if(!empty($location_titles)) { |
|
3889 | + if (!empty($location_titles)) { |
|
3890 | 3890 | $vars['%%in_location%%'] = __('in ', 'geodirectory') . implode(", ", $location_titles); |
3891 | 3891 | } |
3892 | 3892 | |
3893 | 3893 | |
3894 | 3894 | |
3895 | - if($location_single) { |
|
3896 | - $vars['%%in_location_single%%'] = __('in', 'geodirectory') . ' ' .$location_single; |
|
3895 | + if ($location_single) { |
|
3896 | + $vars['%%in_location_single%%'] = __('in', 'geodirectory') . ' ' . $location_single; |
|
3897 | 3897 | } |
3898 | 3898 | |
3899 | 3899 | |
3900 | - if($location_single) { |
|
3900 | + if ($location_single) { |
|
3901 | 3901 | $vars['%%location_single%%'] = $location_single; |
3902 | 3902 | } |
3903 | 3903 | |
@@ -3909,17 +3909,17 @@ discard block |
||
3909 | 3909 | * @param string $vars The title with variables. |
3910 | 3910 | * @param array $location_array The array of location variables. |
3911 | 3911 | */ |
3912 | - return apply_filters('geodir_wpseo_replacements_vars',$vars,$location_array); |
|
3912 | + return apply_filters('geodir_wpseo_replacements_vars', $vars, $location_array); |
|
3913 | 3913 | } |
3914 | 3914 | |
3915 | 3915 | |
3916 | -add_filter('geodir_seo_meta_title','geodir_filter_title_variables',10,3); |
|
3917 | -add_filter('geodir_seo_page_title','geodir_filter_title_variables',10,2); |
|
3918 | -add_filter('geodir_seo_meta_description_pre','geodir_filter_title_variables',10,3); |
|
3919 | -function geodir_filter_title_variables($title, $gd_page, $sep=''){ |
|
3916 | +add_filter('geodir_seo_meta_title', 'geodir_filter_title_variables', 10, 3); |
|
3917 | +add_filter('geodir_seo_page_title', 'geodir_filter_title_variables', 10, 2); |
|
3918 | +add_filter('geodir_seo_meta_description_pre', 'geodir_filter_title_variables', 10, 3); |
|
3919 | +function geodir_filter_title_variables($title, $gd_page, $sep = '') { |
|
3920 | 3920 | |
3921 | 3921 | |
3922 | - if(!$gd_page || !$title){return $title;}// if no a GD page then bail. |
|
3922 | + if (!$gd_page || !$title) {return $title; }// if no a GD page then bail. |
|
3923 | 3923 | global $post; |
3924 | 3924 | //print_r($post); |
3925 | 3925 | /* |
@@ -3961,123 +3961,123 @@ discard block |
||
3961 | 3961 | } |
3962 | 3962 | |
3963 | 3963 | |
3964 | - if(strpos($title,'%%title%%') !== false){ |
|
3965 | - $title = str_replace("%%title%%",$post->post_title,$title); |
|
3964 | + if (strpos($title, '%%title%%') !== false) { |
|
3965 | + $title = str_replace("%%title%%", $post->post_title, $title); |
|
3966 | 3966 | } |
3967 | 3967 | |
3968 | - if(strpos($title,'%%sitename%%') !== false){ |
|
3969 | - $title = str_replace("%%sitename%%",get_bloginfo('name'),$title); |
|
3968 | + if (strpos($title, '%%sitename%%') !== false) { |
|
3969 | + $title = str_replace("%%sitename%%", get_bloginfo('name'), $title); |
|
3970 | 3970 | } |
3971 | 3971 | |
3972 | - if(strpos($title,'%%sitedesc%%') !== false){ |
|
3973 | - $title = str_replace("%%sitedesc%%",get_bloginfo('description'),$title); |
|
3972 | + if (strpos($title, '%%sitedesc%%') !== false) { |
|
3973 | + $title = str_replace("%%sitedesc%%", get_bloginfo('description'), $title); |
|
3974 | 3974 | } |
3975 | 3975 | |
3976 | - if(strpos($title,'%%excerpt%%') !== false){ |
|
3977 | - $title = str_replace("%%excerpt%%",strip_tags(get_the_excerpt()),$title); |
|
3976 | + if (strpos($title, '%%excerpt%%') !== false) { |
|
3977 | + $title = str_replace("%%excerpt%%", strip_tags(get_the_excerpt()), $title); |
|
3978 | 3978 | } |
3979 | 3979 | |
3980 | - if(strpos($title,'%%pt_single%%') !== false){ |
|
3980 | + if (strpos($title, '%%pt_single%%') !== false) { |
|
3981 | 3981 | $single_name = ''; |
3982 | - if($gd_page=='search' || $gd_page=='author'){ |
|
3982 | + if ($gd_page == 'search' || $gd_page == 'author') { |
|
3983 | 3983 | $geodir_post_types = get_option('geodir_post_types'); |
3984 | 3984 | $spt = esc_attr($_REQUEST['stype']); |
3985 | - if(isset($geodir_post_types[$spt]['labels']['singular_name'])){ |
|
3986 | - $single_name = __($geodir_post_types[$spt]['labels']['singular_name'],'geodirectory'); |
|
3985 | + if (isset($geodir_post_types[$spt]['labels']['singular_name'])) { |
|
3986 | + $single_name = __($geodir_post_types[$spt]['labels']['singular_name'], 'geodirectory'); |
|
3987 | 3987 | } |
3988 | - }elseif($gd_page=='add-listing'){ |
|
3988 | + }elseif ($gd_page == 'add-listing') { |
|
3989 | 3989 | $geodir_post_types = get_option('geodir_post_types'); |
3990 | 3990 | $spt = isset($_REQUEST['listing_type']) ? esc_attr($_REQUEST['listing_type']) : ''; |
3991 | - if(!$spt && isset($_REQUEST['pid'])){ |
|
3992 | - $spt = get_post_type( $_REQUEST['pid'] ); |
|
3991 | + if (!$spt && isset($_REQUEST['pid'])) { |
|
3992 | + $spt = get_post_type($_REQUEST['pid']); |
|
3993 | 3993 | } |
3994 | - if(!$spt){$spt='gd_place';} |
|
3995 | - if(isset($geodir_post_types[$spt]['labels']['singular_name'])){ |
|
3996 | - $single_name = __($geodir_post_types[$spt]['labels']['singular_name'],'geodirectory'); |
|
3994 | + if (!$spt) {$spt = 'gd_place'; } |
|
3995 | + if (isset($geodir_post_types[$spt]['labels']['singular_name'])) { |
|
3996 | + $single_name = __($geodir_post_types[$spt]['labels']['singular_name'], 'geodirectory'); |
|
3997 | 3997 | } |
3998 | 3998 | } |
3999 | - elseif($post->post_type){ |
|
3999 | + elseif ($post->post_type) { |
|
4000 | 4000 | $geodir_post_types = get_option('geodir_post_types'); |
4001 | - if(isset($geodir_post_types[$post->post_type]['labels']['singular_name'])){ |
|
4002 | - $single_name = __($geodir_post_types[$post->post_type]['labels']['singular_name'],'geodirectory'); |
|
4001 | + if (isset($geodir_post_types[$post->post_type]['labels']['singular_name'])) { |
|
4002 | + $single_name = __($geodir_post_types[$post->post_type]['labels']['singular_name'], 'geodirectory'); |
|
4003 | 4003 | } |
4004 | 4004 | |
4005 | 4005 | |
4006 | 4006 | } |
4007 | - $title = str_replace("%%pt_single%%",$single_name,$title); |
|
4007 | + $title = str_replace("%%pt_single%%", $single_name, $title); |
|
4008 | 4008 | } |
4009 | 4009 | |
4010 | - if(strpos($title,'%%pt_plural%%') !== false){ |
|
4010 | + if (strpos($title, '%%pt_plural%%') !== false) { |
|
4011 | 4011 | $plural_name = ''; |
4012 | - if($gd_page=='search' || $gd_page=='author'){ |
|
4012 | + if ($gd_page == 'search' || $gd_page == 'author') { |
|
4013 | 4013 | $geodir_post_types = get_option('geodir_post_types'); |
4014 | 4014 | $spt = esc_attr($_REQUEST['stype']); |
4015 | - if(isset($geodir_post_types[$spt]['labels']['name'])){ |
|
4016 | - $plural_name = __($geodir_post_types[$spt]['labels']['name'],'geodirectory'); |
|
4015 | + if (isset($geodir_post_types[$spt]['labels']['name'])) { |
|
4016 | + $plural_name = __($geodir_post_types[$spt]['labels']['name'], 'geodirectory'); |
|
4017 | 4017 | } |
4018 | - }elseif($gd_page=='add-listing'){ |
|
4018 | + }elseif ($gd_page == 'add-listing') { |
|
4019 | 4019 | $geodir_post_types = get_option('geodir_post_types'); |
4020 | 4020 | $spt = sanitize_text_field($_REQUEST['listing_type']); |
4021 | - if(!$spt){$spt='gd_place';} |
|
4022 | - if(isset($geodir_post_types[$spt]['labels']['name'])){ |
|
4023 | - $plural_name = __($geodir_post_types[$spt]['labels']['name'],'geodirectory'); |
|
4021 | + if (!$spt) {$spt = 'gd_place'; } |
|
4022 | + if (isset($geodir_post_types[$spt]['labels']['name'])) { |
|
4023 | + $plural_name = __($geodir_post_types[$spt]['labels']['name'], 'geodirectory'); |
|
4024 | 4024 | } |
4025 | 4025 | } |
4026 | - elseif(isset($post->post_type) && $post->post_type){ |
|
4026 | + elseif (isset($post->post_type) && $post->post_type) { |
|
4027 | 4027 | $geodir_post_types = get_option('geodir_post_types'); |
4028 | - if(isset($geodir_post_types[$post->post_type]['labels']['name'])){ |
|
4029 | - $plural_name = __($geodir_post_types[$post->post_type]['labels']['name'],'geodirectory'); |
|
4028 | + if (isset($geodir_post_types[$post->post_type]['labels']['name'])) { |
|
4029 | + $plural_name = __($geodir_post_types[$post->post_type]['labels']['name'], 'geodirectory'); |
|
4030 | 4030 | } |
4031 | 4031 | |
4032 | 4032 | } |
4033 | - $title = str_replace("%%pt_plural%%",$plural_name,$title); |
|
4033 | + $title = str_replace("%%pt_plural%%", $plural_name, $title); |
|
4034 | 4034 | } |
4035 | 4035 | |
4036 | 4036 | |
4037 | 4037 | |
4038 | - if(strpos($title,'%%category%%') !== false){ |
|
4038 | + if (strpos($title, '%%category%%') !== false) { |
|
4039 | 4039 | $cat_name = ''; |
4040 | 4040 | |
4041 | - if($gd_page=='detail') { |
|
4041 | + if ($gd_page == 'detail') { |
|
4042 | 4042 | if ($post->default_category) { |
4043 | 4043 | $cat = get_term($post->default_category, $post->post_type . 'category'); |
4044 | 4044 | $cat_name = (isset($cat->name)) ? $cat->name : ''; |
4045 | 4045 | } |
4046 | - }elseif($gd_page=='listing'){ |
|
4046 | + }elseif ($gd_page == 'listing') { |
|
4047 | 4047 | $queried_object = get_queried_object(); |
4048 | - if(isset($queried_object->name)){ |
|
4048 | + if (isset($queried_object->name)) { |
|
4049 | 4049 | $cat_name = $queried_object->name; |
4050 | 4050 | } |
4051 | 4051 | } |
4052 | - $title = str_replace("%%category%%",$cat_name,$title); |
|
4052 | + $title = str_replace("%%category%%", $cat_name, $title); |
|
4053 | 4053 | } |
4054 | 4054 | |
4055 | - if(strpos($title,'%%tag%%') !== false){ |
|
4055 | + if (strpos($title, '%%tag%%') !== false) { |
|
4056 | 4056 | $cat_name = ''; |
4057 | 4057 | |
4058 | - if($gd_page=='detail') { |
|
4058 | + if ($gd_page == 'detail') { |
|
4059 | 4059 | if ($post->default_category) { |
4060 | 4060 | $cat = get_term($post->default_category, $post->post_type . 'category'); |
4061 | 4061 | $cat_name = (isset($cat->name)) ? $cat->name : ''; |
4062 | 4062 | } |
4063 | - }elseif($gd_page=='listing'){ |
|
4063 | + }elseif ($gd_page == 'listing') { |
|
4064 | 4064 | $queried_object = get_queried_object(); |
4065 | - if(isset($queried_object->name)){ |
|
4065 | + if (isset($queried_object->name)) { |
|
4066 | 4066 | $cat_name = $queried_object->name; |
4067 | 4067 | } |
4068 | 4068 | } |
4069 | - $title = str_replace("%%tag%%",$cat_name,$title); |
|
4069 | + $title = str_replace("%%tag%%", $cat_name, $title); |
|
4070 | 4070 | } |
4071 | 4071 | |
4072 | 4072 | |
4073 | 4073 | |
4074 | - if(strpos($title,'%%id%%') !== false){ |
|
4074 | + if (strpos($title, '%%id%%') !== false) { |
|
4075 | 4075 | $ID = (isset($post->ID)) ? $post->ID : ''; |
4076 | - $title = str_replace("%%id%%",$ID,$title); |
|
4076 | + $title = str_replace("%%id%%", $ID, $title); |
|
4077 | 4077 | } |
4078 | 4078 | |
4079 | - if(strpos($title,'%%sep%%') !== false){ |
|
4080 | - $title = str_replace("%%sep%%",$sep,$title); |
|
4079 | + if (strpos($title, '%%sep%%') !== false) { |
|
4080 | + $title = str_replace("%%sep%%", $sep, $title); |
|
4081 | 4081 | } |
4082 | 4082 | |
4083 | 4083 | |
@@ -4095,12 +4095,12 @@ discard block |
||
4095 | 4095 | * @param string $gd_page The page being filtered. |
4096 | 4096 | * @param string $sep The separator, default: `|`. |
4097 | 4097 | */ |
4098 | - $location_array = apply_filters('geodir_filter_title_variables_location_arr',$location_array,$title, $gd_page, $sep); |
|
4098 | + $location_array = apply_filters('geodir_filter_title_variables_location_arr', $location_array, $title, $gd_page, $sep); |
|
4099 | 4099 | $location_titles = array(); |
4100 | - if($gd_page=='location' && get_query_var( 'gd_country_full' )){ |
|
4101 | - if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );} |
|
4102 | - if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );} |
|
4103 | - if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );} |
|
4100 | + if ($gd_page == 'location' && get_query_var('gd_country_full')) { |
|
4101 | + if (get_query_var('gd_country_full')) {$location_array['gd_country'] = get_query_var('gd_country_full'); } |
|
4102 | + if (get_query_var('gd_region_full')) {$location_array['gd_region'] = get_query_var('gd_region_full'); } |
|
4103 | + if (get_query_var('gd_city_full')) {$location_array['gd_city'] = get_query_var('gd_city_full'); } |
|
4104 | 4104 | } |
4105 | 4105 | $location_single = ''; |
4106 | 4106 | $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
@@ -4172,51 +4172,51 @@ discard block |
||
4172 | 4172 | } |
4173 | 4173 | |
4174 | 4174 | |
4175 | - if(strpos($title,'%%location%%') !== false){ |
|
4175 | + if (strpos($title, '%%location%%') !== false) { |
|
4176 | 4176 | $location = ''; |
4177 | - if($location_titles) { |
|
4177 | + if ($location_titles) { |
|
4178 | 4178 | $location = implode(", ", $location_titles); |
4179 | 4179 | } |
4180 | - $title = str_replace("%%location%%",$location,$title); |
|
4180 | + $title = str_replace("%%location%%", $location, $title); |
|
4181 | 4181 | } |
4182 | 4182 | |
4183 | - if(strpos($title,'%%in_location%%') !== false){ |
|
4183 | + if (strpos($title, '%%in_location%%') !== false) { |
|
4184 | 4184 | $location = ''; |
4185 | - if($location_titles) { |
|
4185 | + if ($location_titles) { |
|
4186 | 4186 | $location = __('in ', 'geodirectory') . implode(", ", $location_titles); |
4187 | 4187 | } |
4188 | - $title = str_replace("%%in_location%%",$location,$title); |
|
4188 | + $title = str_replace("%%in_location%%", $location, $title); |
|
4189 | 4189 | } |
4190 | 4190 | |
4191 | - if(strpos($title,'%%in_location_single%%') !== false){ |
|
4192 | - if($location_single) { |
|
4193 | - $location_single = __('in', 'geodirectory') . ' ' .$location_single; |
|
4191 | + if (strpos($title, '%%in_location_single%%') !== false) { |
|
4192 | + if ($location_single) { |
|
4193 | + $location_single = __('in', 'geodirectory') . ' ' . $location_single; |
|
4194 | 4194 | } |
4195 | - $title = str_replace("%%in_location_single%%",$location_single,$title); |
|
4195 | + $title = str_replace("%%in_location_single%%", $location_single, $title); |
|
4196 | 4196 | } |
4197 | 4197 | |
4198 | - if(strpos($title,'%%location_single%%') !== false){ |
|
4199 | - $title = str_replace("%%location_single%%",$location_single,$title); |
|
4198 | + if (strpos($title, '%%location_single%%') !== false) { |
|
4199 | + $title = str_replace("%%location_single%%", $location_single, $title); |
|
4200 | 4200 | } |
4201 | 4201 | |
4202 | 4202 | |
4203 | - if(strpos($title,'%%search_term%%') !== false){ |
|
4203 | + if (strpos($title, '%%search_term%%') !== false) { |
|
4204 | 4204 | $search_term = ''; |
4205 | - if(isset($_REQUEST['s'])){ |
|
4205 | + if (isset($_REQUEST['s'])) { |
|
4206 | 4206 | $search_term = esc_attr($_REQUEST['s']); |
4207 | 4207 | } |
4208 | - $title = str_replace("%%search_term%%",$search_term,$title); |
|
4208 | + $title = str_replace("%%search_term%%", $search_term, $title); |
|
4209 | 4209 | } |
4210 | 4210 | |
4211 | - if(strpos($title,'%%search_near%%') !== false){ |
|
4211 | + if (strpos($title, '%%search_near%%') !== false) { |
|
4212 | 4212 | $search_term = ''; |
4213 | - if(isset($_REQUEST['snear'])){ |
|
4213 | + if (isset($_REQUEST['snear'])) { |
|
4214 | 4214 | $search_term = esc_attr($_REQUEST['snear']); |
4215 | 4215 | } |
4216 | - $title = str_replace("%%search_near%%",$search_term,$title); |
|
4216 | + $title = str_replace("%%search_near%%", $search_term, $title); |
|
4217 | 4217 | } |
4218 | 4218 | |
4219 | - if(strpos($title,'%%name%%') !== false){ |
|
4219 | + if (strpos($title, '%%name%%') !== false) { |
|
4220 | 4220 | $author_name = get_the_author(); |
4221 | 4221 | if (!$author_name || $author_name === '') { |
4222 | 4222 | $queried_object = get_queried_object(); |
@@ -4241,9 +4241,9 @@ discard block |
||
4241 | 4241 | $title = str_replace("%%pagetotal%%", $pagetotal, $title); |
4242 | 4242 | } |
4243 | 4243 | |
4244 | - $title = wptexturize( $title ); |
|
4245 | - $title = convert_chars( $title ); |
|
4246 | - $title = esc_html( $title ); |
|
4244 | + $title = wptexturize($title); |
|
4245 | + $title = convert_chars($title); |
|
4246 | + $title = esc_html($title); |
|
4247 | 4247 | |
4248 | 4248 | /** |
4249 | 4249 | * Filter the title variables after standard ones have been filtered. |
@@ -4256,7 +4256,7 @@ discard block |
||
4256 | 4256 | * @param string $sep The separator, default: `|`. |
4257 | 4257 | */ |
4258 | 4258 | |
4259 | - return apply_filters('geodir_filter_title_variables_vars',$title,$location_array, $gd_page, $sep); |
|
4259 | + return apply_filters('geodir_filter_title_variables_vars', $title, $location_array, $gd_page, $sep); |
|
4260 | 4260 | } |
4261 | 4261 | |
4262 | 4262 | /** |
@@ -4379,7 +4379,7 @@ discard block |
||
4379 | 4379 | } |
4380 | 4380 | |
4381 | 4381 | $action = isset($_REQUEST['action']) ? sanitize_text_field($_REQUEST['action']) : ''; |
4382 | - $is_admin = is_admin() && ( !defined('DOING_AJAX' ) || ( defined('DOING_AJAX') && !DOING_AJAX ) ) ? true : false; |
|
4382 | + $is_admin = is_admin() && (!defined('DOING_AJAX') || (defined('DOING_AJAX') && !DOING_AJAX)) ? true : false; |
|
4383 | 4383 | $inline_save = $action == 'inline-save' ? true : false; |
4384 | 4384 | |
4385 | 4385 | if (empty($post->post_type) || $is_admin || $inline_save || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)) { |
@@ -4390,7 +4390,7 @@ discard block |
||
4390 | 4390 | return; |
4391 | 4391 | } |
4392 | 4392 | |
4393 | - $user_id = (int)get_current_user_id(); |
|
4393 | + $user_id = (int) get_current_user_id(); |
|
4394 | 4394 | |
4395 | 4395 | if ($user_id > 0 && get_option('geodir_notify_post_edited') && !wp_is_post_revision($post_ID) && in_array($post->post_type, geodir_get_posttypes())) { |
4396 | 4396 | $author_id = !empty($post->post_author) ? $post->post_author : 0; |
@@ -4453,7 +4453,7 @@ discard block |
||
4453 | 4453 | |
4454 | 4454 | $nr = geodir_title_meta_pagenumbering('nr'); |
4455 | 4455 | if (isset($nr) && $nr > 0) { |
4456 | - $replacement = (string)$nr; |
|
4456 | + $replacement = (string) $nr; |
|
4457 | 4457 | } |
4458 | 4458 | |
4459 | 4459 | return $replacement; |
@@ -4472,7 +4472,7 @@ discard block |
||
4472 | 4472 | |
4473 | 4473 | $max = geodir_title_meta_pagenumbering('max'); |
4474 | 4474 | if (isset($max) && $max > 0) { |
4475 | - $replacement = (string)$max; |
|
4475 | + $replacement = (string) $max; |
|
4476 | 4476 | } |
4477 | 4477 | |
4478 | 4478 | return $replacement; |
@@ -4514,7 +4514,7 @@ discard block |
||
4514 | 4514 | } |
4515 | 4515 | |
4516 | 4516 | if (isset($post->post_content)) { |
4517 | - $max_num_pages = (substr_count($post->post_content, '<!--nextpage-->' ) + 1); |
|
4517 | + $max_num_pages = (substr_count($post->post_content, '<!--nextpage-->') + 1); |
|
4518 | 4518 | } |
4519 | 4519 | } |
4520 | 4520 |