@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @param array $tabs The array of tabs to display. |
53 | 53 | */ |
54 | 54 | $tabs = apply_filters('geodir_settings_tabs_array', $tabs); |
55 | - update_option('geodir_tabs', $tabs);// Important to show settings menu dropdown |
|
55 | + update_option('geodir_tabs', $tabs); // Important to show settings menu dropdown |
|
56 | 56 | |
57 | 57 | foreach ($tabs as $name => $args) : |
58 | 58 | $label = $args['label']; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | jQuery('.geodirectory-nav-tab-wrapper a').click(function () { |
223 | 223 | if (changed) { |
224 | 224 | window.onbeforeunload = function () { |
225 | - return '<?php echo __( 'The changes you made will be lost if you navigate away from this page.', 'geodirectory'); ?>'; |
|
225 | + return '<?php echo __('The changes you made will be lost if you navigate away from this page.', 'geodirectory'); ?>'; |
|
226 | 226 | } |
227 | 227 | } else { |
228 | 228 | window.onbeforeunload = ''; |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | ?> |
328 | 328 | |
329 | 329 | <p class="submit"> |
330 | - <input <?php echo $hide_save_button;?> name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" /> |
|
330 | + <input <?php echo $hide_save_button; ?> name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" /> |
|
331 | 331 | <input type="hidden" name="subtab" id="last_tab" /> |
332 | 332 | </p> |
333 | 333 | |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | |
397 | 397 | ?> |
398 | 398 | |
399 | - <h3><?php _e('Set Default Location', 'geodirectory');?></h3> |
|
399 | + <h3><?php _e('Set Default Location', 'geodirectory'); ?></h3> |
|
400 | 400 | |
401 | 401 | <input type="hidden" name="add_location" value="location"> |
402 | 402 | |
@@ -404,16 +404,16 @@ discard block |
||
404 | 404 | echo $location_result->location_id; |
405 | 405 | } ?>"> |
406 | 406 | |
407 | - <input type="hidden" name="address" id="<?php echo $prefix;?>address" value=""> |
|
407 | + <input type="hidden" name="address" id="<?php echo $prefix; ?>address" value=""> |
|
408 | 408 | |
409 | 409 | <table class="form-table default_location_form"> |
410 | 410 | <tbody> |
411 | 411 | <tr valign="top" class="single_select_page"> |
412 | - <th class="titledesc" scope="row"><?php _e('City', 'geodirectory');?></th> |
|
412 | + <th class="titledesc" scope="row"><?php _e('City', 'geodirectory'); ?></th> |
|
413 | 413 | <td class="forminp"> |
414 | 414 | <div class="gtd-formfeild required"> |
415 | 415 | <input class="require" type="text" size="80" style="width:440px" |
416 | - id="<?php echo $prefix;?>city" name="city" |
|
416 | + id="<?php echo $prefix; ?>city" name="city" |
|
417 | 417 | value="<?php if (isset($location_result->city)) { |
418 | 418 | echo $location_result->city; |
419 | 419 | } ?>"/> |
@@ -425,11 +425,11 @@ discard block |
||
425 | 425 | </td> |
426 | 426 | </tr> |
427 | 427 | <tr valign="top" class="single_select_page"> |
428 | - <th class="titledesc" scope="row"><?php _e('Region', 'geodirectory');?></th> |
|
428 | + <th class="titledesc" scope="row"><?php _e('Region', 'geodirectory'); ?></th> |
|
429 | 429 | <td class="forminp"> |
430 | 430 | <div class="gtd-formfeild required"> |
431 | 431 | <input class="require" type="text" size="80" style="width:440px" |
432 | - id="<?php echo $prefix;?>region" name="region" |
|
432 | + id="<?php echo $prefix; ?>region" name="region" |
|
433 | 433 | value="<?php if (isset($location_result->region)) { |
434 | 434 | echo $location_result->region; |
435 | 435 | } ?>"/> |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | </td> |
442 | 442 | </tr> |
443 | 443 | <tr valign="top" class="single_select_page"> |
444 | - <th class="titledesc" scope="row"><?php _e('Country', 'geodirectory');?></th> |
|
444 | + <th class="titledesc" scope="row"><?php _e('Country', 'geodirectory'); ?></th> |
|
445 | 445 | <td class="forminp"> |
446 | 446 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
447 | 447 | <?php |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | ?> |
451 | 451 | <select id="<?php echo $prefix ?>country" class="chosen_select" |
452 | 452 | data-location_type="country" name="<?php echo $prefix ?>country" |
453 | - data-placeholder="<?php _e('Choose a country.', 'geodirectory');?>" |
|
453 | + data-placeholder="<?php _e('Choose a country.', 'geodirectory'); ?>" |
|
454 | 454 | data-addsearchtermonnorecord="1" data-ajaxchosen="0" data-autoredirect="0" |
455 | 455 | data-showeverywhere="0"> |
456 | 456 | <?php geodir_get_country_dl($country, $prefix); ?> |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | </tr> |
468 | 468 | <tr valign="top" class="single_select_page"> |
469 | 469 | <th class="titledesc" |
470 | - scope="row"><?php _e('Set Location on Map', 'geodirectory');?></th> |
|
470 | + scope="row"><?php _e('Set Location on Map', 'geodirectory'); ?></th> |
|
471 | 471 | <td class="forminp"> |
472 | 472 | <?php |
473 | 473 | /** |
@@ -475,15 +475,15 @@ discard block |
||
475 | 475 | * |
476 | 476 | * @since 1.0.0 |
477 | 477 | */ |
478 | - include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");?> |
|
478 | + include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php"); ?> |
|
479 | 479 | </td> |
480 | 480 | </tr> |
481 | 481 | <tr valign="top" class="single_select_page"> |
482 | - <th class="titledesc" scope="row"><?php _e('City Latitude', 'geodirectory');?></th> |
|
482 | + <th class="titledesc" scope="row"><?php _e('City Latitude', 'geodirectory'); ?></th> |
|
483 | 483 | <td class="forminp"> |
484 | 484 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
485 | 485 | <input type="text" class="require" size="80" style="width:440px" |
486 | - id="<?php echo $prefix;?>latitude" name="latitude" |
|
486 | + id="<?php echo $prefix; ?>latitude" name="latitude" |
|
487 | 487 | value="<?php if (isset($location_result->city_latitude)) { |
488 | 488 | echo $location_result->city_latitude; |
489 | 489 | } ?>"/> |
@@ -496,11 +496,11 @@ discard block |
||
496 | 496 | </tr> |
497 | 497 | <tr valign="top" class="single_select_page"> |
498 | 498 | <th class="titledesc" |
499 | - scope="row"><?php _e('City Longitude', 'geodirectory');?></th> |
|
499 | + scope="row"><?php _e('City Longitude', 'geodirectory'); ?></th> |
|
500 | 500 | <td class="forminp"> |
501 | 501 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
502 | 502 | <input type="text" class="require" size="80" style="width:440px" |
503 | - id="<?php echo $prefix;?>longitude" name="longitude" |
|
503 | + id="<?php echo $prefix; ?>longitude" name="longitude" |
|
504 | 504 | value="<?php if (isset($location_result->city_longitude)) { |
505 | 505 | echo $location_result->city_longitude; |
506 | 506 | } ?>"/> |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | <div class="gd-content-heading"> |
777 | 777 | |
778 | 778 | |
779 | - <h3><?php _e('Theme Compatability Settings', 'geodirectory');?></h3> |
|
779 | + <h3><?php _e('Theme Compatability Settings', 'geodirectory'); ?></h3> |
|
780 | 780 | <style> |
781 | 781 | .gd-theme-compat-table { |
782 | 782 | width: 100%; |
@@ -807,11 +807,11 @@ discard block |
||
807 | 807 | </div> |
808 | 808 | <?php }?> |
809 | 809 | |
810 | - <h4><?php _e('Select Theme Compatibility Pack', 'geodirectory');?></h4> |
|
810 | + <h4><?php _e('Select Theme Compatibility Pack', 'geodirectory'); ?></h4> |
|
811 | 811 | |
812 | 812 | <select name="gd_theme_compat" id="gd_theme_compat"> |
813 | - <option value=""><?php _e('Select Theme', 'geodirectory');?></option> |
|
814 | - <option value="custom"><?php _e('Custom', 'geodirectory');?></option> |
|
813 | + <option value=""><?php _e('Select Theme', 'geodirectory'); ?></option> |
|
814 | + <option value="custom"><?php _e('Custom', 'geodirectory'); ?></option> |
|
815 | 815 | <?php |
816 | 816 | $theme_arr = get_option('gd_theme_compats'); |
817 | 817 | $theme_active = get_option('gd_theme_compat'); |
@@ -830,20 +830,20 @@ discard block |
||
830 | 830 | ?> |
831 | 831 | </select> |
832 | 832 | <button onclick="gd_comp_export();" type="button" |
833 | - class="button-primary"><?php _e('Export', 'geodirectory');?></button> |
|
833 | + class="button-primary"><?php _e('Export', 'geodirectory'); ?></button> |
|
834 | 834 | <button onclick="gd_comp_import();" type="button" |
835 | - class="button-primary"><?php _e('Import', 'geodirectory');?></button> |
|
835 | + class="button-primary"><?php _e('Import', 'geodirectory'); ?></button> |
|
836 | 836 | |
837 | 837 | <div class="gd-comp-import-export"> |
838 | 838 | <textarea id="gd-import-export-theme-comp" |
839 | - placeholder="<?php _e('Paste the JSON code here and then click import again', 'geodirectory');?>"></textarea> |
|
839 | + placeholder="<?php _e('Paste the JSON code here and then click import again', 'geodirectory'); ?>"></textarea> |
|
840 | 840 | </div> |
841 | 841 | <script> |
842 | 842 | |
843 | 843 | function gd_comp_export() { |
844 | 844 | theme = jQuery('#gd_theme_compat').val(); |
845 | 845 | if (theme == '' || theme == 'custom') { |
846 | - alert("<?php _e('Please select a theme to export','geodirectory');?>"); |
|
846 | + alert("<?php _e('Please select a theme to export', 'geodirectory'); ?>"); |
|
847 | 847 | return false; |
848 | 848 | } |
849 | 849 | jQuery('.gd-comp-import-export').show(); |
@@ -877,9 +877,9 @@ discard block |
||
877 | 877 | |
878 | 878 | jQuery.post(ajaxurl, data, function (response) { |
879 | 879 | if (response == '0') { |
880 | - alert("<?php _e('Something went wrong','geodirectory');?>"); |
|
880 | + alert("<?php _e('Something went wrong', 'geodirectory'); ?>"); |
|
881 | 881 | } else { |
882 | - alert("<?php _e('Theme Compatibility Imported','geodirectory');?>"); |
|
882 | + alert("<?php _e('Theme Compatibility Imported', 'geodirectory'); ?>"); |
|
883 | 883 | jQuery('#gd-import-export-theme-comp').val(''); |
884 | 884 | jQuery('.gd-comp-import-export').hide(); |
885 | 885 | jQuery('#gd_theme_compat').append(new Option(response, response)); |
@@ -920,14 +920,14 @@ discard block |
||
920 | 920 | |
921 | 921 | </script> |
922 | 922 | |
923 | - <h4><?php _e('Main Wrapper Actions', 'geodirectory');?></h4> |
|
923 | + <h4><?php _e('Main Wrapper Actions', 'geodirectory'); ?></h4> |
|
924 | 924 | |
925 | 925 | <table class="form-table gd-theme-compat-table"> |
926 | 926 | <tbody> |
927 | 927 | <tr> |
928 | - <td><strong><?php _e('Hook', 'geodirectory');?></strong></td> |
|
929 | - <td><strong><?php _e('ID', 'geodirectory');?></strong></td> |
|
930 | - <td><strong><?php _e('Class', 'geodirectory');?></strong></td> |
|
928 | + <td><strong><?php _e('Hook', 'geodirectory'); ?></strong></td> |
|
929 | + <td><strong><?php _e('ID', 'geodirectory'); ?></strong></td> |
|
930 | + <td><strong><?php _e('Class', 'geodirectory'); ?></strong></td> |
|
931 | 931 | </tr> |
932 | 932 | |
933 | 933 | |
@@ -945,7 +945,7 @@ discard block |
||
945 | 945 | |
946 | 946 | <tr class="gd-theme-comp-out"> |
947 | 947 | <td colspan="3"> |
948 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
948 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
949 | 949 | <textarea name="geodir_wrapper_open_replace" |
950 | 950 | placeholder='<div id="[id]" class="[class]">'><?php if (isset($tc['geodir_wrapper_open_replace'])) { |
951 | 951 | echo $tc['geodir_wrapper_open_replace']; |
@@ -959,14 +959,14 @@ discard block |
||
959 | 959 | <small>geodir_wrapper_close</small> |
960 | 960 | </td> |
961 | 961 | <td><input disabled="disabled" type="text" name="geodir_wrapper_open_id" |
962 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
962 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
963 | 963 | <td><input disabled="disabled" type="text" name="geodir_wrapper_open_class" |
964 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
964 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
965 | 965 | </tr> |
966 | 966 | |
967 | 967 | <tr class="gd-theme-comp-out"> |
968 | 968 | <td colspan="3"> |
969 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
969 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
970 | 970 | <textarea name="geodir_wrapper_close_replace" |
971 | 971 | placeholder='</div><!-- wrapper ends here-->'><?php if (isset($tc['geodir_wrapper_close_replace'])) { |
972 | 972 | echo $tc['geodir_wrapper_close_replace']; |
@@ -990,7 +990,7 @@ discard block |
||
990 | 990 | |
991 | 991 | <tr class="gd-theme-comp-out"> |
992 | 992 | <td colspan="3"> |
993 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
993 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
994 | 994 | <textarea name="geodir_wrapper_content_open_replace" |
995 | 995 | placeholder='<div id="[id]" class="[class]" role="main" [width_css]>'><?php if (isset($tc['geodir_wrapper_content_open_replace'])) { |
996 | 996 | echo $tc['geodir_wrapper_content_open_replace']; |
@@ -1004,14 +1004,14 @@ discard block |
||
1004 | 1004 | <small>geodir_wrapper_content_close</small> |
1005 | 1005 | </td> |
1006 | 1006 | <td><input disabled="disabled" type="text" name="geodir_wrapper_content_close_id" |
1007 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1007 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1008 | 1008 | <td><input disabled="disabled" type="text" name="geodir_wrapper_content_close_class" |
1009 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1009 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1010 | 1010 | </tr> |
1011 | 1011 | |
1012 | 1012 | <tr class="gd-theme-comp-out"> |
1013 | 1013 | <td colspan="3"> |
1014 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1014 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1015 | 1015 | <textarea name="geodir_wrapper_content_close_replace" |
1016 | 1016 | placeholder='</div><!-- content ends here-->'><?php if (isset($tc['geodir_wrapper_content_close_replace'])) { |
1017 | 1017 | echo $tc['geodir_wrapper_content_close_replace']; |
@@ -1033,7 +1033,7 @@ discard block |
||
1033 | 1033 | |
1034 | 1034 | <tr class="gd-theme-comp-out"> |
1035 | 1035 | <td colspan="3"> |
1036 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1036 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1037 | 1037 | <textarea name="geodir_article_open_replace" |
1038 | 1038 | placeholder='<article id="[id]" class="[class]" itemscope itemtype="[itemtype]">'><?php if (isset($tc['geodir_article_open_replace'])) { |
1039 | 1039 | echo $tc['geodir_article_open_replace']; |
@@ -1046,14 +1046,14 @@ discard block |
||
1046 | 1046 | <small>geodir_article_close</small> |
1047 | 1047 | </td> |
1048 | 1048 | <td><input disabled="disabled" type="text" name="geodir_article_close_id" |
1049 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1049 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1050 | 1050 | <td><input disabled="disabled" type="text" name="geodir_article_close_class" |
1051 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1051 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1052 | 1052 | </tr> |
1053 | 1053 | |
1054 | 1054 | <tr class="gd-theme-comp-out"> |
1055 | 1055 | <td colspan="3"> |
1056 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1056 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1057 | 1057 | <textarea name="geodir_article_close_replace" |
1058 | 1058 | placeholder='</article><!-- article ends here-->'><?php if (isset($tc['geodir_article_close_replace'])) { |
1059 | 1059 | echo $tc['geodir_article_close_replace']; |
@@ -1076,7 +1076,7 @@ discard block |
||
1076 | 1076 | |
1077 | 1077 | <tr class="gd-theme-comp-out"> |
1078 | 1078 | <td colspan="3"> |
1079 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1079 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1080 | 1080 | <textarea name="geodir_sidebar_right_open_replace" |
1081 | 1081 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_right_open_replace'])) { |
1082 | 1082 | echo $tc['geodir_sidebar_right_open_replace']; |
@@ -1089,14 +1089,14 @@ discard block |
||
1089 | 1089 | <small>geodir_sidebar_right_close</small> |
1090 | 1090 | </td> |
1091 | 1091 | <td><input disabled="disabled" type="text" name="geodir_sidebar_right_close_id" |
1092 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1092 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1093 | 1093 | <td><input disabled="disabled" type="text" name="geodir_sidebar_right_close_class" |
1094 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1094 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1095 | 1095 | </tr> |
1096 | 1096 | |
1097 | 1097 | <tr class="gd-theme-comp-out"> |
1098 | 1098 | <td colspan="3"> |
1099 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1099 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1100 | 1100 | <textarea name="geodir_sidebar_right_close_replace" |
1101 | 1101 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_right_close_replace'])) { |
1102 | 1102 | echo $tc['geodir_sidebar_right_close_replace']; |
@@ -1120,7 +1120,7 @@ discard block |
||
1120 | 1120 | |
1121 | 1121 | <tr class="gd-theme-comp-out"> |
1122 | 1122 | <td colspan="3"> |
1123 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1123 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1124 | 1124 | <textarea name="geodir_sidebar_left_open_replace" |
1125 | 1125 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_left_open_replace'])) { |
1126 | 1126 | echo $tc['geodir_sidebar_left_open_replace']; |
@@ -1133,14 +1133,14 @@ discard block |
||
1133 | 1133 | <small>geodir_sidebar_left_close</small> |
1134 | 1134 | </td> |
1135 | 1135 | <td><input disabled="disabled" type="text" name="geodir_sidebar_left_close_id" |
1136 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1136 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1137 | 1137 | <td><input disabled="disabled" type="text" name="geodir_sidebar_left_close_class" |
1138 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1138 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1139 | 1139 | </tr> |
1140 | 1140 | |
1141 | 1141 | <tr class="gd-theme-comp-out"> |
1142 | 1142 | <td colspan="3"> |
1143 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1143 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1144 | 1144 | <textarea name="geodir_sidebar_left_close_replace" |
1145 | 1145 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_left_close_replace'])) { |
1146 | 1146 | echo $tc['geodir_sidebar_left_close_replace']; |
@@ -1162,7 +1162,7 @@ discard block |
||
1162 | 1162 | |
1163 | 1163 | <tr class="gd-theme-comp-out"> |
1164 | 1164 | <td colspan="3"> |
1165 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1165 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1166 | 1166 | <textarea name="geodir_main_content_open_replace" |
1167 | 1167 | placeholder='<main id="[id]" class="[class]" role="main">'><?php if (isset($tc['geodir_main_content_open_replace'])) { |
1168 | 1168 | echo $tc['geodir_main_content_open_replace']; |
@@ -1175,14 +1175,14 @@ discard block |
||
1175 | 1175 | <small>geodir_main_content_close</small> |
1176 | 1176 | </td> |
1177 | 1177 | <td><input disabled="disabled" type="text" name="geodir_main_content_close_id" |
1178 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1178 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1179 | 1179 | <td><input disabled="disabled" type="text" name="geodir_main_content_close_class" |
1180 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1180 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1181 | 1181 | </tr> |
1182 | 1182 | |
1183 | 1183 | <tr class="gd-theme-comp-out"> |
1184 | 1184 | <td colspan="3"> |
1185 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1185 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1186 | 1186 | <textarea name="geodir_main_content_close_replace" |
1187 | 1187 | placeholder='</main><!-- main ends here-->'><?php if (isset($tc['geodir_main_content_close_replace'])) { |
1188 | 1188 | echo $tc['geodir_main_content_close_replace']; |
@@ -1194,13 +1194,13 @@ discard block |
||
1194 | 1194 | </tbody> |
1195 | 1195 | </table> |
1196 | 1196 | |
1197 | - <h4><?php _e('Other Actions', 'geodirectory');?></h4> |
|
1197 | + <h4><?php _e('Other Actions', 'geodirectory'); ?></h4> |
|
1198 | 1198 | |
1199 | 1199 | <table class="form-table gd-theme-compat-table"> |
1200 | 1200 | <tbody> |
1201 | 1201 | <tr> |
1202 | - <td><strong><?php _e('Hook', 'geodirectory');?></strong></td> |
|
1203 | - <td><strong><?php _e('Content', 'geodirectory');?></strong></td> |
|
1202 | + <td><strong><?php _e('Hook', 'geodirectory'); ?></strong></td> |
|
1203 | + <td><strong><?php _e('Content', 'geodirectory'); ?></strong></td> |
|
1204 | 1204 | </tr> |
1205 | 1205 | |
1206 | 1206 | |
@@ -1229,13 +1229,13 @@ discard block |
||
1229 | 1229 | </table> |
1230 | 1230 | |
1231 | 1231 | |
1232 | - <h4><?php _e('Other Filters', 'geodirectory');?></h4> |
|
1232 | + <h4><?php _e('Other Filters', 'geodirectory'); ?></h4> |
|
1233 | 1233 | |
1234 | 1234 | <table class="form-table gd-theme-compat-table"> |
1235 | 1235 | <tbody> |
1236 | 1236 | <tr> |
1237 | - <td><strong><?php _e('Filter', 'geodirectory');?></strong></td> |
|
1238 | - <td><strong><?php _e('Content', 'geodirectory');?></strong></td> |
|
1237 | + <td><strong><?php _e('Filter', 'geodirectory'); ?></strong></td> |
|
1238 | + <td><strong><?php _e('Content', 'geodirectory'); ?></strong></td> |
|
1239 | 1239 | </tr> |
1240 | 1240 | |
1241 | 1241 | <tr> |
@@ -1389,13 +1389,13 @@ discard block |
||
1389 | 1389 | * |
1390 | 1390 | * @since 1.4.0 |
1391 | 1391 | */ |
1392 | - do_action('gd_compat_other_filters');?> |
|
1392 | + do_action('gd_compat_other_filters'); ?> |
|
1393 | 1393 | |
1394 | 1394 | </tbody> |
1395 | 1395 | </table> |
1396 | 1396 | |
1397 | 1397 | |
1398 | - <h4><?php _e('Required CSS', 'geodirectory');?></h4> |
|
1398 | + <h4><?php _e('Required CSS', 'geodirectory'); ?></h4> |
|
1399 | 1399 | |
1400 | 1400 | <table class="form-table gd-theme-compat-table"> |
1401 | 1401 | <tbody> |
@@ -1410,7 +1410,7 @@ discard block |
||
1410 | 1410 | </tbody> |
1411 | 1411 | </table> |
1412 | 1412 | |
1413 | - <h4><?php _e('Required JS', 'geodirectory');?></h4> |
|
1413 | + <h4><?php _e('Required JS', 'geodirectory'); ?></h4> |
|
1414 | 1414 | |
1415 | 1415 | <table class="form-table gd-theme-compat-table"> |
1416 | 1416 | <tbody> |
@@ -1428,7 +1428,7 @@ discard block |
||
1428 | 1428 | |
1429 | 1429 | <p class="submit"> |
1430 | 1430 | <input name="save" class="button-primary" type="submit" |
1431 | - value="<?php _e('Save changes', 'geodirectory');?>"> |
|
1431 | + value="<?php _e('Save changes', 'geodirectory'); ?>"> |
|
1432 | 1432 | </p> |
1433 | 1433 | |
1434 | 1434 | </div> |
@@ -1462,7 +1462,7 @@ discard block |
||
1462 | 1462 | * @param string $listing_type Post type. |
1463 | 1463 | */ |
1464 | 1464 | ?> |
1465 | - <h3><?php echo apply_filters('geodir_custom_fields_panel_head', '', $sub_tab, $listing_type);?></h3> |
|
1465 | + <h3><?php echo apply_filters('geodir_custom_fields_panel_head', '', $sub_tab, $listing_type); ?></h3> |
|
1466 | 1466 | </div> |
1467 | 1467 | <div id="container_general" class="clearfix"> |
1468 | 1468 | <div class="general-form-builder-frame"> |
@@ -1477,7 +1477,7 @@ discard block |
||
1477 | 1477 | * @param string $listing_type Post type. |
1478 | 1478 | */ |
1479 | 1479 | ?> |
1480 | - <h3 class="hndle"><span><?php echo apply_filters('geodir_cf_panel_available_fields_head', '', $sub_tab, $listing_type);?> |
|
1480 | + <h3 class="hndle"><span><?php echo apply_filters('geodir_cf_panel_available_fields_head', '', $sub_tab, $listing_type); ?> |
|
1481 | 1481 | </span></h3> |
1482 | 1482 | <?php |
1483 | 1483 | /** |
@@ -1488,7 +1488,7 @@ discard block |
||
1488 | 1488 | * @param string $listing_type Post type. |
1489 | 1489 | */ |
1490 | 1490 | ?> |
1491 | - <p><?php echo apply_filters('geodir_cf_panel_available_fields_note', '', $sub_tab, $listing_type);?></p> |
|
1491 | + <p><?php echo apply_filters('geodir_cf_panel_available_fields_note', '', $sub_tab, $listing_type); ?></p> |
|
1492 | 1492 | |
1493 | 1493 | <div class="inside"> |
1494 | 1494 | |
@@ -1522,7 +1522,7 @@ discard block |
||
1522 | 1522 | * @param string $listing_type Post type. |
1523 | 1523 | */ |
1524 | 1524 | ?> |
1525 | - <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type);?></span> |
|
1525 | + <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type); ?></span> |
|
1526 | 1526 | </h3> |
1527 | 1527 | <?php |
1528 | 1528 | /** |
@@ -1533,7 +1533,7 @@ discard block |
||
1533 | 1533 | * @param string $listing_type Post type. |
1534 | 1534 | */ |
1535 | 1535 | ?> |
1536 | - <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type);?></p> |
|
1536 | + <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type); ?></p> |
|
1537 | 1537 | |
1538 | 1538 | <div class="inside"> |
1539 | 1539 | |
@@ -1574,7 +1574,7 @@ discard block |
||
1574 | 1574 | <div class="gd-content-heading"> |
1575 | 1575 | |
1576 | 1576 | |
1577 | - <h3><?php _e('GD Diagnostic Tools', 'geodirectory');?></h3> |
|
1577 | + <h3><?php _e('GD Diagnostic Tools', 'geodirectory'); ?></h3> |
|
1578 | 1578 | <style> |
1579 | 1579 | .gd-tools-table { |
1580 | 1580 | width: 100%; |
@@ -1593,81 +1593,81 @@ discard block |
||
1593 | 1593 | <table class="form-table gd-tools-table"> |
1594 | 1594 | <tbody> |
1595 | 1595 | <tr> |
1596 | - <td><strong><?php _e('Tool', 'geodirectory');?></strong></td> |
|
1597 | - <td><strong><?php _e('Description', 'geodirectory');?></strong></td> |
|
1598 | - <td><strong><?php _e('Action', 'geodirectory');?></strong></td> |
|
1596 | + <td><strong><?php _e('Tool', 'geodirectory'); ?></strong></td> |
|
1597 | + <td><strong><?php _e('Description', 'geodirectory'); ?></strong></td> |
|
1598 | + <td><strong><?php _e('Action', 'geodirectory'); ?></strong></td> |
|
1599 | 1599 | </tr> |
1600 | 1600 | |
1601 | 1601 | |
1602 | 1602 | <tr> |
1603 | - <td><?php _e('GD pages check', 'geodirectory');?></td> |
|
1603 | + <td><?php _e('GD pages check', 'geodirectory'); ?></td> |
|
1604 | 1604 | <td> |
1605 | - <small><?php _e('Checks if the GD pages are installed correctly or not.', 'geodirectory');?></small> |
|
1605 | + <small><?php _e('Checks if the GD pages are installed correctly or not.', 'geodirectory'); ?></small> |
|
1606 | 1606 | </td> |
1607 | 1607 | <td> |
1608 | - <input type="button" value="<?php _e('Run', 'geodirectory');?>" |
|
1608 | + <input type="button" value="<?php _e('Run', 'geodirectory'); ?>" |
|
1609 | 1609 | class="button-primary geodir_diagnosis_button" data-diagnose="default_pages"/> |
1610 | 1610 | </td> |
1611 | 1611 | </tr> |
1612 | 1612 | |
1613 | 1613 | |
1614 | 1614 | <tr> |
1615 | - <td><?php _e('Multisite DB conversion check', 'geodirectory');?></td> |
|
1615 | + <td><?php _e('Multisite DB conversion check', 'geodirectory'); ?></td> |
|
1616 | 1616 | <td> |
1617 | - <small><?php _e('Checks if the GD database tables have been converted to use multisite correctly.', 'geodirectory');?></small> |
|
1617 | + <small><?php _e('Checks if the GD database tables have been converted to use multisite correctly.', 'geodirectory'); ?></small> |
|
1618 | 1618 | </td> |
1619 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>" |
|
1619 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>" |
|
1620 | 1620 | class="button-primary geodir_diagnosis_button" data-diagnose="multisite_conversion"/> |
1621 | 1621 | </td> |
1622 | 1622 | </tr> |
1623 | 1623 | |
1624 | 1624 | <tr> |
1625 | - <td><?php _e('Ratings check', 'geodirectory');?></td> |
|
1625 | + <td><?php _e('Ratings check', 'geodirectory'); ?></td> |
|
1626 | 1626 | <td> |
1627 | - <small><?php _e('Checks ratings for correct location and content settings', 'geodirectory');?></small> |
|
1627 | + <small><?php _e('Checks ratings for correct location and content settings', 'geodirectory'); ?></small> |
|
1628 | 1628 | </td> |
1629 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>" |
|
1629 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>" |
|
1630 | 1630 | class="button-primary geodir_diagnosis_button" data-diagnose="ratings"/> |
1631 | 1631 | </td> |
1632 | 1632 | </tr> |
1633 | 1633 | |
1634 | 1634 | <tr> |
1635 | - <td><?php _e('Sync GD tags', 'geodirectory');?></td> |
|
1635 | + <td><?php _e('Sync GD tags', 'geodirectory'); ?></td> |
|
1636 | 1636 | <td> |
1637 | - <small><?php _e('This tool can be used when tags are showing in the backend but missing from the front end.', 'geodirectory');?></small> |
|
1637 | + <small><?php _e('This tool can be used when tags are showing in the backend but missing from the front end.', 'geodirectory'); ?></small> |
|
1638 | 1638 | </td> |
1639 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>" |
|
1639 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>" |
|
1640 | 1640 | class="button-primary geodir_diagnosis_button" data-diagnose="tags_sync"/> |
1641 | 1641 | </td> |
1642 | 1642 | </tr> |
1643 | 1643 | |
1644 | 1644 | <tr> |
1645 | - <td><?php _e('Sync GD Categories', 'geodirectory');?></td> |
|
1645 | + <td><?php _e('Sync GD Categories', 'geodirectory'); ?></td> |
|
1646 | 1646 | <td> |
1647 | - <small><?php _e('This tool can be used when categories are missing from the details table but showing in other places in the backend (only checks posts with missing category info in details table)', 'geodirectory');?></small> |
|
1647 | + <small><?php _e('This tool can be used when categories are missing from the details table but showing in other places in the backend (only checks posts with missing category info in details table)', 'geodirectory'); ?></small> |
|
1648 | 1648 | </td> |
1649 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>" |
|
1649 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>" |
|
1650 | 1650 | class="button-primary geodir_diagnosis_button" data-diagnose="cats_sync"/> |
1651 | 1651 | </td> |
1652 | 1652 | </tr> |
1653 | 1653 | |
1654 | 1654 | |
1655 | 1655 | <tr> |
1656 | - <td><?php _e('Clear all GD version numbers', 'geodirectory');?></td> |
|
1656 | + <td><?php _e('Clear all GD version numbers', 'geodirectory'); ?></td> |
|
1657 | 1657 | <td> |
1658 | - <small><?php _e('This tool will clear all GD version numbers so any upgrade functions will run again.', 'geodirectory');?></small> |
|
1658 | + <small><?php _e('This tool will clear all GD version numbers so any upgrade functions will run again.', 'geodirectory'); ?></small> |
|
1659 | 1659 | </td> |
1660 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>" |
|
1660 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>" |
|
1661 | 1661 | class="button-primary geodir_diagnosis_button" data-diagnose="version_clear"/> |
1662 | 1662 | </td> |
1663 | 1663 | </tr> |
1664 | 1664 | <tr> |
1665 | - <td><?php _e('Load custom fields translation', 'geodirectory');?></td> |
|
1665 | + <td><?php _e('Load custom fields translation', 'geodirectory'); ?></td> |
|
1666 | 1666 | <td> |
1667 | - <small><?php _e('This tool will load strings from the database into a file to translate via po editor.Ex: custom fields', 'geodirectory');?></small> |
|
1667 | + <small><?php _e('This tool will load strings from the database into a file to translate via po editor.Ex: custom fields', 'geodirectory'); ?></small> |
|
1668 | 1668 | </td> |
1669 | 1669 | <td> |
1670 | - <input type="button" value="<?php _e('Run', 'geodirectory');?>" class="button-primary geodir_diagnosis_button" data-diagnose="load_db_language"/> |
|
1670 | + <input type="button" value="<?php _e('Run', 'geodirectory'); ?>" class="button-primary geodir_diagnosis_button" data-diagnose="load_db_language"/> |
|
1671 | 1671 | </td> |
1672 | 1672 | </tr> |
1673 | 1673 | <?php |
@@ -1677,7 +1677,7 @@ discard block |
||
1677 | 1677 | * Called after the last setting on the GD>Tools page. |
1678 | 1678 | * @since 1.0.0 |
1679 | 1679 | */ |
1680 | - do_action('geodir_diagnostic_tool');?> |
|
1680 | + do_action('geodir_diagnostic_tool'); ?> |
|
1681 | 1681 | |
1682 | 1682 | </tbody> |
1683 | 1683 | </table> |
@@ -74,17 +74,20 @@ discard block |
||
74 | 74 | $tab_link = $args['url']; |
75 | 75 | } |
76 | 76 | |
77 | - if (!empty($args['request'])) |
|
78 | - $tab_link = geodir_getlink($tab_link, $args['request']); |
|
77 | + if (!empty($args['request'])) { |
|
78 | + $tab_link = geodir_getlink($tab_link, $args['request']); |
|
79 | + } |
|
79 | 80 | |
80 | 81 | if (isset($args['target']) && $args['target'] != '') { |
81 | 82 | $tab_target = " target='" . sanitize_text_field($args['target']) . "' "; |
82 | - } else |
|
83 | - $tab_target = ''; |
|
83 | + } else { |
|
84 | + $tab_target = ''; |
|
85 | + } |
|
84 | 86 | |
85 | 87 | $tab_active = ''; |
86 | - if ($current_tab == $name) |
|
87 | - $tab_active = ' class="tab-active" '; |
|
88 | + if ($current_tab == $name) { |
|
89 | + $tab_active = ' class="tab-active" '; |
|
90 | + } |
|
88 | 91 | /** |
89 | 92 | * Called before the individual settings tabs are output. |
90 | 93 | * |
@@ -122,8 +125,9 @@ discard block |
||
122 | 125 | |
123 | 126 | <?php |
124 | 127 | unset($subtabs); |
125 | - if (isset($tabs[$current_tab]['subtabs'])) |
|
126 | - $subtabs = $tabs[$current_tab]['subtabs']; |
|
128 | + if (isset($tabs[$current_tab]['subtabs'])) { |
|
129 | + $subtabs = $tabs[$current_tab]['subtabs']; |
|
130 | + } |
|
127 | 131 | $form_action = ''; |
128 | 132 | |
129 | 133 | if (!empty($subtabs)): |
@@ -189,7 +193,10 @@ discard block |
||
189 | 193 | jQuery('#last_tab').val( jQuery(this).attr('href') ); |
190 | 194 | return false;*/ |
191 | 195 | }); |
192 | - <?php if (isset($_GET['subtab']) && $_GET['subtab']) echo 'jQuery("ul.subsubsub li a[href=#' . sanitize_text_field($_GET['subtab']) . ']").click();'; ?> |
|
196 | + <?php if (isset($_GET['subtab']) && $_GET['subtab']) { |
|
197 | + echo 'jQuery("ul.subsubsub li a[href=#' . sanitize_text_field($_GET['subtab']) . ']").click();'; |
|
198 | +} |
|
199 | +?> |
|
193 | 200 | // Countries |
194 | 201 | jQuery('select#geodirectory_allowed_countries').change(function () { |
195 | 202 | if (jQuery(this).val() == "specific") { |
@@ -312,10 +319,11 @@ discard block |
||
312 | 319 | geodir_register_defaults(); |
313 | 320 | }*/ |
314 | 321 | |
315 | - if (isset($_REQUEST['active_tab']) && ($_REQUEST['active_tab'] == 'dummy_data_settings' || $_REQUEST['active_tab'] == 'csv_upload_settings')) |
|
316 | - $hide_save_button = "style='display:none;'"; |
|
317 | - else |
|
318 | - $hide_save_button = ''; |
|
322 | + if (isset($_REQUEST['active_tab']) && ($_REQUEST['active_tab'] == 'dummy_data_settings' || $_REQUEST['active_tab'] == 'csv_upload_settings')) { |
|
323 | + $hide_save_button = "style='display:none;'"; |
|
324 | + } else { |
|
325 | + $hide_save_button = ''; |
|
326 | + } |
|
319 | 327 | |
320 | 328 | /** |
321 | 329 | * Filter weather the default save button in the GD admin settings pages should be shown. |
@@ -1,39 +1,39 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin template tag functions. |
|
4 | - * |
|
5 | - * @since 1.0.0 |
|
6 | - * @package GeoDirectory |
|
7 | - */ |
|
3 | + * Admin template tag functions. |
|
4 | + * |
|
5 | + * @since 1.0.0 |
|
6 | + * @package GeoDirectory |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | if (!function_exists('geodir_admin_panel')) { |
10 | - /** |
|
11 | - * GeoDirectory Backend Admin Panel. |
|
12 | - * |
|
13 | - * Handles the display of the main GeoDirectory admin panel. |
|
14 | - * |
|
15 | - * @since 1.0.0 |
|
16 | - * @package GeoDirectory |
|
17 | - * @global string $current_tab Current tab in geodirectory settings. |
|
18 | - * @global object $geodirectory GeoDirectory plugin object. |
|
19 | - */ |
|
20 | - function geodir_admin_panel() |
|
21 | - { |
|
22 | - global $geodirectory; |
|
23 | - global $current_tab; |
|
24 | - |
|
25 | - |
|
26 | - ?> |
|
10 | + /** |
|
11 | + * GeoDirectory Backend Admin Panel. |
|
12 | + * |
|
13 | + * Handles the display of the main GeoDirectory admin panel. |
|
14 | + * |
|
15 | + * @since 1.0.0 |
|
16 | + * @package GeoDirectory |
|
17 | + * @global string $current_tab Current tab in geodirectory settings. |
|
18 | + * @global object $geodirectory GeoDirectory plugin object. |
|
19 | + */ |
|
20 | + function geodir_admin_panel() |
|
21 | + { |
|
22 | + global $geodirectory; |
|
23 | + global $current_tab; |
|
24 | + |
|
25 | + |
|
26 | + ?> |
|
27 | 27 | |
28 | 28 | <div id="gd-wrapper-main" class="wrap geodirectory"> |
29 | 29 | <?php |
30 | - /** |
|
31 | - * Called just after the opening wrapper div for the GD settings page in the admin area. |
|
32 | - * |
|
33 | - * @since 1.0.0 |
|
34 | - */ |
|
35 | - do_action('geodir_before_admin_panel'); |
|
36 | - ?> |
|
30 | + /** |
|
31 | + * Called just after the opening wrapper div for the GD settings page in the admin area. |
|
32 | + * |
|
33 | + * @since 1.0.0 |
|
34 | + */ |
|
35 | + do_action('geodir_before_admin_panel'); |
|
36 | + ?> |
|
37 | 37 | |
38 | 38 | <div class="gd-wrapper gd-wrapper-vr clearfix"> |
39 | 39 | |
@@ -44,75 +44,75 @@ discard block |
||
44 | 44 | alt="geo-logo" class="geo-logoalter"/> |
45 | 45 | <ul> |
46 | 46 | <?php |
47 | - $tabs = array(); |
|
48 | - /** |
|
49 | - * Filter the GD admin settings tabs on the left of the admin menu. |
|
50 | - * |
|
51 | - * @since 1.0.0 |
|
52 | - * @param array $tabs The array of tabs to display. |
|
53 | - */ |
|
54 | - $tabs = apply_filters('geodir_settings_tabs_array', $tabs); |
|
55 | - update_option('geodir_tabs', $tabs);// Important to show settings menu dropdown |
|
56 | - |
|
57 | - foreach ($tabs as $name => $args) : |
|
58 | - $label = $args['label']; |
|
59 | - |
|
60 | - |
|
61 | - $query_string = ''; |
|
62 | - if (isset($args['subtabs']) && !empty($args['subtabs'])): |
|
63 | - |
|
64 | - $subtabs = $args['subtabs']; |
|
65 | - |
|
66 | - $query_string = '&subtab=' . $subtabs[0]['subtab']; |
|
67 | - |
|
68 | - endif; |
|
69 | - |
|
70 | - |
|
71 | - $tab_link = admin_url('admin.php?page=geodirectory&tab=' . $name . $query_string); |
|
72 | - |
|
73 | - if (isset($args['url']) && $args['url'] != '') { |
|
74 | - $tab_link = $args['url']; |
|
75 | - } |
|
76 | - |
|
77 | - if (!empty($args['request'])) |
|
78 | - $tab_link = geodir_getlink($tab_link, $args['request']); |
|
79 | - |
|
80 | - if (isset($args['target']) && $args['target'] != '') { |
|
81 | - $tab_target = " target='" . sanitize_text_field($args['target']) . "' "; |
|
82 | - } else |
|
83 | - $tab_target = ''; |
|
84 | - |
|
85 | - $tab_active = ''; |
|
86 | - if ($current_tab == $name) |
|
87 | - $tab_active = ' class="tab-active" '; |
|
88 | - /** |
|
89 | - * Called before the individual settings tabs are output. |
|
90 | - * |
|
91 | - * @since 1.0.0 |
|
92 | - * @param string $name The name of the settings tab. |
|
93 | - * @see 'geodir_after_settings_tabs' |
|
94 | - */ |
|
95 | - do_action('geodir_before_settings_tabs', $name); |
|
96 | - echo '<li ' . $tab_active . ' ><a href="' . esc_url($tab_link) . '" ' . $tab_target . ' >' . $label . '</a></li>'; |
|
97 | - /** |
|
98 | - * Called after the individual settings tabs are output. |
|
99 | - * |
|
100 | - * @since 1.0.0 |
|
101 | - * @param string $name The name of the settings tab. |
|
102 | - * @see 'geodir_before_settings_tabs' |
|
103 | - */ |
|
104 | - do_action('geodir_after_settings_tabs', $name); |
|
105 | - endforeach; |
|
106 | - |
|
107 | - /** |
|
108 | - * Called after the GD settings tabs have been output. |
|
109 | - * |
|
110 | - * Called before the closing `ul` so can be used to add new settings tab links. |
|
111 | - * |
|
112 | - * @since 1.0.0 |
|
113 | - */ |
|
114 | - do_action('geodir_settings_tabs'); |
|
115 | - ?> |
|
47 | + $tabs = array(); |
|
48 | + /** |
|
49 | + * Filter the GD admin settings tabs on the left of the admin menu. |
|
50 | + * |
|
51 | + * @since 1.0.0 |
|
52 | + * @param array $tabs The array of tabs to display. |
|
53 | + */ |
|
54 | + $tabs = apply_filters('geodir_settings_tabs_array', $tabs); |
|
55 | + update_option('geodir_tabs', $tabs);// Important to show settings menu dropdown |
|
56 | + |
|
57 | + foreach ($tabs as $name => $args) : |
|
58 | + $label = $args['label']; |
|
59 | + |
|
60 | + |
|
61 | + $query_string = ''; |
|
62 | + if (isset($args['subtabs']) && !empty($args['subtabs'])): |
|
63 | + |
|
64 | + $subtabs = $args['subtabs']; |
|
65 | + |
|
66 | + $query_string = '&subtab=' . $subtabs[0]['subtab']; |
|
67 | + |
|
68 | + endif; |
|
69 | + |
|
70 | + |
|
71 | + $tab_link = admin_url('admin.php?page=geodirectory&tab=' . $name . $query_string); |
|
72 | + |
|
73 | + if (isset($args['url']) && $args['url'] != '') { |
|
74 | + $tab_link = $args['url']; |
|
75 | + } |
|
76 | + |
|
77 | + if (!empty($args['request'])) |
|
78 | + $tab_link = geodir_getlink($tab_link, $args['request']); |
|
79 | + |
|
80 | + if (isset($args['target']) && $args['target'] != '') { |
|
81 | + $tab_target = " target='" . sanitize_text_field($args['target']) . "' "; |
|
82 | + } else |
|
83 | + $tab_target = ''; |
|
84 | + |
|
85 | + $tab_active = ''; |
|
86 | + if ($current_tab == $name) |
|
87 | + $tab_active = ' class="tab-active" '; |
|
88 | + /** |
|
89 | + * Called before the individual settings tabs are output. |
|
90 | + * |
|
91 | + * @since 1.0.0 |
|
92 | + * @param string $name The name of the settings tab. |
|
93 | + * @see 'geodir_after_settings_tabs' |
|
94 | + */ |
|
95 | + do_action('geodir_before_settings_tabs', $name); |
|
96 | + echo '<li ' . $tab_active . ' ><a href="' . esc_url($tab_link) . '" ' . $tab_target . ' >' . $label . '</a></li>'; |
|
97 | + /** |
|
98 | + * Called after the individual settings tabs are output. |
|
99 | + * |
|
100 | + * @since 1.0.0 |
|
101 | + * @param string $name The name of the settings tab. |
|
102 | + * @see 'geodir_before_settings_tabs' |
|
103 | + */ |
|
104 | + do_action('geodir_after_settings_tabs', $name); |
|
105 | + endforeach; |
|
106 | + |
|
107 | + /** |
|
108 | + * Called after the GD settings tabs have been output. |
|
109 | + * |
|
110 | + * Called before the closing `ul` so can be used to add new settings tab links. |
|
111 | + * |
|
112 | + * @since 1.0.0 |
|
113 | + */ |
|
114 | + do_action('geodir_settings_tabs'); |
|
115 | + ?> |
|
116 | 116 | </ul> |
117 | 117 | </div> |
118 | 118 | <!--gd-left-nav ends here--> |
@@ -121,52 +121,52 @@ discard block |
||
121 | 121 | <div class="gd-tabs-main"> |
122 | 122 | |
123 | 123 | <?php |
124 | - unset($subtabs); |
|
125 | - if (isset($tabs[$current_tab]['subtabs'])) |
|
126 | - $subtabs = $tabs[$current_tab]['subtabs']; |
|
127 | - $form_action = ''; |
|
124 | + unset($subtabs); |
|
125 | + if (isset($tabs[$current_tab]['subtabs'])) |
|
126 | + $subtabs = $tabs[$current_tab]['subtabs']; |
|
127 | + $form_action = ''; |
|
128 | 128 | |
129 | - if (!empty($subtabs)): |
|
130 | - ?> |
|
129 | + if (!empty($subtabs)): |
|
130 | + ?> |
|
131 | 131 | <dl class="gd-tab-head"> |
132 | 132 | <?php |
133 | - foreach ($subtabs as $sub) { |
|
134 | - $subtab_active = ''; |
|
135 | - if (isset($_REQUEST['subtab']) && $sub['subtab'] == $_REQUEST['subtab']) { |
|
136 | - $subtab_active = 'class="gd-tab-active"'; |
|
137 | - $form_action = isset($sub['form_action']) ? $sub['form_action'] : ''; |
|
138 | - } |
|
139 | - |
|
140 | - $sub_tabs_link = admin_url() . 'admin.php?page=geodirectory&tab=' . $current_tab . '&subtab=' . $sub['subtab']; |
|
141 | - if (isset($sub['request']) && is_array($sub['request']) && !empty($sub['request'])) { |
|
142 | - $sub_tabs_link = geodir_getlink($sub_tabs_link, $sub['request']); |
|
143 | - } |
|
144 | - echo '<dd ' . $subtab_active . ' id="claim_listing"><a href="' . esc_url($sub_tabs_link) . '" >' . sanitize_text_field($sub['label']) . '</a></dd>'; |
|
145 | - } |
|
146 | - ?> |
|
133 | + foreach ($subtabs as $sub) { |
|
134 | + $subtab_active = ''; |
|
135 | + if (isset($_REQUEST['subtab']) && $sub['subtab'] == $_REQUEST['subtab']) { |
|
136 | + $subtab_active = 'class="gd-tab-active"'; |
|
137 | + $form_action = isset($sub['form_action']) ? $sub['form_action'] : ''; |
|
138 | + } |
|
139 | + |
|
140 | + $sub_tabs_link = admin_url() . 'admin.php?page=geodirectory&tab=' . $current_tab . '&subtab=' . $sub['subtab']; |
|
141 | + if (isset($sub['request']) && is_array($sub['request']) && !empty($sub['request'])) { |
|
142 | + $sub_tabs_link = geodir_getlink($sub_tabs_link, $sub['request']); |
|
143 | + } |
|
144 | + echo '<dd ' . $subtab_active . ' id="claim_listing"><a href="' . esc_url($sub_tabs_link) . '" >' . sanitize_text_field($sub['label']) . '</a></dd>'; |
|
145 | + } |
|
146 | + ?> |
|
147 | 147 | </dl> |
148 | 148 | |
149 | 149 | <?php endif; ?> |
150 | 150 | <div class="gd-tab-content <?php if (empty($subtabs)) { |
151 | - echo "inner_contet_tabs"; |
|
152 | - } ?>"> |
|
151 | + echo "inner_contet_tabs"; |
|
152 | + } ?>"> |
|
153 | 153 | <form method="post" id="mainform" |
154 | 154 | class="geodir_optionform <?php echo $current_tab . ' '; ?><?php if (isset($sub['subtab'])) { |
155 | - echo sanitize_text_field($sub['subtab']); |
|
156 | - } ?>" action="<?php echo $form_action; ?>" enctype="multipart/form-data"> |
|
155 | + echo sanitize_text_field($sub['subtab']); |
|
156 | + } ?>" action="<?php echo $form_action; ?>" enctype="multipart/form-data"> |
|
157 | 157 | <input type="hidden" class="active_tab" name="active_tab" |
158 | 158 | value="<?php if (isset($_REQUEST['active_tab'])) { |
159 | - echo sanitize_text_field($_REQUEST['active_tab']); |
|
160 | - } ?>"/> |
|
159 | + echo sanitize_text_field($_REQUEST['active_tab']); |
|
160 | + } ?>"/> |
|
161 | 161 | <?php wp_nonce_field('geodir-settings', '_wpnonce', true, true); ?> |
162 | 162 | <?php wp_nonce_field('geodir-settings-' . $current_tab, '_wpnonce-' . $current_tab, true, true); ?> |
163 | 163 | <?php |
164 | - /** |
|
165 | - * Used to call the content of each GD settings tab page. |
|
166 | - * |
|
167 | - * @since 1.0.0 |
|
168 | - */ |
|
169 | - do_action('geodir_admin_option_form', $current_tab); ?> |
|
164 | + /** |
|
165 | + * Used to call the content of each GD settings tab page. |
|
166 | + * |
|
167 | + * @since 1.0.0 |
|
168 | + */ |
|
169 | + do_action('geodir_admin_option_form', $current_tab); ?> |
|
170 | 170 | </form> |
171 | 171 | </div> |
172 | 172 | |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | </script> |
268 | 268 | <?php |
269 | 269 | |
270 | - } |
|
270 | + } |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | |
@@ -283,48 +283,48 @@ discard block |
||
283 | 283 | function geodir_admin_option_form($tab_name) |
284 | 284 | { |
285 | 285 | |
286 | - //echo $tab_name.'_array.php' ; |
|
287 | - global $geodir_settings, $is_default, $mapzoom; |
|
288 | - if (file_exists(dirname(__FILE__) . '/option-pages/' . $tab_name . '_array.php')) { |
|
289 | - /** |
|
290 | - * Contains settings array for given tab. |
|
291 | - * |
|
292 | - * @since 1.0.0 |
|
293 | - * @package GeoDirectory |
|
294 | - */ |
|
295 | - include_once('option-pages/' . $tab_name . '_array.php'); |
|
296 | - } |
|
297 | - |
|
298 | - $listing_type = isset($_REQUEST['listing_type']) ? $_REQUEST['listing_type'] : ''; |
|
299 | - |
|
300 | - switch ($tab_name) { |
|
301 | - |
|
302 | - case 'general_settings': |
|
303 | - |
|
304 | - geodir_admin_fields($geodir_settings['general_settings']); |
|
305 | - /** |
|
306 | - * |
|
307 | - * Update Taxonomy Options * |
|
308 | - * |
|
309 | - **/ |
|
310 | - /*add_action('updated_option_place_prefix','update_listing_prefix'); |
|
286 | + //echo $tab_name.'_array.php' ; |
|
287 | + global $geodir_settings, $is_default, $mapzoom; |
|
288 | + if (file_exists(dirname(__FILE__) . '/option-pages/' . $tab_name . '_array.php')) { |
|
289 | + /** |
|
290 | + * Contains settings array for given tab. |
|
291 | + * |
|
292 | + * @since 1.0.0 |
|
293 | + * @package GeoDirectory |
|
294 | + */ |
|
295 | + include_once('option-pages/' . $tab_name . '_array.php'); |
|
296 | + } |
|
297 | + |
|
298 | + $listing_type = isset($_REQUEST['listing_type']) ? $_REQUEST['listing_type'] : ''; |
|
299 | + |
|
300 | + switch ($tab_name) { |
|
301 | + |
|
302 | + case 'general_settings': |
|
303 | + |
|
304 | + geodir_admin_fields($geodir_settings['general_settings']); |
|
305 | + /** |
|
306 | + * |
|
307 | + * Update Taxonomy Options * |
|
308 | + * |
|
309 | + **/ |
|
310 | + /*add_action('updated_option_place_prefix','update_listing_prefix'); |
|
311 | 311 | function update_listing_prefix(){ |
312 | 312 | geodir_register_defaults(); |
313 | 313 | }*/ |
314 | 314 | |
315 | - if (isset($_REQUEST['active_tab']) && ($_REQUEST['active_tab'] == 'dummy_data_settings' || $_REQUEST['active_tab'] == 'csv_upload_settings')) |
|
316 | - $hide_save_button = "style='display:none;'"; |
|
317 | - else |
|
318 | - $hide_save_button = ''; |
|
315 | + if (isset($_REQUEST['active_tab']) && ($_REQUEST['active_tab'] == 'dummy_data_settings' || $_REQUEST['active_tab'] == 'csv_upload_settings')) |
|
316 | + $hide_save_button = "style='display:none;'"; |
|
317 | + else |
|
318 | + $hide_save_button = ''; |
|
319 | 319 | |
320 | - /** |
|
321 | - * Filter weather the default save button in the GD admin settings pages should be shown. |
|
322 | - * |
|
323 | - * @since 1.0.0 |
|
324 | - * @param string $hide_save_button The style element, either blank or: style='display:none;'. |
|
325 | - */ |
|
326 | - $hide_save_button = apply_filters('geodir_hide_save_button', $hide_save_button); |
|
327 | - ?> |
|
320 | + /** |
|
321 | + * Filter weather the default save button in the GD admin settings pages should be shown. |
|
322 | + * |
|
323 | + * @since 1.0.0 |
|
324 | + * @param string $hide_save_button The style element, either blank or: style='display:none;'. |
|
325 | + */ |
|
326 | + $hide_save_button = apply_filters('geodir_hide_save_button', $hide_save_button); |
|
327 | + ?> |
|
328 | 328 | |
329 | 329 | <p class="submit"> |
330 | 330 | <input <?php echo $hide_save_button;?> name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" /> |
@@ -334,36 +334,36 @@ discard block |
||
334 | 334 | </div> |
335 | 335 | |
336 | 336 | <?php break; |
337 | - case 'design_settings' : |
|
338 | - geodir_admin_fields($geodir_settings['design_settings']); |
|
337 | + case 'design_settings' : |
|
338 | + geodir_admin_fields($geodir_settings['design_settings']); |
|
339 | 339 | |
340 | 340 | |
341 | 341 | |
342 | - ?> |
|
342 | + ?> |
|
343 | 343 | <p class="submit"> |
344 | 344 | <input name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" /> |
345 | 345 | <input type="hidden" name="subtab" id="last_tab" /> |
346 | 346 | </p> |
347 | 347 | </div> |
348 | 348 | <?php break; |
349 | - case 'permalink_settings' : |
|
350 | - geodir_admin_fields($geodir_settings['permalink_settings']); ?> |
|
349 | + case 'permalink_settings' : |
|
350 | + geodir_admin_fields($geodir_settings['permalink_settings']); ?> |
|
351 | 351 | <p class="submit"> |
352 | 352 | <input name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" /> |
353 | 353 | <input type="hidden" name="subtab" id="last_tab" /> |
354 | 354 | </p> |
355 | 355 | </div> |
356 | 356 | <?php break; |
357 | - case 'title_meta_settings' : |
|
358 | - geodir_admin_fields($geodir_settings['title_meta_settings']); ?> |
|
357 | + case 'title_meta_settings' : |
|
358 | + geodir_admin_fields($geodir_settings['title_meta_settings']); ?> |
|
359 | 359 | <p class="submit"> |
360 | 360 | <input name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" /> |
361 | 361 | <input type="hidden" name="subtab" id="last_tab" /> |
362 | 362 | </p> |
363 | 363 | </div> |
364 | 364 | <?php break; |
365 | - case 'notifications_settings' : |
|
366 | - geodir_admin_fields($geodir_settings['notifications_settings']); ?> |
|
365 | + case 'notifications_settings' : |
|
366 | + geodir_admin_fields($geodir_settings['notifications_settings']); ?> |
|
367 | 367 | |
368 | 368 | <p class="submit"> |
369 | 369 | |
@@ -373,36 +373,36 @@ discard block |
||
373 | 373 | </div> |
374 | 374 | |
375 | 375 | <?php break; |
376 | - case 'default_location_settings' : |
|
377 | - ?> |
|
376 | + case 'default_location_settings' : |
|
377 | + ?> |
|
378 | 378 | <div class="inner_content_tab_main"> |
379 | 379 | <div class="gd-content-heading"> |
380 | 380 | <?php global $wpdb; |
381 | 381 | |
382 | 382 | |
383 | - $location_result = geodir_get_default_location(); |
|
383 | + $location_result = geodir_get_default_location(); |
|
384 | 384 | |
385 | - $prefix = ''; |
|
385 | + $prefix = ''; |
|
386 | 386 | |
387 | 387 | |
388 | - $lat = isset($location_result->city_latitude) ? $location_result->city_latitude : ''; |
|
389 | - $lng = isset($location_result->city_longitude) ? $location_result->city_longitude : ''; |
|
390 | - $city = isset($location_result->city) ? $location_result->city : ''; |
|
391 | - $region = isset($location_result->region) ? $location_result->region : ''; |
|
392 | - $country = isset($location_result->country) ? $location_result->country : ''; |
|
388 | + $lat = isset($location_result->city_latitude) ? $location_result->city_latitude : ''; |
|
389 | + $lng = isset($location_result->city_longitude) ? $location_result->city_longitude : ''; |
|
390 | + $city = isset($location_result->city) ? $location_result->city : ''; |
|
391 | + $region = isset($location_result->region) ? $location_result->region : ''; |
|
392 | + $country = isset($location_result->country) ? $location_result->country : ''; |
|
393 | 393 | |
394 | 394 | |
395 | - $map_title = __("Set Address On Map", 'geodirectory'); |
|
395 | + $map_title = __("Set Address On Map", 'geodirectory'); |
|
396 | 396 | |
397 | - ?> |
|
397 | + ?> |
|
398 | 398 | |
399 | 399 | <h3><?php _e('Set Default Location', 'geodirectory');?></h3> |
400 | 400 | |
401 | 401 | <input type="hidden" name="add_location" value="location"> |
402 | 402 | |
403 | 403 | <input type="hidden" name="update_city" value="<?php if (isset($location_result->location_id)) { |
404 | - echo $location_result->location_id; |
|
405 | - } ?>"> |
|
404 | + echo $location_result->location_id; |
|
405 | + } ?>"> |
|
406 | 406 | |
407 | 407 | <input type="hidden" name="address" id="<?php echo $prefix;?>address" value=""> |
408 | 408 | |
@@ -415,8 +415,8 @@ discard block |
||
415 | 415 | <input class="require" type="text" size="80" style="width:440px" |
416 | 416 | id="<?php echo $prefix;?>city" name="city" |
417 | 417 | value="<?php if (isset($location_result->city)) { |
418 | - echo $location_result->city; |
|
419 | - } ?>"/> |
|
418 | + echo $location_result->city; |
|
419 | + } ?>"/> |
|
420 | 420 | |
421 | 421 | <div |
422 | 422 | class="gd-location_message_error"> <?php _e('This field is required.', 'geodirectory'); ?></div> |
@@ -431,8 +431,8 @@ discard block |
||
431 | 431 | <input class="require" type="text" size="80" style="width:440px" |
432 | 432 | id="<?php echo $prefix;?>region" name="region" |
433 | 433 | value="<?php if (isset($location_result->region)) { |
434 | - echo $location_result->region; |
|
435 | - } ?>"/> |
|
434 | + echo $location_result->region; |
|
435 | + } ?>"/> |
|
436 | 436 | |
437 | 437 | <div |
438 | 438 | class="gd-location_message_error"> <?php _e('This field is required.', 'geodirectory'); ?></div> |
@@ -446,8 +446,8 @@ discard block |
||
446 | 446 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
447 | 447 | <?php |
448 | 448 | |
449 | - $country_result = isset($location_result->country) ? $location_result->country : ''; |
|
450 | - ?> |
|
449 | + $country_result = isset($location_result->country) ? $location_result->country : ''; |
|
450 | + ?> |
|
451 | 451 | <select id="<?php echo $prefix ?>country" class="chosen_select" |
452 | 452 | data-location_type="country" name="<?php echo $prefix ?>country" |
453 | 453 | data-placeholder="<?php _e('Choose a country.', 'geodirectory');?>" |
@@ -470,12 +470,12 @@ discard block |
||
470 | 470 | scope="row"><?php _e('Set Location on Map', 'geodirectory');?></th> |
471 | 471 | <td class="forminp"> |
472 | 472 | <?php |
473 | - /** |
|
474 | - * Contains add listing page map functions. |
|
475 | - * |
|
476 | - * @since 1.0.0 |
|
477 | - */ |
|
478 | - include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");?> |
|
473 | + /** |
|
474 | + * Contains add listing page map functions. |
|
475 | + * |
|
476 | + * @since 1.0.0 |
|
477 | + */ |
|
478 | + include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");?> |
|
479 | 479 | </td> |
480 | 480 | </tr> |
481 | 481 | <tr valign="top" class="single_select_page"> |
@@ -485,8 +485,8 @@ discard block |
||
485 | 485 | <input type="text" class="require" size="80" style="width:440px" |
486 | 486 | id="<?php echo $prefix;?>latitude" name="latitude" |
487 | 487 | value="<?php if (isset($location_result->city_latitude)) { |
488 | - echo $location_result->city_latitude; |
|
489 | - } ?>"/> |
|
488 | + echo $location_result->city_latitude; |
|
489 | + } ?>"/> |
|
490 | 490 | |
491 | 491 | <div |
492 | 492 | class="gd-location_message_error"><?php _e('This field is required.', 'geodirectory'); ?></div> |
@@ -502,8 +502,8 @@ discard block |
||
502 | 502 | <input type="text" class="require" size="80" style="width:440px" |
503 | 503 | id="<?php echo $prefix;?>longitude" name="longitude" |
504 | 504 | value="<?php if (isset($location_result->city_longitude)) { |
505 | - echo $location_result->city_longitude; |
|
506 | - } ?>"/> |
|
505 | + echo $location_result->city_longitude; |
|
506 | + } ?>"/> |
|
507 | 507 | |
508 | 508 | <div |
509 | 509 | class="gd-location_message_error"><?php _e('This field is required.', 'geodirectory'); ?></div> |
@@ -535,22 +535,22 @@ discard block |
||
535 | 535 | </div> |
536 | 536 | </div> |
537 | 537 | <?php break; |
538 | - case $listing_type . '_fields_settings' : |
|
538 | + case $listing_type . '_fields_settings' : |
|
539 | 539 | |
540 | - geodir_custom_post_type_form(); |
|
540 | + geodir_custom_post_type_form(); |
|
541 | 541 | |
542 | - break; |
|
543 | - case 'tools_settings' : |
|
544 | - geodir_diagnostic_tools_setting_page(); |
|
545 | - break; |
|
546 | - case 'compatibility_settings' : |
|
547 | - geodir_theme_compatibility_setting_page(); |
|
548 | - break; |
|
542 | + break; |
|
543 | + case 'tools_settings' : |
|
544 | + geodir_diagnostic_tools_setting_page(); |
|
545 | + break; |
|
546 | + case 'compatibility_settings' : |
|
547 | + geodir_theme_compatibility_setting_page(); |
|
548 | + break; |
|
549 | 549 | case 'import_export' : |
550 | - geodir_import_export_page(); |
|
551 | - break; |
|
550 | + geodir_import_export_page(); |
|
551 | + break; |
|
552 | 552 | |
553 | - }// end of switch |
|
553 | + }// end of switch |
|
554 | 554 | } |
555 | 555 | |
556 | 556 | |
@@ -590,170 +590,170 @@ discard block |
||
590 | 590 | function geodir_update_options_compatibility_settings() |
591 | 591 | { |
592 | 592 | |
593 | - global $wpdb; |
|
593 | + global $wpdb; |
|
594 | 594 | |
595 | 595 | |
596 | - $theme_settings = array(); |
|
596 | + $theme_settings = array(); |
|
597 | 597 | |
598 | - $theme_settings['geodir_wrapper_open_id'] = $_POST['geodir_wrapper_open_id']; |
|
599 | - $theme_settings['geodir_wrapper_open_class'] = $_POST['geodir_wrapper_open_class']; |
|
600 | - $theme_settings['geodir_wrapper_open_replace'] = stripslashes($_POST['geodir_wrapper_open_replace']); |
|
598 | + $theme_settings['geodir_wrapper_open_id'] = $_POST['geodir_wrapper_open_id']; |
|
599 | + $theme_settings['geodir_wrapper_open_class'] = $_POST['geodir_wrapper_open_class']; |
|
600 | + $theme_settings['geodir_wrapper_open_replace'] = stripslashes($_POST['geodir_wrapper_open_replace']); |
|
601 | 601 | |
602 | - $theme_settings['geodir_wrapper_close_replace'] = stripslashes($_POST['geodir_wrapper_close_replace']); |
|
602 | + $theme_settings['geodir_wrapper_close_replace'] = stripslashes($_POST['geodir_wrapper_close_replace']); |
|
603 | 603 | |
604 | - $theme_settings['geodir_wrapper_content_open_id'] = $_POST['geodir_wrapper_content_open_id']; |
|
605 | - $theme_settings['geodir_wrapper_content_open_class'] = $_POST['geodir_wrapper_content_open_class']; |
|
606 | - $theme_settings['geodir_wrapper_content_open_replace'] = stripslashes($_POST['geodir_wrapper_content_open_replace']); |
|
604 | + $theme_settings['geodir_wrapper_content_open_id'] = $_POST['geodir_wrapper_content_open_id']; |
|
605 | + $theme_settings['geodir_wrapper_content_open_class'] = $_POST['geodir_wrapper_content_open_class']; |
|
606 | + $theme_settings['geodir_wrapper_content_open_replace'] = stripslashes($_POST['geodir_wrapper_content_open_replace']); |
|
607 | 607 | |
608 | - $theme_settings['geodir_wrapper_content_close_replace'] = stripslashes($_POST['geodir_wrapper_content_close_replace']); |
|
608 | + $theme_settings['geodir_wrapper_content_close_replace'] = stripslashes($_POST['geodir_wrapper_content_close_replace']); |
|
609 | 609 | |
610 | - $theme_settings['geodir_article_open_id'] = $_POST['geodir_article_open_id']; |
|
611 | - $theme_settings['geodir_article_open_class'] = $_POST['geodir_article_open_class']; |
|
612 | - $theme_settings['geodir_article_open_replace'] = stripslashes($_POST['geodir_article_open_replace']); |
|
610 | + $theme_settings['geodir_article_open_id'] = $_POST['geodir_article_open_id']; |
|
611 | + $theme_settings['geodir_article_open_class'] = $_POST['geodir_article_open_class']; |
|
612 | + $theme_settings['geodir_article_open_replace'] = stripslashes($_POST['geodir_article_open_replace']); |
|
613 | 613 | |
614 | - $theme_settings['geodir_article_close_replace'] = stripslashes($_POST['geodir_article_close_replace']); |
|
614 | + $theme_settings['geodir_article_close_replace'] = stripslashes($_POST['geodir_article_close_replace']); |
|
615 | 615 | |
616 | - $theme_settings['geodir_sidebar_right_open_id'] = $_POST['geodir_sidebar_right_open_id']; |
|
617 | - $theme_settings['geodir_sidebar_right_open_class'] = $_POST['geodir_sidebar_right_open_class']; |
|
618 | - $theme_settings['geodir_sidebar_right_open_replace'] = stripslashes($_POST['geodir_sidebar_right_open_replace']); |
|
616 | + $theme_settings['geodir_sidebar_right_open_id'] = $_POST['geodir_sidebar_right_open_id']; |
|
617 | + $theme_settings['geodir_sidebar_right_open_class'] = $_POST['geodir_sidebar_right_open_class']; |
|
618 | + $theme_settings['geodir_sidebar_right_open_replace'] = stripslashes($_POST['geodir_sidebar_right_open_replace']); |
|
619 | 619 | |
620 | - $theme_settings['geodir_sidebar_right_close_replace'] = stripslashes($_POST['geodir_sidebar_right_close_replace']); |
|
620 | + $theme_settings['geodir_sidebar_right_close_replace'] = stripslashes($_POST['geodir_sidebar_right_close_replace']); |
|
621 | 621 | |
622 | - $theme_settings['geodir_sidebar_left_open_id'] = $_POST['geodir_sidebar_left_open_id']; |
|
623 | - $theme_settings['geodir_sidebar_left_open_class'] = $_POST['geodir_sidebar_left_open_class']; |
|
624 | - $theme_settings['geodir_sidebar_left_open_replace'] = stripslashes($_POST['geodir_sidebar_left_open_replace']); |
|
622 | + $theme_settings['geodir_sidebar_left_open_id'] = $_POST['geodir_sidebar_left_open_id']; |
|
623 | + $theme_settings['geodir_sidebar_left_open_class'] = $_POST['geodir_sidebar_left_open_class']; |
|
624 | + $theme_settings['geodir_sidebar_left_open_replace'] = stripslashes($_POST['geodir_sidebar_left_open_replace']); |
|
625 | 625 | |
626 | - $theme_settings['geodir_sidebar_left_close_replace'] = stripslashes($_POST['geodir_sidebar_left_close_replace']); |
|
626 | + $theme_settings['geodir_sidebar_left_close_replace'] = stripslashes($_POST['geodir_sidebar_left_close_replace']); |
|
627 | 627 | |
628 | - $theme_settings['geodir_main_content_open_id'] = $_POST['geodir_main_content_open_id']; |
|
629 | - $theme_settings['geodir_main_content_open_class'] = $_POST['geodir_main_content_open_class']; |
|
630 | - $theme_settings['geodir_main_content_open_replace'] = stripslashes($_POST['geodir_main_content_open_replace']); |
|
628 | + $theme_settings['geodir_main_content_open_id'] = $_POST['geodir_main_content_open_id']; |
|
629 | + $theme_settings['geodir_main_content_open_class'] = $_POST['geodir_main_content_open_class']; |
|
630 | + $theme_settings['geodir_main_content_open_replace'] = stripslashes($_POST['geodir_main_content_open_replace']); |
|
631 | 631 | |
632 | - $theme_settings['geodir_main_content_close_replace'] = stripslashes($_POST['geodir_main_content_close_replace']); |
|
632 | + $theme_settings['geodir_main_content_close_replace'] = stripslashes($_POST['geodir_main_content_close_replace']); |
|
633 | 633 | |
634 | 634 | // Other Actions |
635 | - $theme_settings['geodir_top_content_add'] = stripslashes($_POST['geodir_top_content_add']); |
|
636 | - $theme_settings['geodir_before_main_content_add'] = stripslashes($_POST['geodir_before_main_content_add']); |
|
635 | + $theme_settings['geodir_top_content_add'] = stripslashes($_POST['geodir_top_content_add']); |
|
636 | + $theme_settings['geodir_before_main_content_add'] = stripslashes($_POST['geodir_before_main_content_add']); |
|
637 | 637 | |
638 | 638 | // Filters |
639 | - $theme_settings['geodir_full_page_class_filter'] = stripslashes($_POST['geodir_full_page_class_filter']); |
|
640 | - $theme_settings['geodir_before_widget_filter'] = stripslashes($_POST['geodir_before_widget_filter']); |
|
641 | - $theme_settings['geodir_after_widget_filter'] = stripslashes($_POST['geodir_after_widget_filter']); |
|
642 | - $theme_settings['geodir_before_title_filter'] = stripslashes($_POST['geodir_before_title_filter']); |
|
643 | - $theme_settings['geodir_after_title_filter'] = stripslashes($_POST['geodir_after_title_filter']); |
|
644 | - $theme_settings['geodir_menu_li_class_filter'] = stripslashes($_POST['geodir_menu_li_class_filter']); |
|
645 | - $theme_settings['geodir_sub_menu_ul_class_filter'] = stripslashes($_POST['geodir_sub_menu_ul_class_filter']); |
|
646 | - $theme_settings['geodir_sub_menu_li_class_filter'] = stripslashes($_POST['geodir_sub_menu_li_class_filter']); |
|
647 | - $theme_settings['geodir_menu_a_class_filter'] = stripslashes($_POST['geodir_menu_a_class_filter']); |
|
648 | - $theme_settings['geodir_sub_menu_a_class_filter'] = stripslashes($_POST['geodir_sub_menu_a_class_filter']); |
|
639 | + $theme_settings['geodir_full_page_class_filter'] = stripslashes($_POST['geodir_full_page_class_filter']); |
|
640 | + $theme_settings['geodir_before_widget_filter'] = stripslashes($_POST['geodir_before_widget_filter']); |
|
641 | + $theme_settings['geodir_after_widget_filter'] = stripslashes($_POST['geodir_after_widget_filter']); |
|
642 | + $theme_settings['geodir_before_title_filter'] = stripslashes($_POST['geodir_before_title_filter']); |
|
643 | + $theme_settings['geodir_after_title_filter'] = stripslashes($_POST['geodir_after_title_filter']); |
|
644 | + $theme_settings['geodir_menu_li_class_filter'] = stripslashes($_POST['geodir_menu_li_class_filter']); |
|
645 | + $theme_settings['geodir_sub_menu_ul_class_filter'] = stripslashes($_POST['geodir_sub_menu_ul_class_filter']); |
|
646 | + $theme_settings['geodir_sub_menu_li_class_filter'] = stripslashes($_POST['geodir_sub_menu_li_class_filter']); |
|
647 | + $theme_settings['geodir_menu_a_class_filter'] = stripslashes($_POST['geodir_menu_a_class_filter']); |
|
648 | + $theme_settings['geodir_sub_menu_a_class_filter'] = stripslashes($_POST['geodir_sub_menu_a_class_filter']); |
|
649 | 649 | //location manager filters |
650 | - $theme_settings['geodir_location_switcher_menu_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_li_class_filter']); |
|
651 | - $theme_settings['geodir_location_switcher_menu_a_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_a_class_filter']); |
|
652 | - $theme_settings['geodir_location_switcher_menu_sub_ul_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_ul_class_filter']); |
|
653 | - $theme_settings['geodir_location_switcher_menu_sub_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_li_class_filter']); |
|
650 | + $theme_settings['geodir_location_switcher_menu_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_li_class_filter']); |
|
651 | + $theme_settings['geodir_location_switcher_menu_a_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_a_class_filter']); |
|
652 | + $theme_settings['geodir_location_switcher_menu_sub_ul_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_ul_class_filter']); |
|
653 | + $theme_settings['geodir_location_switcher_menu_sub_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_li_class_filter']); |
|
654 | 654 | |
655 | 655 | |
656 | 656 | // theme required css |
657 | - $theme_settings['geodir_theme_compat_css'] = stripslashes($_POST['geodir_theme_compat_css']); |
|
657 | + $theme_settings['geodir_theme_compat_css'] = stripslashes($_POST['geodir_theme_compat_css']); |
|
658 | 658 | |
659 | 659 | // theme required js |
660 | - $theme_settings['geodir_theme_compat_js'] = stripslashes($_POST['geodir_theme_compat_js']); |
|
660 | + $theme_settings['geodir_theme_compat_js'] = stripslashes($_POST['geodir_theme_compat_js']); |
|
661 | 661 | |
662 | 662 | // theme compat name |
663 | - $theme_settings['gd_theme_compat'] = $_POST['gd_theme_compat']; |
|
664 | - if ($theme_settings['gd_theme_compat'] == '') { |
|
665 | - update_option('gd_theme_compat', ''); |
|
666 | - update_option('theme_compatibility_setting', ''); |
|
667 | - return; |
|
668 | - } |
|
663 | + $theme_settings['gd_theme_compat'] = $_POST['gd_theme_compat']; |
|
664 | + if ($theme_settings['gd_theme_compat'] == '') { |
|
665 | + update_option('gd_theme_compat', ''); |
|
666 | + update_option('theme_compatibility_setting', ''); |
|
667 | + return; |
|
668 | + } |
|
669 | 669 | |
670 | 670 | // theme default options |
671 | - $theme_settings['geodir_theme_compat_default_options'] = ''; |
|
671 | + $theme_settings['geodir_theme_compat_default_options'] = ''; |
|
672 | 672 | |
673 | 673 | |
674 | 674 | //suported theme code |
675 | - $theme_settings['geodir_theme_compat_code'] = false; |
|
676 | - |
|
677 | - $theme = wp_get_theme(); |
|
678 | - |
|
679 | - if ($theme->parent()) { |
|
680 | - $theme_name = str_replace(" ", "_", $theme->parent()->get('Name')); |
|
681 | - } else { |
|
682 | - $theme_name = str_replace(" ", "_", $theme->get('Name')); |
|
683 | - } |
|
684 | - |
|
685 | - if (in_array($theme_name, array('Avada', 'Enfold', 'X', 'Divi', 'Genesis', 'Jupiter', 'Multi_News'))) {// list of themes that have php files |
|
686 | - $theme_settings['geodir_theme_compat_code'] = $theme_name; |
|
687 | - } |
|
688 | - |
|
689 | - |
|
690 | - $theme_name = $theme_name . "_custom"; |
|
691 | - $theme_arr = get_option('gd_theme_compats'); |
|
692 | - update_option('gd_theme_compat', $theme_name); |
|
693 | - /** |
|
694 | - * Called before the theme compatibility settings are saved to the DB. |
|
695 | - * |
|
696 | - * @since 1.4.0 |
|
697 | - * @param array $theme_settings { |
|
698 | - * Attributes of the theme compatibility settings array. |
|
699 | - * |
|
700 | - * @type string $geodir_wrapper_open_id Geodir wrapper open html id. |
|
701 | - * @type string $geodir_wrapper_open_class Geodir wrapper open html class. |
|
702 | - * @type string $geodir_wrapper_open_replace Geodir wrapper open content replace. |
|
703 | - * @type string $geodir_wrapper_close_replace Geodir wrapper close content replace. |
|
704 | - * @type string $geodir_wrapper_content_open_id Geodir wrapper content open html id. |
|
705 | - * @type string $geodir_wrapper_content_open_class Geodir wrapper content open html class. |
|
706 | - * @type string $geodir_wrapper_content_open_replace Geodir wrapper content open content replace. |
|
707 | - * @type string $geodir_wrapper_content_close_replace Geodir wrapper content close content replace. |
|
708 | - * @type string $geodir_article_open_id Geodir article open html id. |
|
709 | - * @type string $geodir_article_open_class Geodir article open html class. |
|
710 | - * @type string $geodir_article_open_replace Geodir article open content replace. |
|
711 | - * @type string $geodir_article_close_replace Geodir article close content replace. |
|
712 | - * @type string $geodir_sidebar_right_open_id Geodir sidebar right open html id. |
|
713 | - * @type string $geodir_sidebar_right_open_class Geodir sidebar right open html class. |
|
714 | - * @type string $geodir_sidebar_right_open_replace Geodir sidebar right open content replace. |
|
715 | - * @type string $geodir_sidebar_right_close_replace Geodir sidebar right close content replace. |
|
716 | - * @type string $geodir_sidebar_left_open_id Geodir sidebar left open html id. |
|
717 | - * @type string $geodir_sidebar_left_open_class Geodir sidebar left open html class. |
|
718 | - * @type string $geodir_sidebar_left_open_replace Geodir sidebar left open content replace. |
|
719 | - * @type string $geodir_sidebar_left_close_replace Geodir sidebar left close content replace. |
|
720 | - * @type string $geodir_main_content_open_id Geodir main content open html id. |
|
721 | - * @type string $geodir_main_content_open_class Geodir main content open html class. |
|
722 | - * @type string $geodir_main_content_open_replace Geodir main content open content replace. |
|
723 | - * @type string $geodir_main_content_close_replace Geodir main content close content replace. |
|
724 | - * @type string $geodir_top_content_add Geodir top content add. |
|
725 | - * @type string $geodir_before_main_content_add Geodir before main content add. |
|
726 | - * @type string $geodir_full_page_class_filter Geodir full page class filter. |
|
727 | - * @type string $geodir_before_widget_filter Geodir before widget filter. |
|
728 | - * @type string $geodir_after_widget_filter Geodir after widget filter. |
|
729 | - * @type string $geodir_before_title_filter Geodir before title filter. |
|
730 | - * @type string $geodir_after_title_filter Geodir after title filter. |
|
731 | - * @type string $geodir_menu_li_class_filter Geodir menu li class filter. |
|
732 | - * @type string $geodir_sub_menu_ul_class_filter Geodir sub menu ul class filter. |
|
733 | - * @type string $geodir_sub_menu_li_class_filter Geodir sub menu li class filter. |
|
734 | - * @type string $geodir_menu_a_class_filter Geodir menu a class filter. |
|
735 | - * @type string $geodir_sub_menu_a_class_filter Geodir sub menu a class filter. |
|
736 | - * @type string $geodir_location_switcher_menu_li_class_filter Geodir location switcher menu li class filter. |
|
737 | - * @type string $geodir_location_switcher_menu_a_class_filter Geodir location switcher menu a class filter. |
|
738 | - * @type string $geodir_location_switcher_menu_sub_ul_class_filter Geodir location switcher menu sub ul class filter. |
|
739 | - * @type string $geodir_location_switcher_menu_sub_li_class_filter Geodir location switcher menu sub li class filter. |
|
740 | - * @type string $geodir_theme_compat_css Geodir theme compatibility css. |
|
741 | - * @type string $geodir_theme_compat_js Geodir theme compatibility js. |
|
742 | - * @type string $gd_theme_compat Gd theme compatibility. |
|
743 | - * @type string $geodir_theme_compat_default_options Geodir theme compatibility default options. |
|
744 | - * @type bool $geodir_theme_compat_code Geodir theme compatibility code Ex: 'Avada. |
|
745 | - * |
|
746 | - * } |
|
747 | - */ |
|
748 | - do_action('gd_compat_save_settings', $theme_settings); |
|
675 | + $theme_settings['geodir_theme_compat_code'] = false; |
|
676 | + |
|
677 | + $theme = wp_get_theme(); |
|
678 | + |
|
679 | + if ($theme->parent()) { |
|
680 | + $theme_name = str_replace(" ", "_", $theme->parent()->get('Name')); |
|
681 | + } else { |
|
682 | + $theme_name = str_replace(" ", "_", $theme->get('Name')); |
|
683 | + } |
|
684 | + |
|
685 | + if (in_array($theme_name, array('Avada', 'Enfold', 'X', 'Divi', 'Genesis', 'Jupiter', 'Multi_News'))) {// list of themes that have php files |
|
686 | + $theme_settings['geodir_theme_compat_code'] = $theme_name; |
|
687 | + } |
|
688 | + |
|
689 | + |
|
690 | + $theme_name = $theme_name . "_custom"; |
|
691 | + $theme_arr = get_option('gd_theme_compats'); |
|
692 | + update_option('gd_theme_compat', $theme_name); |
|
693 | + /** |
|
694 | + * Called before the theme compatibility settings are saved to the DB. |
|
695 | + * |
|
696 | + * @since 1.4.0 |
|
697 | + * @param array $theme_settings { |
|
698 | + * Attributes of the theme compatibility settings array. |
|
699 | + * |
|
700 | + * @type string $geodir_wrapper_open_id Geodir wrapper open html id. |
|
701 | + * @type string $geodir_wrapper_open_class Geodir wrapper open html class. |
|
702 | + * @type string $geodir_wrapper_open_replace Geodir wrapper open content replace. |
|
703 | + * @type string $geodir_wrapper_close_replace Geodir wrapper close content replace. |
|
704 | + * @type string $geodir_wrapper_content_open_id Geodir wrapper content open html id. |
|
705 | + * @type string $geodir_wrapper_content_open_class Geodir wrapper content open html class. |
|
706 | + * @type string $geodir_wrapper_content_open_replace Geodir wrapper content open content replace. |
|
707 | + * @type string $geodir_wrapper_content_close_replace Geodir wrapper content close content replace. |
|
708 | + * @type string $geodir_article_open_id Geodir article open html id. |
|
709 | + * @type string $geodir_article_open_class Geodir article open html class. |
|
710 | + * @type string $geodir_article_open_replace Geodir article open content replace. |
|
711 | + * @type string $geodir_article_close_replace Geodir article close content replace. |
|
712 | + * @type string $geodir_sidebar_right_open_id Geodir sidebar right open html id. |
|
713 | + * @type string $geodir_sidebar_right_open_class Geodir sidebar right open html class. |
|
714 | + * @type string $geodir_sidebar_right_open_replace Geodir sidebar right open content replace. |
|
715 | + * @type string $geodir_sidebar_right_close_replace Geodir sidebar right close content replace. |
|
716 | + * @type string $geodir_sidebar_left_open_id Geodir sidebar left open html id. |
|
717 | + * @type string $geodir_sidebar_left_open_class Geodir sidebar left open html class. |
|
718 | + * @type string $geodir_sidebar_left_open_replace Geodir sidebar left open content replace. |
|
719 | + * @type string $geodir_sidebar_left_close_replace Geodir sidebar left close content replace. |
|
720 | + * @type string $geodir_main_content_open_id Geodir main content open html id. |
|
721 | + * @type string $geodir_main_content_open_class Geodir main content open html class. |
|
722 | + * @type string $geodir_main_content_open_replace Geodir main content open content replace. |
|
723 | + * @type string $geodir_main_content_close_replace Geodir main content close content replace. |
|
724 | + * @type string $geodir_top_content_add Geodir top content add. |
|
725 | + * @type string $geodir_before_main_content_add Geodir before main content add. |
|
726 | + * @type string $geodir_full_page_class_filter Geodir full page class filter. |
|
727 | + * @type string $geodir_before_widget_filter Geodir before widget filter. |
|
728 | + * @type string $geodir_after_widget_filter Geodir after widget filter. |
|
729 | + * @type string $geodir_before_title_filter Geodir before title filter. |
|
730 | + * @type string $geodir_after_title_filter Geodir after title filter. |
|
731 | + * @type string $geodir_menu_li_class_filter Geodir menu li class filter. |
|
732 | + * @type string $geodir_sub_menu_ul_class_filter Geodir sub menu ul class filter. |
|
733 | + * @type string $geodir_sub_menu_li_class_filter Geodir sub menu li class filter. |
|
734 | + * @type string $geodir_menu_a_class_filter Geodir menu a class filter. |
|
735 | + * @type string $geodir_sub_menu_a_class_filter Geodir sub menu a class filter. |
|
736 | + * @type string $geodir_location_switcher_menu_li_class_filter Geodir location switcher menu li class filter. |
|
737 | + * @type string $geodir_location_switcher_menu_a_class_filter Geodir location switcher menu a class filter. |
|
738 | + * @type string $geodir_location_switcher_menu_sub_ul_class_filter Geodir location switcher menu sub ul class filter. |
|
739 | + * @type string $geodir_location_switcher_menu_sub_li_class_filter Geodir location switcher menu sub li class filter. |
|
740 | + * @type string $geodir_theme_compat_css Geodir theme compatibility css. |
|
741 | + * @type string $geodir_theme_compat_js Geodir theme compatibility js. |
|
742 | + * @type string $gd_theme_compat Gd theme compatibility. |
|
743 | + * @type string $geodir_theme_compat_default_options Geodir theme compatibility default options. |
|
744 | + * @type bool $geodir_theme_compat_code Geodir theme compatibility code Ex: 'Avada. |
|
745 | + * |
|
746 | + * } |
|
747 | + */ |
|
748 | + do_action('gd_compat_save_settings', $theme_settings); |
|
749 | 749 | |
750 | 750 | //if($_POST['gd_theme_compat'])== |
751 | - $theme_arr[$theme_name] = $theme_settings; |
|
752 | - update_option('gd_theme_compats', $theme_arr); |
|
751 | + $theme_arr[$theme_name] = $theme_settings; |
|
752 | + update_option('gd_theme_compats', $theme_arr); |
|
753 | 753 | |
754 | 754 | |
755 | 755 | //print_r($theme_settings);exit; |
756 | - update_option('theme_compatibility_setting', $theme_settings); |
|
756 | + update_option('theme_compatibility_setting', $theme_settings); |
|
757 | 757 | |
758 | 758 | } |
759 | 759 | |
@@ -766,12 +766,12 @@ discard block |
||
766 | 766 | */ |
767 | 767 | function geodir_theme_compatibility_setting_page() |
768 | 768 | { |
769 | - global $wpdb; |
|
770 | - $tc = get_option('theme_compatibility_setting'); |
|
771 | - //print_r($tc); |
|
772 | - //print_r(wp_get_theme()); |
|
769 | + global $wpdb; |
|
770 | + $tc = get_option('theme_compatibility_setting'); |
|
771 | + //print_r($tc); |
|
772 | + //print_r(wp_get_theme()); |
|
773 | 773 | |
774 | - ?> |
|
774 | + ?> |
|
775 | 775 | <div class="inner_content_tab_main"> |
776 | 776 | <div class="gd-content-heading"> |
777 | 777 | |
@@ -813,21 +813,21 @@ discard block |
||
813 | 813 | <option value=""><?php _e('Select Theme', 'geodirectory');?></option> |
814 | 814 | <option value="custom"><?php _e('Custom', 'geodirectory');?></option> |
815 | 815 | <?php |
816 | - $theme_arr = get_option('gd_theme_compats'); |
|
817 | - $theme_active = get_option('gd_theme_compat'); |
|
818 | - if (is_array($theme_arr)) { |
|
819 | - foreach ($theme_arr as $key => $theme) { |
|
820 | - $sel = ''; |
|
821 | - if ($theme_active == $key) { |
|
822 | - $sel = "selected"; |
|
823 | - } |
|
824 | - echo "<option $sel>$key</option>"; |
|
825 | - } |
|
816 | + $theme_arr = get_option('gd_theme_compats'); |
|
817 | + $theme_active = get_option('gd_theme_compat'); |
|
818 | + if (is_array($theme_arr)) { |
|
819 | + foreach ($theme_arr as $key => $theme) { |
|
820 | + $sel = ''; |
|
821 | + if ($theme_active == $key) { |
|
822 | + $sel = "selected"; |
|
823 | + } |
|
824 | + echo "<option $sel>$key</option>"; |
|
825 | + } |
|
826 | 826 | |
827 | 827 | |
828 | - } |
|
828 | + } |
|
829 | 829 | |
830 | - ?> |
|
830 | + ?> |
|
831 | 831 | </select> |
832 | 832 | <button onclick="gd_comp_export();" type="button" |
833 | 833 | class="button-primary"><?php _e('Export', 'geodirectory');?></button> |
@@ -936,11 +936,11 @@ discard block |
||
936 | 936 | <small>geodir_wrapper_open</small> |
937 | 937 | </td> |
938 | 938 | <td><input value="<?php if (isset($tc['geodir_wrapper_open_id'])) { |
939 | - echo $tc['geodir_wrapper_open_id']; |
|
940 | - }?>" type="text" name="geodir_wrapper_open_id" placeholder="geodir-wrapper"/></td> |
|
939 | + echo $tc['geodir_wrapper_open_id']; |
|
940 | + }?>" type="text" name="geodir_wrapper_open_id" placeholder="geodir-wrapper"/></td> |
|
941 | 941 | <td><input value="<?php if (isset($tc['geodir_wrapper_open_class'])) { |
942 | - echo $tc['geodir_wrapper_open_class']; |
|
943 | - }?>" type="text" name="geodir_wrapper_open_class" placeholder=""/></td> |
|
942 | + echo $tc['geodir_wrapper_open_class']; |
|
943 | + }?>" type="text" name="geodir_wrapper_open_class" placeholder=""/></td> |
|
944 | 944 | </tr> |
945 | 945 | |
946 | 946 | <tr class="gd-theme-comp-out"> |
@@ -948,8 +948,8 @@ discard block |
||
948 | 948 | <span><?php _e('Output:', 'geodirectory');?></span> |
949 | 949 | <textarea name="geodir_wrapper_open_replace" |
950 | 950 | placeholder='<div id="[id]" class="[class]">'><?php if (isset($tc['geodir_wrapper_open_replace'])) { |
951 | - echo $tc['geodir_wrapper_open_replace']; |
|
952 | - }?></textarea> |
|
951 | + echo $tc['geodir_wrapper_open_replace']; |
|
952 | + }?></textarea> |
|
953 | 953 | </td> |
954 | 954 | </tr> |
955 | 955 | |
@@ -969,8 +969,8 @@ discard block |
||
969 | 969 | <span><?php _e('Output:', 'geodirectory');?></span> |
970 | 970 | <textarea name="geodir_wrapper_close_replace" |
971 | 971 | placeholder='</div><!-- wrapper ends here-->'><?php if (isset($tc['geodir_wrapper_close_replace'])) { |
972 | - echo $tc['geodir_wrapper_close_replace']; |
|
973 | - }?></textarea> |
|
972 | + echo $tc['geodir_wrapper_close_replace']; |
|
973 | + }?></textarea> |
|
974 | 974 | </td> |
975 | 975 | </tr> |
976 | 976 | |
@@ -980,12 +980,12 @@ discard block |
||
980 | 980 | <small>geodir_wrapper_content_open</small> |
981 | 981 | </td> |
982 | 982 | <td><input value="<?php if (isset($tc['geodir_wrapper_content_open_id'])) { |
983 | - echo $tc['geodir_wrapper_content_open_id']; |
|
984 | - }?>" type="text" name="geodir_wrapper_content_open_id" placeholder="geodir-wrapper-content"/> |
|
983 | + echo $tc['geodir_wrapper_content_open_id']; |
|
984 | + }?>" type="text" name="geodir_wrapper_content_open_id" placeholder="geodir-wrapper-content"/> |
|
985 | 985 | </td> |
986 | 986 | <td><input value="<?php if (isset($tc['geodir_wrapper_content_open_class'])) { |
987 | - echo $tc['geodir_wrapper_content_open_class']; |
|
988 | - }?>" type="text" name="geodir_wrapper_content_open_class" placeholder=""/></td> |
|
987 | + echo $tc['geodir_wrapper_content_open_class']; |
|
988 | + }?>" type="text" name="geodir_wrapper_content_open_class" placeholder=""/></td> |
|
989 | 989 | </tr> |
990 | 990 | |
991 | 991 | <tr class="gd-theme-comp-out"> |
@@ -993,8 +993,8 @@ discard block |
||
993 | 993 | <span><?php _e('Output:', 'geodirectory');?></span> |
994 | 994 | <textarea name="geodir_wrapper_content_open_replace" |
995 | 995 | placeholder='<div id="[id]" class="[class]" role="main" [width_css]>'><?php if (isset($tc['geodir_wrapper_content_open_replace'])) { |
996 | - echo $tc['geodir_wrapper_content_open_replace']; |
|
997 | - }?></textarea> |
|
996 | + echo $tc['geodir_wrapper_content_open_replace']; |
|
997 | + }?></textarea> |
|
998 | 998 | </td> |
999 | 999 | </tr> |
1000 | 1000 | |
@@ -1014,8 +1014,8 @@ discard block |
||
1014 | 1014 | <span><?php _e('Output:', 'geodirectory');?></span> |
1015 | 1015 | <textarea name="geodir_wrapper_content_close_replace" |
1016 | 1016 | placeholder='</div><!-- content ends here-->'><?php if (isset($tc['geodir_wrapper_content_close_replace'])) { |
1017 | - echo $tc['geodir_wrapper_content_close_replace']; |
|
1018 | - }?></textarea> |
|
1017 | + echo $tc['geodir_wrapper_content_close_replace']; |
|
1018 | + }?></textarea> |
|
1019 | 1019 | </td> |
1020 | 1020 | </tr> |
1021 | 1021 | |
@@ -1024,11 +1024,11 @@ discard block |
||
1024 | 1024 | <small>geodir_article_open</small> |
1025 | 1025 | </td> |
1026 | 1026 | <td><input value="<?php if (isset($tc['geodir_article_open_id'])) { |
1027 | - echo $tc['geodir_article_open_id']; |
|
1028 | - }?>" type="text" name="geodir_article_open_id" placeholder="geodir-wrapper-content"/></td> |
|
1027 | + echo $tc['geodir_article_open_id']; |
|
1028 | + }?>" type="text" name="geodir_article_open_id" placeholder="geodir-wrapper-content"/></td> |
|
1029 | 1029 | <td><input value="<?php if (isset($tc['geodir_article_open_class'])) { |
1030 | - echo $tc['geodir_article_open_class']; |
|
1031 | - }?>" type="text" name="geodir_article_open_class" placeholder=""/></td> |
|
1030 | + echo $tc['geodir_article_open_class']; |
|
1031 | + }?>" type="text" name="geodir_article_open_class" placeholder=""/></td> |
|
1032 | 1032 | </tr> |
1033 | 1033 | |
1034 | 1034 | <tr class="gd-theme-comp-out"> |
@@ -1036,8 +1036,8 @@ discard block |
||
1036 | 1036 | <span><?php _e('Output:', 'geodirectory');?></span> |
1037 | 1037 | <textarea name="geodir_article_open_replace" |
1038 | 1038 | placeholder='<article id="[id]" class="[class]" itemscope itemtype="[itemtype]">'><?php if (isset($tc['geodir_article_open_replace'])) { |
1039 | - echo $tc['geodir_article_open_replace']; |
|
1040 | - }?></textarea> |
|
1039 | + echo $tc['geodir_article_open_replace']; |
|
1040 | + }?></textarea> |
|
1041 | 1041 | </td> |
1042 | 1042 | </tr> |
1043 | 1043 | |
@@ -1056,8 +1056,8 @@ discard block |
||
1056 | 1056 | <span><?php _e('Output:', 'geodirectory');?></span> |
1057 | 1057 | <textarea name="geodir_article_close_replace" |
1058 | 1058 | placeholder='</article><!-- article ends here-->'><?php if (isset($tc['geodir_article_close_replace'])) { |
1059 | - echo $tc['geodir_article_close_replace']; |
|
1060 | - }?></textarea> |
|
1059 | + echo $tc['geodir_article_close_replace']; |
|
1060 | + }?></textarea> |
|
1061 | 1061 | </td> |
1062 | 1062 | </tr> |
1063 | 1063 | |
@@ -1066,11 +1066,11 @@ discard block |
||
1066 | 1066 | <small>geodir_sidebar_right_open</small> |
1067 | 1067 | </td> |
1068 | 1068 | <td><input value="<?php if (isset($tc['geodir_sidebar_right_open_id'])) { |
1069 | - echo $tc['geodir_sidebar_right_open_id']; |
|
1070 | - }?>" type="text" name="geodir_sidebar_right_open_id" placeholder="geodir-sidebar-right"/></td> |
|
1069 | + echo $tc['geodir_sidebar_right_open_id']; |
|
1070 | + }?>" type="text" name="geodir_sidebar_right_open_id" placeholder="geodir-sidebar-right"/></td> |
|
1071 | 1071 | <td><input value="<?php if (isset($tc['geodir_sidebar_right_open_class'])) { |
1072 | - echo $tc['geodir_sidebar_right_open_class']; |
|
1073 | - }?>" type="text" name="geodir_sidebar_right_open_class" |
|
1072 | + echo $tc['geodir_sidebar_right_open_class']; |
|
1073 | + }?>" type="text" name="geodir_sidebar_right_open_class" |
|
1074 | 1074 | placeholder="geodir-sidebar-right geodir-listings-sidebar-right"/></td> |
1075 | 1075 | </tr> |
1076 | 1076 | |
@@ -1079,8 +1079,8 @@ discard block |
||
1079 | 1079 | <span><?php _e('Output:', 'geodirectory');?></span> |
1080 | 1080 | <textarea name="geodir_sidebar_right_open_replace" |
1081 | 1081 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_right_open_replace'])) { |
1082 | - echo $tc['geodir_sidebar_right_open_replace']; |
|
1083 | - }?></textarea> |
|
1082 | + echo $tc['geodir_sidebar_right_open_replace']; |
|
1083 | + }?></textarea> |
|
1084 | 1084 | </td> |
1085 | 1085 | </tr> |
1086 | 1086 | |
@@ -1099,8 +1099,8 @@ discard block |
||
1099 | 1099 | <span><?php _e('Output:', 'geodirectory');?></span> |
1100 | 1100 | <textarea name="geodir_sidebar_right_close_replace" |
1101 | 1101 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_right_close_replace'])) { |
1102 | - echo $tc['geodir_sidebar_right_close_replace']; |
|
1103 | - }?></textarea> |
|
1102 | + echo $tc['geodir_sidebar_right_close_replace']; |
|
1103 | + }?></textarea> |
|
1104 | 1104 | </td> |
1105 | 1105 | </tr> |
1106 | 1106 | |
@@ -1110,11 +1110,11 @@ discard block |
||
1110 | 1110 | <small>geodir_sidebar_left_open</small> |
1111 | 1111 | </td> |
1112 | 1112 | <td><input value="<?php if (isset($tc['geodir_sidebar_left_open_id'])) { |
1113 | - echo $tc['geodir_sidebar_left_open_id']; |
|
1114 | - }?>" type="text" name="geodir_sidebar_left_open_id" placeholder="geodir-sidebar-left"/></td> |
|
1113 | + echo $tc['geodir_sidebar_left_open_id']; |
|
1114 | + }?>" type="text" name="geodir_sidebar_left_open_id" placeholder="geodir-sidebar-left"/></td> |
|
1115 | 1115 | <td><input value="<?php if (isset($tc['geodir_sidebar_left_open_class'])) { |
1116 | - echo $tc['geodir_sidebar_left_open_class']; |
|
1117 | - }?>" type="text" name="geodir_sidebar_left_open_class" |
|
1116 | + echo $tc['geodir_sidebar_left_open_class']; |
|
1117 | + }?>" type="text" name="geodir_sidebar_left_open_class" |
|
1118 | 1118 | placeholder="geodir-sidebar-left geodir-listings-sidebar-left"/></td> |
1119 | 1119 | </tr> |
1120 | 1120 | |
@@ -1123,8 +1123,8 @@ discard block |
||
1123 | 1123 | <span><?php _e('Output:', 'geodirectory');?></span> |
1124 | 1124 | <textarea name="geodir_sidebar_left_open_replace" |
1125 | 1125 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_left_open_replace'])) { |
1126 | - echo $tc['geodir_sidebar_left_open_replace']; |
|
1127 | - }?></textarea> |
|
1126 | + echo $tc['geodir_sidebar_left_open_replace']; |
|
1127 | + }?></textarea> |
|
1128 | 1128 | </td> |
1129 | 1129 | </tr> |
1130 | 1130 | |
@@ -1143,8 +1143,8 @@ discard block |
||
1143 | 1143 | <span><?php _e('Output:', 'geodirectory');?></span> |
1144 | 1144 | <textarea name="geodir_sidebar_left_close_replace" |
1145 | 1145 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_left_close_replace'])) { |
1146 | - echo $tc['geodir_sidebar_left_close_replace']; |
|
1147 | - }?></textarea> |
|
1146 | + echo $tc['geodir_sidebar_left_close_replace']; |
|
1147 | + }?></textarea> |
|
1148 | 1148 | </td> |
1149 | 1149 | </tr> |
1150 | 1150 | |
@@ -1153,11 +1153,11 @@ discard block |
||
1153 | 1153 | <small>geodir_main_content_open</small> |
1154 | 1154 | </td> |
1155 | 1155 | <td><input value="<?php if (isset($tc['geodir_main_content_open_id'])) { |
1156 | - echo $tc['geodir_main_content_open_id']; |
|
1157 | - }?>" type="text" name="geodir_main_content_open_id" placeholder="geodir-main-content"/></td> |
|
1156 | + echo $tc['geodir_main_content_open_id']; |
|
1157 | + }?>" type="text" name="geodir_main_content_open_id" placeholder="geodir-main-content"/></td> |
|
1158 | 1158 | <td><input value="<?php if (isset($tc['geodir_main_content_open_class'])) { |
1159 | - echo $tc['geodir_main_content_open_class']; |
|
1160 | - }?>" type="text" name="geodir_main_content_open_class" placeholder="CURRENT-PAGE-page"/></td> |
|
1159 | + echo $tc['geodir_main_content_open_class']; |
|
1160 | + }?>" type="text" name="geodir_main_content_open_class" placeholder="CURRENT-PAGE-page"/></td> |
|
1161 | 1161 | </tr> |
1162 | 1162 | |
1163 | 1163 | <tr class="gd-theme-comp-out"> |
@@ -1165,8 +1165,8 @@ discard block |
||
1165 | 1165 | <span><?php _e('Output:', 'geodirectory');?></span> |
1166 | 1166 | <textarea name="geodir_main_content_open_replace" |
1167 | 1167 | placeholder='<main id="[id]" class="[class]" role="main">'><?php if (isset($tc['geodir_main_content_open_replace'])) { |
1168 | - echo $tc['geodir_main_content_open_replace']; |
|
1169 | - }?></textarea> |
|
1168 | + echo $tc['geodir_main_content_open_replace']; |
|
1169 | + }?></textarea> |
|
1170 | 1170 | </td> |
1171 | 1171 | </tr> |
1172 | 1172 | |
@@ -1185,8 +1185,8 @@ discard block |
||
1185 | 1185 | <span><?php _e('Output:', 'geodirectory');?></span> |
1186 | 1186 | <textarea name="geodir_main_content_close_replace" |
1187 | 1187 | placeholder='</main><!-- main ends here-->'><?php if (isset($tc['geodir_main_content_close_replace'])) { |
1188 | - echo $tc['geodir_main_content_close_replace']; |
|
1189 | - }?></textarea> |
|
1188 | + echo $tc['geodir_main_content_close_replace']; |
|
1189 | + }?></textarea> |
|
1190 | 1190 | </td> |
1191 | 1191 | </tr> |
1192 | 1192 | |
@@ -1210,8 +1210,8 @@ discard block |
||
1210 | 1210 | </td> |
1211 | 1211 | <td><textarea name="geodir_top_content_add" |
1212 | 1212 | placeholder=''><?php if (isset($tc['geodir_top_content_add'])) { |
1213 | - echo $tc['geodir_top_content_add']; |
|
1214 | - }?></textarea></td> |
|
1213 | + echo $tc['geodir_top_content_add']; |
|
1214 | + }?></textarea></td> |
|
1215 | 1215 | </tr> |
1216 | 1216 | |
1217 | 1217 | <tr> |
@@ -1220,8 +1220,8 @@ discard block |
||
1220 | 1220 | </td> |
1221 | 1221 | <td><textarea name="geodir_before_main_content_add" |
1222 | 1222 | placeholder=''><?php if (isset($tc['geodir_before_main_content_add'])) { |
1223 | - echo $tc['geodir_before_main_content_add']; |
|
1224 | - }?></textarea></td> |
|
1223 | + echo $tc['geodir_before_main_content_add']; |
|
1224 | + }?></textarea></td> |
|
1225 | 1225 | </tr> |
1226 | 1226 | |
1227 | 1227 | |
@@ -1244,8 +1244,8 @@ discard block |
||
1244 | 1244 | </td> |
1245 | 1245 | <td><textarea name="geodir_full_page_class_filter" |
1246 | 1246 | placeholder='geodir_full_page clearfix'><?php if (isset($tc['geodir_full_page_class_filter'])) { |
1247 | - echo $tc['geodir_full_page_class_filter']; |
|
1248 | - }?></textarea></td> |
|
1247 | + echo $tc['geodir_full_page_class_filter']; |
|
1248 | + }?></textarea></td> |
|
1249 | 1249 | </tr> |
1250 | 1250 | |
1251 | 1251 | <tr> |
@@ -1254,8 +1254,8 @@ discard block |
||
1254 | 1254 | </td> |
1255 | 1255 | <td><textarea name="geodir_before_widget_filter" |
1256 | 1256 | placeholder='<section id="%1$s" class="widget geodir-widget %2$s">'><?php if (isset($tc['geodir_before_widget_filter'])) { |
1257 | - echo $tc['geodir_before_widget_filter']; |
|
1258 | - }?></textarea></td> |
|
1257 | + echo $tc['geodir_before_widget_filter']; |
|
1258 | + }?></textarea></td> |
|
1259 | 1259 | </tr> |
1260 | 1260 | |
1261 | 1261 | <tr> |
@@ -1264,8 +1264,8 @@ discard block |
||
1264 | 1264 | </td> |
1265 | 1265 | <td><textarea name="geodir_after_widget_filter" |
1266 | 1266 | placeholder='</section>'><?php if (isset($tc['geodir_after_widget_filter'])) { |
1267 | - echo $tc['geodir_after_widget_filter']; |
|
1268 | - }?></textarea></td> |
|
1267 | + echo $tc['geodir_after_widget_filter']; |
|
1268 | + }?></textarea></td> |
|
1269 | 1269 | </tr> |
1270 | 1270 | |
1271 | 1271 | <tr> |
@@ -1274,8 +1274,8 @@ discard block |
||
1274 | 1274 | </td> |
1275 | 1275 | <td><textarea name="geodir_before_title_filter" |
1276 | 1276 | placeholder='<h3 class="widget-title">'><?php if (isset($tc['geodir_before_title_filter'])) { |
1277 | - echo $tc['geodir_before_title_filter']; |
|
1278 | - }?></textarea></td> |
|
1277 | + echo $tc['geodir_before_title_filter']; |
|
1278 | + }?></textarea></td> |
|
1279 | 1279 | </tr> |
1280 | 1280 | |
1281 | 1281 | <tr> |
@@ -1284,8 +1284,8 @@ discard block |
||
1284 | 1284 | </td> |
1285 | 1285 | <td><textarea name="geodir_after_title_filter" |
1286 | 1286 | placeholder='</h3>'><?php if (isset($tc['geodir_after_title_filter'])) { |
1287 | - echo $tc['geodir_after_title_filter']; |
|
1288 | - }?></textarea></td> |
|
1287 | + echo $tc['geodir_after_title_filter']; |
|
1288 | + }?></textarea></td> |
|
1289 | 1289 | </tr> |
1290 | 1290 | |
1291 | 1291 | <tr> |
@@ -1294,8 +1294,8 @@ discard block |
||
1294 | 1294 | </td> |
1295 | 1295 | <td><textarea name="geodir_menu_li_class_filter" |
1296 | 1296 | placeholder='menu-item'><?php if (isset($tc['geodir_menu_li_class_filter'])) { |
1297 | - echo $tc['geodir_menu_li_class_filter']; |
|
1298 | - }?></textarea></td> |
|
1297 | + echo $tc['geodir_menu_li_class_filter']; |
|
1298 | + }?></textarea></td> |
|
1299 | 1299 | </tr> |
1300 | 1300 | |
1301 | 1301 | <tr> |
@@ -1304,8 +1304,8 @@ discard block |
||
1304 | 1304 | </td> |
1305 | 1305 | <td><textarea name="geodir_sub_menu_ul_class_filter" |
1306 | 1306 | placeholder='sub-menu'><?php if (isset($tc['geodir_sub_menu_ul_class_filter'])) { |
1307 | - echo $tc['geodir_sub_menu_ul_class_filter']; |
|
1308 | - }?></textarea></td> |
|
1307 | + echo $tc['geodir_sub_menu_ul_class_filter']; |
|
1308 | + }?></textarea></td> |
|
1309 | 1309 | </tr> |
1310 | 1310 | |
1311 | 1311 | <tr> |
@@ -1314,8 +1314,8 @@ discard block |
||
1314 | 1314 | </td> |
1315 | 1315 | <td><textarea name="geodir_sub_menu_li_class_filter" |
1316 | 1316 | placeholder='menu-item'><?php if (isset($tc['geodir_sub_menu_li_class_filter'])) { |
1317 | - echo $tc['geodir_sub_menu_li_class_filter']; |
|
1318 | - }?></textarea></td> |
|
1317 | + echo $tc['geodir_sub_menu_li_class_filter']; |
|
1318 | + }?></textarea></td> |
|
1319 | 1319 | </tr> |
1320 | 1320 | |
1321 | 1321 | <tr> |
@@ -1324,8 +1324,8 @@ discard block |
||
1324 | 1324 | </td> |
1325 | 1325 | <td><textarea name="geodir_menu_a_class_filter" |
1326 | 1326 | placeholder=''><?php if (isset($tc['geodir_menu_a_class_filter'])) { |
1327 | - echo $tc['geodir_menu_a_class_filter']; |
|
1328 | - }?></textarea></td> |
|
1327 | + echo $tc['geodir_menu_a_class_filter']; |
|
1328 | + }?></textarea></td> |
|
1329 | 1329 | </tr> |
1330 | 1330 | |
1331 | 1331 | <tr> |
@@ -1334,8 +1334,8 @@ discard block |
||
1334 | 1334 | </td> |
1335 | 1335 | <td><textarea name="geodir_sub_menu_a_class_filter" |
1336 | 1336 | placeholder=''><?php if (isset($tc['geodir_sub_menu_a_class_filter'])) { |
1337 | - echo $tc['geodir_sub_menu_a_class_filter']; |
|
1338 | - }?></textarea></td> |
|
1337 | + echo $tc['geodir_sub_menu_a_class_filter']; |
|
1338 | + }?></textarea></td> |
|
1339 | 1339 | </tr> |
1340 | 1340 | |
1341 | 1341 | |
@@ -1345,8 +1345,8 @@ discard block |
||
1345 | 1345 | </td> |
1346 | 1346 | <td><textarea name="geodir_location_switcher_menu_li_class_filter" |
1347 | 1347 | placeholder='menu-item menu-item-type-social menu-item-type-social gd-location-switcher'><?php if (isset($tc['geodir_location_switcher_menu_li_class_filter'])) { |
1348 | - echo $tc['geodir_location_switcher_menu_li_class_filter']; |
|
1349 | - }?></textarea></td> |
|
1348 | + echo $tc['geodir_location_switcher_menu_li_class_filter']; |
|
1349 | + }?></textarea></td> |
|
1350 | 1350 | </tr> |
1351 | 1351 | |
1352 | 1352 | <tr> |
@@ -1355,8 +1355,8 @@ discard block |
||
1355 | 1355 | </td> |
1356 | 1356 | <td><textarea name="geodir_location_switcher_menu_a_class_filter" |
1357 | 1357 | placeholder=''><?php if (isset($tc['geodir_location_switcher_menu_a_class_filter'])) { |
1358 | - echo $tc['geodir_location_switcher_menu_a_class_filter']; |
|
1359 | - }?></textarea></td> |
|
1358 | + echo $tc['geodir_location_switcher_menu_a_class_filter']; |
|
1359 | + }?></textarea></td> |
|
1360 | 1360 | </tr> |
1361 | 1361 | |
1362 | 1362 | <tr> |
@@ -1365,8 +1365,8 @@ discard block |
||
1365 | 1365 | </td> |
1366 | 1366 | <td><textarea name="geodir_location_switcher_menu_sub_ul_class_filter" |
1367 | 1367 | placeholder='sub-menu'><?php if (isset($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) { |
1368 | - echo $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
1369 | - }?></textarea></td> |
|
1368 | + echo $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
1369 | + }?></textarea></td> |
|
1370 | 1370 | </tr> |
1371 | 1371 | |
1372 | 1372 | <tr> |
@@ -1375,21 +1375,21 @@ discard block |
||
1375 | 1375 | </td> |
1376 | 1376 | <td><textarea name="geodir_location_switcher_menu_sub_li_class_filter" |
1377 | 1377 | placeholder='menu-item gd-location-switcher-menu-item'><?php if (isset($tc['geodir_location_switcher_menu_sub_li_class_filter'])) { |
1378 | - echo $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
1379 | - }?></textarea></td> |
|
1378 | + echo $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
1379 | + }?></textarea></td> |
|
1380 | 1380 | </tr> |
1381 | 1381 | |
1382 | 1382 | |
1383 | 1383 | |
1384 | 1384 | <?php |
1385 | - /** |
|
1386 | - * Allows more filter setting to be added to theme compatibility settings page. |
|
1387 | - * |
|
1388 | - * Called after the last setting in "Other filters" section of theme compatibility settings. |
|
1389 | - * |
|
1390 | - * @since 1.4.0 |
|
1391 | - */ |
|
1392 | - do_action('gd_compat_other_filters');?> |
|
1385 | + /** |
|
1386 | + * Allows more filter setting to be added to theme compatibility settings page. |
|
1387 | + * |
|
1388 | + * Called after the last setting in "Other filters" section of theme compatibility settings. |
|
1389 | + * |
|
1390 | + * @since 1.4.0 |
|
1391 | + */ |
|
1392 | + do_action('gd_compat_other_filters');?> |
|
1393 | 1393 | |
1394 | 1394 | </tbody> |
1395 | 1395 | </table> |
@@ -1402,8 +1402,8 @@ discard block |
||
1402 | 1402 | <tr> |
1403 | 1403 | <td><textarea name="geodir_theme_compat_css" |
1404 | 1404 | placeholder=''><?php if (isset($tc['geodir_theme_compat_css'])) { |
1405 | - echo $tc['geodir_theme_compat_css']; |
|
1406 | - }?></textarea></td> |
|
1405 | + echo $tc['geodir_theme_compat_css']; |
|
1406 | + }?></textarea></td> |
|
1407 | 1407 | </tr> |
1408 | 1408 | |
1409 | 1409 | |
@@ -1417,8 +1417,8 @@ discard block |
||
1417 | 1417 | <tr> |
1418 | 1418 | <td><textarea name="geodir_theme_compat_js" |
1419 | 1419 | placeholder=''><?php if (isset($tc['geodir_theme_compat_js'])) { |
1420 | - echo $tc['geodir_theme_compat_js']; |
|
1421 | - }?></textarea></td> |
|
1420 | + echo $tc['geodir_theme_compat_js']; |
|
1421 | + }?></textarea></td> |
|
1422 | 1422 | </tr> |
1423 | 1423 | |
1424 | 1424 | |
@@ -1445,23 +1445,23 @@ discard block |
||
1445 | 1445 | */ |
1446 | 1446 | function geodir_custom_post_type_form() |
1447 | 1447 | { |
1448 | - $listing_type = ($_REQUEST['listing_type'] != '') ? $_REQUEST['listing_type'] : 'gd_place'; |
|
1448 | + $listing_type = ($_REQUEST['listing_type'] != '') ? $_REQUEST['listing_type'] : 'gd_place'; |
|
1449 | 1449 | |
1450 | - $sub_tab = ($_REQUEST['subtab'] != '') ? $_REQUEST['subtab'] : ''; |
|
1450 | + $sub_tab = ($_REQUEST['subtab'] != '') ? $_REQUEST['subtab'] : ''; |
|
1451 | 1451 | |
1452 | 1452 | |
1453 | - ?> |
|
1453 | + ?> |
|
1454 | 1454 | |
1455 | 1455 | <div class="gd-content-heading"> |
1456 | 1456 | <?php |
1457 | - /** |
|
1458 | - * Filter custom fields panel heading. |
|
1459 | - * |
|
1460 | - * @since 1.0.0 |
|
1461 | - * @param string $sub_tab Sub tab name. |
|
1462 | - * @param string $listing_type Post type. |
|
1463 | - */ |
|
1464 | - ?> |
|
1457 | + /** |
|
1458 | + * Filter custom fields panel heading. |
|
1459 | + * |
|
1460 | + * @since 1.0.0 |
|
1461 | + * @param string $sub_tab Sub tab name. |
|
1462 | + * @param string $listing_type Post type. |
|
1463 | + */ |
|
1464 | + ?> |
|
1465 | 1465 | <h3><?php echo apply_filters('geodir_custom_fields_panel_head', '', $sub_tab, $listing_type);?></h3> |
1466 | 1466 | </div> |
1467 | 1467 | <div id="container_general" class="clearfix"> |
@@ -1469,25 +1469,25 @@ discard block |
||
1469 | 1469 | |
1470 | 1470 | <div class="side-sortables" id="geodir-available-fields"> |
1471 | 1471 | <?php |
1472 | - /** |
|
1473 | - * Filter custom field available fields heading. |
|
1474 | - * |
|
1475 | - * @since 1.0.0 |
|
1476 | - * @param string $sub_tab Sub tab name. |
|
1477 | - * @param string $listing_type Post type. |
|
1478 | - */ |
|
1479 | - ?> |
|
1472 | + /** |
|
1473 | + * Filter custom field available fields heading. |
|
1474 | + * |
|
1475 | + * @since 1.0.0 |
|
1476 | + * @param string $sub_tab Sub tab name. |
|
1477 | + * @param string $listing_type Post type. |
|
1478 | + */ |
|
1479 | + ?> |
|
1480 | 1480 | <h3 class="hndle"><span><?php echo apply_filters('geodir_cf_panel_available_fields_head', '', $sub_tab, $listing_type);?> |
1481 | 1481 | </span></h3> |
1482 | 1482 | <?php |
1483 | - /** |
|
1484 | - * Filter custom field available fields note text. |
|
1485 | - * |
|
1486 | - * @since 1.0.0 |
|
1487 | - * @param string $sub_tab Sub tab name. |
|
1488 | - * @param string $listing_type Post type. |
|
1489 | - */ |
|
1490 | - ?> |
|
1483 | + /** |
|
1484 | + * Filter custom field available fields note text. |
|
1485 | + * |
|
1486 | + * @since 1.0.0 |
|
1487 | + * @param string $sub_tab Sub tab name. |
|
1488 | + * @param string $listing_type Post type. |
|
1489 | + */ |
|
1490 | + ?> |
|
1491 | 1491 | <p><?php echo apply_filters('geodir_cf_panel_available_fields_note', '', $sub_tab, $listing_type);?></p> |
1492 | 1492 | |
1493 | 1493 | <div class="inside"> |
@@ -1495,13 +1495,13 @@ discard block |
||
1495 | 1495 | <div id="gt-form-builder-tab" class="gt-tabs-panel"> |
1496 | 1496 | |
1497 | 1497 | <?php |
1498 | - /** |
|
1499 | - * Adds the available fields to the custom fields settings page per post type. |
|
1500 | - * |
|
1501 | - * @since 1.0.0 |
|
1502 | - * @param string $sub_tab The current settings tab name. |
|
1503 | - */ |
|
1504 | - do_action('geodir_manage_available_fields', $sub_tab); ?> |
|
1498 | + /** |
|
1499 | + * Adds the available fields to the custom fields settings page per post type. |
|
1500 | + * |
|
1501 | + * @since 1.0.0 |
|
1502 | + * @param string $sub_tab The current settings tab name. |
|
1503 | + */ |
|
1504 | + do_action('geodir_manage_available_fields', $sub_tab); ?> |
|
1505 | 1505 | |
1506 | 1506 | <div style="clear:both"></div> |
1507 | 1507 | </div> |
@@ -1514,25 +1514,25 @@ discard block |
||
1514 | 1514 | <div class="side-sortables" id="geodir-selected-fields"> |
1515 | 1515 | <h3 class="hndle"> |
1516 | 1516 | <?php |
1517 | - /** |
|
1518 | - * Filter custom field selected fields heading. |
|
1519 | - * |
|
1520 | - * @since 1.0.0 |
|
1521 | - * @param string $sub_tab Sub tab name. |
|
1522 | - * @param string $listing_type Post type. |
|
1523 | - */ |
|
1524 | - ?> |
|
1517 | + /** |
|
1518 | + * Filter custom field selected fields heading. |
|
1519 | + * |
|
1520 | + * @since 1.0.0 |
|
1521 | + * @param string $sub_tab Sub tab name. |
|
1522 | + * @param string $listing_type Post type. |
|
1523 | + */ |
|
1524 | + ?> |
|
1525 | 1525 | <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type);?></span> |
1526 | 1526 | </h3> |
1527 | 1527 | <?php |
1528 | - /** |
|
1529 | - * Filter custom field selected fields note text. |
|
1530 | - * |
|
1531 | - * @since 1.0.0 |
|
1532 | - * @param string $sub_tab Sub tab name. |
|
1533 | - * @param string $listing_type Post type. |
|
1534 | - */ |
|
1535 | - ?> |
|
1528 | + /** |
|
1529 | + * Filter custom field selected fields note text. |
|
1530 | + * |
|
1531 | + * @since 1.0.0 |
|
1532 | + * @param string $sub_tab Sub tab name. |
|
1533 | + * @param string $listing_type Post type. |
|
1534 | + */ |
|
1535 | + ?> |
|
1536 | 1536 | <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type);?></p> |
1537 | 1537 | |
1538 | 1538 | <div class="inside"> |
@@ -1540,13 +1540,13 @@ discard block |
||
1540 | 1540 | <div id="gt-form-builder-tab" class="gt-tabs-panel"> |
1541 | 1541 | <div class="field_row_main"> |
1542 | 1542 | <?php |
1543 | - /** |
|
1544 | - * Adds the selected fields and setting to the custom fields settings page per post type. |
|
1545 | - * |
|
1546 | - * @since 1.0.0 |
|
1547 | - * @param string $sub_tab The current settings tab name. |
|
1548 | - */ |
|
1549 | - do_action('geodir_manage_selected_fields', $sub_tab); ?> |
|
1543 | + /** |
|
1544 | + * Adds the selected fields and setting to the custom fields settings page per post type. |
|
1545 | + * |
|
1546 | + * @since 1.0.0 |
|
1547 | + * @param string $sub_tab The current settings tab name. |
|
1548 | + */ |
|
1549 | + do_action('geodir_manage_selected_fields', $sub_tab); ?> |
|
1550 | 1550 | </div> |
1551 | 1551 | <div style="clear:both"></div> |
1552 | 1552 | </div> |
@@ -1569,7 +1569,7 @@ discard block |
||
1569 | 1569 | */ |
1570 | 1570 | function geodir_diagnostic_tools_setting_page() |
1571 | 1571 | { |
1572 | - ?> |
|
1572 | + ?> |
|
1573 | 1573 | <div class="inner_content_tab_main"> |
1574 | 1574 | <div class="gd-content-heading"> |
1575 | 1575 | |
@@ -1671,13 +1671,13 @@ discard block |
||
1671 | 1671 | </td> |
1672 | 1672 | </tr> |
1673 | 1673 | <?php |
1674 | - /** |
|
1675 | - * Allows you to add more setting to the GD>Tools settings page. |
|
1676 | - * |
|
1677 | - * Called after the last setting on the GD>Tools page. |
|
1678 | - * @since 1.0.0 |
|
1679 | - */ |
|
1680 | - do_action('geodir_diagnostic_tool');?> |
|
1674 | + /** |
|
1675 | + * Allows you to add more setting to the GD>Tools settings page. |
|
1676 | + * |
|
1677 | + * Called after the last setting on the GD>Tools page. |
|
1678 | + * @since 1.0.0 |
|
1679 | + */ |
|
1680 | + do_action('geodir_diagnostic_tool');?> |
|
1681 | 1681 | |
1682 | 1682 | </tbody> |
1683 | 1683 | </table> |
@@ -35,23 +35,26 @@ discard block |
||
35 | 35 | |
36 | 36 | /* ---- Delete field ---- */ |
37 | 37 | if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') { |
38 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) |
|
39 | - return; |
|
38 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) { |
|
39 | + return; |
|
40 | + } |
|
40 | 41 | |
41 | 42 | echo geodir_custom_field_delete($field_id); |
42 | 43 | } |
43 | 44 | |
44 | 45 | if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') { |
45 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) |
|
46 | - return; |
|
46 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) { |
|
47 | + return; |
|
48 | + } |
|
47 | 49 | |
48 | 50 | echo geodir_custom_sort_field_delete($field_id); |
49 | 51 | } |
50 | 52 | |
51 | 53 | /* ---- Save field ---- */ |
52 | 54 | if ($field_id != '' && $field_action == 'submit' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') { |
53 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) |
|
54 | - return; |
|
55 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) { |
|
56 | + return; |
|
57 | + } |
|
55 | 58 | |
56 | 59 | foreach ($_REQUEST as $pkey => $pval) { |
57 | 60 | if (is_array($_REQUEST[$pkey])) { |
@@ -77,8 +80,9 @@ discard block |
||
77 | 80 | |
78 | 81 | /* ---- Save sort field ---- */ |
79 | 82 | if ($field_id != '' && $field_action == 'submit' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') { |
80 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) |
|
81 | - return; |
|
83 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) { |
|
84 | + return; |
|
85 | + } |
|
82 | 86 | |
83 | 87 | foreach ($_REQUEST as $pkey => $pval) { |
84 | 88 | if (is_array($_REQUEST[$pkey])) { |
@@ -15,100 +15,100 @@ |
||
15 | 15 | |
16 | 16 | $field_ids = array(); |
17 | 17 | if (!empty($_REQUEST['licontainer']) && is_array($_REQUEST['licontainer'])) { |
18 | - foreach ($_REQUEST['licontainer'] as $lic_id) { |
|
19 | - $field_ids[] = sanitize_text_field($lic_id); |
|
20 | - } |
|
18 | + foreach ($_REQUEST['licontainer'] as $lic_id) { |
|
19 | + $field_ids[] = sanitize_text_field($lic_id); |
|
20 | + } |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | /* ------- check nonce field ------- */ |
24 | 24 | if (isset($_REQUEST['update']) && $_REQUEST['update'] == "update" && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') { |
25 | - echo godir_set_field_order($field_ids); |
|
25 | + echo godir_set_field_order($field_ids); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | if (isset($_REQUEST['update']) && $_REQUEST['update'] == "update" && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') { |
29 | - $response = godir_set_sort_field_order($field_ids); |
|
30 | - if (is_array($response)) { |
|
31 | - wp_send_json($response); |
|
32 | - } else { |
|
33 | - echo $response; |
|
34 | - } |
|
29 | + $response = godir_set_sort_field_order($field_ids); |
|
30 | + if (is_array($response)) { |
|
31 | + wp_send_json($response); |
|
32 | + } else { |
|
33 | + echo $response; |
|
34 | + } |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /* ---- Show field form in admin ---- */ |
38 | 38 | if ($field_type != '' && $field_id != '' && $field_action == 'new' && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') { |
39 | - geodir_custom_field_adminhtml($field_type, $field_id, $field_action); |
|
39 | + geodir_custom_field_adminhtml($field_type, $field_id, $field_action); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | if ($field_type != '' && $field_id != '' && $field_action == 'new' && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') { |
43 | - geodir_custom_sort_field_adminhtml($field_type, $field_id, $field_action); |
|
43 | + geodir_custom_sort_field_adminhtml($field_type, $field_id, $field_action); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /* ---- Delete field ---- */ |
47 | 47 | if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') { |
48 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) |
|
49 | - return; |
|
48 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) |
|
49 | + return; |
|
50 | 50 | |
51 | - echo geodir_custom_field_delete($field_id); |
|
51 | + echo geodir_custom_field_delete($field_id); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') { |
55 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) |
|
56 | - return; |
|
55 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) |
|
56 | + return; |
|
57 | 57 | |
58 | - echo geodir_custom_sort_field_delete($field_id); |
|
58 | + echo geodir_custom_sort_field_delete($field_id); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /* ---- Save field ---- */ |
62 | 62 | if ($field_id != '' && $field_action == 'submit' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') { |
63 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) |
|
64 | - return; |
|
65 | - |
|
66 | - foreach ($_REQUEST as $pkey => $pval) { |
|
67 | - if (is_array($_REQUEST[$pkey])) { |
|
68 | - $tags = 'skip_field'; |
|
69 | - } else { |
|
70 | - $tags = ''; |
|
71 | - } |
|
72 | - |
|
73 | - if ($tags != 'skip_field') { |
|
74 | - $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags); |
|
75 | - } |
|
76 | - } |
|
77 | - |
|
78 | - $return = geodir_custom_field_save($_REQUEST); |
|
79 | - |
|
80 | - if (is_int($return)) { |
|
81 | - $lastid = $return; |
|
82 | - geodir_custom_field_adminhtml($field_type, $lastid, 'submit'); |
|
83 | - } else { |
|
84 | - echo $return; |
|
85 | - } |
|
63 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) |
|
64 | + return; |
|
65 | + |
|
66 | + foreach ($_REQUEST as $pkey => $pval) { |
|
67 | + if (is_array($_REQUEST[$pkey])) { |
|
68 | + $tags = 'skip_field'; |
|
69 | + } else { |
|
70 | + $tags = ''; |
|
71 | + } |
|
72 | + |
|
73 | + if ($tags != 'skip_field') { |
|
74 | + $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags); |
|
75 | + } |
|
76 | + } |
|
77 | + |
|
78 | + $return = geodir_custom_field_save($_REQUEST); |
|
79 | + |
|
80 | + if (is_int($return)) { |
|
81 | + $lastid = $return; |
|
82 | + geodir_custom_field_adminhtml($field_type, $lastid, 'submit'); |
|
83 | + } else { |
|
84 | + echo $return; |
|
85 | + } |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /* ---- Save sort field ---- */ |
89 | 89 | if ($field_id != '' && $field_action == 'submit' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') { |
90 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) |
|
91 | - return; |
|
92 | - |
|
93 | - foreach ($_REQUEST as $pkey => $pval) { |
|
94 | - if (is_array($_REQUEST[$pkey])) { |
|
95 | - $tags = 'skip_field'; |
|
96 | - } else { |
|
97 | - $tags = ''; |
|
98 | - } |
|
99 | - |
|
100 | - if ($tags != 'skip_field') { |
|
101 | - $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags); |
|
102 | - } |
|
103 | - } |
|
104 | - |
|
105 | - $return = geodir_custom_sort_field_save($_REQUEST); |
|
106 | - |
|
107 | - if (is_int($return)) { |
|
108 | - $lastid = $return; |
|
109 | - $default = false; |
|
110 | - geodir_custom_sort_field_adminhtml($field_type, $lastid, 'submit', $default); |
|
111 | - } else { |
|
112 | - echo $return; |
|
113 | - } |
|
90 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id)) |
|
91 | + return; |
|
92 | + |
|
93 | + foreach ($_REQUEST as $pkey => $pval) { |
|
94 | + if (is_array($_REQUEST[$pkey])) { |
|
95 | + $tags = 'skip_field'; |
|
96 | + } else { |
|
97 | + $tags = ''; |
|
98 | + } |
|
99 | + |
|
100 | + if ($tags != 'skip_field') { |
|
101 | + $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags); |
|
102 | + } |
|
103 | + } |
|
104 | + |
|
105 | + $return = geodir_custom_sort_field_save($_REQUEST); |
|
106 | + |
|
107 | + if (is_int($return)) { |
|
108 | + $lastid = $return; |
|
109 | + $default = false; |
|
110 | + geodir_custom_sort_field_adminhtml($field_type, $lastid, 'submit', $default); |
|
111 | + } else { |
|
112 | + echo $return; |
|
113 | + } |
|
114 | 114 | } |
115 | 115 | \ No newline at end of file |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $is_detail_page = false; |
39 | 39 | |
40 | - if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) { |
|
40 | + if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) { |
|
41 | 41 | $is_detail_page = true; |
42 | 42 | } |
43 | 43 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | 'siteurl' => get_option('siteurl'), |
52 | 52 | 'geodir_plugin_url' => geodir_plugin_url(), |
53 | 53 | 'geodir_ajax_url' => geodir_get_ajax_url(), |
54 | - 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'), |
|
54 | + 'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'), |
|
55 | 55 | 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
56 | 56 | ); |
57 | 57 | |
@@ -72,25 +72,25 @@ discard block |
||
72 | 72 | * |
73 | 73 | * } |
74 | 74 | */ |
75 | - $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data); |
|
75 | + $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data); |
|
76 | 76 | |
77 | 77 | wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data); |
78 | 78 | |
79 | 79 | |
80 | 80 | |
81 | 81 | |
82 | - wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true); |
|
83 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');} |
|
82 | + wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true); |
|
83 | + if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); } |
|
84 | 84 | |
85 | 85 | |
86 | 86 | |
87 | - wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true); |
|
87 | + wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true); |
|
88 | 88 | wp_enqueue_script('geodirectory-lightbox-jquery'); |
89 | 89 | |
90 | 90 | |
91 | 91 | |
92 | - wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true); |
|
93 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-simplemodal');} |
|
92 | + wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true); |
|
93 | + if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-simplemodal'); } |
|
94 | 94 | |
95 | 95 | |
96 | 96 | //if( get_option('geodir_enqueue_google_api_script')==1) |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | wp_enqueue_script( 'geodirectory-googlemap-script' ); |
112 | 112 | } |
113 | 113 | */ |
114 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true); |
|
114 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true); |
|
115 | 115 | wp_enqueue_script('geodirectory-goMap-script'); |
116 | 116 | |
117 | 117 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | wp_enqueue_script('plupload-all'); |
134 | 134 | wp_enqueue_script('jquery-ui-sortable'); |
135 | 135 | |
136 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true); |
|
136 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
137 | 137 | wp_enqueue_script('geodirectory-plupload-script'); |
138 | 138 | |
139 | 139 | // SCRIPT FOR UPLOAD END |
@@ -245,12 +245,12 @@ discard block |
||
245 | 245 | */ |
246 | 246 | function geodir_add_async_forscript($url) |
247 | 247 | { |
248 | - if (strpos($url, '#asyncload')===false) |
|
248 | + if (strpos($url, '#asyncload') === false) |
|
249 | 249 | return $url; |
250 | 250 | else if (is_admin()) |
251 | 251 | return str_replace('#asyncload', '', $url); |
252 | 252 | else |
253 | - return str_replace('#asyncload', '', $url)."' async='async"; |
|
253 | + return str_replace('#asyncload', '', $url) . "' async='async"; |
|
254 | 254 | } |
255 | 255 | add_filter('clean_url', 'geodir_add_async_forscript', 11, 1); |
256 | 256 | |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | { |
265 | 265 | |
266 | 266 | |
267 | - if(get_option('geodir_scss_core')) { |
|
267 | + if (get_option('geodir_scss_core')) { |
|
268 | 268 | |
269 | 269 | |
270 | 270 | wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION); |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
299 | 299 | wp_enqueue_style('geodir-chosen-style'); |
300 | 300 | |
301 | - }else{ |
|
301 | + } else { |
|
302 | 302 | wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION); |
303 | 303 | wp_enqueue_style('geodir-core-scss'); |
304 | 304 | |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | |
307 | 307 | } |
308 | 308 | |
309 | - if(is_rtl()){ |
|
309 | + if (is_rtl()) { |
|
310 | 310 | wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION); |
311 | 311 | wp_enqueue_style('geodirectory-frontend-rtl-style'); |
312 | 312 | } |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | if ($max_page > 1 || $always_show) { |
379 | 379 | // Extra pagination info |
380 | 380 | $geodir_pagination_more_info = get_option('geodir_pagination_advance_info'); |
381 | - $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
|
381 | + $start_no = ($paged - 1) * $posts_per_page + 1; |
|
382 | 382 | $end_no = min($paged * $posts_per_page, $numposts); |
383 | 383 | |
384 | 384 | if ($geodir_pagination_more_info != '') { |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | jQuery(function ($) { |
446 | 446 | $("#distance_slider").slider({ |
447 | 447 | range: true, |
448 | - values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
448 | + values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>], |
|
449 | 449 | min: 0, |
450 | 450 | max: <?php echo $dist; ?>, |
451 | 451 | step: <?php echo $dist_dif; ?>, |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | |
511 | 511 | |
512 | 512 | <script type="text/javascript"> |
513 | - var default_location = '<?php if($search_location = geodir_get_default_location()) echo $search_location->city ;?>'; |
|
513 | + var default_location = '<?php if ($search_location = geodir_get_default_location()) echo $search_location->city; ?>'; |
|
514 | 514 | var latlng; |
515 | 515 | var Sgeocoder; |
516 | 516 | var address; |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | var $form = jQuery(this).closest('form'); |
524 | 524 | |
525 | 525 | if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val(); |
526 | - if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s); |
|
526 | + if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s); |
|
527 | 527 | |
528 | 528 | // Disable location based search for disabled location post type. |
529 | 529 | if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') { |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | } |
538 | 538 | } |
539 | 539 | |
540 | - if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) { |
|
540 | + if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) { |
|
541 | 541 | geodir_setsearch($form); |
542 | 542 | } else { |
543 | 543 | jQuery(".snear", $form).val(''); |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | }); |
558 | 558 | |
559 | 559 | function geodir_setsearch($form) { |
560 | - if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location); |
|
560 | + if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location); |
|
561 | 561 | geocodeAddress($form); |
562 | 562 | } |
563 | 563 | |
@@ -570,8 +570,8 @@ discard block |
||
570 | 570 | function geocodeAddress($form) { |
571 | 571 | Sgeocoder = new google.maps.Geocoder(); // Call the geocode function |
572 | 572 | |
573 | - if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) { |
|
574 | - if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) { |
|
573 | + if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) { |
|
574 | + if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) { |
|
575 | 575 | jQuery(".snear", $form).val(''); |
576 | 576 | } |
577 | 577 | jQuery($form).submit(); |
@@ -579,24 +579,24 @@ discard block |
||
579 | 579 | |
580 | 580 | var address = jQuery(".snear", $form).val(); |
581 | 581 | |
582 | - if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') { |
|
582 | + if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') { |
|
583 | 583 | initialise2(); |
584 | 584 | } else { |
585 | 585 | |
586 | 586 | Sgeocoder.geocode({'address': address<?php |
587 | - if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';} |
|
588 | - if($near_add2 = |
|
587 | + if ($near_add = get_option('geodir_search_near_addition')) {echo '+", ' . $near_add . '"'; } |
|
588 | + if ($near_add2 = |
|
589 | 589 | /** |
590 | 590 | * Adds any extra info to the near search box query when trying to geolocate it via google api. |
591 | 591 | * |
592 | 592 | * @since 1.0.0 |
593 | 593 | */ |
594 | - apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>}, |
|
594 | + apply_filters('geodir_search_near_addition', '')) {echo $near_add2; }//gt_advanced_near_search();?>}, |
|
595 | 595 | function (results, status) { |
596 | 596 | if (status == google.maps.GeocoderStatus.OK) { |
597 | 597 | updateSearchPosition(results[0].geometry.location, $form); |
598 | 598 | } else { |
599 | - alert("<?php _e('Search was not successful for the following reason:','geodirectory');?>" + status); |
|
599 | + alert("<?php _e('Search was not successful for the following reason:', 'geodirectory'); ?>" + status); |
|
600 | 600 | } |
601 | 601 | }); |
602 | 602 | } |
@@ -627,19 +627,19 @@ discard block |
||
627 | 627 | var msg; |
628 | 628 | switch (err.code) { |
629 | 629 | case err.UNKNOWN_ERROR: |
630 | - msg = "<?php _e('Unable to find your location','geodirectory');?>"; |
|
630 | + msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>"; |
|
631 | 631 | break; |
632 | 632 | case err.PERMISSION_DENINED: |
633 | - msg = "<?php _e('Permission denied in finding your location','geodirectory');?>"; |
|
633 | + msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>"; |
|
634 | 634 | break; |
635 | 635 | case err.POSITION_UNAVAILABLE: |
636 | - msg = "<?php _e('Your location is currently unknown','geodirectory');?>"; |
|
636 | + msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>"; |
|
637 | 637 | break; |
638 | 638 | case err.BREAK: |
639 | - msg = "<?php _e('Attempt to find location took too long','geodirectory');?>"; |
|
639 | + msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>"; |
|
640 | 640 | break; |
641 | 641 | default: |
642 | - msg = "<?php _e('Location detection not supported in browser','geodirectory');?>"; |
|
642 | + msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>"; |
|
643 | 643 | } |
644 | 644 | jQuery('#info').html(msg); |
645 | 645 | } |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | * @param object $post The post object. |
680 | 680 | * @param string $link The link to the post. |
681 | 681 | */ |
682 | - return apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link); |
|
682 | + return apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>', $post, $link); |
|
683 | 683 | break; |
684 | 684 | case 'new' : |
685 | 685 | /** |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | * @param object $post The post object. |
690 | 690 | * @param string $link The link to the post. |
691 | 691 | */ |
692 | - return apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link); |
|
692 | + return apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>', $post, $link); |
|
693 | 693 | break; |
694 | 694 | |
695 | 695 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | function geodir_core_dequeue_script() |
24 | 24 | { |
25 | - wp_dequeue_script('flexslider'); |
|
25 | + wp_dequeue_script('flexslider'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | add_action('wp_print_scripts', 'geodir_core_dequeue_script', 100); |
@@ -35,159 +35,159 @@ discard block |
||
35 | 35 | */ |
36 | 36 | function geodir_templates_scripts() |
37 | 37 | { |
38 | - $is_detail_page = false; |
|
38 | + $is_detail_page = false; |
|
39 | 39 | |
40 | - if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) { |
|
41 | - $is_detail_page = true; |
|
42 | - } |
|
40 | + if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) { |
|
41 | + $is_detail_page = true; |
|
42 | + } |
|
43 | 43 | |
44 | - wp_enqueue_script('jquery'); |
|
44 | + wp_enqueue_script('jquery'); |
|
45 | 45 | |
46 | - wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION); |
|
47 | - wp_enqueue_script('geodirectory-script'); |
|
46 | + wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION); |
|
47 | + wp_enqueue_script('geodirectory-script'); |
|
48 | 48 | |
49 | 49 | |
50 | - $geodir_vars_data = array( |
|
51 | - 'siteurl' => get_option('siteurl'), |
|
52 | - 'geodir_plugin_url' => geodir_plugin_url(), |
|
53 | - 'geodir_ajax_url' => geodir_get_ajax_url(), |
|
54 | - 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'), |
|
55 | - 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
|
56 | - ); |
|
50 | + $geodir_vars_data = array( |
|
51 | + 'siteurl' => get_option('siteurl'), |
|
52 | + 'geodir_plugin_url' => geodir_plugin_url(), |
|
53 | + 'geodir_ajax_url' => geodir_get_ajax_url(), |
|
54 | + 'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'), |
|
55 | + 'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue |
|
56 | + ); |
|
57 | 57 | |
58 | - /** |
|
59 | - * Filter the `geodir_var` data array that outputs the wp_localize_script() translations and variables. |
|
60 | - * |
|
61 | - * This is used by addons to add JS translatable variables. |
|
62 | - * |
|
63 | - * @since 1.4.4 |
|
64 | - * @param array $geodir_vars_data { |
|
65 | - * geodir var data used by addons to add JS translatable variables. |
|
66 | - * |
|
67 | - * @type string $siteurl Site url. |
|
68 | - * @type string $geodir_plugin_url Geodirectory core plugin url. |
|
69 | - * @type string $geodir_ajax_url Geodirectory plugin ajax url. |
|
70 | - * @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?. |
|
71 | - * @type int $is_rtl Checks if current locale is RTL. |
|
72 | - * |
|
73 | - * } |
|
74 | - */ |
|
75 | - $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data); |
|
58 | + /** |
|
59 | + * Filter the `geodir_var` data array that outputs the wp_localize_script() translations and variables. |
|
60 | + * |
|
61 | + * This is used by addons to add JS translatable variables. |
|
62 | + * |
|
63 | + * @since 1.4.4 |
|
64 | + * @param array $geodir_vars_data { |
|
65 | + * geodir var data used by addons to add JS translatable variables. |
|
66 | + * |
|
67 | + * @type string $siteurl Site url. |
|
68 | + * @type string $geodir_plugin_url Geodirectory core plugin url. |
|
69 | + * @type string $geodir_ajax_url Geodirectory plugin ajax url. |
|
70 | + * @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?. |
|
71 | + * @type int $is_rtl Checks if current locale is RTL. |
|
72 | + * |
|
73 | + * } |
|
74 | + */ |
|
75 | + $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data); |
|
76 | 76 | |
77 | - wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data); |
|
77 | + wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data); |
|
78 | 78 | |
79 | 79 | |
80 | 80 | |
81 | 81 | |
82 | - wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true); |
|
83 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');} |
|
82 | + wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true); |
|
83 | + if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');} |
|
84 | 84 | |
85 | 85 | |
86 | 86 | |
87 | - wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true); |
|
88 | - wp_enqueue_script('geodirectory-lightbox-jquery'); |
|
87 | + wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true); |
|
88 | + wp_enqueue_script('geodirectory-lightbox-jquery'); |
|
89 | 89 | |
90 | 90 | |
91 | 91 | |
92 | - wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true); |
|
93 | - if($is_detail_page){wp_enqueue_script('geodirectory-jquery-simplemodal');} |
|
92 | + wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true); |
|
93 | + if($is_detail_page){wp_enqueue_script('geodirectory-jquery-simplemodal');} |
|
94 | 94 | |
95 | 95 | |
96 | - //if( get_option('geodir_enqueue_google_api_script')==1) |
|
96 | + //if( get_option('geodir_enqueue_google_api_script')==1) |
|
97 | 97 | |
98 | - $map_lang = "&language=" . geodir_get_map_default_language(); |
|
99 | - /** |
|
100 | - * Filter the variables that are added to the end of the google maps script call. |
|
101 | - * |
|
102 | - * This i used to change things like google maps language etc. |
|
103 | - * |
|
104 | - * @since 1.0.0 |
|
105 | - * @param string $var The string to filter, default is empty string. |
|
106 | - */ |
|
107 | - $map_extra = apply_filters('geodir_googlemap_script_extra', ''); |
|
108 | - wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL); |
|
109 | - /* { |
|
98 | + $map_lang = "&language=" . geodir_get_map_default_language(); |
|
99 | + /** |
|
100 | + * Filter the variables that are added to the end of the google maps script call. |
|
101 | + * |
|
102 | + * This i used to change things like google maps language etc. |
|
103 | + * |
|
104 | + * @since 1.0.0 |
|
105 | + * @param string $var The string to filter, default is empty string. |
|
106 | + */ |
|
107 | + $map_extra = apply_filters('geodir_googlemap_script_extra', ''); |
|
108 | + wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL); |
|
109 | + /* { |
|
110 | 110 | wp_register_script( 'geodirectory-googlemap-script', "//maps.google.com/maps/api/js?sensor=false&language=en" ); |
111 | 111 | wp_enqueue_script( 'geodirectory-googlemap-script' ); |
112 | 112 | } |
113 | 113 | */ |
114 | - wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true); |
|
115 | - wp_enqueue_script('geodirectory-goMap-script'); |
|
114 | + wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true); |
|
115 | + wp_enqueue_script('geodirectory-goMap-script'); |
|
116 | 116 | |
117 | 117 | |
118 | - wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION); |
|
119 | - wp_enqueue_script('chosen'); |
|
118 | + wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION); |
|
119 | + wp_enqueue_script('chosen'); |
|
120 | 120 | |
121 | - wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION); |
|
122 | - wp_enqueue_script('geodirectory-choose-ajax'); |
|
121 | + wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION); |
|
122 | + wp_enqueue_script('geodirectory-choose-ajax'); |
|
123 | 123 | |
124 | - wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true); |
|
124 | + wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true); |
|
125 | 125 | |
126 | 126 | |
127 | - if (is_page() && geodir_is_page('add-listing')) { |
|
127 | + if (is_page() && geodir_is_page('add-listing')) { |
|
128 | 128 | |
129 | 129 | |
130 | 130 | |
131 | 131 | |
132 | - // SCRIPT FOR UPLOAD |
|
133 | - wp_enqueue_script('plupload-all'); |
|
134 | - wp_enqueue_script('jquery-ui-sortable'); |
|
132 | + // SCRIPT FOR UPLOAD |
|
133 | + wp_enqueue_script('plupload-all'); |
|
134 | + wp_enqueue_script('jquery-ui-sortable'); |
|
135 | 135 | |
136 | - wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true); |
|
137 | - wp_enqueue_script('geodirectory-plupload-script'); |
|
136 | + wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true); |
|
137 | + wp_enqueue_script('geodirectory-plupload-script'); |
|
138 | 138 | |
139 | - // SCRIPT FOR UPLOAD END |
|
139 | + // SCRIPT FOR UPLOAD END |
|
140 | 140 | |
141 | - // check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls |
|
142 | - if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) { |
|
143 | - $ajax_url = admin_url('admin-ajax.php'); |
|
144 | - } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) { |
|
145 | - $ajax_url = admin_url('admin-ajax.php'); |
|
146 | - } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) { |
|
147 | - $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php')); |
|
148 | - } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) { |
|
149 | - $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php')); |
|
150 | - } |
|
141 | + // check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls |
|
142 | + if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) { |
|
143 | + $ajax_url = admin_url('admin-ajax.php'); |
|
144 | + } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) { |
|
145 | + $ajax_url = admin_url('admin-ajax.php'); |
|
146 | + } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) { |
|
147 | + $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php')); |
|
148 | + } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) { |
|
149 | + $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php')); |
|
150 | + } |
|
151 | 151 | |
152 | - // place js config array for plupload |
|
153 | - $plupload_init = array( |
|
154 | - 'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4', |
|
155 | - 'browse_button' => 'plupload-browse-button', // will be adjusted per uploader |
|
156 | - 'container' => 'plupload-upload-ui', // will be adjusted per uploader |
|
157 | - 'drop_element' => 'dropbox', // will be adjusted per uploader |
|
158 | - 'file_data_name' => 'async-upload', // will be adjusted per uploader |
|
159 | - 'multiple_queues' => true, |
|
160 | - 'max_file_size' => geodir_max_upload_size(), |
|
161 | - 'url' => $ajax_url, |
|
162 | - 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), |
|
163 | - 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), |
|
164 | - 'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')), |
|
165 | - 'multipart' => true, |
|
166 | - 'urlstream_upload' => true, |
|
167 | - 'multi_selection' => false, // will be added per uploader |
|
168 | - // additional post data to send to our ajax hook |
|
169 | - 'multipart_params' => array( |
|
170 | - '_ajax_nonce' => "", // will be added per uploader |
|
171 | - 'action' => 'plupload_action', // the ajax action name |
|
172 | - 'imgid' => 0 // will be added per uploader |
|
173 | - ) |
|
174 | - ); |
|
175 | - $base_plupload_config = json_encode($plupload_init); |
|
176 | - |
|
177 | - $gd_plupload_init = array('base_plupload_config' => $base_plupload_config, |
|
178 | - 'upload_img_size' => geodir_max_upload_size()); |
|
179 | - |
|
180 | - wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init); |
|
181 | - |
|
182 | - wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload'); |
|
183 | - } // End if for add place page |
|
184 | - |
|
185 | - wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
186 | - if ($is_detail_page) { |
|
152 | + // place js config array for plupload |
|
153 | + $plupload_init = array( |
|
154 | + 'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4', |
|
155 | + 'browse_button' => 'plupload-browse-button', // will be adjusted per uploader |
|
156 | + 'container' => 'plupload-upload-ui', // will be adjusted per uploader |
|
157 | + 'drop_element' => 'dropbox', // will be adjusted per uploader |
|
158 | + 'file_data_name' => 'async-upload', // will be adjusted per uploader |
|
159 | + 'multiple_queues' => true, |
|
160 | + 'max_file_size' => geodir_max_upload_size(), |
|
161 | + 'url' => $ajax_url, |
|
162 | + 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), |
|
163 | + 'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'), |
|
164 | + 'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')), |
|
165 | + 'multipart' => true, |
|
166 | + 'urlstream_upload' => true, |
|
167 | + 'multi_selection' => false, // will be added per uploader |
|
168 | + // additional post data to send to our ajax hook |
|
169 | + 'multipart_params' => array( |
|
170 | + '_ajax_nonce' => "", // will be added per uploader |
|
171 | + 'action' => 'plupload_action', // the ajax action name |
|
172 | + 'imgid' => 0 // will be added per uploader |
|
173 | + ) |
|
174 | + ); |
|
175 | + $base_plupload_config = json_encode($plupload_init); |
|
176 | + |
|
177 | + $gd_plupload_init = array('base_plupload_config' => $base_plupload_config, |
|
178 | + 'upload_img_size' => geodir_max_upload_size()); |
|
179 | + |
|
180 | + wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init); |
|
181 | + |
|
182 | + wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload'); |
|
183 | + } // End if for add place page |
|
184 | + |
|
185 | + wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
186 | + if ($is_detail_page) { |
|
187 | 187 | wp_enqueue_script('geodirectory-post-custom-js'); |
188 | 188 | } |
189 | 189 | |
190 | - // font awesome rating script |
|
190 | + // font awesome rating script |
|
191 | 191 | if (get_option('geodir_reviewrating_enable_font_awesome')) { |
192 | 192 | wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true); |
193 | 193 | wp_enqueue_script('geodir-barrating-js'); |
@@ -196,11 +196,11 @@ discard block |
||
196 | 196 | wp_enqueue_script('geodir-jRating-js'); |
197 | 197 | } |
198 | 198 | |
199 | - wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
200 | - wp_enqueue_script('geodir-on-document-load'); |
|
199 | + wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
200 | + wp_enqueue_script('geodir-on-document-load'); |
|
201 | 201 | |
202 | - wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
203 | - wp_enqueue_script('google-geometa'); |
|
202 | + wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true); |
|
203 | + wp_enqueue_script('google-geometa'); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
@@ -214,8 +214,8 @@ discard block |
||
214 | 214 | */ |
215 | 215 | function geodir_header_scripts() |
216 | 216 | { |
217 | - echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>'; |
|
218 | - echo stripslashes(get_option('geodir_header_scripts')); |
|
217 | + echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>'; |
|
218 | + echo stripslashes(get_option('geodir_header_scripts')); |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | function geodir_footer_scripts() |
232 | 232 | { |
233 | 233 | echo stripslashes(get_option('geodir_ga_tracking_code')); |
234 | - echo stripslashes(get_option('geodir_footer_scripts')); |
|
234 | + echo stripslashes(get_option('geodir_footer_scripts')); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | |
@@ -245,12 +245,12 @@ discard block |
||
245 | 245 | */ |
246 | 246 | function geodir_add_async_forscript($url) |
247 | 247 | { |
248 | - if (strpos($url, '#asyncload')===false) |
|
249 | - return $url; |
|
250 | - else if (is_admin()) |
|
251 | - return str_replace('#asyncload', '', $url); |
|
252 | - else |
|
253 | - return str_replace('#asyncload', '', $url)."' async='async"; |
|
248 | + if (strpos($url, '#asyncload')===false) |
|
249 | + return $url; |
|
250 | + else if (is_admin()) |
|
251 | + return str_replace('#asyncload', '', $url); |
|
252 | + else |
|
253 | + return str_replace('#asyncload', '', $url)."' async='async"; |
|
254 | 254 | } |
255 | 255 | add_filter('clean_url', 'geodir_add_async_forscript', 11, 1); |
256 | 256 | |
@@ -264,55 +264,55 @@ discard block |
||
264 | 264 | { |
265 | 265 | |
266 | 266 | |
267 | - if(get_option('geodir_scss_core')) { |
|
267 | + if(get_option('geodir_scss_core')) { |
|
268 | 268 | |
269 | 269 | |
270 | - wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION); |
|
271 | - wp_enqueue_style('geodirectory-frontend-style'); |
|
270 | + wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION); |
|
271 | + wp_enqueue_style('geodirectory-frontend-style'); |
|
272 | 272 | |
273 | - wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION); |
|
274 | - wp_enqueue_style('geodirectory-media-style'); |
|
273 | + wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION); |
|
274 | + wp_enqueue_style('geodirectory-media-style'); |
|
275 | 275 | |
276 | 276 | |
277 | - wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION); |
|
278 | - wp_enqueue_style('geodirectory-jquery-ui-css'); |
|
277 | + wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION); |
|
278 | + wp_enqueue_style('geodirectory-jquery-ui-css'); |
|
279 | 279 | |
280 | - wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION); |
|
281 | - wp_enqueue_style('geodirectory-jquery-ui-timepicker-css'); |
|
280 | + wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION); |
|
281 | + wp_enqueue_style('geodirectory-jquery-ui-timepicker-css'); |
|
282 | 282 | |
283 | - wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION); |
|
284 | - wp_enqueue_style('geodirectory-flexslider-css'); |
|
283 | + wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION); |
|
284 | + wp_enqueue_style('geodirectory-flexslider-css'); |
|
285 | 285 | |
286 | - wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION); |
|
287 | - wp_enqueue_style('geodirectory-thic-box-css'); |
|
286 | + wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION); |
|
287 | + wp_enqueue_style('geodirectory-thic-box-css'); |
|
288 | 288 | |
289 | - wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION); |
|
290 | - wp_enqueue_style('geodirectory-pluplodar-css'); |
|
289 | + wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION); |
|
290 | + wp_enqueue_style('geodirectory-pluplodar-css'); |
|
291 | 291 | |
292 | - wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION); |
|
293 | - wp_enqueue_style('geodirectory-lightbox-css'); |
|
292 | + wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION); |
|
293 | + wp_enqueue_style('geodirectory-lightbox-css'); |
|
294 | 294 | |
295 | - wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION); |
|
296 | - wp_enqueue_style('geodir-rating-style'); |
|
295 | + wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION); |
|
296 | + wp_enqueue_style('geodir-rating-style'); |
|
297 | 297 | |
298 | - wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
|
299 | - wp_enqueue_style('geodir-chosen-style'); |
|
298 | + wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
|
299 | + wp_enqueue_style('geodir-chosen-style'); |
|
300 | 300 | |
301 | - }else{ |
|
302 | - wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION); |
|
303 | - wp_enqueue_style('geodir-core-scss'); |
|
301 | + }else{ |
|
302 | + wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION); |
|
303 | + wp_enqueue_style('geodir-core-scss'); |
|
304 | 304 | |
305 | - wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION); |
|
305 | + wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION); |
|
306 | 306 | |
307 | - } |
|
307 | + } |
|
308 | 308 | |
309 | - if(is_rtl()){ |
|
310 | - wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION); |
|
311 | - wp_enqueue_style('geodirectory-frontend-rtl-style'); |
|
312 | - } |
|
309 | + if(is_rtl()){ |
|
310 | + wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION); |
|
311 | + wp_enqueue_style('geodirectory-frontend-rtl-style'); |
|
312 | + } |
|
313 | 313 | |
314 | - wp_register_style('geodirectory-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION); |
|
315 | - wp_enqueue_style('geodirectory-font-awesome'); |
|
314 | + wp_register_style('geodirectory-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION); |
|
315 | + wp_enqueue_style('geodirectory-font-awesome'); |
|
316 | 316 | |
317 | 317 | |
318 | 318 | } |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | */ |
327 | 327 | function geodir_get_sidebar() |
328 | 328 | { |
329 | - get_sidebar('geodirectory'); |
|
329 | + get_sidebar('geodirectory'); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | /** |
@@ -347,35 +347,35 @@ discard block |
||
347 | 347 | function geodir_pagination($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) |
348 | 348 | { |
349 | 349 | |
350 | - global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id; |
|
350 | + global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id; |
|
351 | 351 | |
352 | - if (empty($prelabel)) { |
|
353 | - $prelabel = '<strong>«</strong>'; |
|
354 | - } |
|
352 | + if (empty($prelabel)) { |
|
353 | + $prelabel = '<strong>«</strong>'; |
|
354 | + } |
|
355 | 355 | |
356 | - if (empty($nxtlabel)) { |
|
357 | - $nxtlabel = '<strong>»</strong>'; |
|
358 | - } |
|
356 | + if (empty($nxtlabel)) { |
|
357 | + $nxtlabel = '<strong>»</strong>'; |
|
358 | + } |
|
359 | 359 | |
360 | - $half_pages_to_show = round($pages_to_show / 2); |
|
360 | + $half_pages_to_show = round($pages_to_show / 2); |
|
361 | 361 | |
362 | - if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default pagination for geodirectory home page. |
|
363 | - return; |
|
362 | + if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default pagination for geodirectory home page. |
|
363 | + return; |
|
364 | 364 | |
365 | - if (!is_single()) { |
|
365 | + if (!is_single()) { |
|
366 | 366 | if (function_exists('geodir_location_geo_home_link')) { |
367 | 367 | remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
368 | 368 | } |
369 | - $numposts = $wp_query->found_posts; |
|
369 | + $numposts = $wp_query->found_posts; |
|
370 | 370 | |
371 | 371 | |
372 | - $max_page = ceil($numposts / $posts_per_page); |
|
372 | + $max_page = ceil($numposts / $posts_per_page); |
|
373 | 373 | |
374 | - if (empty($paged)) { |
|
375 | - $paged = 1; |
|
376 | - } |
|
374 | + if (empty($paged)) { |
|
375 | + $paged = 1; |
|
376 | + } |
|
377 | 377 | |
378 | - if ($max_page > 1 || $always_show) { |
|
378 | + if ($max_page > 1 || $always_show) { |
|
379 | 379 | // Extra pagination info |
380 | 380 | $geodir_pagination_more_info = get_option('geodir_pagination_advance_info'); |
381 | 381 | $start_no = ( $paged - 1 ) * $posts_per_page + 1; |
@@ -392,30 +392,30 @@ discard block |
||
392 | 392 | } |
393 | 393 | |
394 | 394 | echo "$before <div class='Navi'>"; |
395 | - if ($paged >= ($pages_to_show - 1)) { |
|
396 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>'; |
|
397 | - } |
|
398 | - previous_posts_link($prelabel); |
|
399 | - for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) { |
|
400 | - if ($i >= 1 && $i <= $max_page) { |
|
401 | - if ($i == $paged) { |
|
402 | - echo "<strong class='on'>$i</strong>"; |
|
403 | - } else { |
|
404 | - echo ' <a href="' . str_replace('&paged', '&paged', get_pagenum_link($i)) . '">' . $i . '</a> '; |
|
405 | - } |
|
406 | - } |
|
407 | - } |
|
408 | - next_posts_link($nxtlabel, $max_page); |
|
409 | - if (($paged + $half_pages_to_show) < ($max_page)) { |
|
410 | - echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link($max_page)) . '">»</a>'; |
|
411 | - } |
|
412 | - echo "</div> $after"; |
|
413 | - } |
|
395 | + if ($paged >= ($pages_to_show - 1)) { |
|
396 | + echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>'; |
|
397 | + } |
|
398 | + previous_posts_link($prelabel); |
|
399 | + for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) { |
|
400 | + if ($i >= 1 && $i <= $max_page) { |
|
401 | + if ($i == $paged) { |
|
402 | + echo "<strong class='on'>$i</strong>"; |
|
403 | + } else { |
|
404 | + echo ' <a href="' . str_replace('&paged', '&paged', get_pagenum_link($i)) . '">' . $i . '</a> '; |
|
405 | + } |
|
406 | + } |
|
407 | + } |
|
408 | + next_posts_link($nxtlabel, $max_page); |
|
409 | + if (($paged + $half_pages_to_show) < ($max_page)) { |
|
410 | + echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link($max_page)) . '">»</a>'; |
|
411 | + } |
|
412 | + echo "</div> $after"; |
|
413 | + } |
|
414 | 414 | |
415 | 415 | if (function_exists('geodir_location_geo_home_link')) { |
416 | 416 | add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
417 | 417 | } |
418 | - } |
|
418 | + } |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | /** |
@@ -426,20 +426,20 @@ discard block |
||
426 | 426 | */ |
427 | 427 | function geodir_listingsearch_scripts() |
428 | 428 | { |
429 | - if (get_option('gd_search_dist') != '') { |
|
430 | - $dist = get_option('gd_search_dist'); |
|
431 | - } else { |
|
432 | - $dist = 500; |
|
433 | - } |
|
434 | - $dist_dif = 1000; |
|
435 | - |
|
436 | - if ($dist <= 5000) $dist_dif = 500; |
|
437 | - if ($dist <= 1000) $dist_dif = 100; |
|
438 | - if ($dist <= 500) $dist_dif = 50; |
|
439 | - if ($dist <= 100) $dist_dif = 10; |
|
440 | - if ($dist <= 50) $dist_dif = 5; |
|
441 | - |
|
442 | - ?> |
|
429 | + if (get_option('gd_search_dist') != '') { |
|
430 | + $dist = get_option('gd_search_dist'); |
|
431 | + } else { |
|
432 | + $dist = 500; |
|
433 | + } |
|
434 | + $dist_dif = 1000; |
|
435 | + |
|
436 | + if ($dist <= 5000) $dist_dif = 500; |
|
437 | + if ($dist <= 1000) $dist_dif = 100; |
|
438 | + if ($dist <= 500) $dist_dif = 50; |
|
439 | + if ($dist <= 100) $dist_dif = 10; |
|
440 | + if ($dist <= 50) $dist_dif = 5; |
|
441 | + |
|
442 | + ?> |
|
443 | 443 | <script type="text/javascript"> |
444 | 444 | |
445 | 445 | jQuery(function ($) { |
@@ -498,15 +498,15 @@ discard block |
||
498 | 498 | function geodir_add_sharelocation_scripts() |
499 | 499 | { |
500 | 500 | |
501 | - $default_search_for_text = SEARCH_FOR_TEXT; |
|
502 | - if (get_option('geodir_search_field_default_text')) |
|
503 | - $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory'); |
|
501 | + $default_search_for_text = SEARCH_FOR_TEXT; |
|
502 | + if (get_option('geodir_search_field_default_text')) |
|
503 | + $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory'); |
|
504 | 504 | |
505 | - $default_near_text = NEAR_TEXT; |
|
506 | - if (get_option('geodir_near_field_default_text')) |
|
507 | - $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory'); |
|
505 | + $default_near_text = NEAR_TEXT; |
|
506 | + if (get_option('geodir_near_field_default_text')) |
|
507 | + $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory'); |
|
508 | 508 | |
509 | - ?> |
|
509 | + ?> |
|
510 | 510 | |
511 | 511 | |
512 | 512 | <script type="text/javascript"> |
@@ -584,14 +584,14 @@ discard block |
||
584 | 584 | } else { |
585 | 585 | |
586 | 586 | Sgeocoder.geocode({'address': address<?php |
587 | - if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';} |
|
588 | - if($near_add2 = |
|
589 | - /** |
|
590 | - * Adds any extra info to the near search box query when trying to geolocate it via google api. |
|
591 | - * |
|
592 | - * @since 1.0.0 |
|
593 | - */ |
|
594 | - apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>}, |
|
587 | + if($near_add = get_option('geodir_search_near_addition')){echo '+", '.$near_add.'"';} |
|
588 | + if($near_add2 = |
|
589 | + /** |
|
590 | + * Adds any extra info to the near search box query when trying to geolocate it via google api. |
|
591 | + * |
|
592 | + * @since 1.0.0 |
|
593 | + */ |
|
594 | + apply_filters('geodir_search_near_addition','')){echo $near_add2;}//gt_advanced_near_search();?>}, |
|
595 | 595 | function (results, status) { |
596 | 596 | if (status == google.maps.GeocoderStatus.OK) { |
597 | 597 | updateSearchPosition(results[0].geometry.location, $form); |
@@ -670,29 +670,29 @@ discard block |
||
670 | 670 | */ |
671 | 671 | function geodir_show_badges_on_image($which, $post, $link) |
672 | 672 | { |
673 | - switch ($which) { |
|
674 | - case 'featured': |
|
675 | - /** |
|
676 | - * Filter the featured image badge html that appears in the listings pages over the thumbnail. |
|
677 | - * |
|
678 | - * @since 1.0.0 |
|
679 | - * @param object $post The post object. |
|
680 | - * @param string $link The link to the post. |
|
681 | - */ |
|
682 | - return apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link); |
|
683 | - break; |
|
684 | - case 'new' : |
|
685 | - /** |
|
686 | - * Filter the new image badge html that appears in the listings pages over the thumbnail. |
|
687 | - * |
|
688 | - * @since 1.0.0 |
|
689 | - * @param object $post The post object. |
|
690 | - * @param string $link The link to the post. |
|
691 | - */ |
|
692 | - return apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link); |
|
693 | - break; |
|
694 | - |
|
695 | - } |
|
673 | + switch ($which) { |
|
674 | + case 'featured': |
|
675 | + /** |
|
676 | + * Filter the featured image badge html that appears in the listings pages over the thumbnail. |
|
677 | + * |
|
678 | + * @since 1.0.0 |
|
679 | + * @param object $post The post object. |
|
680 | + * @param string $link The link to the post. |
|
681 | + */ |
|
682 | + return apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link); |
|
683 | + break; |
|
684 | + case 'new' : |
|
685 | + /** |
|
686 | + * Filter the new image badge html that appears in the listings pages over the thumbnail. |
|
687 | + * |
|
688 | + * @since 1.0.0 |
|
689 | + * @param object $post The post object. |
|
690 | + * @param string $link The link to the post. |
|
691 | + */ |
|
692 | + return apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link); |
|
693 | + break; |
|
694 | + |
|
695 | + } |
|
696 | 696 | } |
697 | 697 | |
698 | 698 | ?> |
699 | 699 | \ No newline at end of file |
@@ -245,13 +245,14 @@ discard block |
||
245 | 245 | */ |
246 | 246 | function geodir_add_async_forscript($url) |
247 | 247 | { |
248 | - if (strpos($url, '#asyncload')===false) |
|
249 | - return $url; |
|
250 | - else if (is_admin()) |
|
251 | - return str_replace('#asyncload', '', $url); |
|
252 | - else |
|
253 | - return str_replace('#asyncload', '', $url)."' async='async"; |
|
254 | -} |
|
248 | + if (strpos($url, '#asyncload')===false) { |
|
249 | + return $url; |
|
250 | + } else if (is_admin()) { |
|
251 | + return str_replace('#asyncload', '', $url); |
|
252 | + } else { |
|
253 | + return str_replace('#asyncload', '', $url)."' async='async"; |
|
254 | + } |
|
255 | + } |
|
255 | 256 | add_filter('clean_url', 'geodir_add_async_forscript', 11, 1); |
256 | 257 | |
257 | 258 | /** |
@@ -298,7 +299,7 @@ discard block |
||
298 | 299 | wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION); |
299 | 300 | wp_enqueue_style('geodir-chosen-style'); |
300 | 301 | |
301 | - }else{ |
|
302 | + } else{ |
|
302 | 303 | wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION); |
303 | 304 | wp_enqueue_style('geodir-core-scss'); |
304 | 305 | |
@@ -359,8 +360,10 @@ discard block |
||
359 | 360 | |
360 | 361 | $half_pages_to_show = round($pages_to_show / 2); |
361 | 362 | |
362 | - if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default pagination for geodirectory home page. |
|
363 | - return; |
|
363 | + if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) { |
|
364 | + // dont apply default pagination for geodirectory home page. |
|
365 | + return; |
|
366 | + } |
|
364 | 367 | |
365 | 368 | if (!is_single()) { |
366 | 369 | if (function_exists('geodir_location_geo_home_link')) { |
@@ -433,11 +436,21 @@ discard block |
||
433 | 436 | } |
434 | 437 | $dist_dif = 1000; |
435 | 438 | |
436 | - if ($dist <= 5000) $dist_dif = 500; |
|
437 | - if ($dist <= 1000) $dist_dif = 100; |
|
438 | - if ($dist <= 500) $dist_dif = 50; |
|
439 | - if ($dist <= 100) $dist_dif = 10; |
|
440 | - if ($dist <= 50) $dist_dif = 5; |
|
439 | + if ($dist <= 5000) { |
|
440 | + $dist_dif = 500; |
|
441 | + } |
|
442 | + if ($dist <= 1000) { |
|
443 | + $dist_dif = 100; |
|
444 | + } |
|
445 | + if ($dist <= 500) { |
|
446 | + $dist_dif = 50; |
|
447 | + } |
|
448 | + if ($dist <= 100) { |
|
449 | + $dist_dif = 10; |
|
450 | + } |
|
451 | + if ($dist <= 50) { |
|
452 | + $dist_dif = 5; |
|
453 | + } |
|
441 | 454 | |
442 | 455 | ?> |
443 | 456 | <script type="text/javascript"> |
@@ -499,18 +512,23 @@ discard block |
||
499 | 512 | { |
500 | 513 | |
501 | 514 | $default_search_for_text = SEARCH_FOR_TEXT; |
502 | - if (get_option('geodir_search_field_default_text')) |
|
503 | - $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory'); |
|
515 | + if (get_option('geodir_search_field_default_text')) { |
|
516 | + $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory'); |
|
517 | + } |
|
504 | 518 | |
505 | 519 | $default_near_text = NEAR_TEXT; |
506 | - if (get_option('geodir_near_field_default_text')) |
|
507 | - $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory'); |
|
520 | + if (get_option('geodir_near_field_default_text')) { |
|
521 | + $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory'); |
|
522 | + } |
|
508 | 523 | |
509 | 524 | ?> |
510 | 525 | |
511 | 526 | |
512 | 527 | <script type="text/javascript"> |
513 | - var default_location = '<?php if($search_location = geodir_get_default_location()) echo $search_location->city ;?>'; |
|
528 | + var default_location = '<?php if($search_location = geodir_get_default_location()) { |
|
529 | + echo $search_location->city ; |
|
530 | +} |
|
531 | +?>'; |
|
514 | 532 | var latlng; |
515 | 533 | var Sgeocoder; |
516 | 534 | var address; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | |
50 | - add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions |
|
50 | + add_action('init', 'gd_fix_cpt_rewrite_slug', 11); // this needs to be kept for a few versions |
|
51 | 51 | |
52 | 52 | update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION); |
53 | 53 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | * @since 1.0.0 |
85 | 85 | * @package GeoDirectory |
86 | 86 | */ |
87 | -function geodir_upgrade_146(){ |
|
87 | +function geodir_upgrade_146() { |
|
88 | 88 | gd_convert_virtual_pages(); |
89 | 89 | } |
90 | 90 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @since 1.5.0 |
95 | 95 | * @package GeoDirectory |
96 | 96 | */ |
97 | -function geodir_upgrade_150(){ |
|
97 | +function geodir_upgrade_150() { |
|
98 | 98 | gd_fix_cpt_rewrite_slug(); |
99 | 99 | } |
100 | 100 | |
@@ -106,12 +106,12 @@ discard block |
||
106 | 106 | * @since 1.4.8 |
107 | 107 | * @package GeoDirectory |
108 | 108 | */ |
109 | -function geodir_upgrade_148(){ |
|
109 | +function geodir_upgrade_148() { |
|
110 | 110 | /* |
111 | 111 | * Blank the users google password if present as we now use oAuth 2.0 |
112 | 112 | */ |
113 | - update_option('geodir_ga_pass',''); |
|
114 | - update_option('geodir_ga_user',''); |
|
113 | + update_option('geodir_ga_pass', ''); |
|
114 | + update_option('geodir_ga_user', ''); |
|
115 | 115 | |
116 | 116 | } |
117 | 117 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @since 1.5.3 |
123 | 123 | * @package GeoDirectory |
124 | 124 | */ |
125 | -function geodir_upgrade_153(){ |
|
125 | +function geodir_upgrade_153() { |
|
126 | 126 | geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
127 | 127 | geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
128 | 128 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * @since 1.5.3 |
134 | 134 | * @package GeoDirectory |
135 | 135 | */ |
136 | -function geodir_upgrade_154(){ |
|
136 | +function geodir_upgrade_154() { |
|
137 | 137 | geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
138 | 138 | } |
139 | 139 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @since 1.5.2 |
144 | 144 | * @package GeoDirectory |
145 | 145 | */ |
146 | -function geodir_upgrade_152(){ |
|
146 | +function geodir_upgrade_152() { |
|
147 | 147 | gd_fix_address_detail_table_limit(); |
148 | 148 | } |
149 | 149 | |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | |
642 | 642 | update_option('gd_theme_compats', $theme_compat); |
643 | 643 | |
644 | - gd_set_theme_compat();// set the compat pack if avail |
|
644 | + gd_set_theme_compat(); // set the compat pack if avail |
|
645 | 645 | } |
646 | 646 | |
647 | 647 | |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | * @package GeoDirectory |
653 | 653 | * @global object $wpdb WordPress Database object. |
654 | 654 | */ |
655 | -function gd_convert_virtual_pages(){ |
|
655 | +function gd_convert_virtual_pages() { |
|
656 | 656 | global $wpdb; |
657 | 657 | |
658 | 658 | // Update the add listing page settings |
@@ -663,9 +663,9 @@ discard block |
||
663 | 663 | ) |
664 | 664 | ); |
665 | 665 | |
666 | - if($add_listing_page){ |
|
667 | - wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') ); |
|
668 | - update_option( 'geodir_add_listing_page', $add_listing_page); |
|
666 | + if ($add_listing_page) { |
|
667 | + wp_update_post(array('ID' => $add_listing_page, 'post_status' => 'publish')); |
|
668 | + update_option('geodir_add_listing_page', $add_listing_page); |
|
669 | 669 | } |
670 | 670 | |
671 | 671 | // Update the listing preview page settings |
@@ -676,9 +676,9 @@ discard block |
||
676 | 676 | ) |
677 | 677 | ); |
678 | 678 | |
679 | - if($listing_preview_page){ |
|
680 | - wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') ); |
|
681 | - update_option( 'geodir_preview_page', $listing_preview_page); |
|
679 | + if ($listing_preview_page) { |
|
680 | + wp_update_post(array('ID' => $listing_preview_page, 'post_status' => 'publish')); |
|
681 | + update_option('geodir_preview_page', $listing_preview_page); |
|
682 | 682 | } |
683 | 683 | |
684 | 684 | // Update the listing success page settings |
@@ -689,9 +689,9 @@ discard block |
||
689 | 689 | ) |
690 | 690 | ); |
691 | 691 | |
692 | - if($listing_success_page){ |
|
693 | - wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') ); |
|
694 | - update_option( 'geodir_success_page', $listing_success_page); |
|
692 | + if ($listing_success_page) { |
|
693 | + wp_update_post(array('ID' => $listing_success_page, 'post_status' => 'publish')); |
|
694 | + update_option('geodir_success_page', $listing_success_page); |
|
695 | 695 | } |
696 | 696 | |
697 | 697 | // Update the listing success page settings |
@@ -702,11 +702,11 @@ discard block |
||
702 | 702 | ) |
703 | 703 | ); |
704 | 704 | |
705 | - if($location_page){ |
|
705 | + if ($location_page) { |
|
706 | 706 | $location_slug = get_option('geodir_location_prefix'); |
707 | - if(!$location_slug ){$location_slug = 'location';} |
|
708 | - wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) ); |
|
709 | - update_option( 'geodir_location_page', $location_page); |
|
707 | + if (!$location_slug) {$location_slug = 'location'; } |
|
708 | + wp_update_post(array('ID' => $location_page, 'post_status' => 'publish', 'post_name' => $location_slug)); |
|
709 | + update_option('geodir_location_page', $location_page); |
|
710 | 710 | } |
711 | 711 | |
712 | 712 | } |
@@ -725,13 +725,13 @@ discard block |
||
725 | 725 | $post_types = get_option('geodir_post_types'); |
726 | 726 | |
727 | 727 | |
728 | - if (is_array($post_types)){ |
|
728 | + if (is_array($post_types)) { |
|
729 | 729 | |
730 | 730 | foreach ($post_types as $post_type => $args) { |
731 | 731 | |
732 | 732 | |
733 | - if(isset($args['rewrite']['slug'])){ |
|
734 | - $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']); |
|
733 | + if (isset($args['rewrite']['slug'])) { |
|
734 | + $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%", "", $args['rewrite']['slug']); |
|
735 | 735 | } |
736 | 736 | |
737 | 737 | $alt_post_types[$post_type] = $args; |
@@ -739,8 +739,8 @@ discard block |
||
739 | 739 | } |
740 | 740 | } |
741 | 741 | |
742 | - if(!empty($alt_post_types)) { |
|
743 | - update_option('geodir_post_types',$alt_post_types); |
|
742 | + if (!empty($alt_post_types)) { |
|
743 | + update_option('geodir_post_types', $alt_post_types); |
|
744 | 744 | } |
745 | 745 | |
746 | 746 | |
@@ -767,8 +767,8 @@ discard block |
||
767 | 767 | // update each GD CTP |
768 | 768 | try { |
769 | 769 | $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL"); |
770 | - } catch(Exception $e) { |
|
771 | - error_log( 'Error: ' . $e->getMessage() ); |
|
770 | + } catch (Exception $e) { |
|
771 | + error_log('Error: ' . $e->getMessage()); |
|
772 | 772 | } |
773 | 773 | } |
774 | 774 | } |
@@ -10,46 +10,46 @@ discard block |
||
10 | 10 | global $wpdb; |
11 | 11 | |
12 | 12 | if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) { |
13 | - /** |
|
14 | - * Include custom database table related functions. |
|
15 | - * |
|
16 | - * @since 1.0.0 |
|
17 | - * @package GeoDirectory |
|
18 | - */ |
|
19 | - include_once('geodirectory-admin/admin_db_install.php'); |
|
20 | - add_action('plugins_loaded', 'geodirectory_upgrade_all', 10); |
|
21 | - if (GEODIRECTORY_VERSION <= '1.3.6') { |
|
22 | - add_action('plugins_loaded', 'geodir_upgrade_136', 11); |
|
23 | - } |
|
13 | + /** |
|
14 | + * Include custom database table related functions. |
|
15 | + * |
|
16 | + * @since 1.0.0 |
|
17 | + * @package GeoDirectory |
|
18 | + */ |
|
19 | + include_once('geodirectory-admin/admin_db_install.php'); |
|
20 | + add_action('plugins_loaded', 'geodirectory_upgrade_all', 10); |
|
21 | + if (GEODIRECTORY_VERSION <= '1.3.6') { |
|
22 | + add_action('plugins_loaded', 'geodir_upgrade_136', 11); |
|
23 | + } |
|
24 | 24 | |
25 | - if (GEODIRECTORY_VERSION <= '1.4.6') { |
|
26 | - add_action('init', 'geodir_upgrade_146', 11); |
|
27 | - } |
|
25 | + if (GEODIRECTORY_VERSION <= '1.4.6') { |
|
26 | + add_action('init', 'geodir_upgrade_146', 11); |
|
27 | + } |
|
28 | 28 | |
29 | - if (GEODIRECTORY_VERSION <= '1.4.8') { |
|
30 | - add_action('init', 'geodir_upgrade_148', 11); |
|
31 | - } |
|
29 | + if (GEODIRECTORY_VERSION <= '1.4.8') { |
|
30 | + add_action('init', 'geodir_upgrade_148', 11); |
|
31 | + } |
|
32 | 32 | |
33 | - if (GEODIRECTORY_VERSION <= '1.5.0') { |
|
34 | - add_action('init', 'geodir_upgrade_150', 11); |
|
35 | - } |
|
33 | + if (GEODIRECTORY_VERSION <= '1.5.0') { |
|
34 | + add_action('init', 'geodir_upgrade_150', 11); |
|
35 | + } |
|
36 | 36 | |
37 | - if (GEODIRECTORY_VERSION <= '1.5.2') { |
|
38 | - add_action('init', 'geodir_upgrade_152', 11); |
|
39 | - } |
|
37 | + if (GEODIRECTORY_VERSION <= '1.5.2') { |
|
38 | + add_action('init', 'geodir_upgrade_152', 11); |
|
39 | + } |
|
40 | 40 | |
41 | - if (GEODIRECTORY_VERSION <= '1.5.3') { |
|
42 | - add_action('init', 'geodir_upgrade_153', 11); |
|
43 | - } |
|
41 | + if (GEODIRECTORY_VERSION <= '1.5.3') { |
|
42 | + add_action('init', 'geodir_upgrade_153', 11); |
|
43 | + } |
|
44 | 44 | |
45 | - if (GEODIRECTORY_VERSION <= '1.5.4') { |
|
46 | - add_action('init', 'geodir_upgrade_154', 11); |
|
47 | - } |
|
45 | + if (GEODIRECTORY_VERSION <= '1.5.4') { |
|
46 | + add_action('init', 'geodir_upgrade_154', 11); |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | - add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions |
|
50 | + add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions |
|
51 | 51 | |
52 | - update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION); |
|
52 | + update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION); |
|
53 | 53 | |
54 | 54 | } |
55 | 55 | |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | */ |
63 | 63 | function geodirectory_upgrade_all() |
64 | 64 | { |
65 | - geodir_create_tables(); |
|
66 | - geodir_update_review_db(); |
|
67 | - gd_install_theme_compat(); |
|
65 | + geodir_create_tables(); |
|
66 | + geodir_update_review_db(); |
|
67 | + gd_install_theme_compat(); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | function geodir_upgrade_136() |
77 | 77 | { |
78 | - geodir_fix_review_overall_rating(); |
|
78 | + geodir_fix_review_overall_rating(); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @package GeoDirectory |
86 | 86 | */ |
87 | 87 | function geodir_upgrade_146(){ |
88 | - gd_convert_virtual_pages(); |
|
88 | + gd_convert_virtual_pages(); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @package GeoDirectory |
96 | 96 | */ |
97 | 97 | function geodir_upgrade_150(){ |
98 | - gd_fix_cpt_rewrite_slug(); |
|
98 | + gd_fix_cpt_rewrite_slug(); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | * @package GeoDirectory |
108 | 108 | */ |
109 | 109 | function geodir_upgrade_148(){ |
110 | - /* |
|
110 | + /* |
|
111 | 111 | * Blank the users google password if present as we now use oAuth 2.0 |
112 | 112 | */ |
113 | - update_option('geodir_ga_pass',''); |
|
114 | - update_option('geodir_ga_user',''); |
|
113 | + update_option('geodir_ga_pass',''); |
|
114 | + update_option('geodir_ga_user',''); |
|
115 | 115 | |
116 | 116 | } |
117 | 117 | |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | * @package GeoDirectory |
124 | 124 | */ |
125 | 125 | function geodir_upgrade_153(){ |
126 | - geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
|
127 | - geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
|
126 | + geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
|
127 | + geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @package GeoDirectory |
135 | 135 | */ |
136 | 136 | function geodir_upgrade_154(){ |
137 | - geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
|
137 | + geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | * @package GeoDirectory |
145 | 145 | */ |
146 | 146 | function geodir_upgrade_152(){ |
147 | - gd_fix_address_detail_table_limit(); |
|
147 | + gd_fix_address_detail_table_limit(); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | |
@@ -158,12 +158,12 @@ discard block |
||
158 | 158 | */ |
159 | 159 | function geodir_update_review_db() |
160 | 160 | { |
161 | - global $wpdb, $plugin_prefix; |
|
161 | + global $wpdb, $plugin_prefix; |
|
162 | 162 | |
163 | - geodir_fix_review_date(); |
|
164 | - geodir_fix_review_post_status(); |
|
165 | - geodir_fix_review_content(); |
|
166 | - geodir_fix_review_location(); |
|
163 | + geodir_fix_review_date(); |
|
164 | + geodir_fix_review_post_status(); |
|
165 | + geodir_fix_review_content(); |
|
166 | + geodir_fix_review_location(); |
|
167 | 167 | |
168 | 168 | } |
169 | 169 | |
@@ -176,8 +176,8 @@ discard block |
||
176 | 176 | */ |
177 | 177 | function geodir_fix_review_date() |
178 | 178 | { |
179 | - global $wpdb; |
|
180 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'"); |
|
179 | + global $wpdb; |
|
180 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'"); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
@@ -189,8 +189,8 @@ discard block |
||
189 | 189 | */ |
190 | 190 | function geodir_fix_review_post_status() |
191 | 191 | { |
192 | - global $wpdb; |
|
193 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'"); |
|
192 | + global $wpdb; |
|
193 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'"); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | /** |
@@ -203,12 +203,12 @@ discard block |
||
203 | 203 | */ |
204 | 204 | function geodir_fix_review_content() |
205 | 205 | { |
206 | - global $wpdb; |
|
207 | - if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) { |
|
208 | - return true; |
|
209 | - } else { |
|
210 | - return false; |
|
211 | - } |
|
206 | + global $wpdb; |
|
207 | + if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) { |
|
208 | + return true; |
|
209 | + } else { |
|
210 | + return false; |
|
211 | + } |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | /** |
@@ -221,20 +221,20 @@ discard block |
||
221 | 221 | */ |
222 | 222 | function geodir_fix_review_location() |
223 | 223 | { |
224 | - global $wpdb; |
|
224 | + global $wpdb; |
|
225 | 225 | |
226 | - $all_postypes = geodir_get_posttypes(); |
|
226 | + $all_postypes = geodir_get_posttypes(); |
|
227 | 227 | |
228 | - if (!empty($all_postypes)) { |
|
229 | - foreach ($all_postypes as $key) { |
|
230 | - // update each GD CTP |
|
228 | + if (!empty($all_postypes)) { |
|
229 | + foreach ($all_postypes as $key) { |
|
230 | + // update each GD CTP |
|
231 | 231 | |
232 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL"); |
|
232 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL"); |
|
233 | 233 | |
234 | - } |
|
235 | - return true; |
|
236 | - } |
|
237 | - return false; |
|
234 | + } |
|
235 | + return true; |
|
236 | + } |
|
237 | + return false; |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | /** |
@@ -246,25 +246,25 @@ discard block |
||
246 | 246 | */ |
247 | 247 | function geodir_fix_review_overall_rating() |
248 | 248 | { |
249 | - global $wpdb; |
|
249 | + global $wpdb; |
|
250 | 250 | |
251 | - $all_postypes = geodir_get_posttypes(); |
|
251 | + $all_postypes = geodir_get_posttypes(); |
|
252 | 252 | |
253 | - if (!empty($all_postypes)) { |
|
254 | - foreach ($all_postypes as $key) { |
|
255 | - // update each GD CTP |
|
256 | - $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d"); |
|
253 | + if (!empty($all_postypes)) { |
|
254 | + foreach ($all_postypes as $key) { |
|
255 | + // update each GD CTP |
|
256 | + $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d"); |
|
257 | 257 | |
258 | - if (!empty($reviews)) { |
|
259 | - foreach ($reviews as $post_id) { |
|
260 | - geodir_update_postrating($post_id->post_id, $key); |
|
261 | - } |
|
258 | + if (!empty($reviews)) { |
|
259 | + foreach ($reviews as $post_id) { |
|
260 | + geodir_update_postrating($post_id->post_id, $key); |
|
261 | + } |
|
262 | 262 | |
263 | - } |
|
263 | + } |
|
264 | 264 | |
265 | - } |
|
265 | + } |
|
266 | 266 | |
267 | - } |
|
267 | + } |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | |
@@ -281,367 +281,367 @@ discard block |
||
281 | 281 | */ |
282 | 282 | function gd_install_theme_compat() |
283 | 283 | { |
284 | - global $wpdb; |
|
284 | + global $wpdb; |
|
285 | 285 | |
286 | - $theme_compat = array(); |
|
287 | - $theme_compat = get_option('gd_theme_compats'); |
|
286 | + $theme_compat = array(); |
|
287 | + $theme_compat = get_option('gd_theme_compats'); |
|
288 | 288 | //GDF |
289 | - $theme_compat['GeoDirectory_Framework'] = array( |
|
290 | - 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
291 | - 'geodir_wrapper_open_class' => '', |
|
292 | - 'geodir_wrapper_open_replace' => '', |
|
293 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
294 | - 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
295 | - 'geodir_wrapper_content_open_class' => '', |
|
296 | - 'geodir_wrapper_content_open_replace' => '', |
|
297 | - 'geodir_wrapper_content_close_replace' => '', |
|
298 | - 'geodir_article_open_id' => '', |
|
299 | - 'geodir_article_open_class' => '', |
|
300 | - 'geodir_article_open_replace' => '', |
|
301 | - 'geodir_article_close_replace' => '', |
|
302 | - 'geodir_sidebar_right_open_id' => '', |
|
303 | - 'geodir_sidebar_right_open_class' => '', |
|
304 | - 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
305 | - 'geodir_sidebar_right_close_replace' => '', |
|
306 | - 'geodir_sidebar_left_open_id' => '', |
|
307 | - 'geodir_sidebar_left_open_class' => '', |
|
308 | - 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
309 | - 'geodir_sidebar_left_close_replace' => '', |
|
310 | - 'geodir_main_content_open_id' => '', |
|
311 | - 'geodir_main_content_open_class' => '', |
|
312 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
313 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
314 | - 'geodir_top_content_add' => '', |
|
315 | - 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
316 | - 'geodir_before_widget_filter' => '', |
|
317 | - 'geodir_after_widget_filter' => '', |
|
318 | - 'geodir_theme_compat_css' => '', |
|
319 | - 'geodir_theme_compat_js' => '', |
|
320 | - 'geodir_theme_compat_default_options' => '', |
|
321 | - 'geodir_theme_compat_code' => '' |
|
322 | - ); |
|
289 | + $theme_compat['GeoDirectory_Framework'] = array( |
|
290 | + 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
291 | + 'geodir_wrapper_open_class' => '', |
|
292 | + 'geodir_wrapper_open_replace' => '', |
|
293 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
294 | + 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
295 | + 'geodir_wrapper_content_open_class' => '', |
|
296 | + 'geodir_wrapper_content_open_replace' => '', |
|
297 | + 'geodir_wrapper_content_close_replace' => '', |
|
298 | + 'geodir_article_open_id' => '', |
|
299 | + 'geodir_article_open_class' => '', |
|
300 | + 'geodir_article_open_replace' => '', |
|
301 | + 'geodir_article_close_replace' => '', |
|
302 | + 'geodir_sidebar_right_open_id' => '', |
|
303 | + 'geodir_sidebar_right_open_class' => '', |
|
304 | + 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
305 | + 'geodir_sidebar_right_close_replace' => '', |
|
306 | + 'geodir_sidebar_left_open_id' => '', |
|
307 | + 'geodir_sidebar_left_open_class' => '', |
|
308 | + 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
309 | + 'geodir_sidebar_left_close_replace' => '', |
|
310 | + 'geodir_main_content_open_id' => '', |
|
311 | + 'geodir_main_content_open_class' => '', |
|
312 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
313 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
314 | + 'geodir_top_content_add' => '', |
|
315 | + 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
316 | + 'geodir_before_widget_filter' => '', |
|
317 | + 'geodir_after_widget_filter' => '', |
|
318 | + 'geodir_theme_compat_css' => '', |
|
319 | + 'geodir_theme_compat_js' => '', |
|
320 | + 'geodir_theme_compat_default_options' => '', |
|
321 | + 'geodir_theme_compat_code' => '' |
|
322 | + ); |
|
323 | 323 | |
324 | 324 | //Directory Theme |
325 | - $theme_compat['Directory_Starter'] = array( |
|
326 | - 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
327 | - 'geodir_wrapper_open_class' => '', |
|
328 | - 'geodir_wrapper_open_replace' => '', |
|
329 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
330 | - 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
331 | - 'geodir_wrapper_content_open_class' => '', |
|
332 | - 'geodir_wrapper_content_open_replace' => '', |
|
333 | - 'geodir_wrapper_content_close_replace' => '', |
|
334 | - 'geodir_article_open_id' => '', |
|
335 | - 'geodir_article_open_class' => '', |
|
336 | - 'geodir_article_open_replace' => '', |
|
337 | - 'geodir_article_close_replace' => '', |
|
338 | - 'geodir_sidebar_right_open_id' => '', |
|
339 | - 'geodir_sidebar_right_open_class' => '', |
|
340 | - 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
341 | - 'geodir_sidebar_right_close_replace' => '', |
|
342 | - 'geodir_sidebar_left_open_id' => '', |
|
343 | - 'geodir_sidebar_left_open_class' => '', |
|
344 | - 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
345 | - 'geodir_sidebar_left_close_replace' => '', |
|
346 | - 'geodir_main_content_open_id' => '', |
|
347 | - 'geodir_main_content_open_class' => '', |
|
348 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
349 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
350 | - 'geodir_top_content_add' => '', |
|
351 | - 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
352 | - 'geodir_before_widget_filter' => '', |
|
353 | - 'geodir_after_widget_filter' => '', |
|
354 | - 'geodir_theme_compat_css' => '', |
|
355 | - 'geodir_theme_compat_js' => '', |
|
356 | - 'geodir_theme_compat_default_options' => '', |
|
357 | - 'geodir_theme_compat_code' => '' |
|
358 | - ); |
|
325 | + $theme_compat['Directory_Starter'] = array( |
|
326 | + 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
327 | + 'geodir_wrapper_open_class' => '', |
|
328 | + 'geodir_wrapper_open_replace' => '', |
|
329 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
330 | + 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
331 | + 'geodir_wrapper_content_open_class' => '', |
|
332 | + 'geodir_wrapper_content_open_replace' => '', |
|
333 | + 'geodir_wrapper_content_close_replace' => '', |
|
334 | + 'geodir_article_open_id' => '', |
|
335 | + 'geodir_article_open_class' => '', |
|
336 | + 'geodir_article_open_replace' => '', |
|
337 | + 'geodir_article_close_replace' => '', |
|
338 | + 'geodir_sidebar_right_open_id' => '', |
|
339 | + 'geodir_sidebar_right_open_class' => '', |
|
340 | + 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
341 | + 'geodir_sidebar_right_close_replace' => '', |
|
342 | + 'geodir_sidebar_left_open_id' => '', |
|
343 | + 'geodir_sidebar_left_open_class' => '', |
|
344 | + 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
345 | + 'geodir_sidebar_left_close_replace' => '', |
|
346 | + 'geodir_main_content_open_id' => '', |
|
347 | + 'geodir_main_content_open_class' => '', |
|
348 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
349 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
350 | + 'geodir_top_content_add' => '', |
|
351 | + 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
352 | + 'geodir_before_widget_filter' => '', |
|
353 | + 'geodir_after_widget_filter' => '', |
|
354 | + 'geodir_theme_compat_css' => '', |
|
355 | + 'geodir_theme_compat_js' => '', |
|
356 | + 'geodir_theme_compat_default_options' => '', |
|
357 | + 'geodir_theme_compat_code' => '' |
|
358 | + ); |
|
359 | 359 | |
360 | 360 | //Jobby |
361 | - $theme_compat['Jobby'] = $theme_compat['Directory_Starter']; |
|
361 | + $theme_compat['Jobby'] = $theme_compat['Directory_Starter']; |
|
362 | 362 | |
363 | 363 | //GeoProperty |
364 | - $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter']; |
|
364 | + $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter']; |
|
365 | 365 | |
366 | 366 | //Avada |
367 | - $theme_compat['Avada'] = array( |
|
368 | - 'geodir_wrapper_open_id' => '', |
|
369 | - 'geodir_wrapper_open_class' => '', |
|
370 | - 'geodir_wrapper_open_replace' => '<!-- removed -->', |
|
371 | - 'geodir_wrapper_close_replace' => '<!-- removed -->', |
|
372 | - 'geodir_wrapper_content_open_id' => 'content', |
|
373 | - 'geodir_wrapper_content_open_class' => '', |
|
374 | - 'geodir_wrapper_content_open_replace' => '', |
|
375 | - 'geodir_wrapper_content_close_replace' => '', |
|
376 | - 'geodir_article_open_id' => '', |
|
377 | - 'geodir_article_open_class' => '', |
|
378 | - 'geodir_article_open_replace' => '', |
|
379 | - 'geodir_article_close_replace' => '', |
|
380 | - 'geodir_sidebar_right_open_id' => '', |
|
381 | - 'geodir_sidebar_right_open_class' => '', |
|
382 | - 'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
383 | - 'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->', |
|
384 | - 'geodir_sidebar_left_open_id' => '', |
|
385 | - 'geodir_sidebar_left_open_class' => '', |
|
386 | - 'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
387 | - 'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->', |
|
388 | - 'geodir_main_content_open_id' => '', |
|
389 | - 'geodir_main_content_open_class' => '', |
|
390 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
391 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
392 | - 'geodir_top_content_add' => '', |
|
393 | - 'geodir_before_main_content_add' => '', |
|
394 | - 'geodir_before_widget_filter' => '', |
|
395 | - 'geodir_after_widget_filter' => '', |
|
396 | - 'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'), |
|
397 | - 'geodir_theme_compat_js' => '', |
|
398 | - 'geodir_theme_compat_default_options' => '', |
|
399 | - 'geodir_theme_compat_code' => 'Avada' |
|
400 | - ); |
|
367 | + $theme_compat['Avada'] = array( |
|
368 | + 'geodir_wrapper_open_id' => '', |
|
369 | + 'geodir_wrapper_open_class' => '', |
|
370 | + 'geodir_wrapper_open_replace' => '<!-- removed -->', |
|
371 | + 'geodir_wrapper_close_replace' => '<!-- removed -->', |
|
372 | + 'geodir_wrapper_content_open_id' => 'content', |
|
373 | + 'geodir_wrapper_content_open_class' => '', |
|
374 | + 'geodir_wrapper_content_open_replace' => '', |
|
375 | + 'geodir_wrapper_content_close_replace' => '', |
|
376 | + 'geodir_article_open_id' => '', |
|
377 | + 'geodir_article_open_class' => '', |
|
378 | + 'geodir_article_open_replace' => '', |
|
379 | + 'geodir_article_close_replace' => '', |
|
380 | + 'geodir_sidebar_right_open_id' => '', |
|
381 | + 'geodir_sidebar_right_open_class' => '', |
|
382 | + 'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
383 | + 'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->', |
|
384 | + 'geodir_sidebar_left_open_id' => '', |
|
385 | + 'geodir_sidebar_left_open_class' => '', |
|
386 | + 'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
387 | + 'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->', |
|
388 | + 'geodir_main_content_open_id' => '', |
|
389 | + 'geodir_main_content_open_class' => '', |
|
390 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
391 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
392 | + 'geodir_top_content_add' => '', |
|
393 | + 'geodir_before_main_content_add' => '', |
|
394 | + 'geodir_before_widget_filter' => '', |
|
395 | + 'geodir_after_widget_filter' => '', |
|
396 | + 'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'), |
|
397 | + 'geodir_theme_compat_js' => '', |
|
398 | + 'geodir_theme_compat_default_options' => '', |
|
399 | + 'geodir_theme_compat_code' => 'Avada' |
|
400 | + ); |
|
401 | 401 | |
402 | 402 | //Enfold |
403 | - $theme_compat['Enfold'] = array( |
|
404 | - 'geodir_wrapper_open_id' => '', |
|
405 | - 'geodir_wrapper_open_class' => '', |
|
406 | - 'geodir_wrapper_open_replace' => '', |
|
407 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
408 | - 'geodir_wrapper_content_open_id' => '', |
|
409 | - 'geodir_wrapper_content_open_class' => '', |
|
410 | - 'geodir_wrapper_content_open_replace' => '', |
|
411 | - 'geodir_wrapper_content_close_replace' => '</div></main>', |
|
412 | - 'geodir_article_open_id' => '', |
|
413 | - 'geodir_article_open_class' => '', |
|
414 | - 'geodir_article_open_replace' => '', |
|
415 | - 'geodir_article_close_replace' => '', |
|
416 | - 'geodir_sidebar_right_open_id' => '', |
|
417 | - 'geodir_sidebar_right_open_class' => '', |
|
418 | - 'geodir_sidebar_right_open_replace' => '', |
|
419 | - 'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
420 | - 'geodir_sidebar_left_open_id' => '', |
|
421 | - 'geodir_sidebar_left_open_class' => '', |
|
422 | - 'geodir_sidebar_left_open_replace' => '', |
|
423 | - 'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
424 | - 'geodir_main_content_open_id' => '', |
|
425 | - 'geodir_main_content_open_class' => '', |
|
426 | - 'geodir_main_content_open_replace' => '', |
|
427 | - 'geodir_main_content_close_replace' => '', |
|
428 | - 'geodir_top_content_add' => '', |
|
429 | - 'geodir_before_main_content_add' => '', |
|
430 | - 'geodir_before_widget_filter' => '', |
|
431 | - 'geodir_after_widget_filter' => '', |
|
432 | - 'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'), |
|
433 | - 'geodir_theme_compat_js' => '', |
|
434 | - 'geodir_theme_compat_default_options' => '', |
|
435 | - 'geodir_theme_compat_code' => 'Enfold' |
|
436 | - ); |
|
403 | + $theme_compat['Enfold'] = array( |
|
404 | + 'geodir_wrapper_open_id' => '', |
|
405 | + 'geodir_wrapper_open_class' => '', |
|
406 | + 'geodir_wrapper_open_replace' => '', |
|
407 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
408 | + 'geodir_wrapper_content_open_id' => '', |
|
409 | + 'geodir_wrapper_content_open_class' => '', |
|
410 | + 'geodir_wrapper_content_open_replace' => '', |
|
411 | + 'geodir_wrapper_content_close_replace' => '</div></main>', |
|
412 | + 'geodir_article_open_id' => '', |
|
413 | + 'geodir_article_open_class' => '', |
|
414 | + 'geodir_article_open_replace' => '', |
|
415 | + 'geodir_article_close_replace' => '', |
|
416 | + 'geodir_sidebar_right_open_id' => '', |
|
417 | + 'geodir_sidebar_right_open_class' => '', |
|
418 | + 'geodir_sidebar_right_open_replace' => '', |
|
419 | + 'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
420 | + 'geodir_sidebar_left_open_id' => '', |
|
421 | + 'geodir_sidebar_left_open_class' => '', |
|
422 | + 'geodir_sidebar_left_open_replace' => '', |
|
423 | + 'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
424 | + 'geodir_main_content_open_id' => '', |
|
425 | + 'geodir_main_content_open_class' => '', |
|
426 | + 'geodir_main_content_open_replace' => '', |
|
427 | + 'geodir_main_content_close_replace' => '', |
|
428 | + 'geodir_top_content_add' => '', |
|
429 | + 'geodir_before_main_content_add' => '', |
|
430 | + 'geodir_before_widget_filter' => '', |
|
431 | + 'geodir_after_widget_filter' => '', |
|
432 | + 'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'), |
|
433 | + 'geodir_theme_compat_js' => '', |
|
434 | + 'geodir_theme_compat_default_options' => '', |
|
435 | + 'geodir_theme_compat_code' => 'Enfold' |
|
436 | + ); |
|
437 | 437 | |
438 | 438 | // X |
439 | - $theme_compat['X'] = array( |
|
440 | - 'geodir_wrapper_open_id' => '', |
|
441 | - 'geodir_wrapper_open_class' => '', |
|
442 | - 'geodir_wrapper_open_replace' => '', |
|
443 | - 'geodir_wrapper_close_replace' => '', |
|
444 | - 'geodir_wrapper_content_open_id' => '', |
|
445 | - 'geodir_wrapper_content_open_class' => '', |
|
446 | - 'geodir_wrapper_content_open_replace' => '', |
|
447 | - 'geodir_wrapper_content_close_replace' => '', |
|
448 | - 'geodir_article_open_id' => '', |
|
449 | - 'geodir_article_open_class' => '', |
|
450 | - 'geodir_article_open_replace' => '', |
|
451 | - 'geodir_article_close_replace' => '', |
|
452 | - 'geodir_sidebar_right_open_id' => '', |
|
453 | - 'geodir_sidebar_right_open_class' => '', |
|
454 | - 'geodir_sidebar_right_open_replace' => '', |
|
455 | - 'geodir_sidebar_right_close_replace' => '', |
|
456 | - 'geodir_sidebar_left_open_id' => '', |
|
457 | - 'geodir_sidebar_left_open_class' => '', |
|
458 | - 'geodir_sidebar_left_open_replace' => '', |
|
459 | - 'geodir_sidebar_left_close_replace' => '', |
|
460 | - 'geodir_main_content_open_id' => '', |
|
461 | - 'geodir_main_content_open_class' => '', |
|
462 | - 'geodir_main_content_open_replace' => '', |
|
463 | - 'geodir_main_content_close_replace' => '', |
|
464 | - 'geodir_top_content_add' => '', |
|
465 | - 'geodir_before_main_content_add' => '', |
|
466 | - 'geodir_before_widget_filter' => '', |
|
467 | - 'geodir_after_widget_filter' => '', |
|
468 | - 'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
469 | - 'geodir_theme_compat_js' => '', |
|
470 | - 'geodir_theme_compat_default_options' => '', |
|
471 | - 'geodir_theme_compat_code' => 'X' |
|
472 | - ); |
|
439 | + $theme_compat['X'] = array( |
|
440 | + 'geodir_wrapper_open_id' => '', |
|
441 | + 'geodir_wrapper_open_class' => '', |
|
442 | + 'geodir_wrapper_open_replace' => '', |
|
443 | + 'geodir_wrapper_close_replace' => '', |
|
444 | + 'geodir_wrapper_content_open_id' => '', |
|
445 | + 'geodir_wrapper_content_open_class' => '', |
|
446 | + 'geodir_wrapper_content_open_replace' => '', |
|
447 | + 'geodir_wrapper_content_close_replace' => '', |
|
448 | + 'geodir_article_open_id' => '', |
|
449 | + 'geodir_article_open_class' => '', |
|
450 | + 'geodir_article_open_replace' => '', |
|
451 | + 'geodir_article_close_replace' => '', |
|
452 | + 'geodir_sidebar_right_open_id' => '', |
|
453 | + 'geodir_sidebar_right_open_class' => '', |
|
454 | + 'geodir_sidebar_right_open_replace' => '', |
|
455 | + 'geodir_sidebar_right_close_replace' => '', |
|
456 | + 'geodir_sidebar_left_open_id' => '', |
|
457 | + 'geodir_sidebar_left_open_class' => '', |
|
458 | + 'geodir_sidebar_left_open_replace' => '', |
|
459 | + 'geodir_sidebar_left_close_replace' => '', |
|
460 | + 'geodir_main_content_open_id' => '', |
|
461 | + 'geodir_main_content_open_class' => '', |
|
462 | + 'geodir_main_content_open_replace' => '', |
|
463 | + 'geodir_main_content_close_replace' => '', |
|
464 | + 'geodir_top_content_add' => '', |
|
465 | + 'geodir_before_main_content_add' => '', |
|
466 | + 'geodir_before_widget_filter' => '', |
|
467 | + 'geodir_after_widget_filter' => '', |
|
468 | + 'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
469 | + 'geodir_theme_compat_js' => '', |
|
470 | + 'geodir_theme_compat_default_options' => '', |
|
471 | + 'geodir_theme_compat_code' => 'X' |
|
472 | + ); |
|
473 | 473 | |
474 | 474 | // Divi |
475 | - $theme_compat['Divi'] = array( |
|
476 | - 'geodir_wrapper_open_id' => 'main-content', |
|
477 | - 'geodir_wrapper_open_class' => '', |
|
478 | - 'geodir_wrapper_open_replace' => '', |
|
479 | - 'geodir_wrapper_close_replace' => '', |
|
480 | - 'geodir_wrapper_content_open_id' => 'left-area', |
|
481 | - 'geodir_wrapper_content_open_class' => '', |
|
482 | - 'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >', |
|
483 | - 'geodir_wrapper_content_close_replace' => '', |
|
484 | - 'geodir_article_open_id' => '', |
|
485 | - 'geodir_article_open_class' => '', |
|
486 | - 'geodir_article_open_replace' => '', |
|
487 | - 'geodir_article_close_replace' => '', |
|
488 | - 'geodir_sidebar_right_open_id' => 'sidebar', |
|
489 | - 'geodir_sidebar_right_open_class' => '', |
|
490 | - 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
491 | - 'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
492 | - 'geodir_sidebar_left_open_id' => 'sidebar', |
|
493 | - 'geodir_sidebar_left_open_class' => '', |
|
494 | - 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
495 | - 'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
496 | - 'geodir_main_content_open_id' => '', |
|
497 | - 'geodir_main_content_open_class' => '', |
|
498 | - 'geodir_main_content_open_replace' => '', |
|
499 | - 'geodir_main_content_close_replace' => '', |
|
500 | - 'geodir_top_content_add' => '', |
|
501 | - 'geodir_before_main_content_add' => '', |
|
502 | - 'geodir_before_widget_filter' => '', |
|
503 | - 'geodir_after_widget_filter' => '', |
|
504 | - 'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
505 | - 'geodir_theme_compat_js' => '', |
|
506 | - 'geodir_theme_compat_default_options' => '', |
|
507 | - 'geodir_theme_compat_code' => 'Divi' |
|
508 | - ); |
|
475 | + $theme_compat['Divi'] = array( |
|
476 | + 'geodir_wrapper_open_id' => 'main-content', |
|
477 | + 'geodir_wrapper_open_class' => '', |
|
478 | + 'geodir_wrapper_open_replace' => '', |
|
479 | + 'geodir_wrapper_close_replace' => '', |
|
480 | + 'geodir_wrapper_content_open_id' => 'left-area', |
|
481 | + 'geodir_wrapper_content_open_class' => '', |
|
482 | + 'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >', |
|
483 | + 'geodir_wrapper_content_close_replace' => '', |
|
484 | + 'geodir_article_open_id' => '', |
|
485 | + 'geodir_article_open_class' => '', |
|
486 | + 'geodir_article_open_replace' => '', |
|
487 | + 'geodir_article_close_replace' => '', |
|
488 | + 'geodir_sidebar_right_open_id' => 'sidebar', |
|
489 | + 'geodir_sidebar_right_open_class' => '', |
|
490 | + 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
491 | + 'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
492 | + 'geodir_sidebar_left_open_id' => 'sidebar', |
|
493 | + 'geodir_sidebar_left_open_class' => '', |
|
494 | + 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
495 | + 'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
496 | + 'geodir_main_content_open_id' => '', |
|
497 | + 'geodir_main_content_open_class' => '', |
|
498 | + 'geodir_main_content_open_replace' => '', |
|
499 | + 'geodir_main_content_close_replace' => '', |
|
500 | + 'geodir_top_content_add' => '', |
|
501 | + 'geodir_before_main_content_add' => '', |
|
502 | + 'geodir_before_widget_filter' => '', |
|
503 | + 'geodir_after_widget_filter' => '', |
|
504 | + 'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
505 | + 'geodir_theme_compat_js' => '', |
|
506 | + 'geodir_theme_compat_default_options' => '', |
|
507 | + 'geodir_theme_compat_code' => 'Divi' |
|
508 | + ); |
|
509 | 509 | |
510 | 510 | // Genesis |
511 | - $theme_compat['Genesis'] = array( |
|
512 | - 'geodir_wrapper_open_id' => '', |
|
513 | - 'geodir_wrapper_open_class' => 'content-sidebar-wrap', |
|
514 | - 'geodir_wrapper_open_replace' => '', |
|
515 | - 'geodir_wrapper_close_replace' => '', |
|
516 | - 'geodir_wrapper_content_open_id' => '', |
|
517 | - 'geodir_wrapper_content_open_class' => 'content', |
|
518 | - 'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >', |
|
519 | - 'geodir_wrapper_content_close_replace' => '', |
|
520 | - 'geodir_article_open_id' => '', |
|
521 | - 'geodir_article_open_class' => '', |
|
522 | - 'geodir_article_open_replace' => '', |
|
523 | - 'geodir_article_close_replace' => '', |
|
524 | - 'geodir_sidebar_right_open_id' => '', |
|
525 | - 'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area', |
|
526 | - 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
527 | - 'geodir_sidebar_right_close_replace' => '', |
|
528 | - 'geodir_sidebar_left_open_id' => '', |
|
529 | - 'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area', |
|
530 | - 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
531 | - 'geodir_sidebar_left_close_replace' => '', |
|
532 | - 'geodir_main_content_open_id' => '', |
|
533 | - 'geodir_main_content_open_class' => '', |
|
534 | - 'geodir_main_content_open_replace' => '<main id="[id]" class="entry [class]" role="main">', |
|
535 | - 'geodir_main_content_close_replace' => '', |
|
536 | - 'geodir_top_content_add' => '', |
|
537 | - 'geodir_before_main_content_add' => '', |
|
538 | - 'geodir_before_widget_filter' => '', |
|
539 | - 'geodir_after_widget_filter' => '', |
|
540 | - 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher', |
|
541 | - 'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'), |
|
542 | - 'geodir_theme_compat_js' => '', |
|
543 | - 'geodir_theme_compat_default_options' => '', |
|
544 | - 'geodir_theme_compat_code' => 'Genesis' |
|
545 | - ); |
|
511 | + $theme_compat['Genesis'] = array( |
|
512 | + 'geodir_wrapper_open_id' => '', |
|
513 | + 'geodir_wrapper_open_class' => 'content-sidebar-wrap', |
|
514 | + 'geodir_wrapper_open_replace' => '', |
|
515 | + 'geodir_wrapper_close_replace' => '', |
|
516 | + 'geodir_wrapper_content_open_id' => '', |
|
517 | + 'geodir_wrapper_content_open_class' => 'content', |
|
518 | + 'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >', |
|
519 | + 'geodir_wrapper_content_close_replace' => '', |
|
520 | + 'geodir_article_open_id' => '', |
|
521 | + 'geodir_article_open_class' => '', |
|
522 | + 'geodir_article_open_replace' => '', |
|
523 | + 'geodir_article_close_replace' => '', |
|
524 | + 'geodir_sidebar_right_open_id' => '', |
|
525 | + 'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area', |
|
526 | + 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
527 | + 'geodir_sidebar_right_close_replace' => '', |
|
528 | + 'geodir_sidebar_left_open_id' => '', |
|
529 | + 'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area', |
|
530 | + 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
531 | + 'geodir_sidebar_left_close_replace' => '', |
|
532 | + 'geodir_main_content_open_id' => '', |
|
533 | + 'geodir_main_content_open_class' => '', |
|
534 | + 'geodir_main_content_open_replace' => '<main id="[id]" class="entry [class]" role="main">', |
|
535 | + 'geodir_main_content_close_replace' => '', |
|
536 | + 'geodir_top_content_add' => '', |
|
537 | + 'geodir_before_main_content_add' => '', |
|
538 | + 'geodir_before_widget_filter' => '', |
|
539 | + 'geodir_after_widget_filter' => '', |
|
540 | + 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher', |
|
541 | + 'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'), |
|
542 | + 'geodir_theme_compat_js' => '', |
|
543 | + 'geodir_theme_compat_default_options' => '', |
|
544 | + 'geodir_theme_compat_code' => 'Genesis' |
|
545 | + ); |
|
546 | 546 | |
547 | 547 | // Jupiter |
548 | - $theme_compat['Jupiter'] = array( |
|
549 | - 'geodir_wrapper_open_id' => '', |
|
550 | - 'geodir_wrapper_open_class' => '', |
|
551 | - 'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div class="theme-page-wrapper mk-main-wrapper mk-grid vc_row-fluid">', |
|
552 | - 'geodir_wrapper_close_replace' => '</div></div></div>', |
|
553 | - 'geodir_wrapper_content_open_id' => '', |
|
554 | - 'geodir_wrapper_content_open_class' => '', |
|
555 | - 'geodir_wrapper_content_open_replace' => '', |
|
556 | - 'geodir_wrapper_content_close_replace' => '', |
|
557 | - 'geodir_article_open_id' => '', |
|
558 | - 'geodir_article_open_class' => '', |
|
559 | - 'geodir_article_open_replace' => '', |
|
560 | - 'geodir_article_close_replace' => '', |
|
561 | - 'geodir_sidebar_right_open_id' => 'mk-sidebar', |
|
562 | - 'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
563 | - 'geodir_sidebar_right_open_replace' => '', |
|
564 | - 'geodir_sidebar_right_close_replace' => '', |
|
565 | - 'geodir_sidebar_left_open_id' => 'mk-sidebar', |
|
566 | - 'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
567 | - 'geodir_sidebar_left_open_replace' => '', |
|
568 | - 'geodir_sidebar_left_close_replace' => '', |
|
569 | - 'geodir_main_content_open_id' => '', |
|
570 | - 'geodir_main_content_open_class' => '', |
|
571 | - 'geodir_main_content_open_replace' => '', |
|
572 | - 'geodir_main_content_close_replace' => '', |
|
573 | - 'geodir_top_content_add' => '', |
|
574 | - 'geodir_before_main_content_add' => '', |
|
575 | - 'geodir_before_widget_filter' => '', |
|
576 | - 'geodir_after_widget_filter' => '', |
|
577 | - 'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">', |
|
578 | - 'geodir_after_title_filter' => '', |
|
579 | - 'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu', |
|
580 | - 'geodir_sub_menu_ul_class_filter' => '', |
|
581 | - 'geodir_sub_menu_li_class_filter' => '', |
|
582 | - 'geodir_menu_a_class_filter' => 'menu-item-link', |
|
583 | - 'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item', |
|
584 | - 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu', |
|
585 | - 'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link', |
|
586 | - 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
587 | - 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
588 | - 'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
589 | - 'geodir_theme_compat_js' => '', |
|
590 | - 'geodir_theme_compat_default_options' => '', |
|
591 | - 'geodir_theme_compat_code' => 'Jupiter' |
|
592 | - ); |
|
548 | + $theme_compat['Jupiter'] = array( |
|
549 | + 'geodir_wrapper_open_id' => '', |
|
550 | + 'geodir_wrapper_open_class' => '', |
|
551 | + 'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div class="theme-page-wrapper mk-main-wrapper mk-grid vc_row-fluid">', |
|
552 | + 'geodir_wrapper_close_replace' => '</div></div></div>', |
|
553 | + 'geodir_wrapper_content_open_id' => '', |
|
554 | + 'geodir_wrapper_content_open_class' => '', |
|
555 | + 'geodir_wrapper_content_open_replace' => '', |
|
556 | + 'geodir_wrapper_content_close_replace' => '', |
|
557 | + 'geodir_article_open_id' => '', |
|
558 | + 'geodir_article_open_class' => '', |
|
559 | + 'geodir_article_open_replace' => '', |
|
560 | + 'geodir_article_close_replace' => '', |
|
561 | + 'geodir_sidebar_right_open_id' => 'mk-sidebar', |
|
562 | + 'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
563 | + 'geodir_sidebar_right_open_replace' => '', |
|
564 | + 'geodir_sidebar_right_close_replace' => '', |
|
565 | + 'geodir_sidebar_left_open_id' => 'mk-sidebar', |
|
566 | + 'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
567 | + 'geodir_sidebar_left_open_replace' => '', |
|
568 | + 'geodir_sidebar_left_close_replace' => '', |
|
569 | + 'geodir_main_content_open_id' => '', |
|
570 | + 'geodir_main_content_open_class' => '', |
|
571 | + 'geodir_main_content_open_replace' => '', |
|
572 | + 'geodir_main_content_close_replace' => '', |
|
573 | + 'geodir_top_content_add' => '', |
|
574 | + 'geodir_before_main_content_add' => '', |
|
575 | + 'geodir_before_widget_filter' => '', |
|
576 | + 'geodir_after_widget_filter' => '', |
|
577 | + 'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">', |
|
578 | + 'geodir_after_title_filter' => '', |
|
579 | + 'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu', |
|
580 | + 'geodir_sub_menu_ul_class_filter' => '', |
|
581 | + 'geodir_sub_menu_li_class_filter' => '', |
|
582 | + 'geodir_menu_a_class_filter' => 'menu-item-link', |
|
583 | + 'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item', |
|
584 | + 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu', |
|
585 | + 'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link', |
|
586 | + 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
587 | + 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
588 | + 'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
589 | + 'geodir_theme_compat_js' => '', |
|
590 | + 'geodir_theme_compat_default_options' => '', |
|
591 | + 'geodir_theme_compat_code' => 'Jupiter' |
|
592 | + ); |
|
593 | 593 | |
594 | 594 | // Multi News |
595 | - $theme_compat['Multi_News'] = array( |
|
596 | - 'geodir_wrapper_open_id' => '', |
|
597 | - 'geodir_wrapper_open_class' => 'main-container clearfix', |
|
598 | - 'geodir_wrapper_open_replace' => '', |
|
599 | - 'geodir_wrapper_close_replace' => '', |
|
600 | - 'geodir_wrapper_content_open_id' => '', |
|
601 | - 'geodir_wrapper_content_open_class' => '', |
|
602 | - 'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content "><div class="site-content page-wrap">', |
|
603 | - 'geodir_wrapper_content_close_replace' => '</div></div></div>', |
|
604 | - 'geodir_article_open_id' => '', |
|
605 | - 'geodir_article_open_class' => '', |
|
606 | - 'geodir_article_open_replace' => '', |
|
607 | - 'geodir_article_close_replace' => '', |
|
608 | - 'geodir_sidebar_right_open_id' => '', |
|
609 | - 'geodir_sidebar_right_open_class' => '', |
|
610 | - 'geodir_sidebar_right_open_replace' => '<aside class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
611 | - 'geodir_sidebar_right_close_replace' => '', |
|
612 | - 'geodir_sidebar_left_open_id' => '', |
|
613 | - 'geodir_sidebar_left_open_class' => '', |
|
614 | - 'geodir_sidebar_left_open_replace' => '<aside class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
615 | - 'geodir_sidebar_left_close_replace' => '', |
|
616 | - 'geodir_main_content_open_id' => '', |
|
617 | - 'geodir_main_content_open_class' => '', |
|
618 | - 'geodir_main_content_open_replace' => '<div class="site-content page-wrap">', |
|
619 | - 'geodir_main_content_close_replace' => '</div>', |
|
620 | - 'geodir_top_content_add' => '', |
|
621 | - 'geodir_before_main_content_add' => '', |
|
622 | - 'geodir_full_page_class_filter' => 'section full-width-section', |
|
623 | - 'geodir_before_widget_filter' => '', |
|
624 | - 'geodir_after_widget_filter' => '', |
|
625 | - 'geodir_before_title_filter' => '<div class="widget-title"><h2>', |
|
626 | - 'geodir_after_title_filter' => '</h2></div>', |
|
627 | - 'geodir_menu_li_class_filter' => '', |
|
628 | - 'geodir_sub_menu_ul_class_filter' => '', |
|
629 | - 'geodir_sub_menu_li_class_filter' => '', |
|
630 | - 'geodir_menu_a_class_filter' => '', |
|
631 | - 'geodir_sub_menu_a_class_filter' => '', |
|
632 | - 'geodir_location_switcher_menu_li_class_filter' => '', |
|
633 | - 'geodir_location_switcher_menu_a_class_filter' => '', |
|
634 | - 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
635 | - 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
636 | - 'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'), |
|
637 | - 'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});', |
|
638 | - 'geodir_theme_compat_default_options' => '', |
|
639 | - 'geodir_theme_compat_code' => 'Multi_News' |
|
640 | - ); |
|
641 | - |
|
642 | - update_option('gd_theme_compats', $theme_compat); |
|
643 | - |
|
644 | - gd_set_theme_compat();// set the compat pack if avail |
|
595 | + $theme_compat['Multi_News'] = array( |
|
596 | + 'geodir_wrapper_open_id' => '', |
|
597 | + 'geodir_wrapper_open_class' => 'main-container clearfix', |
|
598 | + 'geodir_wrapper_open_replace' => '', |
|
599 | + 'geodir_wrapper_close_replace' => '', |
|
600 | + 'geodir_wrapper_content_open_id' => '', |
|
601 | + 'geodir_wrapper_content_open_class' => '', |
|
602 | + 'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content "><div class="site-content page-wrap">', |
|
603 | + 'geodir_wrapper_content_close_replace' => '</div></div></div>', |
|
604 | + 'geodir_article_open_id' => '', |
|
605 | + 'geodir_article_open_class' => '', |
|
606 | + 'geodir_article_open_replace' => '', |
|
607 | + 'geodir_article_close_replace' => '', |
|
608 | + 'geodir_sidebar_right_open_id' => '', |
|
609 | + 'geodir_sidebar_right_open_class' => '', |
|
610 | + 'geodir_sidebar_right_open_replace' => '<aside class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
611 | + 'geodir_sidebar_right_close_replace' => '', |
|
612 | + 'geodir_sidebar_left_open_id' => '', |
|
613 | + 'geodir_sidebar_left_open_class' => '', |
|
614 | + 'geodir_sidebar_left_open_replace' => '<aside class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
615 | + 'geodir_sidebar_left_close_replace' => '', |
|
616 | + 'geodir_main_content_open_id' => '', |
|
617 | + 'geodir_main_content_open_class' => '', |
|
618 | + 'geodir_main_content_open_replace' => '<div class="site-content page-wrap">', |
|
619 | + 'geodir_main_content_close_replace' => '</div>', |
|
620 | + 'geodir_top_content_add' => '', |
|
621 | + 'geodir_before_main_content_add' => '', |
|
622 | + 'geodir_full_page_class_filter' => 'section full-width-section', |
|
623 | + 'geodir_before_widget_filter' => '', |
|
624 | + 'geodir_after_widget_filter' => '', |
|
625 | + 'geodir_before_title_filter' => '<div class="widget-title"><h2>', |
|
626 | + 'geodir_after_title_filter' => '</h2></div>', |
|
627 | + 'geodir_menu_li_class_filter' => '', |
|
628 | + 'geodir_sub_menu_ul_class_filter' => '', |
|
629 | + 'geodir_sub_menu_li_class_filter' => '', |
|
630 | + 'geodir_menu_a_class_filter' => '', |
|
631 | + 'geodir_sub_menu_a_class_filter' => '', |
|
632 | + 'geodir_location_switcher_menu_li_class_filter' => '', |
|
633 | + 'geodir_location_switcher_menu_a_class_filter' => '', |
|
634 | + 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
635 | + 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
636 | + 'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'), |
|
637 | + 'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});', |
|
638 | + 'geodir_theme_compat_default_options' => '', |
|
639 | + 'geodir_theme_compat_code' => 'Multi_News' |
|
640 | + ); |
|
641 | + |
|
642 | + update_option('gd_theme_compats', $theme_compat); |
|
643 | + |
|
644 | + gd_set_theme_compat();// set the compat pack if avail |
|
645 | 645 | } |
646 | 646 | |
647 | 647 | |
@@ -653,61 +653,61 @@ discard block |
||
653 | 653 | * @global object $wpdb WordPress Database object. |
654 | 654 | */ |
655 | 655 | function gd_convert_virtual_pages(){ |
656 | - global $wpdb; |
|
657 | - |
|
658 | - // Update the add listing page settings |
|
659 | - $add_listing_page = $wpdb->get_var( |
|
660 | - $wpdb->prepare( |
|
661 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
662 | - array('add-listing') |
|
663 | - ) |
|
664 | - ); |
|
665 | - |
|
666 | - if($add_listing_page){ |
|
667 | - wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') ); |
|
668 | - update_option( 'geodir_add_listing_page', $add_listing_page); |
|
669 | - } |
|
670 | - |
|
671 | - // Update the listing preview page settings |
|
672 | - $listing_preview_page = $wpdb->get_var( |
|
673 | - $wpdb->prepare( |
|
674 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
675 | - array('listing-preview') |
|
676 | - ) |
|
677 | - ); |
|
678 | - |
|
679 | - if($listing_preview_page){ |
|
680 | - wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') ); |
|
681 | - update_option( 'geodir_preview_page', $listing_preview_page); |
|
682 | - } |
|
683 | - |
|
684 | - // Update the listing success page settings |
|
685 | - $listing_success_page = $wpdb->get_var( |
|
686 | - $wpdb->prepare( |
|
687 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
688 | - array('listing-success') |
|
689 | - ) |
|
690 | - ); |
|
691 | - |
|
692 | - if($listing_success_page){ |
|
693 | - wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') ); |
|
694 | - update_option( 'geodir_success_page', $listing_success_page); |
|
695 | - } |
|
696 | - |
|
697 | - // Update the listing success page settings |
|
698 | - $location_page = $wpdb->get_var( |
|
699 | - $wpdb->prepare( |
|
700 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
701 | - array('location') |
|
702 | - ) |
|
703 | - ); |
|
704 | - |
|
705 | - if($location_page){ |
|
706 | - $location_slug = get_option('geodir_location_prefix'); |
|
707 | - if(!$location_slug ){$location_slug = 'location';} |
|
708 | - wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) ); |
|
709 | - update_option( 'geodir_location_page', $location_page); |
|
710 | - } |
|
656 | + global $wpdb; |
|
657 | + |
|
658 | + // Update the add listing page settings |
|
659 | + $add_listing_page = $wpdb->get_var( |
|
660 | + $wpdb->prepare( |
|
661 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
662 | + array('add-listing') |
|
663 | + ) |
|
664 | + ); |
|
665 | + |
|
666 | + if($add_listing_page){ |
|
667 | + wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') ); |
|
668 | + update_option( 'geodir_add_listing_page', $add_listing_page); |
|
669 | + } |
|
670 | + |
|
671 | + // Update the listing preview page settings |
|
672 | + $listing_preview_page = $wpdb->get_var( |
|
673 | + $wpdb->prepare( |
|
674 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
675 | + array('listing-preview') |
|
676 | + ) |
|
677 | + ); |
|
678 | + |
|
679 | + if($listing_preview_page){ |
|
680 | + wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') ); |
|
681 | + update_option( 'geodir_preview_page', $listing_preview_page); |
|
682 | + } |
|
683 | + |
|
684 | + // Update the listing success page settings |
|
685 | + $listing_success_page = $wpdb->get_var( |
|
686 | + $wpdb->prepare( |
|
687 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
688 | + array('listing-success') |
|
689 | + ) |
|
690 | + ); |
|
691 | + |
|
692 | + if($listing_success_page){ |
|
693 | + wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') ); |
|
694 | + update_option( 'geodir_success_page', $listing_success_page); |
|
695 | + } |
|
696 | + |
|
697 | + // Update the listing success page settings |
|
698 | + $location_page = $wpdb->get_var( |
|
699 | + $wpdb->prepare( |
|
700 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
701 | + array('location') |
|
702 | + ) |
|
703 | + ); |
|
704 | + |
|
705 | + if($location_page){ |
|
706 | + $location_slug = get_option('geodir_location_prefix'); |
|
707 | + if(!$location_slug ){$location_slug = 'location';} |
|
708 | + wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) ); |
|
709 | + update_option( 'geodir_location_page', $location_page); |
|
710 | + } |
|
711 | 711 | |
712 | 712 | } |
713 | 713 | |
@@ -721,31 +721,31 @@ discard block |
||
721 | 721 | function gd_fix_cpt_rewrite_slug() |
722 | 722 | { |
723 | 723 | |
724 | - $alt_post_types = array(); |
|
725 | - $post_types = get_option('geodir_post_types'); |
|
724 | + $alt_post_types = array(); |
|
725 | + $post_types = get_option('geodir_post_types'); |
|
726 | 726 | |
727 | 727 | |
728 | - if (is_array($post_types)){ |
|
728 | + if (is_array($post_types)){ |
|
729 | 729 | |
730 | - foreach ($post_types as $post_type => $args) { |
|
730 | + foreach ($post_types as $post_type => $args) { |
|
731 | 731 | |
732 | 732 | |
733 | - if(isset($args['rewrite']['slug'])){ |
|
734 | - $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']); |
|
735 | - } |
|
733 | + if(isset($args['rewrite']['slug'])){ |
|
734 | + $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']); |
|
735 | + } |
|
736 | 736 | |
737 | - $alt_post_types[$post_type] = $args; |
|
737 | + $alt_post_types[$post_type] = $args; |
|
738 | 738 | |
739 | - } |
|
740 | - } |
|
739 | + } |
|
740 | + } |
|
741 | 741 | |
742 | - if(!empty($alt_post_types)) { |
|
743 | - update_option('geodir_post_types',$alt_post_types); |
|
744 | - } |
|
742 | + if(!empty($alt_post_types)) { |
|
743 | + update_option('geodir_post_types',$alt_post_types); |
|
744 | + } |
|
745 | 745 | |
746 | 746 | |
747 | - // flush the rewrite rules |
|
748 | - flush_rewrite_rules(); |
|
747 | + // flush the rewrite rules |
|
748 | + flush_rewrite_rules(); |
|
749 | 749 | } |
750 | 750 | |
751 | 751 | |
@@ -758,18 +758,18 @@ discard block |
||
758 | 758 | */ |
759 | 759 | function gd_fix_address_detail_table_limit() |
760 | 760 | { |
761 | - global $wpdb; |
|
762 | - |
|
763 | - $all_postypes = geodir_get_posttypes(); |
|
764 | - |
|
765 | - if (!empty($all_postypes)) { |
|
766 | - foreach ($all_postypes as $key) { |
|
767 | - // update each GD CTP |
|
768 | - try { |
|
769 | - $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL"); |
|
770 | - } catch(Exception $e) { |
|
771 | - error_log( 'Error: ' . $e->getMessage() ); |
|
772 | - } |
|
773 | - } |
|
774 | - } |
|
761 | + global $wpdb; |
|
762 | + |
|
763 | + $all_postypes = geodir_get_posttypes(); |
|
764 | + |
|
765 | + if (!empty($all_postypes)) { |
|
766 | + foreach ($all_postypes as $key) { |
|
767 | + // update each GD CTP |
|
768 | + try { |
|
769 | + $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL"); |
|
770 | + } catch(Exception $e) { |
|
771 | + error_log( 'Error: ' . $e->getMessage() ); |
|
772 | + } |
|
773 | + } |
|
774 | + } |
|
775 | 775 | } |
@@ -23,8 +23,12 @@ |
||
23 | 23 | |
24 | 24 | $collate = ''; |
25 | 25 | if ($wpdb->has_cap('collation')) { |
26 | - if (!empty($wpdb->charset)) $collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
|
27 | - if (!empty($wpdb->collate)) $collate .= " COLLATE $wpdb->collate"; |
|
26 | + if (!empty($wpdb->charset)) { |
|
27 | + $collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
|
28 | + } |
|
29 | + if (!empty($wpdb->collate)) { |
|
30 | + $collate .= " COLLATE $wpdb->collate"; |
|
31 | + } |
|
28 | 32 | } |
29 | 33 | |
30 | 34 | /** |
@@ -1,31 +1,31 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * GeoDirectory custom db table related functions. |
|
4 | - * |
|
5 | - * @since 1.0.0 |
|
6 | - * @package GeoDirectory |
|
7 | - */ |
|
3 | + * GeoDirectory custom db table related functions. |
|
4 | + * |
|
5 | + * @since 1.0.0 |
|
6 | + * @package GeoDirectory |
|
7 | + */ |
|
8 | 8 | if (!function_exists('geodir_create_tables')) { |
9 | - /** |
|
10 | - * Creates custom db tables for storing GeoDirectory plugin data. |
|
11 | - * |
|
12 | - * @since 1.0.0 |
|
13 | - * @package GeoDirectory |
|
14 | - * @global object $wpdb WordPress Database object. |
|
15 | - * @global string $plugin_prefix GeoDirectory plugin table prefix. |
|
16 | - */ |
|
17 | - function geodir_create_tables() |
|
18 | - { |
|
19 | - |
|
20 | - global $wpdb, $plugin_prefix; |
|
21 | - |
|
22 | - $wpdb->hide_errors(); |
|
23 | - |
|
24 | - $collate = ''; |
|
25 | - if ($wpdb->has_cap('collation')) { |
|
26 | - if (!empty($wpdb->charset)) $collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
|
27 | - if (!empty($wpdb->collate)) $collate .= " COLLATE $wpdb->collate"; |
|
28 | - } |
|
9 | + /** |
|
10 | + * Creates custom db tables for storing GeoDirectory plugin data. |
|
11 | + * |
|
12 | + * @since 1.0.0 |
|
13 | + * @package GeoDirectory |
|
14 | + * @global object $wpdb WordPress Database object. |
|
15 | + * @global string $plugin_prefix GeoDirectory plugin table prefix. |
|
16 | + */ |
|
17 | + function geodir_create_tables() |
|
18 | + { |
|
19 | + |
|
20 | + global $wpdb, $plugin_prefix; |
|
21 | + |
|
22 | + $wpdb->hide_errors(); |
|
23 | + |
|
24 | + $collate = ''; |
|
25 | + if ($wpdb->has_cap('collation')) { |
|
26 | + if (!empty($wpdb->charset)) $collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
|
27 | + if (!empty($wpdb->collate)) $collate .= " COLLATE $wpdb->collate"; |
|
28 | + } |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Include any functions needed for upgrades. |
@@ -36,31 +36,31 @@ discard block |
||
36 | 36 | |
37 | 37 | |
38 | 38 | // rename tables if we need to |
39 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_countries'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_countries'") == 0) { |
|
40 | - $wpdb->query("RENAME TABLE geodir_countries TO " . $wpdb->prefix . "geodir_countries"); |
|
41 | - } |
|
42 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_fields'") == 0) { |
|
43 | - $wpdb->query("RENAME TABLE geodir_custom_fields TO " . $wpdb->prefix . "geodir_custom_fields"); |
|
44 | - } |
|
45 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_icon'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_icon'") == 0) { |
|
46 | - $wpdb->query("RENAME TABLE geodir_post_icon TO " . $wpdb->prefix . "geodir_post_icon"); |
|
47 | - } |
|
48 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_attachments'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_attachments'") == 0) { |
|
49 | - $wpdb->query("RENAME TABLE geodir_attachments TO " . $wpdb->prefix . "geodir_attachments"); |
|
50 | - } |
|
51 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_review'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_review'") == 0) { |
|
52 | - $wpdb->query("RENAME TABLE geodir_post_review TO " . $wpdb->prefix . "geodir_post_review"); |
|
53 | - } |
|
54 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_sort_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_sort_fields'") == 0) { |
|
55 | - $wpdb->query("RENAME TABLE geodir_custom_sort_fields TO " . $wpdb->prefix . "geodir_custom_sort_fields"); |
|
56 | - } |
|
57 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_gd_place_detail'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_gd_place_detail'") == 0) { |
|
58 | - $wpdb->query("RENAME TABLE geodir_gd_place_detail TO " . $wpdb->prefix . "geodir_gd_place_detail"); |
|
59 | - } |
|
60 | - |
|
61 | - |
|
62 | - // Table for storing Countries |
|
63 | - $GEODIR_COUNTRIES_TABLE = "CREATE TABLE " . GEODIR_COUNTRIES_TABLE . " ( |
|
39 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_countries'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_countries'") == 0) { |
|
40 | + $wpdb->query("RENAME TABLE geodir_countries TO " . $wpdb->prefix . "geodir_countries"); |
|
41 | + } |
|
42 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_fields'") == 0) { |
|
43 | + $wpdb->query("RENAME TABLE geodir_custom_fields TO " . $wpdb->prefix . "geodir_custom_fields"); |
|
44 | + } |
|
45 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_icon'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_icon'") == 0) { |
|
46 | + $wpdb->query("RENAME TABLE geodir_post_icon TO " . $wpdb->prefix . "geodir_post_icon"); |
|
47 | + } |
|
48 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_attachments'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_attachments'") == 0) { |
|
49 | + $wpdb->query("RENAME TABLE geodir_attachments TO " . $wpdb->prefix . "geodir_attachments"); |
|
50 | + } |
|
51 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_review'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_review'") == 0) { |
|
52 | + $wpdb->query("RENAME TABLE geodir_post_review TO " . $wpdb->prefix . "geodir_post_review"); |
|
53 | + } |
|
54 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_sort_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_sort_fields'") == 0) { |
|
55 | + $wpdb->query("RENAME TABLE geodir_custom_sort_fields TO " . $wpdb->prefix . "geodir_custom_sort_fields"); |
|
56 | + } |
|
57 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_gd_place_detail'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_gd_place_detail'") == 0) { |
|
58 | + $wpdb->query("RENAME TABLE geodir_gd_place_detail TO " . $wpdb->prefix . "geodir_gd_place_detail"); |
|
59 | + } |
|
60 | + |
|
61 | + |
|
62 | + // Table for storing Countries |
|
63 | + $GEODIR_COUNTRIES_TABLE = "CREATE TABLE " . GEODIR_COUNTRIES_TABLE . " ( |
|
64 | 64 | CountryId smallint AUTO_INCREMENT NOT NULL , |
65 | 65 | Country varchar (50) NOT NULL , |
66 | 66 | FIPS104 varchar (2) NOT NULL , |
@@ -79,21 +79,21 @@ discard block |
||
79 | 79 | Comment varchar (255) NULL , |
80 | 80 | PRIMARY KEY (CountryId)) $collate "; |
81 | 81 | |
82 | - /** |
|
83 | - * Filter the SQL query that creates/updates the country DB table structure. |
|
84 | - * |
|
85 | - * @since 1.0.0 |
|
86 | - * @param string $sql The SQL insert query string. |
|
87 | - */ |
|
88 | - $GEODIR_COUNTRIES_TABLE = apply_filters('geodir_before_country_table_create', $GEODIR_COUNTRIES_TABLE); |
|
89 | - dbDelta($GEODIR_COUNTRIES_TABLE); |
|
82 | + /** |
|
83 | + * Filter the SQL query that creates/updates the country DB table structure. |
|
84 | + * |
|
85 | + * @since 1.0.0 |
|
86 | + * @param string $sql The SQL insert query string. |
|
87 | + */ |
|
88 | + $GEODIR_COUNTRIES_TABLE = apply_filters('geodir_before_country_table_create', $GEODIR_COUNTRIES_TABLE); |
|
89 | + dbDelta($GEODIR_COUNTRIES_TABLE); |
|
90 | 90 | |
91 | 91 | |
92 | - $country_table_empty = $wpdb->get_var("SELECT COUNT(CountryId) FROM " . GEODIR_COUNTRIES_TABLE . ""); |
|
92 | + $country_table_empty = $wpdb->get_var("SELECT COUNT(CountryId) FROM " . GEODIR_COUNTRIES_TABLE . ""); |
|
93 | 93 | |
94 | - if ($country_table_empty == 0) { |
|
94 | + if ($country_table_empty == 0) { |
|
95 | 95 | |
96 | - $countries_insert = "INSERT INTO " . GEODIR_COUNTRIES_TABLE . " (`CountryId`, `Country`, `FIPS104`, `ISO2`, `ISO3`, `ISON`, `Internet`, `Capital`, `MapReference`, `NationalitySingular`, `NationalityPlural`, `Currency`, `CurrencyCode`, `Population`, `Title`, `COMMENT`) VALUES |
|
96 | + $countries_insert = "INSERT INTO " . GEODIR_COUNTRIES_TABLE . " (`CountryId`, `Country`, `FIPS104`, `ISO2`, `ISO3`, `ISON`, `Internet`, `Capital`, `MapReference`, `NationalitySingular`, `NationalityPlural`, `Currency`, `CurrencyCode`, `Population`, `Title`, `COMMENT`) VALUES |
|
97 | 97 | (1, 'Afghanistan', 'AF', 'AF', 'AFG', '4', 'AF', 'Kabul ', 'Asia ', 'Afghan', 'Afghans', 'Afghani ', 'AFA', 26813057, 'Afghanistan', ''), |
98 | 98 | (2, 'Albania', 'AL', 'AL', 'ALB', '8', 'AL', 'Tirana ', 'Europe ', 'Albanian', 'Albanians', 'Lek ', 'ALL', 3510484, 'Albania', ''), |
99 | 99 | (3, 'Algeria', 'AG', 'DZ', 'DZA', '12', 'DZ', 'Algiers ', 'Africa ', 'Algerian', 'Algerians', 'Algerian Dinar ', 'DZD', 31736053, 'Algeria', ''), |
@@ -368,21 +368,21 @@ discard block |
||
368 | 368 | (277, 'Caribbean Netherlands', '--', 'BQ', 'BES', '535', 'BQ', '--', 'Central America and the Caribbean', '--', '--', 'United States dollar', 'USD', 21133, 'Caribbean Netherlands', ''), |
369 | 369 | (278, 'Kosovo', 'XK', 'XK', '--', '--', 'XK', 'Pristina', 'Europe', '--', '--', 'Euro', 'EUR', 1859203, 'Caribbean Netherlands', 'Kosovo')"; |
370 | 370 | |
371 | - /** |
|
372 | - * Filter the SQL query that inserts the country DB table data. |
|
373 | - * |
|
374 | - * @since 1.0.0 |
|
375 | - * @param string $sql The SQL insert query string. |
|
376 | - */ |
|
377 | - $countries_insert = apply_filters('geodir_before_country_data_insert', $countries_insert); |
|
378 | - $wpdb->query($countries_insert); |
|
371 | + /** |
|
372 | + * Filter the SQL query that inserts the country DB table data. |
|
373 | + * |
|
374 | + * @since 1.0.0 |
|
375 | + * @param string $sql The SQL insert query string. |
|
376 | + */ |
|
377 | + $countries_insert = apply_filters('geodir_before_country_data_insert', $countries_insert); |
|
378 | + $wpdb->query($countries_insert); |
|
379 | 379 | |
380 | - } |
|
380 | + } |
|
381 | 381 | |
382 | 382 | |
383 | - // Table for storing location attribute - these are user defined |
|
383 | + // Table for storing location attribute - these are user defined |
|
384 | 384 | |
385 | - $icon_table = "CREATE TABLE " . GEODIR_ICON_TABLE . " ( |
|
385 | + $icon_table = "CREATE TABLE " . GEODIR_ICON_TABLE . " ( |
|
386 | 386 | id int NOT NULL AUTO_INCREMENT, |
387 | 387 | post_id int( 10 ) NOT NULL, |
388 | 388 | post_title varchar(254) NOT NULL, |
@@ -391,19 +391,19 @@ discard block |
||
391 | 391 | PRIMARY KEY (id) |
392 | 392 | ) $collate "; |
393 | 393 | |
394 | - /** |
|
395 | - * Filter the SQL query that creates/updates the post_icon DB table structure. |
|
396 | - * |
|
397 | - * @since 1.0.0 |
|
398 | - * @param string $sql The SQL insert query string. |
|
399 | - */ |
|
400 | - $icon_table = apply_filters('geodir_before_icon_table_create', $icon_table); |
|
394 | + /** |
|
395 | + * Filter the SQL query that creates/updates the post_icon DB table structure. |
|
396 | + * |
|
397 | + * @since 1.0.0 |
|
398 | + * @param string $sql The SQL insert query string. |
|
399 | + */ |
|
400 | + $icon_table = apply_filters('geodir_before_icon_table_create', $icon_table); |
|
401 | 401 | |
402 | - dbDelta($icon_table); |
|
402 | + dbDelta($icon_table); |
|
403 | 403 | |
404 | - // Table for storing post custom fields - these are user defined |
|
404 | + // Table for storing post custom fields - these are user defined |
|
405 | 405 | |
406 | - $post_custom_fields = "CREATE TABLE " . GEODIR_CUSTOM_FIELDS_TABLE . " ( |
|
406 | + $post_custom_fields = "CREATE TABLE " . GEODIR_CUSTOM_FIELDS_TABLE . " ( |
|
407 | 407 | id int(11) NOT NULL AUTO_INCREMENT, |
408 | 408 | post_type varchar(100) NULL, |
409 | 409 | data_type varchar(100) NULL DEFAULT NULL, |
@@ -437,18 +437,18 @@ discard block |
||
437 | 437 | PRIMARY KEY (id) |
438 | 438 | ) $collate"; |
439 | 439 | |
440 | - /** |
|
441 | - * Filter the SQL query that creates/updates the custom_fields DB table structure. |
|
442 | - * |
|
443 | - * @since 1.0.0 |
|
444 | - * @param string $sql The SQL insert query string. |
|
445 | - */ |
|
446 | - $post_custom_fields = apply_filters('geodir_before_custom_field_table_create', $post_custom_fields); |
|
440 | + /** |
|
441 | + * Filter the SQL query that creates/updates the custom_fields DB table structure. |
|
442 | + * |
|
443 | + * @since 1.0.0 |
|
444 | + * @param string $sql The SQL insert query string. |
|
445 | + */ |
|
446 | + $post_custom_fields = apply_filters('geodir_before_custom_field_table_create', $post_custom_fields); |
|
447 | 447 | |
448 | - dbDelta($post_custom_fields); |
|
448 | + dbDelta($post_custom_fields); |
|
449 | 449 | |
450 | - // Table for storing place attribute - these are user defined |
|
451 | - $post_detail = "CREATE TABLE " . $plugin_prefix . "gd_place_detail ( |
|
450 | + // Table for storing place attribute - these are user defined |
|
451 | + $post_detail = "CREATE TABLE " . $plugin_prefix . "gd_place_detail ( |
|
452 | 452 | post_id int(11) NOT NULL, |
453 | 453 | post_title text NULL DEFAULT NULL, |
454 | 454 | post_status varchar(20) NULL DEFAULT NULL, |
@@ -474,22 +474,22 @@ discard block |
||
474 | 474 | PRIMARY KEY (post_id) |
475 | 475 | ) $collate "; |
476 | 476 | |
477 | - /** |
|
478 | - * Filter the SQL query that creates/updates the post_detail DB table structure. |
|
479 | - * |
|
480 | - * @since 1.0.0 |
|
481 | - * @param string $sql The SQL insert query string. |
|
482 | - */ |
|
483 | - $post_detail = apply_filters('geodir_before_post_detail_table_create', $post_detail); |
|
477 | + /** |
|
478 | + * Filter the SQL query that creates/updates the post_detail DB table structure. |
|
479 | + * |
|
480 | + * @since 1.0.0 |
|
481 | + * @param string $sql The SQL insert query string. |
|
482 | + */ |
|
483 | + $post_detail = apply_filters('geodir_before_post_detail_table_create', $post_detail); |
|
484 | 484 | |
485 | - dbDelta($post_detail); |
|
485 | + dbDelta($post_detail); |
|
486 | 486 | |
487 | - // alter post_title |
|
488 | - //$wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_gd_place_detail MODIFY `post_title` text NULL"); |
|
487 | + // alter post_title |
|
488 | + //$wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_gd_place_detail MODIFY `post_title` text NULL"); |
|
489 | 489 | |
490 | - // Table for storing place images - these are user defined |
|
490 | + // Table for storing place images - these are user defined |
|
491 | 491 | |
492 | - $attechment_table = "CREATE TABLE " . GEODIR_ATTACHMENT_TABLE . " ( |
|
492 | + $attechment_table = "CREATE TABLE " . GEODIR_ATTACHMENT_TABLE . " ( |
|
493 | 493 | ID int(11) NOT NULL AUTO_INCREMENT, |
494 | 494 | post_id int(11) NOT NULL, |
495 | 495 | user_id int(11) DEFAULT NULL, |
@@ -505,18 +505,18 @@ discard block |
||
505 | 505 | PRIMARY KEY (ID) |
506 | 506 | ) $collate "; |
507 | 507 | |
508 | - /** |
|
509 | - * Filter the SQL query that creates/updates the attachments DB table structure. |
|
510 | - * |
|
511 | - * @since 1.0.0 |
|
512 | - * @param string $sql The SQL insert query string. |
|
513 | - */ |
|
514 | - $attechment_table = apply_filters('geodir_before_attachment_table_create', $attechment_table); |
|
508 | + /** |
|
509 | + * Filter the SQL query that creates/updates the attachments DB table structure. |
|
510 | + * |
|
511 | + * @since 1.0.0 |
|
512 | + * @param string $sql The SQL insert query string. |
|
513 | + */ |
|
514 | + $attechment_table = apply_filters('geodir_before_attachment_table_create', $attechment_table); |
|
515 | 515 | |
516 | - dbDelta($attechment_table); |
|
516 | + dbDelta($attechment_table); |
|
517 | 517 | |
518 | 518 | |
519 | - $custom_sort_fields_table = "CREATE TABLE " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " ( |
|
519 | + $custom_sort_fields_table = "CREATE TABLE " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " ( |
|
520 | 520 | id int(11) NOT NULL AUTO_INCREMENT, |
521 | 521 | post_type varchar(255) NOT NULL, |
522 | 522 | data_type varchar(255) NOT NULL, |
@@ -534,18 +534,18 @@ discard block |
||
534 | 534 | PRIMARY KEY (id) |
535 | 535 | ) $collate "; |
536 | 536 | |
537 | - /** |
|
538 | - * Filter the SQL query that creates/updates the custom_sort_fields DB table structure. |
|
539 | - * |
|
540 | - * @since 1.0.0 |
|
541 | - * @param string $sql The SQL insert query string. |
|
542 | - */ |
|
543 | - $custom_sort_fields_table = apply_filters('geodir_before_sort_fields_table_create', $custom_sort_fields_table); |
|
537 | + /** |
|
538 | + * Filter the SQL query that creates/updates the custom_sort_fields DB table structure. |
|
539 | + * |
|
540 | + * @since 1.0.0 |
|
541 | + * @param string $sql The SQL insert query string. |
|
542 | + */ |
|
543 | + $custom_sort_fields_table = apply_filters('geodir_before_sort_fields_table_create', $custom_sort_fields_table); |
|
544 | 544 | |
545 | - dbDelta($custom_sort_fields_table); |
|
545 | + dbDelta($custom_sort_fields_table); |
|
546 | 546 | |
547 | 547 | |
548 | - $review_table = "CREATE TABLE " . GEODIR_REVIEW_TABLE . " ( |
|
548 | + $review_table = "CREATE TABLE " . GEODIR_REVIEW_TABLE . " ( |
|
549 | 549 | id int(11) NOT NULL AUTO_INCREMENT, |
550 | 550 | post_id int(11) DEFAULT NULL, |
551 | 551 | post_title varchar( 255 ) NULL DEFAULT NULL, |
@@ -569,191 +569,191 @@ discard block |
||
569 | 569 | PRIMARY KEY (id) |
570 | 570 | ) $collate "; |
571 | 571 | |
572 | - /** |
|
573 | - * Filter the SQL query that creates the review DB table structure. |
|
574 | - * |
|
575 | - * @since 1.0.0 |
|
576 | - * @param string $sql The SQL insert query string. |
|
577 | - */ |
|
578 | - $review_table = apply_filters('geodir_before_review_table_create', $review_table); |
|
579 | - dbDelta($review_table); |
|
572 | + /** |
|
573 | + * Filter the SQL query that creates the review DB table structure. |
|
574 | + * |
|
575 | + * @since 1.0.0 |
|
576 | + * @param string $sql The SQL insert query string. |
|
577 | + */ |
|
578 | + $review_table = apply_filters('geodir_before_review_table_create', $review_table); |
|
579 | + dbDelta($review_table); |
|
580 | 580 | |
581 | 581 | |
582 | 582 | |
583 | - // Alter terms table |
|
584 | - $term_icon_column = $wpdb->get_var("SHOW COLUMNS FROM $wpdb->terms where field='term_icon'"); |
|
585 | - if (!$term_icon_column) { |
|
586 | - $wpdb->query("ALTER TABLE $wpdb->terms ADD `term_icon` TEXT NULL DEFAULT NULL"); |
|
587 | - } |
|
583 | + // Alter terms table |
|
584 | + $term_icon_column = $wpdb->get_var("SHOW COLUMNS FROM $wpdb->terms where field='term_icon'"); |
|
585 | + if (!$term_icon_column) { |
|
586 | + $wpdb->query("ALTER TABLE $wpdb->terms ADD `term_icon` TEXT NULL DEFAULT NULL"); |
|
587 | + } |
|
588 | 588 | |
589 | - //require_once(geodir_plugin_path() . '/upgrade.php'); |
|
589 | + //require_once(geodir_plugin_path() . '/upgrade.php'); |
|
590 | 590 | |
591 | 591 | |
592 | - } |
|
592 | + } |
|
593 | 593 | } // END MAIN FUNCTION geodir_tables_install |
594 | 594 | |
595 | 595 | if (!function_exists('geodir_create_default_fields')) { |
596 | - /** |
|
597 | - * Inserts default custom fields table data into database. |
|
598 | - * |
|
599 | - * @since 1.0.0 |
|
600 | - * @package GeoDirectory |
|
601 | - */ |
|
602 | - function geodir_create_default_fields() |
|
603 | - { |
|
604 | - |
|
605 | - $fields = array(); |
|
606 | - |
|
607 | - $fields[] = array('listing_type' => 'gd_place', |
|
608 | - 'data_type' => 'VARCHAR', |
|
609 | - 'field_type' => 'taxonomy', |
|
610 | - 'admin_title' => __('Category', 'geodirectory'), |
|
611 | - 'admin_desc' => __('SELECT listing category FROM here. SELECT at least one CATEGORY', 'geodirectory'), |
|
612 | - 'site_title' => __('Category', 'geodirectory'), |
|
613 | - 'htmlvar_name' => 'gd_placecategory', |
|
614 | - 'default_value' => '', |
|
615 | - 'is_default' => '1', |
|
616 | - 'is_admin' => '1', |
|
617 | - 'is_required' => '1', |
|
618 | - 'clabels' => __('Category', 'geodirectory')); |
|
619 | - |
|
620 | - $fields[] = array('listing_type' => 'gd_place', |
|
621 | - 'data_type' => 'VARCHAR', |
|
622 | - 'field_type' => 'address', |
|
623 | - 'admin_title' => __('Address', 'geodirectory'), |
|
624 | - 'admin_desc' => ADDRESS_MSG, |
|
625 | - 'site_title' => __('Address', 'geodirectory'), |
|
626 | - 'htmlvar_name' => 'post', |
|
627 | - 'default_value' => '', |
|
628 | - 'option_values' => '', |
|
629 | - 'is_default' => '1', |
|
630 | - 'is_admin' => '1', |
|
631 | - 'is_required' => '1', |
|
632 | - 'required_msg' => __('Address fields are required', 'geodirectory'), |
|
633 | - 'clabels' => __('Address', 'geodirectory'), |
|
634 | - 'extra' => array('show_city' => 1, 'city_lable' => __('City', 'geodirectory'), |
|
635 | - 'show_region' => 1, 'region_lable' => __('Region', 'geodirectory'), |
|
636 | - 'show_country' => 1, 'country_lable' => __('Country', 'geodirectory'), |
|
637 | - 'show_zip' => 1, 'zip_lable' => __('Zip/Post Code', 'geodirectory'), |
|
638 | - 'show_map' => 1, 'map_lable' => __('Set Address On Map', 'geodirectory'), |
|
639 | - 'show_mapview' => 1, 'mapview_lable' => __('Select Map View', 'geodirectory'), |
|
640 | - 'show_mapzoom' => 1, 'mapzoom_lable' => 'hidden', |
|
641 | - 'show_latlng' => 1)); |
|
642 | - |
|
643 | - $fields[] = array('listing_type' => 'gd_place', |
|
644 | - 'data_type' => 'VARCHAR', |
|
645 | - 'field_type' => 'text', |
|
646 | - 'admin_title' => __('Time', 'geodirectory'), |
|
647 | - 'admin_desc' => __('Enter Business or Listing Timing Information.<br/>eg. : 10.00 am to 6 pm every day', 'geodirectory'), |
|
648 | - 'site_title' => __('Time', 'geodirectory'), |
|
649 | - 'htmlvar_name' => 'timing', |
|
650 | - 'default_value' => '', |
|
651 | - 'option_values' => '', |
|
652 | - 'is_default' => '1', |
|
653 | - 'is_admin' => '1', |
|
654 | - 'clabels' => __('Time', 'geodirectory')); |
|
655 | - |
|
656 | - $fields[] = array('listing_type' => 'gd_place', |
|
657 | - 'data_type' => 'VARCHAR', |
|
658 | - 'field_type' => 'phone', |
|
659 | - 'admin_title' => __('Phone', 'geodirectory'), |
|
660 | - 'admin_desc' => __('You can enter phone number,cell phone number etc.', 'geodirectory'), |
|
661 | - 'site_title' => __('Phone', 'geodirectory'), |
|
662 | - 'htmlvar_name' => 'contact', |
|
663 | - 'default_value' => '', |
|
664 | - 'option_values' => '', |
|
665 | - 'is_default' => '1', |
|
666 | - 'is_admin' => '1', |
|
667 | - 'clabels' => __('Phone', 'geodirectory')); |
|
668 | - |
|
669 | - $fields[] = array('listing_type' => 'gd_place', |
|
670 | - 'data_type' => 'VARCHAR', |
|
671 | - 'field_type' => 'email', |
|
672 | - 'admin_title' => __('Email', 'geodirectory'), |
|
673 | - 'admin_desc' => __('You can enter your business or listing email.', 'geodirectory'), |
|
674 | - 'site_title' => __('Email', 'geodirectory'), |
|
675 | - 'htmlvar_name' => 'email', |
|
676 | - 'default_value' => '', |
|
677 | - 'option_values' => '', |
|
678 | - 'is_default' => '1', |
|
679 | - 'is_admin' => '1', |
|
680 | - 'clabels' => __('Email', 'geodirectory')); |
|
681 | - |
|
682 | - $fields[] = array('listing_type' => 'gd_place', |
|
683 | - 'data_type' => 'VARCHAR', |
|
684 | - 'field_type' => 'url', |
|
685 | - 'admin_title' => __('Website', 'geodirectory'), |
|
686 | - 'admin_desc' => __('You can enter your business or listing website.', 'geodirectory'), |
|
687 | - 'site_title' => __('Website', 'geodirectory'), |
|
688 | - 'htmlvar_name' => 'website', |
|
689 | - 'default_value' => '', |
|
690 | - 'option_values' => '', |
|
691 | - 'is_default' => '1', |
|
692 | - 'is_admin' => '1', |
|
693 | - 'clabels' => __('Website', 'geodirectory')); |
|
694 | - |
|
695 | - $fields[] = array('listing_type' => 'gd_place', |
|
696 | - 'data_type' => 'VARCHAR', |
|
697 | - 'field_type' => 'url', |
|
698 | - 'admin_title' => __('Twitter', 'geodirectory'), |
|
699 | - 'admin_desc' => __('You can enter your business or listing twitter url.', 'geodirectory'), |
|
700 | - 'site_title' => __('Twitter', 'geodirectory'), |
|
701 | - 'htmlvar_name' => 'twitter', |
|
702 | - 'default_value' => '', |
|
703 | - 'option_values' => '', |
|
704 | - 'is_default' => '1', |
|
705 | - 'is_admin' => '1', |
|
706 | - 'clabels' => __('Twitter', 'geodirectory')); |
|
707 | - |
|
708 | - $fields[] = array('listing_type' => 'gd_place', |
|
709 | - 'data_type' => 'VARCHAR', |
|
710 | - 'field_type' => 'url', |
|
711 | - 'admin_title' => __('Facebook', 'geodirectory'), |
|
712 | - 'admin_desc' => __('You can enter your business or listing facebook url.', 'geodirectory'), |
|
713 | - 'site_title' => __('Facebook', 'geodirectory'), |
|
714 | - 'htmlvar_name' => 'facebook', |
|
715 | - 'default_value' => '', |
|
716 | - 'option_values' => '', |
|
717 | - 'is_default' => '1', |
|
718 | - 'is_admin' => '1', |
|
719 | - 'clabels' => __('Facebook', 'geodirectory')); |
|
720 | - |
|
721 | - $fields[] = array('listing_type' => 'gd_place', |
|
722 | - 'data_type' => 'TEXT', |
|
723 | - 'field_type' => 'textarea', |
|
724 | - 'admin_title' => __('Video', 'geodirectory'), |
|
725 | - 'admin_desc' => __('Add video code here, YouTube etc.', 'geodirectory'), |
|
726 | - 'site_title' => __('Video', 'geodirectory'), |
|
727 | - 'htmlvar_name' => 'video', |
|
728 | - 'default_value' => '', |
|
729 | - 'option_values' => '', |
|
730 | - 'is_default' => '0', |
|
731 | - 'is_admin' => '1', |
|
732 | - 'clabels' => __('Video', 'geodirectory')); |
|
733 | - |
|
734 | - $fields[] = array('listing_type' => 'gd_place', |
|
735 | - 'data_type' => 'TEXT', |
|
736 | - 'field_type' => 'textarea', |
|
737 | - 'admin_title' => __('Special Offers', 'geodirectory'), |
|
738 | - 'admin_desc' => __('Note: List out any special offers (optional)', 'geodirectory'), |
|
739 | - 'site_title' => __('Special Offers', 'geodirectory'), |
|
740 | - 'htmlvar_name' => 'special_offers', |
|
741 | - 'default_value' => '', |
|
742 | - 'option_values' => '', |
|
743 | - 'is_default' => '0', |
|
744 | - 'is_admin' => '1', |
|
745 | - 'clabels' => __('Special Offers', 'geodirectory')); |
|
746 | - |
|
747 | - /** |
|
748 | - * Filter the array of default custom fields DB table data. |
|
749 | - * |
|
750 | - * @since 1.0.0 |
|
751 | - * @param string $fields The default custom fields as an array. |
|
752 | - */ |
|
753 | - $fields = apply_filters('geodir_before_default_custom_fields_saved', $fields); |
|
754 | - foreach ($fields as $field_index => $field) { |
|
755 | - geodir_custom_field_save($field); |
|
756 | - |
|
757 | - } |
|
758 | - } |
|
596 | + /** |
|
597 | + * Inserts default custom fields table data into database. |
|
598 | + * |
|
599 | + * @since 1.0.0 |
|
600 | + * @package GeoDirectory |
|
601 | + */ |
|
602 | + function geodir_create_default_fields() |
|
603 | + { |
|
604 | + |
|
605 | + $fields = array(); |
|
606 | + |
|
607 | + $fields[] = array('listing_type' => 'gd_place', |
|
608 | + 'data_type' => 'VARCHAR', |
|
609 | + 'field_type' => 'taxonomy', |
|
610 | + 'admin_title' => __('Category', 'geodirectory'), |
|
611 | + 'admin_desc' => __('SELECT listing category FROM here. SELECT at least one CATEGORY', 'geodirectory'), |
|
612 | + 'site_title' => __('Category', 'geodirectory'), |
|
613 | + 'htmlvar_name' => 'gd_placecategory', |
|
614 | + 'default_value' => '', |
|
615 | + 'is_default' => '1', |
|
616 | + 'is_admin' => '1', |
|
617 | + 'is_required' => '1', |
|
618 | + 'clabels' => __('Category', 'geodirectory')); |
|
619 | + |
|
620 | + $fields[] = array('listing_type' => 'gd_place', |
|
621 | + 'data_type' => 'VARCHAR', |
|
622 | + 'field_type' => 'address', |
|
623 | + 'admin_title' => __('Address', 'geodirectory'), |
|
624 | + 'admin_desc' => ADDRESS_MSG, |
|
625 | + 'site_title' => __('Address', 'geodirectory'), |
|
626 | + 'htmlvar_name' => 'post', |
|
627 | + 'default_value' => '', |
|
628 | + 'option_values' => '', |
|
629 | + 'is_default' => '1', |
|
630 | + 'is_admin' => '1', |
|
631 | + 'is_required' => '1', |
|
632 | + 'required_msg' => __('Address fields are required', 'geodirectory'), |
|
633 | + 'clabels' => __('Address', 'geodirectory'), |
|
634 | + 'extra' => array('show_city' => 1, 'city_lable' => __('City', 'geodirectory'), |
|
635 | + 'show_region' => 1, 'region_lable' => __('Region', 'geodirectory'), |
|
636 | + 'show_country' => 1, 'country_lable' => __('Country', 'geodirectory'), |
|
637 | + 'show_zip' => 1, 'zip_lable' => __('Zip/Post Code', 'geodirectory'), |
|
638 | + 'show_map' => 1, 'map_lable' => __('Set Address On Map', 'geodirectory'), |
|
639 | + 'show_mapview' => 1, 'mapview_lable' => __('Select Map View', 'geodirectory'), |
|
640 | + 'show_mapzoom' => 1, 'mapzoom_lable' => 'hidden', |
|
641 | + 'show_latlng' => 1)); |
|
642 | + |
|
643 | + $fields[] = array('listing_type' => 'gd_place', |
|
644 | + 'data_type' => 'VARCHAR', |
|
645 | + 'field_type' => 'text', |
|
646 | + 'admin_title' => __('Time', 'geodirectory'), |
|
647 | + 'admin_desc' => __('Enter Business or Listing Timing Information.<br/>eg. : 10.00 am to 6 pm every day', 'geodirectory'), |
|
648 | + 'site_title' => __('Time', 'geodirectory'), |
|
649 | + 'htmlvar_name' => 'timing', |
|
650 | + 'default_value' => '', |
|
651 | + 'option_values' => '', |
|
652 | + 'is_default' => '1', |
|
653 | + 'is_admin' => '1', |
|
654 | + 'clabels' => __('Time', 'geodirectory')); |
|
655 | + |
|
656 | + $fields[] = array('listing_type' => 'gd_place', |
|
657 | + 'data_type' => 'VARCHAR', |
|
658 | + 'field_type' => 'phone', |
|
659 | + 'admin_title' => __('Phone', 'geodirectory'), |
|
660 | + 'admin_desc' => __('You can enter phone number,cell phone number etc.', 'geodirectory'), |
|
661 | + 'site_title' => __('Phone', 'geodirectory'), |
|
662 | + 'htmlvar_name' => 'contact', |
|
663 | + 'default_value' => '', |
|
664 | + 'option_values' => '', |
|
665 | + 'is_default' => '1', |
|
666 | + 'is_admin' => '1', |
|
667 | + 'clabels' => __('Phone', 'geodirectory')); |
|
668 | + |
|
669 | + $fields[] = array('listing_type' => 'gd_place', |
|
670 | + 'data_type' => 'VARCHAR', |
|
671 | + 'field_type' => 'email', |
|
672 | + 'admin_title' => __('Email', 'geodirectory'), |
|
673 | + 'admin_desc' => __('You can enter your business or listing email.', 'geodirectory'), |
|
674 | + 'site_title' => __('Email', 'geodirectory'), |
|
675 | + 'htmlvar_name' => 'email', |
|
676 | + 'default_value' => '', |
|
677 | + 'option_values' => '', |
|
678 | + 'is_default' => '1', |
|
679 | + 'is_admin' => '1', |
|
680 | + 'clabels' => __('Email', 'geodirectory')); |
|
681 | + |
|
682 | + $fields[] = array('listing_type' => 'gd_place', |
|
683 | + 'data_type' => 'VARCHAR', |
|
684 | + 'field_type' => 'url', |
|
685 | + 'admin_title' => __('Website', 'geodirectory'), |
|
686 | + 'admin_desc' => __('You can enter your business or listing website.', 'geodirectory'), |
|
687 | + 'site_title' => __('Website', 'geodirectory'), |
|
688 | + 'htmlvar_name' => 'website', |
|
689 | + 'default_value' => '', |
|
690 | + 'option_values' => '', |
|
691 | + 'is_default' => '1', |
|
692 | + 'is_admin' => '1', |
|
693 | + 'clabels' => __('Website', 'geodirectory')); |
|
694 | + |
|
695 | + $fields[] = array('listing_type' => 'gd_place', |
|
696 | + 'data_type' => 'VARCHAR', |
|
697 | + 'field_type' => 'url', |
|
698 | + 'admin_title' => __('Twitter', 'geodirectory'), |
|
699 | + 'admin_desc' => __('You can enter your business or listing twitter url.', 'geodirectory'), |
|
700 | + 'site_title' => __('Twitter', 'geodirectory'), |
|
701 | + 'htmlvar_name' => 'twitter', |
|
702 | + 'default_value' => '', |
|
703 | + 'option_values' => '', |
|
704 | + 'is_default' => '1', |
|
705 | + 'is_admin' => '1', |
|
706 | + 'clabels' => __('Twitter', 'geodirectory')); |
|
707 | + |
|
708 | + $fields[] = array('listing_type' => 'gd_place', |
|
709 | + 'data_type' => 'VARCHAR', |
|
710 | + 'field_type' => 'url', |
|
711 | + 'admin_title' => __('Facebook', 'geodirectory'), |
|
712 | + 'admin_desc' => __('You can enter your business or listing facebook url.', 'geodirectory'), |
|
713 | + 'site_title' => __('Facebook', 'geodirectory'), |
|
714 | + 'htmlvar_name' => 'facebook', |
|
715 | + 'default_value' => '', |
|
716 | + 'option_values' => '', |
|
717 | + 'is_default' => '1', |
|
718 | + 'is_admin' => '1', |
|
719 | + 'clabels' => __('Facebook', 'geodirectory')); |
|
720 | + |
|
721 | + $fields[] = array('listing_type' => 'gd_place', |
|
722 | + 'data_type' => 'TEXT', |
|
723 | + 'field_type' => 'textarea', |
|
724 | + 'admin_title' => __('Video', 'geodirectory'), |
|
725 | + 'admin_desc' => __('Add video code here, YouTube etc.', 'geodirectory'), |
|
726 | + 'site_title' => __('Video', 'geodirectory'), |
|
727 | + 'htmlvar_name' => 'video', |
|
728 | + 'default_value' => '', |
|
729 | + 'option_values' => '', |
|
730 | + 'is_default' => '0', |
|
731 | + 'is_admin' => '1', |
|
732 | + 'clabels' => __('Video', 'geodirectory')); |
|
733 | + |
|
734 | + $fields[] = array('listing_type' => 'gd_place', |
|
735 | + 'data_type' => 'TEXT', |
|
736 | + 'field_type' => 'textarea', |
|
737 | + 'admin_title' => __('Special Offers', 'geodirectory'), |
|
738 | + 'admin_desc' => __('Note: List out any special offers (optional)', 'geodirectory'), |
|
739 | + 'site_title' => __('Special Offers', 'geodirectory'), |
|
740 | + 'htmlvar_name' => 'special_offers', |
|
741 | + 'default_value' => '', |
|
742 | + 'option_values' => '', |
|
743 | + 'is_default' => '0', |
|
744 | + 'is_admin' => '1', |
|
745 | + 'clabels' => __('Special Offers', 'geodirectory')); |
|
746 | + |
|
747 | + /** |
|
748 | + * Filter the array of default custom fields DB table data. |
|
749 | + * |
|
750 | + * @since 1.0.0 |
|
751 | + * @param string $fields The default custom fields as an array. |
|
752 | + */ |
|
753 | + $fields = apply_filters('geodir_before_default_custom_fields_saved', $fields); |
|
754 | + foreach ($fields as $field_index => $field) { |
|
755 | + geodir_custom_field_save($field); |
|
756 | + |
|
757 | + } |
|
758 | + } |
|
759 | 759 | } |
760 | 760 | \ No newline at end of file |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * GeoDirectory Installation related functions. |
|
4 | - * |
|
5 | - * Plugin install script which adds default pages, taxonomies, and database tables. |
|
6 | - * |
|
7 | - * @since 1.0.0 |
|
8 | - * @package GeoDirectory |
|
9 | - */ |
|
3 | + * GeoDirectory Installation related functions. |
|
4 | + * |
|
5 | + * Plugin install script which adds default pages, taxonomies, and database tables. |
|
6 | + * |
|
7 | + * @since 1.0.0 |
|
8 | + * @package GeoDirectory |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * Include custom database table related functions. |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | function geodir_activation() |
25 | 25 | { |
26 | 26 | |
27 | - geodir_install(); |
|
28 | - add_action('wp_loaded', 'geodir_flush_activation'); |
|
27 | + geodir_install(); |
|
28 | + add_action('wp_loaded', 'geodir_flush_activation'); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | */ |
37 | 37 | function geodir_flush_activation() |
38 | 38 | { |
39 | - // Remove rewrite rules and then recreate rewrite rules. |
|
40 | - // flush late so everything is loaded |
|
41 | - flush_rewrite_rules(); |
|
39 | + // Remove rewrite rules and then recreate rewrite rules. |
|
40 | + // flush late so everything is loaded |
|
41 | + flush_rewrite_rules(); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -50,44 +50,44 @@ discard block |
||
50 | 50 | */ |
51 | 51 | function geodir_install() |
52 | 52 | { |
53 | - global $geodir_settings; |
|
54 | - |
|
55 | - /** |
|
56 | - * Called before the GD installation scripts have run. |
|
57 | - * |
|
58 | - * @since 1.0.0 |
|
59 | - * @see 'geodir_installation_end' |
|
60 | - */ |
|
61 | - do_action('geodir_installation_start'); |
|
62 | - |
|
63 | - // Do install |
|
64 | - if (!get_option('geodir_default_data_installed')) { |
|
65 | - geodir_create_tables(); // in admin db install.php |
|
66 | - geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php |
|
67 | - geodir_create_default_fields(); |
|
68 | - //geodir_default_taxonomies(); |
|
69 | - geodir_set_default_options(); |
|
70 | - geodir_create_pages(); |
|
71 | - geodir_set_default_widgets(); |
|
72 | - gd_install_theme_compat(); |
|
73 | - |
|
74 | - update_option('geodir_default_data_installed', 1); |
|
75 | - |
|
76 | - } |
|
77 | - |
|
78 | - if (!get_option('geodir_default_data_installed_1.2.8')) { |
|
79 | - //geodir_create_tables(); // in admin db install.php |
|
80 | - update_option('geodir_default_data_installed_1.2.8', 1); |
|
81 | - } |
|
82 | - |
|
83 | - geodir_installation_end(); |
|
84 | - /** |
|
85 | - * Called after the GD installation scripts have run. |
|
86 | - * |
|
87 | - * @since 1.0.0 |
|
88 | - * @see 'geodir_installation_start' |
|
89 | - */ |
|
90 | - do_action('geodir_installation_end'); |
|
53 | + global $geodir_settings; |
|
54 | + |
|
55 | + /** |
|
56 | + * Called before the GD installation scripts have run. |
|
57 | + * |
|
58 | + * @since 1.0.0 |
|
59 | + * @see 'geodir_installation_end' |
|
60 | + */ |
|
61 | + do_action('geodir_installation_start'); |
|
62 | + |
|
63 | + // Do install |
|
64 | + if (!get_option('geodir_default_data_installed')) { |
|
65 | + geodir_create_tables(); // in admin db install.php |
|
66 | + geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php |
|
67 | + geodir_create_default_fields(); |
|
68 | + //geodir_default_taxonomies(); |
|
69 | + geodir_set_default_options(); |
|
70 | + geodir_create_pages(); |
|
71 | + geodir_set_default_widgets(); |
|
72 | + gd_install_theme_compat(); |
|
73 | + |
|
74 | + update_option('geodir_default_data_installed', 1); |
|
75 | + |
|
76 | + } |
|
77 | + |
|
78 | + if (!get_option('geodir_default_data_installed_1.2.8')) { |
|
79 | + //geodir_create_tables(); // in admin db install.php |
|
80 | + update_option('geodir_default_data_installed_1.2.8', 1); |
|
81 | + } |
|
82 | + |
|
83 | + geodir_installation_end(); |
|
84 | + /** |
|
85 | + * Called after the GD installation scripts have run. |
|
86 | + * |
|
87 | + * @since 1.0.0 |
|
88 | + * @see 'geodir_installation_start' |
|
89 | + */ |
|
90 | + do_action('geodir_installation_end'); |
|
91 | 91 | |
92 | 92 | |
93 | 93 | } |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | function geodir_create_pages() |
105 | 105 | { |
106 | 106 | |
107 | - //geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' ); |
|
108 | - geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
|
109 | - geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), ''); |
|
110 | - geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), ''); |
|
111 | - geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), ''); |
|
112 | - geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), ''); |
|
107 | + //geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' ); |
|
108 | + geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
|
109 | + geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), ''); |
|
110 | + geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), ''); |
|
111 | + geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), ''); |
|
112 | + geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), ''); |
|
113 | 113 | |
114 | - //New since 1.5.3 |
|
115 | - geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
|
116 | - geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
|
114 | + //New since 1.5.3 |
|
115 | + geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
|
116 | + geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
|
117 | 117 | |
118 | 118 | |
119 | 119 | } |
@@ -129,11 +129,11 @@ discard block |
||
129 | 129 | */ |
130 | 130 | function geodir_installation_end() |
131 | 131 | { |
132 | - //update_option( "geodir_db_version", GEODIRECTORY_VERSION ); |
|
132 | + //update_option( "geodir_db_version", GEODIRECTORY_VERSION ); |
|
133 | 133 | |
134 | - update_option("geodir_installed", 1); |
|
135 | - update_option("geodir_installation_redirect", 1); |
|
136 | - update_option('skip_install_geodir_pages', 0); |
|
134 | + update_option("geodir_installed", 1); |
|
135 | + update_option("geodir_installation_redirect", 1); |
|
136 | + update_option('skip_install_geodir_pages', 0); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -147,45 +147,45 @@ discard block |
||
147 | 147 | */ |
148 | 148 | function geodir_set_default_options() |
149 | 149 | { |
150 | - global $geodir_settings; |
|
151 | - /** |
|
152 | - * Contains settings array for general tab. |
|
153 | - * |
|
154 | - * @since 1.0.0 |
|
155 | - * @package GeoDirectory |
|
156 | - */ |
|
157 | - include_once("option-pages/general_settings_array.php"); |
|
158 | - /** |
|
159 | - * Contains settings array for design tab. |
|
160 | - * |
|
161 | - * @since 1.0.0 |
|
162 | - * @package GeoDirectory |
|
163 | - */ |
|
164 | - include_once("option-pages/design_settings_array.php"); |
|
165 | - /** |
|
166 | - * Contains settings array for notifications tab. |
|
167 | - * |
|
168 | - * @since 1.0.0 |
|
169 | - * @package GeoDirectory |
|
170 | - */ |
|
171 | - include_once("option-pages/notifications_settings_array.php"); |
|
172 | - /** |
|
173 | - * Contains settings array for permalink tab. |
|
174 | - * |
|
175 | - * @since 1.0.0 |
|
176 | - * @package GeoDirectory |
|
177 | - */ |
|
178 | - include_once("option-pages/permalink_settings_array.php"); |
|
179 | - /** |
|
180 | - * Contains settings array for title / meta tab. |
|
181 | - * |
|
182 | - * @since 1.5.4 |
|
183 | - * @package GeoDirectory |
|
184 | - */ |
|
185 | - include_once("option-pages/title_meta_settings_array.php"); |
|
186 | - foreach ($geodir_settings as $value) { |
|
187 | - geodir_update_options($value, true); |
|
188 | - } |
|
150 | + global $geodir_settings; |
|
151 | + /** |
|
152 | + * Contains settings array for general tab. |
|
153 | + * |
|
154 | + * @since 1.0.0 |
|
155 | + * @package GeoDirectory |
|
156 | + */ |
|
157 | + include_once("option-pages/general_settings_array.php"); |
|
158 | + /** |
|
159 | + * Contains settings array for design tab. |
|
160 | + * |
|
161 | + * @since 1.0.0 |
|
162 | + * @package GeoDirectory |
|
163 | + */ |
|
164 | + include_once("option-pages/design_settings_array.php"); |
|
165 | + /** |
|
166 | + * Contains settings array for notifications tab. |
|
167 | + * |
|
168 | + * @since 1.0.0 |
|
169 | + * @package GeoDirectory |
|
170 | + */ |
|
171 | + include_once("option-pages/notifications_settings_array.php"); |
|
172 | + /** |
|
173 | + * Contains settings array for permalink tab. |
|
174 | + * |
|
175 | + * @since 1.0.0 |
|
176 | + * @package GeoDirectory |
|
177 | + */ |
|
178 | + include_once("option-pages/permalink_settings_array.php"); |
|
179 | + /** |
|
180 | + * Contains settings array for title / meta tab. |
|
181 | + * |
|
182 | + * @since 1.5.4 |
|
183 | + * @package GeoDirectory |
|
184 | + */ |
|
185 | + include_once("option-pages/title_meta_settings_array.php"); |
|
186 | + foreach ($geodir_settings as $value) { |
|
187 | + geodir_update_options($value, true); |
|
188 | + } |
|
189 | 189 | |
190 | 190 | } |
191 | 191 | |
@@ -199,103 +199,103 @@ discard block |
||
199 | 199 | function geodir_set_default_widgets() |
200 | 200 | { |
201 | 201 | |
202 | - $widget_option_list = array(); |
|
203 | - $widgetinfo = array(); |
|
204 | - $sidebarvalue_array = array(); |
|
205 | - $sidebars_widgets = array(); |
|
202 | + $widget_option_list = array(); |
|
203 | + $widgetinfo = array(); |
|
204 | + $sidebarvalue_array = array(); |
|
205 | + $sidebars_widgets = array(); |
|
206 | 206 | |
207 | - /*===========================*/ |
|
208 | - /* Widgets ON HOME PAGE */ |
|
209 | - /*===========================*/ |
|
207 | + /*===========================*/ |
|
208 | + /* Widgets ON HOME PAGE */ |
|
209 | + /*===========================*/ |
|
210 | 210 | |
211 | - $widget_option_list['geodir_home_top'] = |
|
212 | - array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')), |
|
213 | - 'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'), |
|
214 | - 'geodir_advance_search' => array()); |
|
211 | + $widget_option_list['geodir_home_top'] = |
|
212 | + array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')), |
|
213 | + 'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'), |
|
214 | + 'geodir_advance_search' => array()); |
|
215 | 215 | |
216 | - $widget_option_list['geodir_home_content'] = |
|
217 | - array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1')); |
|
216 | + $widget_option_list['geodir_home_content'] = |
|
217 | + array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1')); |
|
218 | 218 | |
219 | - $widget_option_list['geodir_home_right'] = |
|
220 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
221 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
219 | + $widget_option_list['geodir_home_right'] = |
|
220 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
221 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
222 | 222 | |
223 | - /*===========================*/ |
|
224 | - /* Widgets ON LISTING PAGE */ |
|
225 | - /*===========================*/ |
|
223 | + /*===========================*/ |
|
224 | + /* Widgets ON LISTING PAGE */ |
|
225 | + /*===========================*/ |
|
226 | 226 | |
227 | - $widget_option_list['geodir_listing_top'] = |
|
228 | - array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')), |
|
229 | - 'geodir_advance_search' => array()); |
|
227 | + $widget_option_list['geodir_listing_top'] = |
|
228 | + array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')), |
|
229 | + 'geodir_advance_search' => array()); |
|
230 | 230 | |
231 | - $widget_option_list['geodir_listing_right_sidebar'] = |
|
232 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
233 | - 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1), |
|
234 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
231 | + $widget_option_list['geodir_listing_right_sidebar'] = |
|
232 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
233 | + 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1), |
|
234 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
235 | 235 | |
236 | 236 | |
237 | - /*===========================*/ |
|
238 | - /* Widgets ON SEARCH PAGE */ |
|
239 | - /*===========================*/ |
|
237 | + /*===========================*/ |
|
238 | + /* Widgets ON SEARCH PAGE */ |
|
239 | + /*===========================*/ |
|
240 | 240 | |
241 | - $widget_option_list['geodir_search_top'] = |
|
242 | - array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')), |
|
243 | - 'geodir_advance_search' => array()); |
|
241 | + $widget_option_list['geodir_search_top'] = |
|
242 | + array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')), |
|
243 | + 'geodir_advance_search' => array()); |
|
244 | 244 | |
245 | - $widget_option_list['geodir_search_right_sidebar'] = |
|
246 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
247 | - 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1), |
|
248 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
245 | + $widget_option_list['geodir_search_right_sidebar'] = |
|
246 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
247 | + 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1), |
|
248 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
249 | 249 | |
250 | - /*===========================*/ |
|
251 | - /* Widgets ON DETAIL/SINGLE PAGE */ |
|
252 | - /*===========================*/ |
|
250 | + /*===========================*/ |
|
251 | + /* Widgets ON DETAIL/SINGLE PAGE */ |
|
252 | + /*===========================*/ |
|
253 | 253 | |
254 | - $widget_option_list['geodir_detail_sidebar'] = |
|
255 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
256 | - 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1), |
|
257 | - 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
254 | + $widget_option_list['geodir_detail_sidebar'] = |
|
255 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')), |
|
256 | + 'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1), |
|
257 | + 'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1')); |
|
258 | 258 | |
259 | 259 | |
260 | - /*===========================*/ |
|
261 | - /* Widgets ON AUTHOR PAGE */ |
|
262 | - /*===========================*/ |
|
260 | + /*===========================*/ |
|
261 | + /* Widgets ON AUTHOR PAGE */ |
|
262 | + /*===========================*/ |
|
263 | 263 | |
264 | 264 | |
265 | - $widget_option_list['geodir_author_right_sidebar'] = |
|
266 | - array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory'))); |
|
265 | + $widget_option_list['geodir_author_right_sidebar'] = |
|
266 | + array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory'))); |
|
267 | 267 | |
268 | 268 | |
269 | - $sidebars_widgets = get_option('sidebars_widgets'); |
|
269 | + $sidebars_widgets = get_option('sidebars_widgets'); |
|
270 | 270 | |
271 | - foreach ($widget_option_list as $key => $widget_options) { |
|
271 | + foreach ($widget_option_list as $key => $widget_options) { |
|
272 | 272 | |
273 | - foreach ($widget_options as $key2 => $widget_options_obj) { |
|
274 | - $widgetid = 'widget_' . $key2; |
|
273 | + foreach ($widget_options as $key2 => $widget_options_obj) { |
|
274 | + $widgetid = 'widget_' . $key2; |
|
275 | 275 | |
276 | - $widgetinfo[$widgetid][] = $widget_options_obj; |
|
276 | + $widgetinfo[$widgetid][] = $widget_options_obj; |
|
277 | 277 | |
278 | - $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid])); |
|
278 | + $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid])); |
|
279 | 279 | |
280 | - $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj; |
|
280 | + $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj; |
|
281 | 281 | |
282 | - } |
|
282 | + } |
|
283 | 283 | |
284 | - if (!empty($sidebarvalue_array[$key])) { |
|
284 | + if (!empty($sidebarvalue_array[$key])) { |
|
285 | 285 | |
286 | - $sidebars_widgets = get_option('sidebars_widgets'); |
|
287 | - $sidebars_widgets[$key] = $sidebarvalue_array[$key]; |
|
288 | - update_option('sidebars_widgets', $sidebars_widgets); |
|
286 | + $sidebars_widgets = get_option('sidebars_widgets'); |
|
287 | + $sidebars_widgets[$key] = $sidebarvalue_array[$key]; |
|
288 | + update_option('sidebars_widgets', $sidebars_widgets); |
|
289 | 289 | |
290 | - foreach ($widget_update as $key => $value) { |
|
290 | + foreach ($widget_update as $key => $value) { |
|
291 | 291 | |
292 | - update_option($key, $value); |
|
292 | + update_option($key, $value); |
|
293 | 293 | |
294 | - } |
|
294 | + } |
|
295 | 295 | |
296 | - } |
|
296 | + } |
|
297 | 297 | |
298 | - } |
|
298 | + } |
|
299 | 299 | |
300 | 300 | |
301 | 301 | } |
@@ -17,26 +17,26 @@ discard block |
||
17 | 17 | function gd_compat_php_genesis() |
18 | 18 | { |
19 | 19 | // REPLACE GENESIS BREADCRUMBS WITH GD BREADCRUMBS |
20 | - remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
21 | - remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
22 | - remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
23 | - remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
24 | - remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
25 | - remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
20 | + remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
21 | + remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
22 | + remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
23 | + remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
24 | + remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
25 | + remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
26 | 26 | |
27 | 27 | |
28 | - // make top section wide |
|
29 | - remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
30 | - remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
31 | - remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10); |
|
32 | - remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10); |
|
33 | - remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10); |
|
34 | - remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10); |
|
28 | + // make top section wide |
|
29 | + remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
30 | + remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
31 | + remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10); |
|
32 | + remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10); |
|
33 | + remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10); |
|
34 | + remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10); |
|
35 | 35 | |
36 | - // REMOVE PAGE TITLES |
|
37 | - remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
38 | - remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
39 | - remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
36 | + // REMOVE PAGE TITLES |
|
37 | + remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
38 | + remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
39 | + remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
40 | 40 | |
41 | 41 | |
42 | 42 | } |
@@ -53,25 +53,25 @@ discard block |
||
53 | 53 | function gd_genesis_compat_left_sidebars() |
54 | 54 | { |
55 | 55 | |
56 | - if (is_page_geodir_home()) { |
|
57 | - remove_action('geodir_home_sidebar_left', 'geodir_action_home_sidebar_left', 10); |
|
58 | - add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11); |
|
59 | - } elseif (geodir_is_page('location')) { |
|
60 | - remove_action('geodir_location_sidebar_left', 'geodir_action_home_sidebar_left', 10); |
|
61 | - add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11); |
|
62 | - } elseif (geodir_is_page('listing')) { |
|
63 | - remove_action('geodir_listings_sidebar_left', 'geodir_action_listings_sidebar_left', 10); |
|
64 | - add_action('geodir_wrapper_close', 'geodir_action_listings_sidebar_left', 11); |
|
65 | - } elseif (geodir_is_page('detail') && get_option('geodir_detail_sidebar_left_section')) { |
|
66 | - //remove_action( 'geodir_detail_sidebar', 'geodir_action_details_sidebar', 10 ); |
|
67 | - //add_action( 'geodir_wrapper_close', 'geodir_action_details_sidebar', 11 ); |
|
68 | - } elseif (geodir_is_page('search')) { |
|
69 | - remove_action('geodir_search_sidebar_left', 'geodir_action_search_sidebar_left', 10); |
|
70 | - add_action('geodir_wrapper_close', 'geodir_action_search_sidebar_left', 11); |
|
71 | - } elseif (geodir_is_page('author')) { |
|
72 | - remove_action('geodir_author_sidebar_left', 'geodir_action_author_sidebar_left', 10); |
|
73 | - add_action('geodir_wrapper_close', 'geodir_action_author_sidebar_left', 11); |
|
74 | - } |
|
56 | + if (is_page_geodir_home()) { |
|
57 | + remove_action('geodir_home_sidebar_left', 'geodir_action_home_sidebar_left', 10); |
|
58 | + add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11); |
|
59 | + } elseif (geodir_is_page('location')) { |
|
60 | + remove_action('geodir_location_sidebar_left', 'geodir_action_home_sidebar_left', 10); |
|
61 | + add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11); |
|
62 | + } elseif (geodir_is_page('listing')) { |
|
63 | + remove_action('geodir_listings_sidebar_left', 'geodir_action_listings_sidebar_left', 10); |
|
64 | + add_action('geodir_wrapper_close', 'geodir_action_listings_sidebar_left', 11); |
|
65 | + } elseif (geodir_is_page('detail') && get_option('geodir_detail_sidebar_left_section')) { |
|
66 | + //remove_action( 'geodir_detail_sidebar', 'geodir_action_details_sidebar', 10 ); |
|
67 | + //add_action( 'geodir_wrapper_close', 'geodir_action_details_sidebar', 11 ); |
|
68 | + } elseif (geodir_is_page('search')) { |
|
69 | + remove_action('geodir_search_sidebar_left', 'geodir_action_search_sidebar_left', 10); |
|
70 | + add_action('geodir_wrapper_close', 'geodir_action_search_sidebar_left', 11); |
|
71 | + } elseif (geodir_is_page('author')) { |
|
72 | + remove_action('geodir_author_sidebar_left', 'geodir_action_author_sidebar_left', 10); |
|
73 | + add_action('geodir_wrapper_close', 'geodir_action_author_sidebar_left', 11); |
|
74 | + } |
|
75 | 75 | |
76 | 76 | |
77 | 77 | } |
@@ -88,65 +88,65 @@ discard block |
||
88 | 88 | */ |
89 | 89 | function geodir_set_body_scs($classes) |
90 | 90 | { |
91 | - $remove_class = false; |
|
92 | - $new_class = ''; |
|
93 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
94 | - $remove_class = true; |
|
95 | - if (get_option('geodir_show_home_left_section')) { |
|
96 | - $new_class .= 'sidebar-'; |
|
97 | - } |
|
98 | - if (get_option('geodir_show_home_contant_section')) { |
|
99 | - $new_class .= 'content'; |
|
100 | - } |
|
101 | - if (get_option('geodir_show_home_right_section')) { |
|
102 | - $new_class .= '-sidebar'; |
|
103 | - } |
|
104 | - } elseif (geodir_is_page('listing')) { |
|
105 | - $remove_class = true; |
|
106 | - if (get_option('geodir_show_listing_left_section')) { |
|
107 | - $new_class .= 'sidebar-'; |
|
108 | - } |
|
109 | - $new_class .= 'content'; |
|
110 | - if (get_option('geodir_show_listing_right_section')) { |
|
111 | - $new_class .= '-sidebar'; |
|
112 | - } |
|
113 | - } elseif (geodir_is_page('detail')) { |
|
114 | - $remove_class = true; |
|
115 | - if (get_option('geodir_detail_sidebar_left_section')) { |
|
116 | - $new_class .= 'sidebar-content gd-details-sidebar-left'; |
|
117 | - } else { |
|
118 | - $new_class .= 'content-sidebar'; |
|
119 | - } |
|
120 | - } elseif (geodir_is_page('search')) { |
|
121 | - $remove_class = true; |
|
122 | - if (get_option('geodir_show_search_left_section')) { |
|
123 | - $new_class .= 'sidebar-'; |
|
124 | - } |
|
125 | - $new_class .= 'content'; |
|
126 | - if (get_option('geodir_show_search_right_section')) { |
|
127 | - $new_class .= '-sidebar'; |
|
128 | - } |
|
129 | - } elseif (geodir_is_page('author')) { |
|
130 | - $remove_class = true; |
|
131 | - if (get_option('geodir_show_author_left_section')) { |
|
132 | - $new_class .= 'sidebar-'; |
|
133 | - } |
|
134 | - $new_class .= 'content'; |
|
135 | - if (get_option('geodir_show_author_right_section')) { |
|
136 | - $new_class .= '-sidebar'; |
|
137 | - } |
|
138 | - } elseif (geodir_is_page('add-listing')) { |
|
139 | - $remove_class = true; |
|
140 | - $new_class .= 'content-sidebar'; |
|
141 | - } |
|
142 | - |
|
143 | - if ($remove_class) { |
|
144 | - $classes = array_diff($classes, array('content-sidebar', 'sidebar-content', 'content-sidebar-sidebar', 'sidebar-sidebar-content', 'sidebar-content-sidebar', 'full-width-content')); |
|
145 | - //str_replace(array('content-sidebar','sidebar-content','content-sidebar-sidebar','sidebar-sidebar-content','sidebar-content-sidebar','full-width-content'),array('','','','','',''),$classes); |
|
146 | - $classes[] = $new_class; |
|
147 | - } |
|
148 | - |
|
149 | - return $classes; |
|
91 | + $remove_class = false; |
|
92 | + $new_class = ''; |
|
93 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
94 | + $remove_class = true; |
|
95 | + if (get_option('geodir_show_home_left_section')) { |
|
96 | + $new_class .= 'sidebar-'; |
|
97 | + } |
|
98 | + if (get_option('geodir_show_home_contant_section')) { |
|
99 | + $new_class .= 'content'; |
|
100 | + } |
|
101 | + if (get_option('geodir_show_home_right_section')) { |
|
102 | + $new_class .= '-sidebar'; |
|
103 | + } |
|
104 | + } elseif (geodir_is_page('listing')) { |
|
105 | + $remove_class = true; |
|
106 | + if (get_option('geodir_show_listing_left_section')) { |
|
107 | + $new_class .= 'sidebar-'; |
|
108 | + } |
|
109 | + $new_class .= 'content'; |
|
110 | + if (get_option('geodir_show_listing_right_section')) { |
|
111 | + $new_class .= '-sidebar'; |
|
112 | + } |
|
113 | + } elseif (geodir_is_page('detail')) { |
|
114 | + $remove_class = true; |
|
115 | + if (get_option('geodir_detail_sidebar_left_section')) { |
|
116 | + $new_class .= 'sidebar-content gd-details-sidebar-left'; |
|
117 | + } else { |
|
118 | + $new_class .= 'content-sidebar'; |
|
119 | + } |
|
120 | + } elseif (geodir_is_page('search')) { |
|
121 | + $remove_class = true; |
|
122 | + if (get_option('geodir_show_search_left_section')) { |
|
123 | + $new_class .= 'sidebar-'; |
|
124 | + } |
|
125 | + $new_class .= 'content'; |
|
126 | + if (get_option('geodir_show_search_right_section')) { |
|
127 | + $new_class .= '-sidebar'; |
|
128 | + } |
|
129 | + } elseif (geodir_is_page('author')) { |
|
130 | + $remove_class = true; |
|
131 | + if (get_option('geodir_show_author_left_section')) { |
|
132 | + $new_class .= 'sidebar-'; |
|
133 | + } |
|
134 | + $new_class .= 'content'; |
|
135 | + if (get_option('geodir_show_author_right_section')) { |
|
136 | + $new_class .= '-sidebar'; |
|
137 | + } |
|
138 | + } elseif (geodir_is_page('add-listing')) { |
|
139 | + $remove_class = true; |
|
140 | + $new_class .= 'content-sidebar'; |
|
141 | + } |
|
142 | + |
|
143 | + if ($remove_class) { |
|
144 | + $classes = array_diff($classes, array('content-sidebar', 'sidebar-content', 'content-sidebar-sidebar', 'sidebar-sidebar-content', 'sidebar-content-sidebar', 'full-width-content')); |
|
145 | + //str_replace(array('content-sidebar','sidebar-content','content-sidebar-sidebar','sidebar-sidebar-content','sidebar-content-sidebar','full-width-content'),array('','','','','',''),$classes); |
|
146 | + $classes[] = $new_class; |
|
147 | + } |
|
148 | + |
|
149 | + return $classes; |
|
150 | 150 | |
151 | 151 | } |
152 | 152 | |
@@ -160,17 +160,17 @@ discard block |
||
160 | 160 | function gd_genesis_compat_add_top_section_back() |
161 | 161 | { |
162 | 162 | |
163 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
164 | - geodir_action_geodir_sidebar_home_top(); |
|
165 | - } elseif (geodir_is_page('listing')) { |
|
166 | - geodir_action_geodir_sidebar_listings_top(); |
|
167 | - } elseif (geodir_is_page('detail')) { |
|
168 | - geodir_action_geodir_sidebar_detail_top(); |
|
169 | - } elseif (geodir_is_page('search')) { |
|
170 | - geodir_action_geodir_sidebar_search_top(); |
|
171 | - } elseif (geodir_is_page('author')) { |
|
172 | - geodir_action_geodir_sidebar_author_top(); |
|
173 | - } |
|
163 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
164 | + geodir_action_geodir_sidebar_home_top(); |
|
165 | + } elseif (geodir_is_page('listing')) { |
|
166 | + geodir_action_geodir_sidebar_listings_top(); |
|
167 | + } elseif (geodir_is_page('detail')) { |
|
168 | + geodir_action_geodir_sidebar_detail_top(); |
|
169 | + } elseif (geodir_is_page('search')) { |
|
170 | + geodir_action_geodir_sidebar_search_top(); |
|
171 | + } elseif (geodir_is_page('author')) { |
|
172 | + geodir_action_geodir_sidebar_author_top(); |
|
173 | + } |
|
174 | 174 | |
175 | 175 | |
176 | 176 | } |
@@ -183,12 +183,12 @@ discard block |
||
183 | 183 | */ |
184 | 184 | function geodir_replace_breadcrumb() |
185 | 185 | { |
186 | - if (is_front_page() && get_option('geodir_set_as_home') && !geodir_is_page('login')) { |
|
187 | - } else { |
|
188 | - echo '<div class="geodir-breadcrumb-bar"><div class="wrap">'; |
|
189 | - geodir_breadcrumb(); |
|
190 | - echo '</div></div>'; |
|
191 | - } |
|
186 | + if (is_front_page() && get_option('geodir_set_as_home') && !geodir_is_page('login')) { |
|
187 | + } else { |
|
188 | + echo '<div class="geodir-breadcrumb-bar"><div class="wrap">'; |
|
189 | + geodir_breadcrumb(); |
|
190 | + echo '</div></div>'; |
|
191 | + } |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | // Force Full Width on signup page |
@@ -201,9 +201,9 @@ discard block |
||
201 | 201 | */ |
202 | 202 | function geodir_genesis_meta() |
203 | 203 | { |
204 | - if (geodir_is_page('login')) { |
|
205 | - add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content'); |
|
206 | - } |
|
204 | + if (geodir_is_page('login')) { |
|
205 | + add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content'); |
|
206 | + } |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | add_action('geodir_add_listing_page_title', 'geodir_add_listing_page_title_genesis_before', 8); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | function geodir_add_listing_page_title_genesis_before() |
217 | 217 | { |
218 | 218 | |
219 | - echo "<div class='entry' >"; |
|
219 | + echo "<div class='entry' >"; |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | function geodir_add_listing_form_genesis_after() |
231 | 231 | { |
232 | 232 | |
233 | - echo "</div>"; |
|
233 | + echo "</div>"; |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | |
@@ -249,38 +249,38 @@ discard block |
||
249 | 249 | { |
250 | 250 | |
251 | 251 | |
252 | - $title = ''; |
|
253 | - $subtitle = ''; |
|
254 | - |
|
255 | - if (geodir_is_page('listing')) { |
|
256 | - echo '<div class="wrap gd-title-wrap">'; |
|
257 | - geodir_action_listings_title(); |
|
258 | - echo '</div>'; |
|
259 | - } |
|
260 | - |
|
261 | - if (geodir_is_page('add-listing')) { |
|
262 | - echo '<div class="wrap gd-title-wrap">'; |
|
263 | - geodir_action_add_listing_page_title(); |
|
264 | - echo '</div>'; |
|
265 | - } |
|
266 | - |
|
267 | - if (geodir_is_page('author')) { |
|
268 | - echo '<div class="wrap gd-title-wrap">'; |
|
269 | - geodir_action_author_page_title(); |
|
270 | - echo '</div>'; |
|
271 | - } |
|
272 | - |
|
273 | - if (geodir_is_page('detail') || geodir_is_page('preview')) { |
|
274 | - echo '<div class="wrap gd-title-wrap">'; |
|
275 | - echo get_the_title(); |
|
276 | - echo '</div>'; |
|
277 | - } |
|
278 | - |
|
279 | - if (geodir_is_page('search')) { |
|
280 | - echo '<div class="wrap gd-title-wrap">'; |
|
281 | - geodir_action_search_page_title(); |
|
282 | - echo '</div>'; |
|
283 | - } |
|
252 | + $title = ''; |
|
253 | + $subtitle = ''; |
|
254 | + |
|
255 | + if (geodir_is_page('listing')) { |
|
256 | + echo '<div class="wrap gd-title-wrap">'; |
|
257 | + geodir_action_listings_title(); |
|
258 | + echo '</div>'; |
|
259 | + } |
|
260 | + |
|
261 | + if (geodir_is_page('add-listing')) { |
|
262 | + echo '<div class="wrap gd-title-wrap">'; |
|
263 | + geodir_action_add_listing_page_title(); |
|
264 | + echo '</div>'; |
|
265 | + } |
|
266 | + |
|
267 | + if (geodir_is_page('author')) { |
|
268 | + echo '<div class="wrap gd-title-wrap">'; |
|
269 | + geodir_action_author_page_title(); |
|
270 | + echo '</div>'; |
|
271 | + } |
|
272 | + |
|
273 | + if (geodir_is_page('detail') || geodir_is_page('preview')) { |
|
274 | + echo '<div class="wrap gd-title-wrap">'; |
|
275 | + echo get_the_title(); |
|
276 | + echo '</div>'; |
|
277 | + } |
|
278 | + |
|
279 | + if (geodir_is_page('search')) { |
|
280 | + echo '<div class="wrap gd-title-wrap">'; |
|
281 | + geodir_action_search_page_title(); |
|
282 | + echo '</div>'; |
|
283 | + } |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | |
@@ -293,8 +293,8 @@ discard block |
||
293 | 293 | */ |
294 | 294 | function gd_genesis_listing_page_title_bar() |
295 | 295 | { |
296 | - geodir_action_listings_title(); |
|
297 | - //geodir_action_listings_description(); |
|
296 | + geodir_action_listings_title(); |
|
297 | + //geodir_action_listings_description(); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | |
@@ -307,19 +307,19 @@ discard block |
||
307 | 307 | */ |
308 | 308 | function gd_compat_php_genesis_geo_1280_fix() |
309 | 309 | { |
310 | - if (function_exists('geo1280_search_bar')) { |
|
311 | - remove_action('genesis_after_header', 'geo1280_search_bar', 20); |
|
312 | - add_action('genesis_after_header', 'geo1280_search_bar_fix', 4); |
|
310 | + if (function_exists('geo1280_search_bar')) { |
|
311 | + remove_action('genesis_after_header', 'geo1280_search_bar', 20); |
|
312 | + add_action('genesis_after_header', 'geo1280_search_bar_fix', 4); |
|
313 | 313 | |
314 | - // |
|
314 | + // |
|
315 | 315 | |
316 | - remove_action('genesis_after_header', 'geodir_replace_breadcrumb', 20); |
|
317 | - remove_action('genesis_before_content_sidebar_wrap', 'geodir_replace_breadcrumb', 20); |
|
318 | - add_action('geodir_wrapper_open', 'geodir_replace_breadcrumb', 105); |
|
316 | + remove_action('genesis_after_header', 'geodir_replace_breadcrumb', 20); |
|
317 | + remove_action('genesis_before_content_sidebar_wrap', 'geodir_replace_breadcrumb', 20); |
|
318 | + add_action('geodir_wrapper_open', 'geodir_replace_breadcrumb', 105); |
|
319 | 319 | |
320 | - remove_action('genesis_before_content_sidebar_wrap', 'geo1280_page_title', 10); |
|
321 | - add_action('geodir_wrapper_open', 'geo1280_page_title', 101); |
|
322 | - } |
|
320 | + remove_action('genesis_before_content_sidebar_wrap', 'geo1280_page_title', 10); |
|
321 | + add_action('geodir_wrapper_open', 'geo1280_page_title', 101); |
|
322 | + } |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
@@ -331,11 +331,11 @@ discard block |
||
331 | 331 | function geo1280_search_bar_fix() |
332 | 332 | { |
333 | 333 | |
334 | - echo '<div class="geo1280-placeholder"></div>'; |
|
335 | - if (is_active_sidebar('search-bar')) { |
|
336 | - genesis_widget_area('search-bar', array( |
|
337 | - 'before' => '<div class="search-bar widget-area"><div class="wrap">', |
|
338 | - 'after' => '</div></div>', |
|
339 | - )); |
|
340 | - } |
|
334 | + echo '<div class="geo1280-placeholder"></div>'; |
|
335 | + if (is_active_sidebar('search-bar')) { |
|
336 | + genesis_widget_area('search-bar', array( |
|
337 | + 'before' => '<div class="search-bar widget-area"><div class="wrap">', |
|
338 | + 'after' => '</div></div>', |
|
339 | + )); |
|
340 | + } |
|
341 | 341 | } |
@@ -16,36 +16,36 @@ discard block |
||
16 | 16 | */ |
17 | 17 | function multi_news_action_calls() |
18 | 18 | { |
19 | - // REMOVE BREADCRUMB |
|
20 | - remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
21 | - remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
22 | - remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
23 | - remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
24 | - remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
25 | - remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
26 | - |
|
27 | - //ADD BREADCRUMS |
|
28 | - add_action('geodir_detail_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
29 | - add_action('geodir_listings_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
30 | - add_action('geodir_author_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
31 | - add_action('geodir_search_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
32 | - //add_action('geodir_home_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
33 | - add_action('geodir_location_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
34 | - |
|
35 | - |
|
36 | - // fix breadcrums |
|
37 | - add_filter('breadcrumbs_plus_items', 'gd_breadcrumbs_plus_items', 1); |
|
38 | - |
|
39 | - // REMOVE PAGE TITLES |
|
40 | - remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
41 | - // remove_action( 'geodir_add_listing_page_title', 'geodir_action_add_listing_page_title',10); |
|
42 | - remove_action('geodir_details_main_content', 'geodir_action_page_title', 20); |
|
43 | - remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
44 | - remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
45 | - |
|
46 | - |
|
47 | - add_action('geodir_wrapper_content_open', 'gd_mn_extra_wrap', 30, 1); |
|
48 | - add_action('geodir_wrapper_content_close', 'gd_mn_extra_wrap_end', 3, 1); |
|
19 | + // REMOVE BREADCRUMB |
|
20 | + remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
21 | + remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
22 | + remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
23 | + remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
24 | + remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
25 | + remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
26 | + |
|
27 | + //ADD BREADCRUMS |
|
28 | + add_action('geodir_detail_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
29 | + add_action('geodir_listings_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
30 | + add_action('geodir_author_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
31 | + add_action('geodir_search_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
32 | + //add_action('geodir_home_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
33 | + add_action('geodir_location_before_main_content', 'gd_mn_replace_breadcrums', 20); |
|
34 | + |
|
35 | + |
|
36 | + // fix breadcrums |
|
37 | + add_filter('breadcrumbs_plus_items', 'gd_breadcrumbs_plus_items', 1); |
|
38 | + |
|
39 | + // REMOVE PAGE TITLES |
|
40 | + remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
41 | + // remove_action( 'geodir_add_listing_page_title', 'geodir_action_add_listing_page_title',10); |
|
42 | + remove_action('geodir_details_main_content', 'geodir_action_page_title', 20); |
|
43 | + remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
44 | + remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
45 | + |
|
46 | + |
|
47 | + add_action('geodir_wrapper_content_open', 'gd_mn_extra_wrap', 30, 1); |
|
48 | + add_action('geodir_wrapper_content_close', 'gd_mn_extra_wrap_end', 3, 1); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | */ |
58 | 58 | function gd_mn_extra_wrap($page) |
59 | 59 | { |
60 | - if ($page == 'add-listing-page') { |
|
61 | - echo '<div class="site-content page-wrap">'; |
|
62 | - } elseif ($page == 'signup-page') { |
|
63 | - echo '</div><div class="section full-width-section" style="float: left;width:100%;">'; |
|
64 | - } |
|
60 | + if ($page == 'add-listing-page') { |
|
61 | + echo '<div class="site-content page-wrap">'; |
|
62 | + } elseif ($page == 'signup-page') { |
|
63 | + echo '</div><div class="section full-width-section" style="float: left;width:100%;">'; |
|
64 | + } |
|
65 | 65 | |
66 | 66 | } |
67 | 67 | |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | */ |
76 | 76 | function gd_mn_extra_wrap_end($page) |
77 | 77 | { |
78 | - if ($page == 'add-listing-page') { |
|
79 | - echo '</div>'; |
|
80 | - } |
|
78 | + if ($page == 'add-listing-page') { |
|
79 | + echo '</div>'; |
|
80 | + } |
|
81 | 81 | |
82 | 82 | } |
83 | 83 | |
@@ -91,13 +91,13 @@ discard block |
||
91 | 91 | function gd_mn_replace_breadcrums() |
92 | 92 | { |
93 | 93 | |
94 | - if (mom_option('breadcrumb') != 0) { ?> |
|
94 | + if (mom_option('breadcrumb') != 0) { ?> |
|
95 | 95 | <?php if (mom_option('cats_bread')) { |
96 | - $cclass = ''; |
|
97 | - if (mom_option('cat_slider') == false) { |
|
98 | - $cclass = 'post-crumbs '; |
|
99 | - } |
|
100 | - ?> |
|
96 | + $cclass = ''; |
|
97 | + if (mom_option('cat_slider') == false) { |
|
98 | + $cclass = 'post-crumbs '; |
|
99 | + } |
|
100 | + ?> |
|
101 | 101 | <div class="<?php echo $cclass; ?>entry-crumbs" xmlns:v="http://rdf.data-vocabulary.org/#"> |
102 | 102 | |
103 | 103 | <?php mom_breadcrumb(); ?> |
@@ -119,14 +119,14 @@ discard block |
||
119 | 119 | */ |
120 | 120 | function gd_get_breadcrum_links() |
121 | 121 | { |
122 | - ob_start(); |
|
123 | - geodir_breadcrumb(); |
|
124 | - $crums = ob_get_contents(); |
|
125 | - ob_get_clean(); |
|
126 | - $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>"; |
|
127 | - if (preg_match_all("/$regexp/siU", $crums, $matches)) { |
|
128 | - return $matches[0]; |
|
129 | - } else return ''; |
|
122 | + ob_start(); |
|
123 | + geodir_breadcrumb(); |
|
124 | + $crums = ob_get_contents(); |
|
125 | + ob_get_clean(); |
|
126 | + $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>"; |
|
127 | + if (preg_match_all("/$regexp/siU", $crums, $matches)) { |
|
128 | + return $matches[0]; |
|
129 | + } else return ''; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | |
@@ -140,30 +140,30 @@ discard block |
||
140 | 140 | */ |
141 | 141 | function gd_breadcrumbs_plus_items($items) |
142 | 142 | { //print_r($items);exit; |
143 | - $bits = array(); |
|
144 | - $pieces = gd_get_breadcrum_links(); |
|
145 | - //unset($pieces[0]); |
|
146 | - $bits = $pieces; |
|
143 | + $bits = array(); |
|
144 | + $pieces = gd_get_breadcrum_links(); |
|
145 | + //unset($pieces[0]); |
|
146 | + $bits = $pieces; |
|
147 | 147 | |
148 | - $title = $items['last']; |
|
149 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
148 | + $title = $items['last']; |
|
149 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
150 | 150 | |
151 | - } elseif (geodir_is_page('listing')) { |
|
151 | + } elseif (geodir_is_page('listing')) { |
|
152 | 152 | |
153 | - } elseif (geodir_is_page('detail')) { |
|
154 | - ob_start(); |
|
155 | - geodir_action_page_title(); |
|
156 | - $title = ob_get_contents(); |
|
157 | - ob_end_clean(); |
|
158 | - } elseif (geodir_is_page('search')) { |
|
159 | - } elseif (geodir_is_page('author')) { |
|
160 | - } |
|
153 | + } elseif (geodir_is_page('detail')) { |
|
154 | + ob_start(); |
|
155 | + geodir_action_page_title(); |
|
156 | + $title = ob_get_contents(); |
|
157 | + ob_end_clean(); |
|
158 | + } elseif (geodir_is_page('search')) { |
|
159 | + } elseif (geodir_is_page('author')) { |
|
160 | + } |
|
161 | 161 | |
162 | - $title = strip_tags($title); |
|
163 | - $items = gd_breadcrumbs_plus_items_add($items, $bits, $title); |
|
162 | + $title = strip_tags($title); |
|
163 | + $items = gd_breadcrumbs_plus_items_add($items, $bits, $title); |
|
164 | 164 | |
165 | 165 | |
166 | - return $items; |
|
166 | + return $items; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | |
@@ -179,21 +179,21 @@ discard block |
||
179 | 179 | */ |
180 | 180 | function gd_breadcrumbs_plus_items_add($items, $bits, $last) |
181 | 181 | { |
182 | - //$pieces = explode("</div>", $items[0]); |
|
183 | - if (is_array($bits)) { |
|
184 | - $items = array(); |
|
185 | - $pieces = ''; |
|
186 | - foreach ($bits as $bit) { |
|
187 | - $pieces .= $bit; |
|
188 | - } |
|
189 | - $items[0] = '<div class="vbreadcrumb" typeof="v:Breadcrumb">' . $pieces . "</div>"; |
|
190 | - if (isset($last) && $last) { |
|
191 | - $items['last'] = $last; |
|
192 | - } |
|
193 | - } |
|
194 | - |
|
195 | - //print_r($items); |
|
196 | - return $items; |
|
182 | + //$pieces = explode("</div>", $items[0]); |
|
183 | + if (is_array($bits)) { |
|
184 | + $items = array(); |
|
185 | + $pieces = ''; |
|
186 | + foreach ($bits as $bit) { |
|
187 | + $pieces .= $bit; |
|
188 | + } |
|
189 | + $items[0] = '<div class="vbreadcrumb" typeof="v:Breadcrumb">' . $pieces . "</div>"; |
|
190 | + if (isset($last) && $last) { |
|
191 | + $items['last'] = $last; |
|
192 | + } |
|
193 | + } |
|
194 | + |
|
195 | + //print_r($items); |
|
196 | + return $items; |
|
197 | 197 | |
198 | 198 | } |
199 | 199 |
@@ -126,8 +126,10 @@ |
||
126 | 126 | $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>"; |
127 | 127 | if (preg_match_all("/$regexp/siU", $crums, $matches)) { |
128 | 128 | return $matches[0]; |
129 | - } else return ''; |
|
130 | -} |
|
129 | + } else { |
|
130 | + return ''; |
|
131 | + } |
|
132 | + } |
|
131 | 133 | |
132 | 134 | |
133 | 135 | /** |
@@ -39,8 +39,9 @@ discard block |
||
39 | 39 | if (get_option('geodir_show_listing_nav')) { |
40 | 40 | |
41 | 41 | $menu_class = ''; |
42 | - if (geodir_is_page('listing')) |
|
43 | - $menu_class = 'current-menu-item'; |
|
42 | + if (geodir_is_page('listing')) { |
|
43 | + $menu_class = 'current-menu-item'; |
|
44 | + } |
|
44 | 45 | |
45 | 46 | |
46 | 47 | //SHOW LISTING OF POST TYPE IN MAIN NAVIGATION |
@@ -52,8 +53,9 @@ discard block |
||
52 | 53 | if (in_array($post_type, $show_post_type_main_nav)) { |
53 | 54 | if (get_post_type_archive_link($post_type)) { |
54 | 55 | $menu_class = ''; |
55 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) |
|
56 | - $menu_class = 'current-menu-item'; |
|
56 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) { |
|
57 | + $menu_class = 'current-menu-item'; |
|
58 | + } |
|
57 | 59 | /** |
58 | 60 | * Filter the menu li class. |
59 | 61 | * |
@@ -130,8 +132,9 @@ discard block |
||
130 | 132 | if (get_post_type_archive_link($post_type)) { |
131 | 133 | |
132 | 134 | $menu_class = ''; |
133 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) |
|
134 | - $menu_class = 'current-menu-item'; |
|
135 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) { |
|
136 | + $menu_class = 'current-menu-item'; |
|
137 | + } |
|
135 | 138 | |
136 | 139 | $items .= '<li class="' . $sub_li_class . '"> |
137 | 140 | <a href="' . get_post_type_archive_link($post_type) . '" class="' . $sub_a_class . '"> |
@@ -153,8 +156,9 @@ discard block |
||
153 | 156 | if (get_option('geodir_show_addlisting_nav')) { |
154 | 157 | |
155 | 158 | $menu_class = ''; |
156 | - if (geodir_is_page('add-listing')) |
|
157 | - $menu_class = 'current-menu-item'; |
|
159 | + if (geodir_is_page('add-listing')) { |
|
160 | + $menu_class = 'current-menu-item'; |
|
161 | + } |
|
158 | 162 | |
159 | 163 | //SHOW ADD LISTING POST TYPE IN MAIN NAVIGATION |
160 | 164 | $post_types = geodir_get_posttypes('object'); |
@@ -170,8 +174,9 @@ discard block |
||
170 | 174 | if (geodir_get_addlisting_link($post_type)) { |
171 | 175 | |
172 | 176 | $menu_class = ''; |
173 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) |
|
174 | - $menu_class = 'current-menu-item'; |
|
177 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) { |
|
178 | + $menu_class = 'current-menu-item'; |
|
179 | + } |
|
175 | 180 | /** |
176 | 181 | * Filter the menu li class. |
177 | 182 | * |
@@ -255,8 +260,9 @@ discard block |
||
255 | 260 | if (geodir_get_addlisting_link($post_type)) { |
256 | 261 | |
257 | 262 | $menu_class = ''; |
258 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) |
|
259 | - $menu_class = 'current-menu-item'; |
|
263 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) { |
|
264 | + $menu_class = 'current-menu-item'; |
|
265 | + } |
|
260 | 266 | /** |
261 | 267 | * Filter the menu li class. |
262 | 268 | * |
@@ -311,8 +317,9 @@ discard block |
||
311 | 317 | } |
312 | 318 | //else if(empty($geodir_theme_location)) // It means 'Show geodirectory navigation in selected menu locations' is not set yet. |
313 | 319 | // $menu = str_replace("</ul></div>",geodir_add_nav_menu_items()."</ul></div>",$menu); |
314 | - else if (is_array($geodir_theme_location) && isset($args['theme_location']) && in_array($args['theme_location'], $geodir_theme_location)) |
|
315 | - $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu); |
|
320 | + else if (is_array($geodir_theme_location) && isset($args['theme_location']) && in_array($args['theme_location'], $geodir_theme_location)) { |
|
321 | + $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu); |
|
322 | + } |
|
316 | 323 | |
317 | 324 | return $menu; |
318 | 325 | |
@@ -398,24 +405,28 @@ discard block |
||
398 | 405 | $geodir_post_type = get_query_var('post_type'); |
399 | 406 | |
400 | 407 | if (geodir_is_page('add-listing') || geodir_is_page('preview')) { |
401 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
|
402 | - $geodir_post_type = get_post_type((int)$_REQUEST['pid']); |
|
403 | - elseif (isset($_REQUEST['listing_type'])) |
|
404 | - $geodir_post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
408 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
409 | + $geodir_post_type = get_post_type((int)$_REQUEST['pid']); |
|
410 | + } elseif (isset($_REQUEST['listing_type'])) { |
|
411 | + $geodir_post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
412 | + } |
|
405 | 413 | } |
406 | 414 | |
407 | - if ((geodir_is_page('search') || geodir_is_page('author')) && isset($_REQUEST['stype'])) |
|
408 | - $geodir_post_type = sanitize_text_field($_REQUEST['stype']); |
|
415 | + if ((geodir_is_page('search') || geodir_is_page('author')) && isset($_REQUEST['stype'])) { |
|
416 | + $geodir_post_type = sanitize_text_field($_REQUEST['stype']); |
|
417 | + } |
|
409 | 418 | |
410 | - if (is_tax()) |
|
411 | - $geodir_post_type = geodir_get_taxonomy_posttype(); |
|
419 | + if (is_tax()) { |
|
420 | + $geodir_post_type = geodir_get_taxonomy_posttype(); |
|
421 | + } |
|
412 | 422 | |
413 | 423 | |
414 | 424 | $all_postypes = geodir_get_posttypes(); |
415 | 425 | $all_postypes = stripslashes_deep($all_postypes); |
416 | 426 | |
417 | - if (is_array($all_postypes) && !in_array($geodir_post_type, $all_postypes)) |
|
418 | - $geodir_post_type = ''; |
|
427 | + if (is_array($all_postypes) && !in_array($geodir_post_type, $all_postypes)) { |
|
428 | + $geodir_post_type = ''; |
|
429 | + } |
|
419 | 430 | |
420 | 431 | |
421 | 432 | return $geodir_post_type; |
@@ -462,11 +473,12 @@ discard block |
||
462 | 473 | endswitch; |
463 | 474 | } |
464 | 475 | |
465 | - if (!empty($post_types)) |
|
466 | - return $post_types; |
|
467 | - else |
|
468 | - return array(); |
|
469 | -} |
|
476 | + if (!empty($post_types)) { |
|
477 | + return $post_types; |
|
478 | + } else { |
|
479 | + return array(); |
|
480 | + } |
|
481 | + } |
|
470 | 482 | |
471 | 483 | /** |
472 | 484 | * Get Custom Post Type info. |
@@ -483,9 +495,10 @@ discard block |
||
483 | 495 | $post_types = stripslashes_deep($post_types); |
484 | 496 | if (!empty($post_types) && $post_type != '') { |
485 | 497 | return $post_types[$post_type]; |
486 | - } else |
|
487 | - return false; |
|
488 | -} |
|
498 | + } else { |
|
499 | + return false; |
|
500 | + } |
|
501 | + } |
|
489 | 502 | |
490 | 503 | if (!function_exists('geodir_get_taxonomies')) { |
491 | 504 | /** |
@@ -509,18 +522,21 @@ discard block |
||
509 | 522 | $gd_taxonomies = array_keys($taxonomies); |
510 | 523 | |
511 | 524 | |
512 | - if ($post_type != '') |
|
513 | - $gd_taxonomies = array(); |
|
525 | + if ($post_type != '') { |
|
526 | + $gd_taxonomies = array(); |
|
527 | + } |
|
514 | 528 | |
515 | 529 | $i = 0; |
516 | 530 | foreach ($taxonomies as $taxonomy => $args) { |
517 | 531 | |
518 | - if ($post_type != '' && $args['object_type'] == $post_type) |
|
519 | - $gd_taxonomies[] = $taxonomy; |
|
532 | + if ($post_type != '' && $args['object_type'] == $post_type) { |
|
533 | + $gd_taxonomies[] = $taxonomy; |
|
534 | + } |
|
520 | 535 | |
521 | 536 | if ($tages_taxonomies === false && strpos($taxonomy, '_tag') !== false) { |
522 | - if (array_search($taxonomy, $gd_taxonomies) !== false) |
|
523 | - unset($gd_taxonomies[array_search($taxonomy, $gd_taxonomies)]); |
|
537 | + if (array_search($taxonomy, $gd_taxonomies) !== false) { |
|
538 | + unset($gd_taxonomies[array_search($taxonomy, $gd_taxonomies)]); |
|
539 | + } |
|
524 | 540 | } |
525 | 541 | |
526 | 542 | } |
@@ -575,10 +591,11 @@ discard block |
||
575 | 591 | . ucfirst($category_obj->name) . '</option>'; |
576 | 592 | } |
577 | 593 | |
578 | - if ($echo) |
|
579 | - echo $html; |
|
580 | - else |
|
581 | - return $html; |
|
594 | + if ($echo) { |
|
595 | + echo $html; |
|
596 | + } else { |
|
597 | + return $html; |
|
598 | + } |
|
582 | 599 | } |
583 | 600 | } |
584 | 601 | |
@@ -612,11 +629,12 @@ discard block |
||
612 | 629 | |
613 | 630 | } |
614 | 631 | |
615 | - if (!empty($listing_slug)) |
|
616 | - return $listing_slug; |
|
617 | - else |
|
618 | - return false; |
|
619 | -} |
|
632 | + if (!empty($listing_slug)) { |
|
633 | + return $listing_slug; |
|
634 | + } else { |
|
635 | + return false; |
|
636 | + } |
|
637 | + } |
|
620 | 638 | |
621 | 639 | |
622 | 640 | /** |
@@ -647,16 +665,18 @@ discard block |
||
647 | 665 | if (!empty($taxonomies)) { |
648 | 666 | foreach (geodir_get_posttypes() as $pt) { |
649 | 667 | $object_taxonomies = $pt === 'attachment' ? get_taxonomies_for_attachments() : get_object_taxonomies($pt); |
650 | - if (array_intersect($taxonomies, $object_taxonomies)) |
|
651 | - $post_type[] = $pt; |
|
668 | + if (array_intersect($taxonomies, $object_taxonomies)) { |
|
669 | + $post_type[] = $pt; |
|
670 | + } |
|
652 | 671 | } |
653 | 672 | } |
654 | 673 | |
655 | - if (!empty($post_type)) |
|
656 | - return $post_type[0]; |
|
657 | - else |
|
658 | - return false; |
|
659 | -} |
|
674 | + if (!empty($post_type)) { |
|
675 | + return $post_type[0]; |
|
676 | + } else { |
|
677 | + return false; |
|
678 | + } |
|
679 | + } |
|
660 | 680 | |
661 | 681 | if (!function_exists('geodir_custom_taxonomy_walker')) { |
662 | 682 | /** |
@@ -712,18 +732,18 @@ discard block |
||
712 | 732 | $checked = ''; |
713 | 733 | |
714 | 734 | if (in_array($cat_term->term_id, $search_terms)) { |
715 | - if ($cat_display == 'select' || $cat_display == 'multiselect') |
|
716 | - $checked = 'selected="selected"'; |
|
717 | - else |
|
718 | - $checked = 'checked="checked"'; |
|
735 | + if ($cat_display == 'select' || $cat_display == 'multiselect') { |
|
736 | + $checked = 'selected="selected"'; |
|
737 | + } else { |
|
738 | + $checked = 'checked="checked"'; |
|
739 | + } |
|
719 | 740 | } |
720 | 741 | |
721 | - if ($cat_display == 'radio') |
|
722 | - $out .= '<span style="display:block" ><input type="radio" field_type="radio" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
723 | - elseif ($cat_display == 'select' || $cat_display == 'multiselect') |
|
724 | - $out .= '<option ' . $main_list_class . ' style="margin-left:' . $p . 'px;" alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' >' . $term_check . ucfirst($cat_term->name) . '</option>'; |
|
725 | - |
|
726 | - else { |
|
742 | + if ($cat_display == 'radio') { |
|
743 | + $out .= '<span style="display:block" ><input type="radio" field_type="radio" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
744 | + } elseif ($cat_display == 'select' || $cat_display == 'multiselect') { |
|
745 | + $out .= '<option ' . $main_list_class . ' style="margin-left:' . $p . 'px;" alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' >' . $term_check . ucfirst($cat_term->name) . '</option>'; |
|
746 | + } else { |
|
727 | 747 | $out .= '<span style="display:block"><input style="display:inline-block" type="checkbox" field_type="checkbox" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
728 | 748 | } |
729 | 749 | |
@@ -732,8 +752,9 @@ discard block |
||
732 | 752 | |
733 | 753 | } |
734 | 754 | |
735 | - if ($cat_display == 'checkbox' || $cat_display == 'radio') |
|
736 | - $out .= '</div>'; |
|
755 | + if ($cat_display == 'checkbox' || $cat_display == 'radio') { |
|
756 | + $out .= '</div>'; |
|
757 | + } |
|
737 | 758 | |
738 | 759 | return $out; |
739 | 760 | } |
@@ -759,18 +780,21 @@ discard block |
||
759 | 780 | global $exclude_cats, $gd_session; |
760 | 781 | |
761 | 782 | $cat_exclude = ''; |
762 | - if (is_array($exclude_cats) && !empty($exclude_cats)) |
|
763 | - $cat_exclude = serialize($exclude_cats); |
|
783 | + if (is_array($exclude_cats) && !empty($exclude_cats)) { |
|
784 | + $cat_exclude = serialize($exclude_cats); |
|
785 | + } |
|
764 | 786 | |
765 | 787 | if (isset($_REQUEST['backandedit'])) { |
766 | 788 | $post = (object)$gd_session->get('listing'); |
767 | 789 | |
768 | - if (!is_array($post->post_category[$cat_taxonomy])) |
|
769 | - $post_category = $post->post_category[$cat_taxonomy]; |
|
790 | + if (!is_array($post->post_category[$cat_taxonomy])) { |
|
791 | + $post_category = $post->post_category[$cat_taxonomy]; |
|
792 | + } |
|
770 | 793 | |
771 | 794 | $post_categories = $post->post_category_str; |
772 | - if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) |
|
773 | - $post_category_str = $post_categories[$cat_taxonomy]; |
|
795 | + if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) { |
|
796 | + $post_category_str = $post_categories[$cat_taxonomy]; |
|
797 | + } |
|
774 | 798 | |
775 | 799 | } elseif ((geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') || (is_admin())) { |
776 | 800 | global $post; |
@@ -961,8 +985,9 @@ discard block |
||
961 | 985 | if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) { |
962 | 986 | $post_cat_str = $post_categories[$cat_taxonomy]; |
963 | 987 | $post_cat_array = explode("#", $post_cat_str); |
964 | - if (count($post_cat_array) >= $cat_limit && $cat_limit != 0) |
|
965 | - $style = "display:none;"; |
|
988 | + if (count($post_cat_array) >= $cat_limit && $cat_limit != 0) { |
|
989 | + $style = "display:none;"; |
|
990 | + } |
|
966 | 991 | } |
967 | 992 | ?> |
968 | 993 | <div class="main_cat_list" style=" <?php if (isset($style)) { |
@@ -997,7 +1022,7 @@ discard block |
||
997 | 1022 | print_r($exclude_cats); |
998 | 1023 | if(is_array( $exclude_cats)){ |
999 | 1024 | $exclude_cats = array_map( 'intval', $exclude_cats ); |
1000 | - }else{ |
|
1025 | + } else{ |
|
1001 | 1026 | $exclude_cats = intval($exclude_cats); |
1002 | 1027 | } |
1003 | 1028 | |
@@ -1027,7 +1052,10 @@ discard block |
||
1027 | 1052 | |
1028 | 1053 | <div class="post_default_category"> |
1029 | 1054 | <input type="radio" name="post_default_category" value="<?php echo $main_cat->term_id;?>" |
1030 | - onchange="update_listing_cat()" <?php if ($default) echo ' checked="checked" ';?> /> |
|
1055 | + onchange="update_listing_cat()" <?php if ($default) { |
|
1056 | + echo ' checked="checked" '; |
|
1057 | +} |
|
1058 | +?> /> |
|
1031 | 1059 | <span> |
1032 | 1060 | <?php printf(__('Set %s as default category', 'geodirectory'), geodir_ucwords($main_cat->name));?> |
1033 | 1061 | </span> |
@@ -1127,8 +1155,9 @@ discard block |
||
1127 | 1155 | $onchange = ' onchange="show_subcatlist(this.value, this)" '; |
1128 | 1156 | |
1129 | 1157 | $option_selected = ''; |
1130 | - if (!$selected) |
|
1131 | - $option_slected = ' selected="selected" '; |
|
1158 | + if (!$selected) { |
|
1159 | + $option_slected = ' selected="selected" '; |
|
1160 | + } |
|
1132 | 1161 | |
1133 | 1162 | echo '<select field_type="select" id="' . sanitize_text_field($cat_taxonomy) . '" class="chosen_select" ' . $onchange . ' option-ajaxChosen="false" >'; |
1134 | 1163 | |
@@ -1136,8 +1165,9 @@ discard block |
||
1136 | 1165 | |
1137 | 1166 | foreach ($cat_terms as $cat_term) { |
1138 | 1167 | $option_selected = ''; |
1139 | - if ($selected == $cat_term->term_id) |
|
1140 | - $option_selected = ' selected="selected" '; |
|
1168 | + if ($selected == $cat_term->term_id) { |
|
1169 | + $option_selected = ' selected="selected" '; |
|
1170 | + } |
|
1141 | 1171 | |
1142 | 1172 | // Count child terms |
1143 | 1173 | $child_terms = get_terms( $cat_taxonomy, array( 'parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1 ) ); |
@@ -1202,8 +1232,9 @@ discard block |
||
1202 | 1232 | |
1203 | 1233 | $menu_icon = geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico'; |
1204 | 1234 | |
1205 | - if (!$listing_slug = get_option('geodir_listing_prefix')) |
|
1206 | - $listing_slug = 'places'; |
|
1235 | + if (!$listing_slug = get_option('geodir_listing_prefix')) { |
|
1236 | + $listing_slug = 'places'; |
|
1237 | + } |
|
1207 | 1238 | |
1208 | 1239 | /** |
1209 | 1240 | * Taxonomies |
@@ -1351,7 +1382,7 @@ discard block |
||
1351 | 1382 | //print_r( $segments); |
1352 | 1383 | if($gd_wpml_get_languages){ |
1353 | 1384 | $langs = $gd_wpml_get_languages; |
1354 | - }else{ |
|
1385 | + } else{ |
|
1355 | 1386 | global $sitepress; |
1356 | 1387 | $gd_wpml_get_languages = $sitepress->get_active_languages(); |
1357 | 1388 | } |
@@ -1494,8 +1525,9 @@ discard block |
||
1494 | 1525 | 'city_slug' => $post->city_slug |
1495 | 1526 | ); |
1496 | 1527 | |
1497 | - } else |
|
1498 | - $post_location = geodir_get_location(); |
|
1528 | + } else { |
|
1529 | + $post_location = geodir_get_location(); |
|
1530 | + } |
|
1499 | 1531 | |
1500 | 1532 | |
1501 | 1533 | } else { |
@@ -1524,8 +1556,9 @@ discard block |
||
1524 | 1556 | ); |
1525 | 1557 | |
1526 | 1558 | } |
1527 | - } else |
|
1528 | - $post_location = geodir_get_location(); |
|
1559 | + } else { |
|
1560 | + $post_location = geodir_get_location(); |
|
1561 | + } |
|
1529 | 1562 | } |
1530 | 1563 | |
1531 | 1564 | |
@@ -1568,8 +1601,9 @@ discard block |
||
1568 | 1601 | $post_terms = $post_terms[0]; |
1569 | 1602 | } |
1570 | 1603 | |
1571 | - if (!$post_terms) |
|
1572 | - $post_terms = geodir_get_post_meta($post->ID, 'default_category', true); |
|
1604 | + if (!$post_terms) { |
|
1605 | + $post_terms = geodir_get_post_meta($post->ID, 'default_category', true); |
|
1606 | + } |
|
1573 | 1607 | |
1574 | 1608 | if (!$post_terms) { |
1575 | 1609 | $post_terms = geodir_get_post_meta($post->ID, $taxonomies, true); |
@@ -1583,8 +1617,9 @@ discard block |
||
1583 | 1617 | |
1584 | 1618 | $term = get_term_by('id', $post_terms, $taxonomies); |
1585 | 1619 | |
1586 | - if (!empty($term)) |
|
1587 | - $term_request = $term->slug; |
|
1620 | + if (!empty($term)) { |
|
1621 | + $term_request = $term->slug; |
|
1622 | + } |
|
1588 | 1623 | //$term_request = $term->slug.'/'; |
1589 | 1624 | } |
1590 | 1625 | |
@@ -1599,15 +1634,20 @@ discard block |
||
1599 | 1634 | $request_term .= $term_request; |
1600 | 1635 | |
1601 | 1636 | } else { |
1602 | - if (isset($location_request) && $location_request != '') $request_term = $location_request; |
|
1637 | + if (isset($location_request) && $location_request != '') { |
|
1638 | + $request_term = $location_request; |
|
1639 | + } |
|
1603 | 1640 | |
1604 | - if (isset($term_request) && $term_request != '') $request_term .= $term_request; |
|
1641 | + if (isset($term_request) && $term_request != '') { |
|
1642 | + $request_term .= $term_request; |
|
1643 | + } |
|
1605 | 1644 | } |
1606 | 1645 | $request_term = trim($request_term, '/'); |
1607 | - if (!empty($request_term)) |
|
1608 | - $post_link = str_replace('%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1609 | - else |
|
1610 | - $post_link = str_replace('/%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1646 | + if (!empty($request_term)) { |
|
1647 | + $post_link = str_replace('%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1648 | + } else { |
|
1649 | + $post_link = str_replace('/%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1650 | + } |
|
1611 | 1651 | //echo $post_link ; |
1612 | 1652 | } |
1613 | 1653 | // temp cache the permalink |
@@ -1649,8 +1689,9 @@ discard block |
||
1649 | 1689 | if ($geodir_add_location_url && get_option('geodir_add_location_url')) { |
1650 | 1690 | $include_location = true; |
1651 | 1691 | } |
1652 | - } elseif (get_option('geodir_add_location_url') && $gd_session->get('gd_multi_location') == 1) |
|
1653 | - $include_location = true; |
|
1692 | + } elseif (get_option('geodir_add_location_url') && $gd_session->get('gd_multi_location') == 1) { |
|
1693 | + $include_location = true; |
|
1694 | + } |
|
1654 | 1695 | |
1655 | 1696 | if ($include_location) { |
1656 | 1697 | global $post; |
@@ -1800,10 +1841,11 @@ discard block |
||
1800 | 1841 | if (!is_object($obj_post_type)) { |
1801 | 1842 | return; |
1802 | 1843 | } |
1803 | - if ($echo) |
|
1804 | - echo $obj_post_type->labels->singular_name; |
|
1805 | - else |
|
1806 | - return $obj_post_type->labels->singular_name; |
|
1844 | + if ($echo) { |
|
1845 | + echo $obj_post_type->labels->singular_name; |
|
1846 | + } else { |
|
1847 | + return $obj_post_type->labels->singular_name; |
|
1848 | + } |
|
1807 | 1849 | |
1808 | 1850 | } |
1809 | 1851 | |
@@ -1820,14 +1862,16 @@ discard block |
||
1820 | 1862 | { |
1821 | 1863 | $all_postypes = geodir_get_posttypes(); |
1822 | 1864 | |
1823 | - if (!in_array($post_type, $all_postypes)) |
|
1824 | - return false; |
|
1865 | + if (!in_array($post_type, $all_postypes)) { |
|
1866 | + return false; |
|
1867 | + } |
|
1825 | 1868 | |
1826 | 1869 | $obj_post_type = get_post_type_object($post_type); |
1827 | - if ($echo) |
|
1828 | - echo $obj_post_type->labels->name; |
|
1829 | - else |
|
1830 | - return $obj_post_type->labels->name; |
|
1870 | + if ($echo) { |
|
1871 | + echo $obj_post_type->labels->name; |
|
1872 | + } else { |
|
1873 | + return $obj_post_type->labels->name; |
|
1874 | + } |
|
1831 | 1875 | |
1832 | 1876 | } |
1833 | 1877 | |
@@ -1852,19 +1896,22 @@ discard block |
||
1852 | 1896 | $tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE "; |
1853 | 1897 | |
1854 | 1898 | if (is_int($term)) { |
1855 | - if (0 == $term) |
|
1856 | - return 0; |
|
1899 | + if (0 == $term) { |
|
1900 | + return 0; |
|
1901 | + } |
|
1857 | 1902 | $where = 't.term_id = %d'; |
1858 | - if (!empty($taxonomy)) |
|
1859 | - return $wpdb->get_row($wpdb->prepare($tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); |
|
1860 | - else |
|
1861 | - return $wpdb->get_var($wpdb->prepare($select . $where, $term)); |
|
1903 | + if (!empty($taxonomy)) { |
|
1904 | + return $wpdb->get_row($wpdb->prepare($tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); |
|
1905 | + } else { |
|
1906 | + return $wpdb->get_var($wpdb->prepare($select . $where, $term)); |
|
1907 | + } |
|
1862 | 1908 | } |
1863 | 1909 | |
1864 | 1910 | $term = trim(wp_unslash($term)); |
1865 | 1911 | |
1866 | - if ('' === $slug = sanitize_title($term)) |
|
1867 | - return 0; |
|
1912 | + if ('' === $slug = sanitize_title($term)) { |
|
1913 | + return 0; |
|
1914 | + } |
|
1868 | 1915 | |
1869 | 1916 | $where = 't.slug = %s'; |
1870 | 1917 | |
@@ -1881,14 +1928,16 @@ discard block |
||
1881 | 1928 | $where_fields[] = $taxonomy; |
1882 | 1929 | |
1883 | 1930 | |
1884 | - if ($result = $wpdb->get_row($wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $where_fields), ARRAY_A)) |
|
1885 | - return $result; |
|
1931 | + if ($result = $wpdb->get_row($wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $where_fields), ARRAY_A)) { |
|
1932 | + return $result; |
|
1933 | + } |
|
1886 | 1934 | |
1887 | 1935 | return false; |
1888 | 1936 | } |
1889 | 1937 | |
1890 | - if ($result = $wpdb->get_var($wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where", $where_fields))) |
|
1891 | - return $result; |
|
1938 | + if ($result = $wpdb->get_var($wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where", $where_fields))) { |
|
1939 | + return $result; |
|
1940 | + } |
|
1892 | 1941 | |
1893 | 1942 | return false; |
1894 | 1943 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | |
136 | 136 | $items .= '<li class="' . $sub_li_class . '"> |
137 | 137 | <a href="' . get_post_type_archive_link($post_type) . '" class="' . $sub_a_class . '"> |
138 | - ' . __(ucfirst($args->labels->name),'geodirectory') . ' |
|
138 | + ' . __(ucfirst($args->labels->name), 'geodirectory') . ' |
|
139 | 139 | </a> |
140 | 140 | </li>'; |
141 | 141 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
189 | 189 | $items .= '<li class="' . $li_class . '"> |
190 | 190 | <a href="' . geodir_get_addlisting_link($post_type) . '" class="' . $a_class . '"> |
191 | - ' . sprintf( __('Add %s', 'geodirectory'), $cpt_name ) . ' |
|
191 | + ' . sprintf(__('Add %s', 'geodirectory'), $cpt_name) . ' |
|
192 | 192 | </a> |
193 | 193 | </li>'; |
194 | 194 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
268 | 268 | $items .= '<li class="' . $li_class . '"> |
269 | 269 | <a href="' . geodir_get_addlisting_link($post_type) . '" class="' . $sub_a_class . '"> |
270 | - ' . sprintf( __('Add %s', 'geodirectory'), $cpt_name ) . ' |
|
270 | + ' . sprintf(__('Add %s', 'geodirectory'), $cpt_name) . ' |
|
271 | 271 | </a> |
272 | 272 | </li>'; |
273 | 273 | } |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | |
400 | 400 | if (geodir_is_page('add-listing') || geodir_is_page('preview')) { |
401 | 401 | if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
402 | - $geodir_post_type = get_post_type((int)$_REQUEST['pid']); |
|
402 | + $geodir_post_type = get_post_type((int) $_REQUEST['pid']); |
|
403 | 403 | elseif (isset($_REQUEST['listing_type'])) |
404 | 404 | $geodir_post_type = sanitize_text_field($_REQUEST['listing_type']); |
405 | 405 | } |
@@ -439,14 +439,14 @@ discard block |
||
439 | 439 | switch ($output): |
440 | 440 | case 'object': |
441 | 441 | case 'Object': |
442 | - $post_types = json_decode(json_encode($post_types), FALSE);//(object)$post_types; |
|
442 | + $post_types = json_decode(json_encode($post_types), FALSE); //(object)$post_types; |
|
443 | 443 | break; |
444 | 444 | case 'array': |
445 | 445 | case 'Array': |
446 | - $post_types = (array)$post_types; |
|
446 | + $post_types = (array) $post_types; |
|
447 | 447 | break; |
448 | 448 | case 'options': |
449 | - $post_types = (array)$post_types; |
|
449 | + $post_types = (array) $post_types; |
|
450 | 450 | |
451 | 451 | $options = array(); |
452 | 452 | if (!empty($post_types)) { |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | } elseif (isset($wp_query->tax_query->queries)) { |
641 | 641 | $tax_arr = $wp_query->tax_query->queries; |
642 | 642 | //if tax query has 'relation' set then it will break wp_list_pluck so we remove it |
643 | - if(isset( $tax_arr['relation'])){unset( $tax_arr['relation']);} |
|
643 | + if (isset($tax_arr['relation'])) {unset($tax_arr['relation']); } |
|
644 | 644 | $taxonomies = wp_list_pluck($tax_arr, 'taxonomy'); |
645 | 645 | } |
646 | 646 | |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | $cat_exclude = serialize($exclude_cats); |
764 | 764 | |
765 | 765 | if (isset($_REQUEST['backandedit'])) { |
766 | - $post = (object)$gd_session->get('listing'); |
|
766 | + $post = (object) $gd_session->get('listing'); |
|
767 | 767 | |
768 | 768 | if (!is_array($post->post_category[$cat_taxonomy])) |
769 | 769 | $post_category = $post->post_category[$cat_taxonomy]; |
@@ -841,14 +841,14 @@ discard block |
||
841 | 841 | |
842 | 842 | function show_subcatlist(main_cat, catObj) { |
843 | 843 | if (main_cat != '') { |
844 | - var url = '<?php echo geodir_get_ajax_url();?>'; |
|
845 | - var cat_taxonomy = '<?php echo $cat_taxonomy;?>'; |
|
846 | - var cat_exclude = '<?php echo base64_encode($cat_exclude);?>'; |
|
844 | + var url = '<?php echo geodir_get_ajax_url(); ?>'; |
|
845 | + var cat_taxonomy = '<?php echo $cat_taxonomy; ?>'; |
|
846 | + var cat_exclude = '<?php echo base64_encode($cat_exclude); ?>'; |
|
847 | 847 | var cat_limit = jQuery('#' + cat_taxonomy).find('#cat_limit').val(); |
848 | - <?php if ((int)$cat_limit > 0) { ?> |
|
848 | + <?php if ((int) $cat_limit > 0) { ?> |
|
849 | 849 | var selected = parseInt(jQuery('#' + cat_taxonomy).find('.cat_sublist > div.post_catlist_item').length); |
850 | 850 | if (cat_limit != '' && selected > 0 && selected >= cat_limit && cat_limit != 0) { |
851 | - alert("<?php echo esc_attr(wp_sprintf(__('You have reached category limit of %d categories.', 'geodirectory'), (int)$cat_limit));?>"); |
|
851 | + alert("<?php echo esc_attr(wp_sprintf(__('You have reached category limit of %d categories.', 'geodirectory'), (int) $cat_limit)); ?>"); |
|
852 | 852 | return false; |
853 | 853 | } |
854 | 854 | <?php } ?> |
@@ -887,7 +887,7 @@ discard block |
||
887 | 887 | } |
888 | 888 | |
889 | 889 | function update_listing_cat(el) { |
890 | - var cat_taxonomy = '<?php echo $cat_taxonomy;?>'; |
|
890 | + var cat_taxonomy = '<?php echo $cat_taxonomy; ?>'; |
|
891 | 891 | var cat_ids = ''; |
892 | 892 | var main_cat = ''; |
893 | 893 | var sub_cat = ''; |
@@ -968,7 +968,7 @@ discard block |
||
968 | 968 | <div class="main_cat_list" style=" <?php if (isset($style)) { |
969 | 969 | echo $style; |
970 | 970 | }?> "> |
971 | - <?php geodir_get_catlist($cat_taxonomy, 0); // print main categories list |
|
971 | + <?php geodir_get_catlist($cat_taxonomy, 0); // print main categories list |
|
972 | 972 | ?> |
973 | 973 | </div> |
974 | 974 | <?php |
@@ -995,9 +995,9 @@ discard block |
||
995 | 995 | if ($exclude != '') { |
996 | 996 | $exclude_cats = maybe_unserialize(base64_decode($exclude)); |
997 | 997 | print_r($exclude_cats); |
998 | - if(is_array( $exclude_cats)){ |
|
999 | - $exclude_cats = array_map( 'intval', $exclude_cats ); |
|
1000 | - }else{ |
|
998 | + if (is_array($exclude_cats)) { |
|
999 | + $exclude_cats = array_map('intval', $exclude_cats); |
|
1000 | + } else { |
|
1001 | 1001 | $exclude_cats = intval($exclude_cats); |
1002 | 1002 | } |
1003 | 1003 | |
@@ -1011,25 +1011,25 @@ discard block |
||
1011 | 1011 | <?php $main_cat = get_term($parrent, $request_taxonomy); ?> |
1012 | 1012 | |
1013 | 1013 | <div class="post_catlist_item" style="border:1px solid #CCCCCC; margin:5px auto; padding:5px;"> |
1014 | - <img alt="move icon" src="<?php echo geodir_plugin_url() . '/geodirectory-assets/images/move.png';?>" |
|
1014 | + <img alt="move icon" src="<?php echo geodir_plugin_url() . '/geodirectory-assets/images/move.png'; ?>" |
|
1015 | 1015 | onclick="jQuery(this).closest('div').remove();update_listing_cat(this);" align="right"/> |
1016 | 1016 | <?php /* ?> |
1017 | 1017 | <img src="<?php echo geodir_plugin_url().'/geodirectory-assets/images/move.png';?>" onclick="jQuery(this).closest('div').remove();show_subcatlist();" align="right" /> |
1018 | 1018 | <?php */ ?> |
1019 | 1019 | |
1020 | - <input type="checkbox" value="<?php echo $main_cat->term_id;?>" class="listing_main_cat" |
|
1020 | + <input type="checkbox" value="<?php echo $main_cat->term_id; ?>" class="listing_main_cat" |
|
1021 | 1021 | onchange="if(jQuery(this).is(':checked')){jQuery(this).closest('div').find('.post_default_category').prop('checked',false).show();}else{jQuery(this).closest('div').find('.post_default_category').prop('checked',false).hide();};update_listing_cat()" |
1022 | 1022 | checked="checked" disabled="disabled"/> |
1023 | 1023 | <span> |
1024 | - <?php printf(__('Add listing in %s category', 'geodirectory'), geodir_ucwords($main_cat->name));?> |
|
1024 | + <?php printf(__('Add listing in %s category', 'geodirectory'), geodir_ucwords($main_cat->name)); ?> |
|
1025 | 1025 | </span> |
1026 | 1026 | <br/> |
1027 | 1027 | |
1028 | 1028 | <div class="post_default_category"> |
1029 | - <input type="radio" name="post_default_category" value="<?php echo $main_cat->term_id;?>" |
|
1030 | - onchange="update_listing_cat()" <?php if ($default) echo ' checked="checked" ';?> /> |
|
1029 | + <input type="radio" name="post_default_category" value="<?php echo $main_cat->term_id; ?>" |
|
1030 | + onchange="update_listing_cat()" <?php if ($default) echo ' checked="checked" '; ?> /> |
|
1031 | 1031 | <span> |
1032 | - <?php printf(__('Set %s as default category', 'geodirectory'), geodir_ucwords($main_cat->name));?> |
|
1032 | + <?php printf(__('Set %s as default category', 'geodirectory'), geodir_ucwords($main_cat->name)); ?> |
|
1033 | 1033 | </span> |
1034 | 1034 | </div> |
1035 | 1035 | |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | $post_cat_str = $post_categories[$request_taxonomy]; |
1063 | 1063 | $post_cat_array = explode("#", $post_cat_str); |
1064 | 1064 | if (is_array($post_cat_array)) { |
1065 | - $post_cat_array = array_unique( $post_cat_array ); |
|
1065 | + $post_cat_array = array_unique($post_cat_array); |
|
1066 | 1066 | |
1067 | 1067 | foreach ($post_cat_array as $post_cat_html) { |
1068 | 1068 | |
@@ -1077,7 +1077,7 @@ discard block |
||
1077 | 1077 | } |
1078 | 1078 | $post_sub_catid = ''; |
1079 | 1079 | if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) { |
1080 | - $post_sub_catid = (int)$post_cat_info[1]; |
|
1080 | + $post_sub_catid = (int) $post_cat_info[1]; |
|
1081 | 1081 | } |
1082 | 1082 | |
1083 | 1083 | geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
@@ -1098,7 +1098,7 @@ discard block |
||
1098 | 1098 | } |
1099 | 1099 | |
1100 | 1100 | if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) { |
1101 | - $post_sub_catid = (int)$post_cat_info[1]; |
|
1101 | + $post_sub_catid = (int) $post_cat_info[1]; |
|
1102 | 1102 | } |
1103 | 1103 | |
1104 | 1104 | geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
@@ -1140,8 +1140,8 @@ discard block |
||
1140 | 1140 | $option_selected = ' selected="selected" '; |
1141 | 1141 | |
1142 | 1142 | // Count child terms |
1143 | - $child_terms = get_terms( $cat_taxonomy, array( 'parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1 ) ); |
|
1144 | - $has_child = !empty( $child_terms ) ? 't' : 'f'; |
|
1143 | + $child_terms = get_terms($cat_taxonomy, array('parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1)); |
|
1144 | + $has_child = !empty($child_terms) ? 't' : 'f'; |
|
1145 | 1145 | |
1146 | 1146 | echo '<option ' . $option_selected . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" _hc="' . $has_child . '" >' . ucfirst($cat_term->name) . '</option>'; |
1147 | 1147 | } |
@@ -1174,7 +1174,7 @@ discard block |
||
1174 | 1174 | 2 => __('Custom field updated.', 'geodirectory'), |
1175 | 1175 | 3 => __('Custom field deleted.', 'geodirectory'), |
1176 | 1176 | 4 => sprintf(__('%s updated.', 'geodirectory'), $post_object->labels->singular_name), |
1177 | - 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'geodirectory'), $post_object->labels->singular_name, wp_post_revision_title((int)$_GET['revision'], false)) : false, |
|
1177 | + 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'geodirectory'), $post_object->labels->singular_name, wp_post_revision_title((int) $_GET['revision'], false)) : false, |
|
1178 | 1178 | 6 => sprintf(__('%s published. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name), |
1179 | 1179 | 7 => sprintf(__('%s saved.', 'geodirectory'), $post_object->labels->singular_name), |
1180 | 1180 | 8 => sprintf(__('%s submitted. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name), |
@@ -1311,7 +1311,7 @@ discard block |
||
1311 | 1311 | 'menu_icon' => $menu_icon, |
1312 | 1312 | 'public' => true, |
1313 | 1313 | 'query_var' => true, |
1314 | - 'rewrite' => array('slug' => $listing_slug , 'with_front' => false, 'hierarchical' => true), |
|
1314 | + 'rewrite' => array('slug' => $listing_slug, 'with_front' => false, 'hierarchical' => true), |
|
1315 | 1315 | 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'comments', /*'revisions', 'post-formats'*/), |
1316 | 1316 | 'taxonomies' => array('gd_placecategory', 'gd_place_tags')); |
1317 | 1317 | |
@@ -1333,25 +1333,25 @@ discard block |
||
1333 | 1333 | } |
1334 | 1334 | |
1335 | 1335 | $gd_wpml_get_languages = ""; |
1336 | -function gd_wpml_get_lang_from_url($url){ |
|
1336 | +function gd_wpml_get_lang_from_url($url) { |
|
1337 | 1337 | |
1338 | 1338 | global $gd_wpml_get_languages; |
1339 | - if(isset($_REQUEST['lang']) && $_REQUEST['lang']){return $_REQUEST['lang'];} |
|
1339 | + if (isset($_REQUEST['lang']) && $_REQUEST['lang']) {return $_REQUEST['lang']; } |
|
1340 | 1340 | |
1341 | 1341 | |
1342 | 1342 | // |
1343 | - $url = str_replace(array("http://","https://"),"",$url); |
|
1344 | - $site_url = str_replace(array("http://","https://"),"",get_bloginfo('url')); |
|
1343 | + $url = str_replace(array("http://", "https://"), "", $url); |
|
1344 | + $site_url = str_replace(array("http://", "https://"), "", get_bloginfo('url')); |
|
1345 | 1345 | |
1346 | - $url = str_replace($site_url,"",$url); |
|
1346 | + $url = str_replace($site_url, "", $url); |
|
1347 | 1347 | |
1348 | 1348 | |
1349 | 1349 | $segments = explode('/', trim($url, '/')); |
1350 | 1350 | |
1351 | 1351 | //print_r( $segments); |
1352 | - if($gd_wpml_get_languages){ |
|
1352 | + if ($gd_wpml_get_languages) { |
|
1353 | 1353 | $langs = $gd_wpml_get_languages; |
1354 | - }else{ |
|
1354 | + } else { |
|
1355 | 1355 | global $sitepress; |
1356 | 1356 | $gd_wpml_get_languages = $sitepress->get_active_languages(); |
1357 | 1357 | } |
@@ -1414,17 +1414,17 @@ discard block |
||
1414 | 1414 | $slug = $post_types[$post->post_type]['rewrite']['slug']; |
1415 | 1415 | |
1416 | 1416 | // Alter the CPT slug if WPML is set to do so |
1417 | - if(function_exists('icl_object_id')){ |
|
1418 | - if ( gd_wpml_slug_translation_turned_on( $post->post_type ) && $language_code = gd_wpml_get_lang_from_url($post_link)) { |
|
1417 | + if (function_exists('icl_object_id')) { |
|
1418 | + if (gd_wpml_slug_translation_turned_on($post->post_type) && $language_code = gd_wpml_get_lang_from_url($post_link)) { |
|
1419 | 1419 | |
1420 | 1420 | $org_slug = $slug; |
1421 | - $slug = apply_filters( 'wpml_translate_single_string', |
|
1421 | + $slug = apply_filters('wpml_translate_single_string', |
|
1422 | 1422 | $slug, |
1423 | 1423 | 'WordPress', |
1424 | 1424 | 'URL slug: ' . $slug, |
1425 | 1425 | $language_code); |
1426 | 1426 | |
1427 | - if(!$slug){$slug = $org_slug;} |
|
1427 | + if (!$slug) {$slug = $org_slug; } |
|
1428 | 1428 | |
1429 | 1429 | } |
1430 | 1430 | } |
@@ -1438,7 +1438,7 @@ discard block |
||
1438 | 1438 | } |
1439 | 1439 | |
1440 | 1440 | $post_link = trailingslashit( |
1441 | - preg_replace( "/" . preg_quote( $slug, "/" ) . "/", $slug ."/%gd_taxonomy%",$post_link, 1 ) |
|
1441 | + preg_replace("/" . preg_quote($slug, "/") . "/", $slug . "/%gd_taxonomy%", $post_link, 1) |
|
1442 | 1442 | ); |
1443 | 1443 | |
1444 | 1444 | if ($fix_url) { |
@@ -1466,7 +1466,7 @@ discard block |
||
1466 | 1466 | ) |
1467 | 1467 | ); |
1468 | 1468 | |
1469 | - $post = (object)array_merge((array)$post, (array)$post2); |
|
1469 | + $post = (object) array_merge((array) $post, (array) $post2); |
|
1470 | 1470 | |
1471 | 1471 | $comment_post_cache[$post->ID] = $post; |
1472 | 1472 | } |
@@ -1475,7 +1475,7 @@ discard block |
||
1475 | 1475 | |
1476 | 1476 | if (false !== strpos($post_link, '%gd_taxonomy%')) { |
1477 | 1477 | |
1478 | - if ( apply_filters("geodir_add_location_url_to_url",get_option('geodir_add_location_url'),$post->post_type,$post)) { |
|
1478 | + if (apply_filters("geodir_add_location_url_to_url", get_option('geodir_add_location_url'), $post->post_type, $post)) { |
|
1479 | 1479 | $location_request = ''; |
1480 | 1480 | |
1481 | 1481 | |
@@ -1489,7 +1489,7 @@ discard block |
||
1489 | 1489 | $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]); |
1490 | 1490 | $post->country_slug = str_replace(']', '', $post->country_slug); |
1491 | 1491 | |
1492 | - $post_location = (object)array('country_slug' => $post->country_slug, |
|
1492 | + $post_location = (object) array('country_slug' => $post->country_slug, |
|
1493 | 1493 | 'region_slug' => $post->region_slug, |
1494 | 1494 | 'city_slug' => $post->city_slug |
1495 | 1495 | ); |
@@ -1518,7 +1518,7 @@ discard block |
||
1518 | 1518 | $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]); |
1519 | 1519 | $post->country_slug = str_replace(']', '', $post->country_slug); |
1520 | 1520 | |
1521 | - $post_location = (object)array('country_slug' => $post->country_slug, |
|
1521 | + $post_location = (object) array('country_slug' => $post->country_slug, |
|
1522 | 1522 | 'region_slug' => $post->region_slug, |
1523 | 1523 | 'city_slug' => $post->city_slug |
1524 | 1524 | ); |
@@ -1658,7 +1658,7 @@ discard block |
||
1658 | 1658 | $location_manager = defined('POST_LOCATION_TABLE') ? true : false; |
1659 | 1659 | $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false; |
1660 | 1660 | |
1661 | - if(geodir_is_page('detail') && isset($post->country_slug)){ |
|
1661 | + if (geodir_is_page('detail') && isset($post->country_slug)) { |
|
1662 | 1662 | $location_terms = array( |
1663 | 1663 | 'gd_country' => $post->country_slug, |
1664 | 1664 | 'gd_region' => $post->region_slug, |
@@ -1677,7 +1677,7 @@ discard block |
||
1677 | 1677 | |
1678 | 1678 | if (!empty($location_terms)) { |
1679 | 1679 | |
1680 | - $url_separator = '';//get_option('geodir_listingurl_separator'); |
|
1680 | + $url_separator = ''; //get_option('geodir_listingurl_separator'); |
|
1681 | 1681 | |
1682 | 1682 | if (get_option('permalink_structure') != '') { |
1683 | 1683 | $old_listing_slug = '/' . $listing_slug . '/'; |
@@ -1700,31 +1700,31 @@ discard block |
||
1700 | 1700 | }*/ |
1701 | 1701 | |
1702 | 1702 | // Alter the CPT slug if WPML is set to do so |
1703 | - if(function_exists('icl_object_id')){ |
|
1703 | + if (function_exists('icl_object_id')) { |
|
1704 | 1704 | $post_types = get_option('geodir_post_types'); |
1705 | - $post_type = str_replace("category","",$taxonomy); |
|
1706 | - $post_type = str_replace("_tags","",$post_type); |
|
1705 | + $post_type = str_replace("category", "", $taxonomy); |
|
1706 | + $post_type = str_replace("_tags", "", $post_type); |
|
1707 | 1707 | $slug = $post_types[$post_type]['rewrite']['slug']; |
1708 | - if ( gd_wpml_slug_translation_turned_on( $post_type )) { |
|
1708 | + if (gd_wpml_slug_translation_turned_on($post_type)) { |
|
1709 | 1709 | |
1710 | 1710 | global $sitepress; |
1711 | 1711 | $default_lang = $sitepress->get_default_language(); |
1712 | 1712 | $language_code = gd_wpml_get_lang_from_url($termlink); |
1713 | - if(!$language_code ){$language_code = $default_lang;} |
|
1713 | + if (!$language_code) {$language_code = $default_lang; } |
|
1714 | 1714 | |
1715 | 1715 | $org_slug = $slug; |
1716 | - $slug = apply_filters( 'wpml_translate_single_string', |
|
1716 | + $slug = apply_filters('wpml_translate_single_string', |
|
1717 | 1717 | $slug, |
1718 | 1718 | 'WordPress', |
1719 | 1719 | 'URL slug: ' . $slug, |
1720 | 1720 | $language_code); |
1721 | 1721 | |
1722 | 1722 | |
1723 | - if(!$slug){$slug = $org_slug;} |
|
1723 | + if (!$slug) {$slug = $org_slug; } |
|
1724 | 1724 | |
1725 | 1725 | $termlink = trailingslashit( |
1726 | 1726 | |
1727 | - preg_replace( "/" . preg_quote( $org_slug, "/" ) . "/", $slug ,$termlink, 1 ) |
|
1727 | + preg_replace("/" . preg_quote($org_slug, "/") . "/", $slug, $termlink, 1) |
|
1728 | 1728 | ); |
1729 | 1729 | |
1730 | 1730 | } |
@@ -1757,7 +1757,7 @@ discard block |
||
1757 | 1757 | |
1758 | 1758 | if (in_array($post_type, geodir_get_posttypes())) { |
1759 | 1759 | if (get_option('geodir_add_location_url') && $gd_session->get('gd_multi_location') == 1) { |
1760 | - if(geodir_is_page('detail') && !empty($post) && isset($post->country_slug)) { |
|
1760 | + if (geodir_is_page('detail') && !empty($post) && isset($post->country_slug)) { |
|
1761 | 1761 | $location_terms = array( |
1762 | 1762 | 'gd_country' => $post->country_slug, |
1763 | 1763 | 'gd_region' => $post->region_slug, |
@@ -1870,7 +1870,7 @@ discard block |
||
1870 | 1870 | |
1871 | 1871 | $where_fields = array($slug); |
1872 | 1872 | if (!empty($taxonomy)) { |
1873 | - $parent = (int)$parent; |
|
1873 | + $parent = (int) $parent; |
|
1874 | 1874 | if ($parent > 0) { |
1875 | 1875 | $where_fields[] = $parent; |
1876 | 1876 | $else_where_fields[] = $parent; |
@@ -1939,7 +1939,7 @@ discard block |
||
1939 | 1939 | $terms = $wpdb->get_results("SELECT * FROM $wpdb->term_taxonomy WHERE taxonomy IN ($tax_c)"); |
1940 | 1940 | //$terms = get_terms( $taxonomy ); |
1941 | 1941 | |
1942 | - if($terms) { |
|
1942 | + if ($terms) { |
|
1943 | 1943 | foreach ($terms as $term) { |
1944 | 1944 | $post_type = str_replace("category", "", $term->taxonomy); |
1945 | 1945 | $a_terms[$post_type][] = $term; |
@@ -1947,7 +1947,7 @@ discard block |
||
1947 | 1947 | } |
1948 | 1948 | } |
1949 | 1949 | |
1950 | - if($a_terms) { |
|
1950 | + if ($a_terms) { |
|
1951 | 1951 | foreach ($a_terms as $pt => $t2) { |
1952 | 1952 | |
1953 | 1953 | foreach ($t2 as $term) { |
@@ -1972,7 +1972,7 @@ discard block |
||
1972 | 1972 | } |
1973 | 1973 | |
1974 | 1974 | if (is_ssl()) { |
1975 | - $terms_icons = str_replace("http:","https:",$terms_icons ); |
|
1975 | + $terms_icons = str_replace("http:", "https:", $terms_icons); |
|
1976 | 1976 | } |
1977 | 1977 | |
1978 | 1978 | return $terms_icons; |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Geodirectory Custom Post Types/Taxonomies |
|
4 | - * |
|
5 | - * Inits custom post types and taxonomies |
|
6 | - * |
|
7 | - * @package GeoDirectory |
|
8 | - * @category Core |
|
9 | - * @author WPGeoDirectory |
|
10 | - */ |
|
3 | + * Geodirectory Custom Post Types/Taxonomies |
|
4 | + * |
|
5 | + * Inits custom post types and taxonomies |
|
6 | + * |
|
7 | + * @package GeoDirectory |
|
8 | + * @category Core |
|
9 | + * @author WPGeoDirectory |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * Contains custom post types/taxonomies related functions. |
@@ -33,257 +33,257 @@ discard block |
||
33 | 33 | */ |
34 | 34 | function geodir_add_nav_menu_items() |
35 | 35 | { |
36 | - $items = ''; |
|
37 | - // apply filter to add more navigations // -Filter-Location-Manager |
|
38 | - |
|
39 | - if (get_option('geodir_show_listing_nav')) { |
|
40 | - |
|
41 | - $menu_class = ''; |
|
42 | - if (geodir_is_page('listing')) |
|
43 | - $menu_class = 'current-menu-item'; |
|
44 | - |
|
45 | - |
|
46 | - //SHOW LISTING OF POST TYPE IN MAIN NAVIGATION |
|
47 | - $post_types = geodir_get_posttypes('object'); |
|
48 | - $show_post_type_main_nav = get_option('geodir_add_posttype_in_main_nav'); |
|
49 | - if (!empty($post_types)) { |
|
50 | - foreach ($post_types as $post_type => $args) { |
|
51 | - if (!empty($show_post_type_main_nav)) { |
|
52 | - if (in_array($post_type, $show_post_type_main_nav)) { |
|
53 | - if (get_post_type_archive_link($post_type)) { |
|
54 | - $menu_class = ''; |
|
55 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) |
|
56 | - $menu_class = 'current-menu-item'; |
|
57 | - /** |
|
58 | - * Filter the menu li class. |
|
59 | - * |
|
60 | - * @since 1.0.0 |
|
61 | - * @param string $menu_class The menu HTML class. |
|
62 | - */ |
|
63 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class); |
|
64 | - /** |
|
65 | - * Filter the menu a class. |
|
66 | - * |
|
67 | - * @since 1.0.0 |
|
68 | - */ |
|
69 | - $a_class = apply_filters('geodir_menu_a_class', ''); |
|
70 | - $items .= '<li class="' . $li_class . '"> |
|
36 | + $items = ''; |
|
37 | + // apply filter to add more navigations // -Filter-Location-Manager |
|
38 | + |
|
39 | + if (get_option('geodir_show_listing_nav')) { |
|
40 | + |
|
41 | + $menu_class = ''; |
|
42 | + if (geodir_is_page('listing')) |
|
43 | + $menu_class = 'current-menu-item'; |
|
44 | + |
|
45 | + |
|
46 | + //SHOW LISTING OF POST TYPE IN MAIN NAVIGATION |
|
47 | + $post_types = geodir_get_posttypes('object'); |
|
48 | + $show_post_type_main_nav = get_option('geodir_add_posttype_in_main_nav'); |
|
49 | + if (!empty($post_types)) { |
|
50 | + foreach ($post_types as $post_type => $args) { |
|
51 | + if (!empty($show_post_type_main_nav)) { |
|
52 | + if (in_array($post_type, $show_post_type_main_nav)) { |
|
53 | + if (get_post_type_archive_link($post_type)) { |
|
54 | + $menu_class = ''; |
|
55 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) |
|
56 | + $menu_class = 'current-menu-item'; |
|
57 | + /** |
|
58 | + * Filter the menu li class. |
|
59 | + * |
|
60 | + * @since 1.0.0 |
|
61 | + * @param string $menu_class The menu HTML class. |
|
62 | + */ |
|
63 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class); |
|
64 | + /** |
|
65 | + * Filter the menu a class. |
|
66 | + * |
|
67 | + * @since 1.0.0 |
|
68 | + */ |
|
69 | + $a_class = apply_filters('geodir_menu_a_class', ''); |
|
70 | + $items .= '<li class="' . $li_class . '"> |
|
71 | 71 | <a href="' . get_post_type_archive_link($post_type) . '" class="' . $a_class . '"> |
72 | 72 | ' . __(ucfirst($args->labels->name)) . ' |
73 | 73 | </a> |
74 | 74 | </li>'; |
75 | - } |
|
76 | - } |
|
77 | - } |
|
78 | - } |
|
79 | - } |
|
80 | - //END LISTING OF POST TYPE IN MAIN NAVIGATION |
|
81 | - |
|
82 | - $view_posttype_listing = get_option('geodir_add_posttype_in_listing_nav'); |
|
83 | - $is_listing_sub_meny_exists = (!empty($view_posttype_listing)) ? true : false; |
|
84 | - if ($is_listing_sub_meny_exists) { |
|
85 | - /** |
|
86 | - * Filter the menu li class. |
|
87 | - * |
|
88 | - * @since 1.0.0 |
|
89 | - * @param string $menu_class The menu HTML class. |
|
90 | - */ |
|
91 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-listings ' . $menu_class); |
|
92 | - /** |
|
93 | - * Filter the sub menu li class. |
|
94 | - * |
|
95 | - * @since 1.0.0 |
|
96 | - * @param string $menu_class The menu HTML class. |
|
97 | - */ |
|
98 | - $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class); |
|
99 | - /** |
|
100 | - * Filter the sub menu ul class. |
|
101 | - * |
|
102 | - * @since 1.0.0 |
|
103 | - */ |
|
104 | - $sub_ul_class = apply_filters('geodir_sub_menu_ul_class', 'sub-menu'); |
|
105 | - /** |
|
106 | - * Filter the menu a class. |
|
107 | - * |
|
108 | - * @since 1.0.0 |
|
109 | - */ |
|
110 | - $a_class = apply_filters('geodir_menu_a_class', ''); |
|
111 | - /** |
|
112 | - * Filter the sub menu a class. |
|
113 | - * |
|
114 | - * @since 1.0.0 |
|
115 | - */ |
|
116 | - $sub_a_class = apply_filters('geodir_sub_menu_a_class', ''); |
|
117 | - $items .= '<li class="' . $li_class . '"> |
|
75 | + } |
|
76 | + } |
|
77 | + } |
|
78 | + } |
|
79 | + } |
|
80 | + //END LISTING OF POST TYPE IN MAIN NAVIGATION |
|
81 | + |
|
82 | + $view_posttype_listing = get_option('geodir_add_posttype_in_listing_nav'); |
|
83 | + $is_listing_sub_meny_exists = (!empty($view_posttype_listing)) ? true : false; |
|
84 | + if ($is_listing_sub_meny_exists) { |
|
85 | + /** |
|
86 | + * Filter the menu li class. |
|
87 | + * |
|
88 | + * @since 1.0.0 |
|
89 | + * @param string $menu_class The menu HTML class. |
|
90 | + */ |
|
91 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-listings ' . $menu_class); |
|
92 | + /** |
|
93 | + * Filter the sub menu li class. |
|
94 | + * |
|
95 | + * @since 1.0.0 |
|
96 | + * @param string $menu_class The menu HTML class. |
|
97 | + */ |
|
98 | + $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class); |
|
99 | + /** |
|
100 | + * Filter the sub menu ul class. |
|
101 | + * |
|
102 | + * @since 1.0.0 |
|
103 | + */ |
|
104 | + $sub_ul_class = apply_filters('geodir_sub_menu_ul_class', 'sub-menu'); |
|
105 | + /** |
|
106 | + * Filter the menu a class. |
|
107 | + * |
|
108 | + * @since 1.0.0 |
|
109 | + */ |
|
110 | + $a_class = apply_filters('geodir_menu_a_class', ''); |
|
111 | + /** |
|
112 | + * Filter the sub menu a class. |
|
113 | + * |
|
114 | + * @since 1.0.0 |
|
115 | + */ |
|
116 | + $sub_a_class = apply_filters('geodir_sub_menu_a_class', ''); |
|
117 | + $items .= '<li class="' . $li_class . '"> |
|
118 | 118 | <a href="#" class="' . $a_class . '">' . __('Listing', 'geodirectory') . '</a> |
119 | 119 | <ul class="' . $sub_ul_class . '">'; |
120 | - $post_types = geodir_get_posttypes('object'); |
|
120 | + $post_types = geodir_get_posttypes('object'); |
|
121 | 121 | |
122 | - $show_listing_post_types = get_option('geodir_add_posttype_in_listing_nav'); |
|
122 | + $show_listing_post_types = get_option('geodir_add_posttype_in_listing_nav'); |
|
123 | 123 | |
124 | - if (!empty($post_types)) { |
|
125 | - global $geodir_add_location_url; |
|
126 | - $geodir_add_location_url = true; |
|
127 | - foreach ($post_types as $post_type => $args) { |
|
128 | - if (!empty($show_listing_post_types)) { |
|
129 | - if (in_array($post_type, $show_listing_post_types)) { |
|
130 | - if (get_post_type_archive_link($post_type)) { |
|
124 | + if (!empty($post_types)) { |
|
125 | + global $geodir_add_location_url; |
|
126 | + $geodir_add_location_url = true; |
|
127 | + foreach ($post_types as $post_type => $args) { |
|
128 | + if (!empty($show_listing_post_types)) { |
|
129 | + if (in_array($post_type, $show_listing_post_types)) { |
|
130 | + if (get_post_type_archive_link($post_type)) { |
|
131 | 131 | |
132 | - $menu_class = ''; |
|
133 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) |
|
134 | - $menu_class = 'current-menu-item'; |
|
132 | + $menu_class = ''; |
|
133 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing')) |
|
134 | + $menu_class = 'current-menu-item'; |
|
135 | 135 | |
136 | - $items .= '<li class="' . $sub_li_class . '"> |
|
136 | + $items .= '<li class="' . $sub_li_class . '"> |
|
137 | 137 | <a href="' . get_post_type_archive_link($post_type) . '" class="' . $sub_a_class . '"> |
138 | 138 | ' . __(ucfirst($args->labels->name),'geodirectory') . ' |
139 | 139 | </a> |
140 | 140 | </li>'; |
141 | - } |
|
142 | - } |
|
143 | - } |
|
144 | - } |
|
145 | - $geodir_add_location_url = NULL; |
|
146 | - } |
|
141 | + } |
|
142 | + } |
|
143 | + } |
|
144 | + } |
|
145 | + $geodir_add_location_url = NULL; |
|
146 | + } |
|
147 | 147 | |
148 | - $items .= ' </ul> |
|
148 | + $items .= ' </ul> |
|
149 | 149 | </li>'; |
150 | - } |
|
151 | - } |
|
152 | - |
|
153 | - if (get_option('geodir_show_addlisting_nav')) { |
|
154 | - |
|
155 | - $menu_class = ''; |
|
156 | - if (geodir_is_page('add-listing')) |
|
157 | - $menu_class = 'current-menu-item'; |
|
158 | - |
|
159 | - //SHOW ADD LISTING POST TYPE IN MAIN NAVIGATION |
|
160 | - $post_types = geodir_get_posttypes('object'); |
|
161 | - $show_add_listing_post_types_main_nav = get_option('geodir_add_listing_link_main_nav'); |
|
162 | - $geodir_allow_posttype_frontend = get_option('geodir_allow_posttype_frontend'); |
|
163 | - |
|
164 | - if (!empty($post_types)) { |
|
165 | - foreach ($post_types as $post_type => $args) { |
|
166 | - if (!empty($geodir_allow_posttype_frontend)) { |
|
167 | - if (in_array($post_type, $geodir_allow_posttype_frontend)) { |
|
168 | - if (!empty($show_add_listing_post_types_main_nav)) { |
|
169 | - if (in_array($post_type, $show_add_listing_post_types_main_nav)) { |
|
170 | - if (geodir_get_addlisting_link($post_type)) { |
|
171 | - |
|
172 | - $menu_class = ''; |
|
173 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) |
|
174 | - $menu_class = 'current-menu-item'; |
|
175 | - /** |
|
176 | - * Filter the menu li class. |
|
177 | - * |
|
178 | - * @since 1.0.0 |
|
179 | - * @param string $menu_class The menu HTML class. |
|
180 | - */ |
|
181 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class); |
|
182 | - /** |
|
183 | - * Filter the menu a class. |
|
184 | - * |
|
185 | - * @since 1.0.0 |
|
186 | - */ |
|
187 | - $a_class = apply_filters('geodir_menu_a_class', ''); |
|
188 | - $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
|
189 | - $items .= '<li class="' . $li_class . '"> |
|
150 | + } |
|
151 | + } |
|
152 | + |
|
153 | + if (get_option('geodir_show_addlisting_nav')) { |
|
154 | + |
|
155 | + $menu_class = ''; |
|
156 | + if (geodir_is_page('add-listing')) |
|
157 | + $menu_class = 'current-menu-item'; |
|
158 | + |
|
159 | + //SHOW ADD LISTING POST TYPE IN MAIN NAVIGATION |
|
160 | + $post_types = geodir_get_posttypes('object'); |
|
161 | + $show_add_listing_post_types_main_nav = get_option('geodir_add_listing_link_main_nav'); |
|
162 | + $geodir_allow_posttype_frontend = get_option('geodir_allow_posttype_frontend'); |
|
163 | + |
|
164 | + if (!empty($post_types)) { |
|
165 | + foreach ($post_types as $post_type => $args) { |
|
166 | + if (!empty($geodir_allow_posttype_frontend)) { |
|
167 | + if (in_array($post_type, $geodir_allow_posttype_frontend)) { |
|
168 | + if (!empty($show_add_listing_post_types_main_nav)) { |
|
169 | + if (in_array($post_type, $show_add_listing_post_types_main_nav)) { |
|
170 | + if (geodir_get_addlisting_link($post_type)) { |
|
171 | + |
|
172 | + $menu_class = ''; |
|
173 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) |
|
174 | + $menu_class = 'current-menu-item'; |
|
175 | + /** |
|
176 | + * Filter the menu li class. |
|
177 | + * |
|
178 | + * @since 1.0.0 |
|
179 | + * @param string $menu_class The menu HTML class. |
|
180 | + */ |
|
181 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class); |
|
182 | + /** |
|
183 | + * Filter the menu a class. |
|
184 | + * |
|
185 | + * @since 1.0.0 |
|
186 | + */ |
|
187 | + $a_class = apply_filters('geodir_menu_a_class', ''); |
|
188 | + $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
|
189 | + $items .= '<li class="' . $li_class . '"> |
|
190 | 190 | <a href="' . geodir_get_addlisting_link($post_type) . '" class="' . $a_class . '"> |
191 | 191 | ' . sprintf( __('Add %s', 'geodirectory'), $cpt_name ) . ' |
192 | 192 | </a> |
193 | 193 | </li>'; |
194 | - } |
|
195 | - } |
|
196 | - } |
|
197 | - } |
|
198 | - } |
|
199 | - } |
|
200 | - } |
|
201 | - //END SHOW ADD LISTING POST TYPE IN MAIN NAVIGATION |
|
202 | - } |
|
203 | - |
|
204 | - $view_add_posttype_listing = get_option('geodir_add_listing_link_add_listing_nav'); |
|
205 | - $is_add_listing_sub_meny_exists = (!empty($view_add_posttype_listing)) ? true : false; |
|
206 | - if ($is_add_listing_sub_meny_exists) { |
|
207 | - |
|
208 | - if (get_option('geodir_show_addlisting_nav')) { |
|
209 | - /** |
|
210 | - * Filter the menu li class. |
|
211 | - * |
|
212 | - * @since 1.0.0 |
|
213 | - * @param string $menu_class The menu HTML class. |
|
214 | - */ |
|
215 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-add-listing ' . $menu_class); |
|
216 | - /** |
|
217 | - * Filter the sub menu li class. |
|
218 | - * |
|
219 | - * @since 1.0.0 |
|
220 | - * @param string $menu_class The menu HTML class. |
|
221 | - */ |
|
222 | - $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class); |
|
223 | - /** |
|
224 | - * Filter the sub menu ul class. |
|
225 | - * |
|
226 | - * @since 1.0.0 |
|
227 | - */ |
|
228 | - $sub_ul_class = apply_filters('geodir_sub_menu_ul_class', 'sub-menu'); |
|
229 | - /** |
|
230 | - * Filter the menu a class. |
|
231 | - * |
|
232 | - * @since 1.0.0 |
|
233 | - */ |
|
234 | - $a_class = apply_filters('geodir_menu_a_class', ''); |
|
235 | - /** |
|
236 | - * Filter the sub menu a class. |
|
237 | - * |
|
238 | - * @since 1.0.0 |
|
239 | - */ |
|
240 | - $sub_a_class = apply_filters('geodir_sub_menu_a_class', ''); |
|
241 | - $items .= '<li class="' . $li_class . '"> |
|
194 | + } |
|
195 | + } |
|
196 | + } |
|
197 | + } |
|
198 | + } |
|
199 | + } |
|
200 | + } |
|
201 | + //END SHOW ADD LISTING POST TYPE IN MAIN NAVIGATION |
|
202 | + } |
|
203 | + |
|
204 | + $view_add_posttype_listing = get_option('geodir_add_listing_link_add_listing_nav'); |
|
205 | + $is_add_listing_sub_meny_exists = (!empty($view_add_posttype_listing)) ? true : false; |
|
206 | + if ($is_add_listing_sub_meny_exists) { |
|
207 | + |
|
208 | + if (get_option('geodir_show_addlisting_nav')) { |
|
209 | + /** |
|
210 | + * Filter the menu li class. |
|
211 | + * |
|
212 | + * @since 1.0.0 |
|
213 | + * @param string $menu_class The menu HTML class. |
|
214 | + */ |
|
215 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-add-listing ' . $menu_class); |
|
216 | + /** |
|
217 | + * Filter the sub menu li class. |
|
218 | + * |
|
219 | + * @since 1.0.0 |
|
220 | + * @param string $menu_class The menu HTML class. |
|
221 | + */ |
|
222 | + $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class); |
|
223 | + /** |
|
224 | + * Filter the sub menu ul class. |
|
225 | + * |
|
226 | + * @since 1.0.0 |
|
227 | + */ |
|
228 | + $sub_ul_class = apply_filters('geodir_sub_menu_ul_class', 'sub-menu'); |
|
229 | + /** |
|
230 | + * Filter the menu a class. |
|
231 | + * |
|
232 | + * @since 1.0.0 |
|
233 | + */ |
|
234 | + $a_class = apply_filters('geodir_menu_a_class', ''); |
|
235 | + /** |
|
236 | + * Filter the sub menu a class. |
|
237 | + * |
|
238 | + * @since 1.0.0 |
|
239 | + */ |
|
240 | + $sub_a_class = apply_filters('geodir_sub_menu_a_class', ''); |
|
241 | + $items .= '<li class="' . $li_class . '"> |
|
242 | 242 | <a href="#" class="' . $a_class . '">' . __('Add Listing', 'geodirectory') . '</a> |
243 | 243 | <ul class="' . $sub_ul_class . '">'; |
244 | 244 | |
245 | - $post_types = geodir_get_posttypes('object'); |
|
246 | - |
|
247 | - $show_add_listing_post_types = get_option('geodir_add_listing_link_add_listing_nav'); |
|
248 | - |
|
249 | - if (!empty($post_types)) { |
|
250 | - foreach ($post_types as $post_type => $args) { |
|
251 | - if (!empty($geodir_allow_posttype_frontend)) { |
|
252 | - if (in_array($post_type, $geodir_allow_posttype_frontend)) { |
|
253 | - if (!empty($show_add_listing_post_types)) { |
|
254 | - if (in_array($post_type, $show_add_listing_post_types)) { |
|
255 | - if (geodir_get_addlisting_link($post_type)) { |
|
256 | - |
|
257 | - $menu_class = ''; |
|
258 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) |
|
259 | - $menu_class = 'current-menu-item'; |
|
260 | - /** |
|
261 | - * Filter the menu li class. |
|
262 | - * |
|
263 | - * @since 1.0.0 |
|
264 | - * @param string $menu_class The menu HTML class. |
|
265 | - */ |
|
266 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class); |
|
267 | - $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
|
268 | - $items .= '<li class="' . $li_class . '"> |
|
245 | + $post_types = geodir_get_posttypes('object'); |
|
246 | + |
|
247 | + $show_add_listing_post_types = get_option('geodir_add_listing_link_add_listing_nav'); |
|
248 | + |
|
249 | + if (!empty($post_types)) { |
|
250 | + foreach ($post_types as $post_type => $args) { |
|
251 | + if (!empty($geodir_allow_posttype_frontend)) { |
|
252 | + if (in_array($post_type, $geodir_allow_posttype_frontend)) { |
|
253 | + if (!empty($show_add_listing_post_types)) { |
|
254 | + if (in_array($post_type, $show_add_listing_post_types)) { |
|
255 | + if (geodir_get_addlisting_link($post_type)) { |
|
256 | + |
|
257 | + $menu_class = ''; |
|
258 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing')) |
|
259 | + $menu_class = 'current-menu-item'; |
|
260 | + /** |
|
261 | + * Filter the menu li class. |
|
262 | + * |
|
263 | + * @since 1.0.0 |
|
264 | + * @param string $menu_class The menu HTML class. |
|
265 | + */ |
|
266 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class); |
|
267 | + $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
|
268 | + $items .= '<li class="' . $li_class . '"> |
|
269 | 269 | <a href="' . geodir_get_addlisting_link($post_type) . '" class="' . $sub_a_class . '"> |
270 | 270 | ' . sprintf( __('Add %s', 'geodirectory'), $cpt_name ) . ' |
271 | 271 | </a> |
272 | 272 | </li>'; |
273 | - } |
|
274 | - } |
|
275 | - } |
|
276 | - } |
|
277 | - } |
|
278 | - } |
|
279 | - } |
|
273 | + } |
|
274 | + } |
|
275 | + } |
|
276 | + } |
|
277 | + } |
|
278 | + } |
|
279 | + } |
|
280 | 280 | |
281 | - $items .= ' </ul> |
|
281 | + $items .= ' </ul> |
|
282 | 282 | </li>'; |
283 | - } |
|
284 | - } |
|
285 | - // apply filter to add more navigations // -Filter-Location-Manager |
|
286 | - return $items; |
|
283 | + } |
|
284 | + } |
|
285 | + // apply filter to add more navigations // -Filter-Location-Manager |
|
286 | + return $items; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | |
@@ -301,20 +301,20 @@ discard block |
||
301 | 301 | */ |
302 | 302 | function geodir_pagemenu_items($menu, $args) |
303 | 303 | { |
304 | - $locations = get_nav_menu_locations(); |
|
305 | - $geodir_theme_location = get_option('geodir_theme_location_nav'); |
|
306 | - $geodir_theme_location_nav = array(); |
|
307 | - if (empty($locations) && empty($geodir_theme_location)) { |
|
308 | - $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu); |
|
309 | - $geodir_theme_location_nav[] = $args['theme_location']; |
|
310 | - update_option('geodir_theme_location_nav', $geodir_theme_location_nav); |
|
311 | - } |
|
312 | - //else if(empty($geodir_theme_location)) // It means 'Show geodirectory navigation in selected menu locations' is not set yet. |
|
304 | + $locations = get_nav_menu_locations(); |
|
305 | + $geodir_theme_location = get_option('geodir_theme_location_nav'); |
|
306 | + $geodir_theme_location_nav = array(); |
|
307 | + if (empty($locations) && empty($geodir_theme_location)) { |
|
308 | + $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu); |
|
309 | + $geodir_theme_location_nav[] = $args['theme_location']; |
|
310 | + update_option('geodir_theme_location_nav', $geodir_theme_location_nav); |
|
311 | + } |
|
312 | + //else if(empty($geodir_theme_location)) // It means 'Show geodirectory navigation in selected menu locations' is not set yet. |
|
313 | 313 | // $menu = str_replace("</ul></div>",geodir_add_nav_menu_items()."</ul></div>",$menu); |
314 | - else if (is_array($geodir_theme_location) && isset($args['theme_location']) && in_array($args['theme_location'], $geodir_theme_location)) |
|
315 | - $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu); |
|
314 | + else if (is_array($geodir_theme_location) && isset($args['theme_location']) && in_array($args['theme_location'], $geodir_theme_location)) |
|
315 | + $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu); |
|
316 | 316 | |
317 | - return $menu; |
|
317 | + return $menu; |
|
318 | 318 | |
319 | 319 | } |
320 | 320 | |
@@ -334,18 +334,18 @@ discard block |
||
334 | 334 | function geodir_menu_items($items, $args) |
335 | 335 | { |
336 | 336 | |
337 | - $location = $args->theme_location; |
|
337 | + $location = $args->theme_location; |
|
338 | 338 | |
339 | - $geodir_theme_location = get_option('geodir_theme_location_nav'); |
|
339 | + $geodir_theme_location = get_option('geodir_theme_location_nav'); |
|
340 | 340 | |
341 | - if (has_nav_menu($location) == '1' && is_array($geodir_theme_location) && in_array($location, $geodir_theme_location)) { |
|
341 | + if (has_nav_menu($location) == '1' && is_array($geodir_theme_location) && in_array($location, $geodir_theme_location)) { |
|
342 | 342 | |
343 | - $items = $items . geodir_add_nav_menu_items(); |
|
344 | - return $items; |
|
343 | + $items = $items . geodir_add_nav_menu_items(); |
|
344 | + return $items; |
|
345 | 345 | |
346 | - } else { |
|
347 | - return $items; |
|
348 | - } |
|
346 | + } else { |
|
347 | + return $items; |
|
348 | + } |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | /** |
@@ -360,25 +360,25 @@ discard block |
||
360 | 360 | */ |
361 | 361 | function geodir_get_category_all_array() |
362 | 362 | { |
363 | - global $wpdb; |
|
364 | - $return_array = array(); |
|
365 | - |
|
366 | - $taxonomies = geodir_get_taxonomies(); |
|
367 | - $taxonomies = implode("','", $taxonomies); |
|
368 | - $taxonomies = "'" . $taxonomies . "'"; |
|
369 | - |
|
370 | - $pn_categories = $wpdb->get_results( |
|
371 | - $wpdb->prepare( |
|
372 | - "SELECT $wpdb->terms.name as name, $wpdb->term_taxonomy.count as count, $wpdb->terms.term_id as cat_ID FROM $wpdb->term_taxonomy, $wpdb->terms WHERE $wpdb->term_taxonomy.term_id = %d AND $wpdb->term_taxonomy.taxonomy in ( $taxonomies ) ORDER BY name", |
|
373 | - array($wpdb->terms . term_id) |
|
374 | - ) |
|
375 | - ); |
|
376 | - |
|
377 | - foreach ($pn_categories as $pn_categories_obj) { |
|
378 | - $return_array[] = array("id" => $pn_categories_obj->cat_ID, |
|
379 | - "title" => $pn_categories_obj->name,); |
|
380 | - } |
|
381 | - return $return_array; |
|
363 | + global $wpdb; |
|
364 | + $return_array = array(); |
|
365 | + |
|
366 | + $taxonomies = geodir_get_taxonomies(); |
|
367 | + $taxonomies = implode("','", $taxonomies); |
|
368 | + $taxonomies = "'" . $taxonomies . "'"; |
|
369 | + |
|
370 | + $pn_categories = $wpdb->get_results( |
|
371 | + $wpdb->prepare( |
|
372 | + "SELECT $wpdb->terms.name as name, $wpdb->term_taxonomy.count as count, $wpdb->terms.term_id as cat_ID FROM $wpdb->term_taxonomy, $wpdb->terms WHERE $wpdb->term_taxonomy.term_id = %d AND $wpdb->term_taxonomy.taxonomy in ( $taxonomies ) ORDER BY name", |
|
373 | + array($wpdb->terms . term_id) |
|
374 | + ) |
|
375 | + ); |
|
376 | + |
|
377 | + foreach ($pn_categories as $pn_categories_obj) { |
|
378 | + $return_array[] = array("id" => $pn_categories_obj->cat_ID, |
|
379 | + "title" => $pn_categories_obj->name,); |
|
380 | + } |
|
381 | + return $return_array; |
|
382 | 382 | } |
383 | 383 | |
384 | 384 | |
@@ -393,32 +393,32 @@ discard block |
||
393 | 393 | */ |
394 | 394 | function geodir_get_current_posttype() |
395 | 395 | { |
396 | - global $wp_query, $geodir_post_type; |
|
396 | + global $wp_query, $geodir_post_type; |
|
397 | 397 | |
398 | - $geodir_post_type = get_query_var('post_type'); |
|
398 | + $geodir_post_type = get_query_var('post_type'); |
|
399 | 399 | |
400 | - if (geodir_is_page('add-listing') || geodir_is_page('preview')) { |
|
401 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
|
402 | - $geodir_post_type = get_post_type((int)$_REQUEST['pid']); |
|
403 | - elseif (isset($_REQUEST['listing_type'])) |
|
404 | - $geodir_post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
405 | - } |
|
400 | + if (geodir_is_page('add-listing') || geodir_is_page('preview')) { |
|
401 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
|
402 | + $geodir_post_type = get_post_type((int)$_REQUEST['pid']); |
|
403 | + elseif (isset($_REQUEST['listing_type'])) |
|
404 | + $geodir_post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
405 | + } |
|
406 | 406 | |
407 | - if ((geodir_is_page('search') || geodir_is_page('author')) && isset($_REQUEST['stype'])) |
|
408 | - $geodir_post_type = sanitize_text_field($_REQUEST['stype']); |
|
407 | + if ((geodir_is_page('search') || geodir_is_page('author')) && isset($_REQUEST['stype'])) |
|
408 | + $geodir_post_type = sanitize_text_field($_REQUEST['stype']); |
|
409 | 409 | |
410 | - if (is_tax()) |
|
411 | - $geodir_post_type = geodir_get_taxonomy_posttype(); |
|
410 | + if (is_tax()) |
|
411 | + $geodir_post_type = geodir_get_taxonomy_posttype(); |
|
412 | 412 | |
413 | 413 | |
414 | - $all_postypes = geodir_get_posttypes(); |
|
415 | - $all_postypes = stripslashes_deep($all_postypes); |
|
414 | + $all_postypes = geodir_get_posttypes(); |
|
415 | + $all_postypes = stripslashes_deep($all_postypes); |
|
416 | 416 | |
417 | - if (is_array($all_postypes) && !in_array($geodir_post_type, $all_postypes)) |
|
418 | - $geodir_post_type = ''; |
|
417 | + if (is_array($all_postypes) && !in_array($geodir_post_type, $all_postypes)) |
|
418 | + $geodir_post_type = ''; |
|
419 | 419 | |
420 | 420 | |
421 | - return $geodir_post_type; |
|
421 | + return $geodir_post_type; |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | /** |
@@ -432,21 +432,21 @@ discard block |
||
432 | 432 | */ |
433 | 433 | function geodir_get_posttypes($output = 'names') |
434 | 434 | { |
435 | - $post_types = array(); |
|
436 | - $post_types = get_option('geodir_post_types'); |
|
437 | - $post_types = stripslashes_deep($post_types); |
|
438 | - if (!empty($post_types)) { |
|
439 | - switch ($output): |
|
440 | - case 'object': |
|
441 | - case 'Object': |
|
442 | - $post_types = json_decode(json_encode($post_types), FALSE);//(object)$post_types; |
|
443 | - break; |
|
444 | - case 'array': |
|
445 | - case 'Array': |
|
446 | - $post_types = (array)$post_types; |
|
447 | - break; |
|
435 | + $post_types = array(); |
|
436 | + $post_types = get_option('geodir_post_types'); |
|
437 | + $post_types = stripslashes_deep($post_types); |
|
438 | + if (!empty($post_types)) { |
|
439 | + switch ($output): |
|
440 | + case 'object': |
|
441 | + case 'Object': |
|
442 | + $post_types = json_decode(json_encode($post_types), FALSE);//(object)$post_types; |
|
443 | + break; |
|
444 | + case 'array': |
|
445 | + case 'Array': |
|
446 | + $post_types = (array)$post_types; |
|
447 | + break; |
|
448 | 448 | case 'options': |
449 | - $post_types = (array)$post_types; |
|
449 | + $post_types = (array)$post_types; |
|
450 | 450 | |
451 | 451 | $options = array(); |
452 | 452 | if (!empty($post_types)) { |
@@ -455,17 +455,17 @@ discard block |
||
455 | 455 | } |
456 | 456 | } |
457 | 457 | $post_types = $options; |
458 | - break; |
|
459 | - default: |
|
460 | - $post_types = array_keys($post_types); |
|
461 | - break; |
|
462 | - endswitch; |
|
463 | - } |
|
464 | - |
|
465 | - if (!empty($post_types)) |
|
466 | - return $post_types; |
|
467 | - else |
|
468 | - return array(); |
|
458 | + break; |
|
459 | + default: |
|
460 | + $post_types = array_keys($post_types); |
|
461 | + break; |
|
462 | + endswitch; |
|
463 | + } |
|
464 | + |
|
465 | + if (!empty($post_types)) |
|
466 | + return $post_types; |
|
467 | + else |
|
468 | + return array(); |
|
469 | 469 | } |
470 | 470 | |
471 | 471 | /** |
@@ -478,108 +478,108 @@ discard block |
||
478 | 478 | */ |
479 | 479 | function geodir_get_posttype_info($post_type = '') |
480 | 480 | { |
481 | - $post_types = array(); |
|
482 | - $post_types = get_option('geodir_post_types'); |
|
483 | - $post_types = stripslashes_deep($post_types); |
|
484 | - if (!empty($post_types) && $post_type != '') { |
|
485 | - return $post_types[$post_type]; |
|
486 | - } else |
|
487 | - return false; |
|
481 | + $post_types = array(); |
|
482 | + $post_types = get_option('geodir_post_types'); |
|
483 | + $post_types = stripslashes_deep($post_types); |
|
484 | + if (!empty($post_types) && $post_type != '') { |
|
485 | + return $post_types[$post_type]; |
|
486 | + } else |
|
487 | + return false; |
|
488 | 488 | } |
489 | 489 | |
490 | 490 | if (!function_exists('geodir_get_taxonomies')) { |
491 | - /** |
|
492 | - * Get all custom taxonomies. |
|
493 | - * |
|
494 | - * @since 1.0.0 |
|
495 | - * @package GeoDirectory |
|
496 | - * @param string $post_type The post type. |
|
497 | - * @param bool $tages_taxonomies Is this a tag taxonomy?. Default: false. |
|
498 | - * @return array|bool Taxonomies on success. false on failure. |
|
499 | - */ |
|
500 | - function geodir_get_taxonomies($post_type = '', $tages_taxonomies = false) |
|
501 | - { |
|
491 | + /** |
|
492 | + * Get all custom taxonomies. |
|
493 | + * |
|
494 | + * @since 1.0.0 |
|
495 | + * @package GeoDirectory |
|
496 | + * @param string $post_type The post type. |
|
497 | + * @param bool $tages_taxonomies Is this a tag taxonomy?. Default: false. |
|
498 | + * @return array|bool Taxonomies on success. false on failure. |
|
499 | + */ |
|
500 | + function geodir_get_taxonomies($post_type = '', $tages_taxonomies = false) |
|
501 | + { |
|
502 | 502 | |
503 | - $taxonomies = array(); |
|
504 | - $gd_taxonomies = array(); |
|
503 | + $taxonomies = array(); |
|
504 | + $gd_taxonomies = array(); |
|
505 | 505 | |
506 | - if ($taxonomies = get_option('geodir_taxonomies')) { |
|
506 | + if ($taxonomies = get_option('geodir_taxonomies')) { |
|
507 | 507 | |
508 | 508 | |
509 | - $gd_taxonomies = array_keys($taxonomies); |
|
509 | + $gd_taxonomies = array_keys($taxonomies); |
|
510 | 510 | |
511 | 511 | |
512 | - if ($post_type != '') |
|
513 | - $gd_taxonomies = array(); |
|
512 | + if ($post_type != '') |
|
513 | + $gd_taxonomies = array(); |
|
514 | 514 | |
515 | - $i = 0; |
|
516 | - foreach ($taxonomies as $taxonomy => $args) { |
|
515 | + $i = 0; |
|
516 | + foreach ($taxonomies as $taxonomy => $args) { |
|
517 | 517 | |
518 | - if ($post_type != '' && $args['object_type'] == $post_type) |
|
519 | - $gd_taxonomies[] = $taxonomy; |
|
518 | + if ($post_type != '' && $args['object_type'] == $post_type) |
|
519 | + $gd_taxonomies[] = $taxonomy; |
|
520 | 520 | |
521 | - if ($tages_taxonomies === false && strpos($taxonomy, '_tag') !== false) { |
|
522 | - if (array_search($taxonomy, $gd_taxonomies) !== false) |
|
523 | - unset($gd_taxonomies[array_search($taxonomy, $gd_taxonomies)]); |
|
524 | - } |
|
521 | + if ($tages_taxonomies === false && strpos($taxonomy, '_tag') !== false) { |
|
522 | + if (array_search($taxonomy, $gd_taxonomies) !== false) |
|
523 | + unset($gd_taxonomies[array_search($taxonomy, $gd_taxonomies)]); |
|
524 | + } |
|
525 | 525 | |
526 | - } |
|
526 | + } |
|
527 | + |
|
528 | + $gd_taxonomies = array_values($gd_taxonomies); |
|
529 | + } |
|
527 | 530 | |
528 | - $gd_taxonomies = array_values($gd_taxonomies); |
|
529 | - } |
|
530 | - |
|
531 | - /** |
|
532 | - * Filter the taxonomies. |
|
533 | - * |
|
534 | - * @since 1.0.0 |
|
535 | - * @param array $gd_taxonomies The taxonomy array. |
|
536 | - */ |
|
537 | - $taxonomies = apply_filters('geodir_taxonomy', $gd_taxonomies); |
|
538 | - |
|
539 | - if (!empty($taxonomies)) { |
|
540 | - return $taxonomies; |
|
541 | - } else { |
|
542 | - return false; |
|
543 | - } |
|
544 | - } |
|
531 | + /** |
|
532 | + * Filter the taxonomies. |
|
533 | + * |
|
534 | + * @since 1.0.0 |
|
535 | + * @param array $gd_taxonomies The taxonomy array. |
|
536 | + */ |
|
537 | + $taxonomies = apply_filters('geodir_taxonomy', $gd_taxonomies); |
|
538 | + |
|
539 | + if (!empty($taxonomies)) { |
|
540 | + return $taxonomies; |
|
541 | + } else { |
|
542 | + return false; |
|
543 | + } |
|
544 | + } |
|
545 | 545 | } |
546 | 546 | |
547 | 547 | if (!function_exists(' geodir_get_categories_dl')) { |
548 | - /** |
|
549 | - * Get categories dropdown HTML. |
|
550 | - * |
|
551 | - * @since 1.0.0 |
|
552 | - * @package GeoDirectory |
|
553 | - * @param string $post_type The post type. |
|
554 | - * @param string $selected The selected value. |
|
555 | - * @param bool $tages_taxonomies Is this a tag taxonomy?. Default: false. |
|
556 | - * @param bool $echo Prints the HTML when set to true. Default: true. |
|
557 | - * @return void|string Dropdown HTML. |
|
558 | - */ |
|
559 | - function geodir_get_categories_dl($post_type = '', $selected = '', $tages_taxonomies = false, $echo = true) |
|
560 | - { |
|
561 | - |
|
562 | - $html = ''; |
|
563 | - $taxonomies = geodir_get_taxonomies($post_type, $tages_taxonomies); |
|
564 | - |
|
565 | - $categories = get_terms($taxonomies); |
|
566 | - |
|
567 | - $html .= '<option value="0">' . __('All', 'geodirectory') . '</option>'; |
|
568 | - |
|
569 | - foreach ($categories as $category_obj) { |
|
570 | - $select_opt = ''; |
|
571 | - if ($selected == $category_obj->term_id) { |
|
572 | - $select_opt = 'selected="selected"'; |
|
573 | - } |
|
574 | - $html .= '<option ' . $select_opt . ' value="' . $category_obj->term_id . '">' |
|
575 | - . ucfirst($category_obj->name) . '</option>'; |
|
576 | - } |
|
577 | - |
|
578 | - if ($echo) |
|
579 | - echo $html; |
|
580 | - else |
|
581 | - return $html; |
|
582 | - } |
|
548 | + /** |
|
549 | + * Get categories dropdown HTML. |
|
550 | + * |
|
551 | + * @since 1.0.0 |
|
552 | + * @package GeoDirectory |
|
553 | + * @param string $post_type The post type. |
|
554 | + * @param string $selected The selected value. |
|
555 | + * @param bool $tages_taxonomies Is this a tag taxonomy?. Default: false. |
|
556 | + * @param bool $echo Prints the HTML when set to true. Default: true. |
|
557 | + * @return void|string Dropdown HTML. |
|
558 | + */ |
|
559 | + function geodir_get_categories_dl($post_type = '', $selected = '', $tages_taxonomies = false, $echo = true) |
|
560 | + { |
|
561 | + |
|
562 | + $html = ''; |
|
563 | + $taxonomies = geodir_get_taxonomies($post_type, $tages_taxonomies); |
|
564 | + |
|
565 | + $categories = get_terms($taxonomies); |
|
566 | + |
|
567 | + $html .= '<option value="0">' . __('All', 'geodirectory') . '</option>'; |
|
568 | + |
|
569 | + foreach ($categories as $category_obj) { |
|
570 | + $select_opt = ''; |
|
571 | + if ($selected == $category_obj->term_id) { |
|
572 | + $select_opt = 'selected="selected"'; |
|
573 | + } |
|
574 | + $html .= '<option ' . $select_opt . ' value="' . $category_obj->term_id . '">' |
|
575 | + . ucfirst($category_obj->name) . '</option>'; |
|
576 | + } |
|
577 | + |
|
578 | + if ($echo) |
|
579 | + echo $html; |
|
580 | + else |
|
581 | + return $html; |
|
582 | + } |
|
583 | 583 | } |
584 | 584 | |
585 | 585 | |
@@ -594,28 +594,28 @@ discard block |
||
594 | 594 | function geodir_get_listing_slug($object_type = '') |
595 | 595 | { |
596 | 596 | |
597 | - $listing_slug = ''; |
|
597 | + $listing_slug = ''; |
|
598 | 598 | |
599 | - $post_types = get_option('geodir_post_types'); |
|
600 | - $taxonomies = get_option('geodir_taxonomies'); |
|
599 | + $post_types = get_option('geodir_post_types'); |
|
600 | + $taxonomies = get_option('geodir_taxonomies'); |
|
601 | 601 | |
602 | 602 | |
603 | - if ($object_type != '') { |
|
604 | - if (!empty($post_types) && array_key_exists($object_type, $post_types)) { |
|
603 | + if ($object_type != '') { |
|
604 | + if (!empty($post_types) && array_key_exists($object_type, $post_types)) { |
|
605 | 605 | |
606 | - $object_info = $post_types[$object_type]; |
|
607 | - $listing_slug = $object_info['listing_slug']; |
|
608 | - } elseif (!empty($taxonomies) && array_key_exists($object_type, $taxonomies)) { |
|
609 | - $object_info = $taxonomies[$object_type]; |
|
610 | - $listing_slug = $object_info['listing_slug']; |
|
611 | - } |
|
606 | + $object_info = $post_types[$object_type]; |
|
607 | + $listing_slug = $object_info['listing_slug']; |
|
608 | + } elseif (!empty($taxonomies) && array_key_exists($object_type, $taxonomies)) { |
|
609 | + $object_info = $taxonomies[$object_type]; |
|
610 | + $listing_slug = $object_info['listing_slug']; |
|
611 | + } |
|
612 | 612 | |
613 | - } |
|
613 | + } |
|
614 | 614 | |
615 | - if (!empty($listing_slug)) |
|
616 | - return $listing_slug; |
|
617 | - else |
|
618 | - return false; |
|
615 | + if (!empty($listing_slug)) |
|
616 | + return $listing_slug; |
|
617 | + else |
|
618 | + return false; |
|
619 | 619 | } |
620 | 620 | |
621 | 621 | |
@@ -630,212 +630,212 @@ discard block |
||
630 | 630 | */ |
631 | 631 | function geodir_get_taxonomy_posttype($taxonomy = '') |
632 | 632 | { |
633 | - global $wp_query; |
|
634 | - |
|
635 | - $post_type = array(); |
|
636 | - $taxonomies = array(); |
|
637 | - |
|
638 | - if (!empty($taxonomy)) { |
|
639 | - $taxonomies[] = $taxonomy; |
|
640 | - } elseif (isset($wp_query->tax_query->queries)) { |
|
641 | - $tax_arr = $wp_query->tax_query->queries; |
|
642 | - //if tax query has 'relation' set then it will break wp_list_pluck so we remove it |
|
643 | - if(isset( $tax_arr['relation'])){unset( $tax_arr['relation']);} |
|
644 | - $taxonomies = wp_list_pluck($tax_arr, 'taxonomy'); |
|
645 | - } |
|
646 | - |
|
647 | - if (!empty($taxonomies)) { |
|
648 | - foreach (geodir_get_posttypes() as $pt) { |
|
649 | - $object_taxonomies = $pt === 'attachment' ? get_taxonomies_for_attachments() : get_object_taxonomies($pt); |
|
650 | - if (array_intersect($taxonomies, $object_taxonomies)) |
|
651 | - $post_type[] = $pt; |
|
652 | - } |
|
653 | - } |
|
654 | - |
|
655 | - if (!empty($post_type)) |
|
656 | - return $post_type[0]; |
|
657 | - else |
|
658 | - return false; |
|
633 | + global $wp_query; |
|
634 | + |
|
635 | + $post_type = array(); |
|
636 | + $taxonomies = array(); |
|
637 | + |
|
638 | + if (!empty($taxonomy)) { |
|
639 | + $taxonomies[] = $taxonomy; |
|
640 | + } elseif (isset($wp_query->tax_query->queries)) { |
|
641 | + $tax_arr = $wp_query->tax_query->queries; |
|
642 | + //if tax query has 'relation' set then it will break wp_list_pluck so we remove it |
|
643 | + if(isset( $tax_arr['relation'])){unset( $tax_arr['relation']);} |
|
644 | + $taxonomies = wp_list_pluck($tax_arr, 'taxonomy'); |
|
645 | + } |
|
646 | + |
|
647 | + if (!empty($taxonomies)) { |
|
648 | + foreach (geodir_get_posttypes() as $pt) { |
|
649 | + $object_taxonomies = $pt === 'attachment' ? get_taxonomies_for_attachments() : get_object_taxonomies($pt); |
|
650 | + if (array_intersect($taxonomies, $object_taxonomies)) |
|
651 | + $post_type[] = $pt; |
|
652 | + } |
|
653 | + } |
|
654 | + |
|
655 | + if (!empty($post_type)) |
|
656 | + return $post_type[0]; |
|
657 | + else |
|
658 | + return false; |
|
659 | 659 | } |
660 | 660 | |
661 | 661 | if (!function_exists('geodir_custom_taxonomy_walker')) { |
662 | - /** |
|
663 | - * Custom taxonomy walker function. |
|
664 | - * |
|
665 | - * @since 1.0.0 |
|
666 | - * @package GeoDirectory |
|
667 | - * @param string $cat_taxonomy The taxonomy name. |
|
668 | - * @param int $cat_parent The parent term ID. |
|
669 | - * @param bool $hide_empty Hide empty taxonomies? Default: false. |
|
670 | - * @param int $pading CSS padding in pixels. |
|
671 | - * @return string|void taxonomy HTML. |
|
672 | - */ |
|
673 | - function geodir_custom_taxonomy_walker($cat_taxonomy, $cat_parent = 0, $hide_empty = false, $pading = 0) |
|
674 | - { |
|
675 | - global $cat_display, $post_cat, $exclude_cats; |
|
676 | - |
|
677 | - $search_terms = trim($post_cat, ","); |
|
678 | - |
|
679 | - $search_terms = explode(",", $search_terms); |
|
680 | - |
|
681 | - $cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'hide_empty' => $hide_empty, 'exclude' => $exclude_cats)); |
|
682 | - |
|
683 | - $display = ''; |
|
684 | - $onchange = ''; |
|
685 | - $term_check = ''; |
|
686 | - $main_list_class = ''; |
|
687 | - $out = ''; |
|
688 | - //If there are terms, start displaying |
|
689 | - if (count($cat_terms) > 0) { |
|
690 | - //Displaying as a list |
|
691 | - $p = $pading * 20; |
|
692 | - $pading++; |
|
693 | - |
|
694 | - |
|
695 | - if ((!geodir_is_page('listing')) || (is_search() && $_REQUEST['search_taxonomy'] == '')) { |
|
696 | - if ($cat_parent == 0) { |
|
697 | - $list_class = 'main_list gd-parent-cats-list gd-cats-display-' . $cat_display; |
|
698 | - $main_list_class = 'class="main_list_selecter"'; |
|
699 | - } else { |
|
700 | - //$display = 'display:none'; |
|
701 | - $list_class = 'sub_list gd-sub-cats-list'; |
|
702 | - } |
|
703 | - } |
|
662 | + /** |
|
663 | + * Custom taxonomy walker function. |
|
664 | + * |
|
665 | + * @since 1.0.0 |
|
666 | + * @package GeoDirectory |
|
667 | + * @param string $cat_taxonomy The taxonomy name. |
|
668 | + * @param int $cat_parent The parent term ID. |
|
669 | + * @param bool $hide_empty Hide empty taxonomies? Default: false. |
|
670 | + * @param int $pading CSS padding in pixels. |
|
671 | + * @return string|void taxonomy HTML. |
|
672 | + */ |
|
673 | + function geodir_custom_taxonomy_walker($cat_taxonomy, $cat_parent = 0, $hide_empty = false, $pading = 0) |
|
674 | + { |
|
675 | + global $cat_display, $post_cat, $exclude_cats; |
|
676 | + |
|
677 | + $search_terms = trim($post_cat, ","); |
|
678 | + |
|
679 | + $search_terms = explode(",", $search_terms); |
|
680 | + |
|
681 | + $cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'hide_empty' => $hide_empty, 'exclude' => $exclude_cats)); |
|
682 | + |
|
683 | + $display = ''; |
|
684 | + $onchange = ''; |
|
685 | + $term_check = ''; |
|
686 | + $main_list_class = ''; |
|
687 | + $out = ''; |
|
688 | + //If there are terms, start displaying |
|
689 | + if (count($cat_terms) > 0) { |
|
690 | + //Displaying as a list |
|
691 | + $p = $pading * 20; |
|
692 | + $pading++; |
|
693 | + |
|
694 | + |
|
695 | + if ((!geodir_is_page('listing')) || (is_search() && $_REQUEST['search_taxonomy'] == '')) { |
|
696 | + if ($cat_parent == 0) { |
|
697 | + $list_class = 'main_list gd-parent-cats-list gd-cats-display-' . $cat_display; |
|
698 | + $main_list_class = 'class="main_list_selecter"'; |
|
699 | + } else { |
|
700 | + //$display = 'display:none'; |
|
701 | + $list_class = 'sub_list gd-sub-cats-list'; |
|
702 | + } |
|
703 | + } |
|
704 | 704 | |
705 | - if ($cat_display == 'checkbox' || $cat_display == 'radio') { |
|
706 | - $p = 0; |
|
707 | - $out = '<div class="' . $list_class . ' gd-cat-row-' . $cat_parent . '" style="margin-left:' . $p . 'px;' . $display . ';">'; |
|
708 | - } |
|
705 | + if ($cat_display == 'checkbox' || $cat_display == 'radio') { |
|
706 | + $p = 0; |
|
707 | + $out = '<div class="' . $list_class . ' gd-cat-row-' . $cat_parent . '" style="margin-left:' . $p . 'px;' . $display . ';">'; |
|
708 | + } |
|
709 | 709 | |
710 | - foreach ($cat_terms as $cat_term) { |
|
710 | + foreach ($cat_terms as $cat_term) { |
|
711 | 711 | |
712 | - $checked = ''; |
|
712 | + $checked = ''; |
|
713 | 713 | |
714 | - if (in_array($cat_term->term_id, $search_terms)) { |
|
715 | - if ($cat_display == 'select' || $cat_display == 'multiselect') |
|
716 | - $checked = 'selected="selected"'; |
|
717 | - else |
|
718 | - $checked = 'checked="checked"'; |
|
719 | - } |
|
714 | + if (in_array($cat_term->term_id, $search_terms)) { |
|
715 | + if ($cat_display == 'select' || $cat_display == 'multiselect') |
|
716 | + $checked = 'selected="selected"'; |
|
717 | + else |
|
718 | + $checked = 'checked="checked"'; |
|
719 | + } |
|
720 | 720 | |
721 | - if ($cat_display == 'radio') |
|
722 | - $out .= '<span style="display:block" ><input type="radio" field_type="radio" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
723 | - elseif ($cat_display == 'select' || $cat_display == 'multiselect') |
|
724 | - $out .= '<option ' . $main_list_class . ' style="margin-left:' . $p . 'px;" alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' >' . $term_check . ucfirst($cat_term->name) . '</option>'; |
|
721 | + if ($cat_display == 'radio') |
|
722 | + $out .= '<span style="display:block" ><input type="radio" field_type="radio" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
723 | + elseif ($cat_display == 'select' || $cat_display == 'multiselect') |
|
724 | + $out .= '<option ' . $main_list_class . ' style="margin-left:' . $p . 'px;" alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' >' . $term_check . ucfirst($cat_term->name) . '</option>'; |
|
725 | 725 | |
726 | - else { |
|
727 | - $out .= '<span style="display:block"><input style="display:inline-block" type="checkbox" field_type="checkbox" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
728 | - } |
|
726 | + else { |
|
727 | + $out .= '<span style="display:block"><input style="display:inline-block" type="checkbox" field_type="checkbox" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
728 | + } |
|
729 | 729 | |
730 | - // Call recurson to print sub cats |
|
731 | - $out .= geodir_custom_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading); |
|
730 | + // Call recurson to print sub cats |
|
731 | + $out .= geodir_custom_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading); |
|
732 | 732 | |
733 | - } |
|
733 | + } |
|
734 | 734 | |
735 | - if ($cat_display == 'checkbox' || $cat_display == 'radio') |
|
736 | - $out .= '</div>'; |
|
735 | + if ($cat_display == 'checkbox' || $cat_display == 'radio') |
|
736 | + $out .= '</div>'; |
|
737 | 737 | |
738 | - return $out; |
|
739 | - } |
|
740 | - return; |
|
741 | - } |
|
738 | + return $out; |
|
739 | + } |
|
740 | + return; |
|
741 | + } |
|
742 | 742 | } |
743 | 743 | |
744 | 744 | if (!function_exists('geodir_custom_taxonomy_walker2')) { |
745 | - /** |
|
746 | - * Custom taxonomy walker function. |
|
747 | - * |
|
748 | - * @since 1.0.0 |
|
749 | - * @package GeoDirectory |
|
750 | - * @global object $post WordPress Post object. |
|
751 | - * @global object $gd_session GeoDirectory Session object. |
|
752 | - * @param string $cat_taxonomy The taxonomy name. |
|
753 | - * @param string $cat_limit Number of categories to display. |
|
754 | - */ |
|
755 | - function geodir_custom_taxonomy_walker2($cat_taxonomy, $cat_limit = '') |
|
756 | - { |
|
757 | - $post_category = ''; |
|
758 | - $post_category_str = ''; |
|
759 | - global $exclude_cats, $gd_session; |
|
760 | - |
|
761 | - $cat_exclude = ''; |
|
762 | - if (is_array($exclude_cats) && !empty($exclude_cats)) |
|
763 | - $cat_exclude = serialize($exclude_cats); |
|
764 | - |
|
765 | - if (isset($_REQUEST['backandedit'])) { |
|
766 | - $post = (object)$gd_session->get('listing'); |
|
767 | - |
|
768 | - if (!is_array($post->post_category[$cat_taxonomy])) |
|
769 | - $post_category = $post->post_category[$cat_taxonomy]; |
|
770 | - |
|
771 | - $post_categories = $post->post_category_str; |
|
772 | - if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) |
|
773 | - $post_category_str = $post_categories[$cat_taxonomy]; |
|
774 | - |
|
775 | - } elseif ((geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') || (is_admin())) { |
|
776 | - global $post; |
|
777 | - |
|
778 | - $post_category = geodir_get_post_meta($post->ID, $cat_taxonomy, true); |
|
779 | - if (empty($post_category) && isset($post->$cat_taxonomy)) { |
|
780 | - $post_category = $post->$cat_taxonomy; |
|
781 | - } |
|
745 | + /** |
|
746 | + * Custom taxonomy walker function. |
|
747 | + * |
|
748 | + * @since 1.0.0 |
|
749 | + * @package GeoDirectory |
|
750 | + * @global object $post WordPress Post object. |
|
751 | + * @global object $gd_session GeoDirectory Session object. |
|
752 | + * @param string $cat_taxonomy The taxonomy name. |
|
753 | + * @param string $cat_limit Number of categories to display. |
|
754 | + */ |
|
755 | + function geodir_custom_taxonomy_walker2($cat_taxonomy, $cat_limit = '') |
|
756 | + { |
|
757 | + $post_category = ''; |
|
758 | + $post_category_str = ''; |
|
759 | + global $exclude_cats, $gd_session; |
|
760 | + |
|
761 | + $cat_exclude = ''; |
|
762 | + if (is_array($exclude_cats) && !empty($exclude_cats)) |
|
763 | + $cat_exclude = serialize($exclude_cats); |
|
764 | + |
|
765 | + if (isset($_REQUEST['backandedit'])) { |
|
766 | + $post = (object)$gd_session->get('listing'); |
|
767 | + |
|
768 | + if (!is_array($post->post_category[$cat_taxonomy])) |
|
769 | + $post_category = $post->post_category[$cat_taxonomy]; |
|
770 | + |
|
771 | + $post_categories = $post->post_category_str; |
|
772 | + if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) |
|
773 | + $post_category_str = $post_categories[$cat_taxonomy]; |
|
774 | + |
|
775 | + } elseif ((geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') || (is_admin())) { |
|
776 | + global $post; |
|
777 | + |
|
778 | + $post_category = geodir_get_post_meta($post->ID, $cat_taxonomy, true); |
|
779 | + if (empty($post_category) && isset($post->$cat_taxonomy)) { |
|
780 | + $post_category = $post->$cat_taxonomy; |
|
781 | + } |
|
782 | 782 | |
783 | - $post_categories = get_post_meta($post->ID, 'post_categories', true); |
|
783 | + $post_categories = get_post_meta($post->ID, 'post_categories', true); |
|
784 | 784 | |
785 | - if (empty($post_category) && !empty($post_categories) && !empty($post_categories[$cat_taxonomy])) { |
|
786 | - foreach (explode(",", $post_categories[$cat_taxonomy]) as $cat_part) { |
|
787 | - if (is_numeric($cat_part)) { |
|
788 | - $cat_part_arr[] = $cat_part; |
|
789 | - } |
|
790 | - } |
|
791 | - if (is_array($cat_part_arr)) { |
|
792 | - $post_category = implode(',', $cat_part_arr); |
|
793 | - } |
|
794 | - } |
|
785 | + if (empty($post_category) && !empty($post_categories) && !empty($post_categories[$cat_taxonomy])) { |
|
786 | + foreach (explode(",", $post_categories[$cat_taxonomy]) as $cat_part) { |
|
787 | + if (is_numeric($cat_part)) { |
|
788 | + $cat_part_arr[] = $cat_part; |
|
789 | + } |
|
790 | + } |
|
791 | + if (is_array($cat_part_arr)) { |
|
792 | + $post_category = implode(',', $cat_part_arr); |
|
793 | + } |
|
794 | + } |
|
795 | 795 | |
796 | - if (!empty($post_category)) { |
|
797 | - $cat1 = array_filter(explode(',', $post_category)); |
|
798 | - $post_category = ',' . implode(',', $cat1) . ','; |
|
796 | + if (!empty($post_category)) { |
|
797 | + $cat1 = array_filter(explode(',', $post_category)); |
|
798 | + $post_category = ',' . implode(',', $cat1) . ','; |
|
799 | 799 | |
800 | - } |
|
800 | + } |
|
801 | 801 | |
802 | - if ($post_category != '' && is_array($exclude_cats) && !empty($exclude_cats)) { |
|
802 | + if ($post_category != '' && is_array($exclude_cats) && !empty($exclude_cats)) { |
|
803 | 803 | |
804 | - $post_category_upd = explode(',', $post_category); |
|
805 | - $post_category_change = ''; |
|
806 | - foreach ($post_category_upd as $cat) { |
|
804 | + $post_category_upd = explode(',', $post_category); |
|
805 | + $post_category_change = ''; |
|
806 | + foreach ($post_category_upd as $cat) { |
|
807 | 807 | |
808 | - if (!in_array($cat, $exclude_cats) && $cat != '') { |
|
809 | - $post_category_change .= ',' . $cat; |
|
810 | - } |
|
811 | - } |
|
812 | - $post_category = $post_category_change; |
|
813 | - } |
|
808 | + if (!in_array($cat, $exclude_cats) && $cat != '') { |
|
809 | + $post_category_change .= ',' . $cat; |
|
810 | + } |
|
811 | + } |
|
812 | + $post_category = $post_category_change; |
|
813 | + } |
|
814 | 814 | |
815 | 815 | |
816 | - if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) { |
|
817 | - $post_category_str = $post_categories[$cat_taxonomy]; |
|
818 | - } |
|
819 | - } |
|
816 | + if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) { |
|
817 | + $post_category_str = $post_categories[$cat_taxonomy]; |
|
818 | + } |
|
819 | + } |
|
820 | 820 | |
821 | - echo '<input type="hidden" id="cat_limit" value="' . $cat_limit . '" name="cat_limit[' . $cat_taxonomy . ']" />'; |
|
821 | + echo '<input type="hidden" id="cat_limit" value="' . $cat_limit . '" name="cat_limit[' . $cat_taxonomy . ']" />'; |
|
822 | 822 | |
823 | - echo '<input type="hidden" id="post_category" value="' . $post_category . '" name="post_category[' . $cat_taxonomy . ']" />'; |
|
823 | + echo '<input type="hidden" id="post_category" value="' . $post_category . '" name="post_category[' . $cat_taxonomy . ']" />'; |
|
824 | 824 | |
825 | - echo '<input type="hidden" id="post_category_str" value="' . $post_category_str . '" name="post_category_str[' . $cat_taxonomy . ']" />'; |
|
825 | + echo '<input type="hidden" id="post_category_str" value="' . $post_category_str . '" name="post_category_str[' . $cat_taxonomy . ']" />'; |
|
826 | 826 | |
827 | 827 | |
828 | - ?> |
|
828 | + ?> |
|
829 | 829 | <div class="cat_sublist"> |
830 | 830 | <?php |
831 | 831 | |
832 | - $post_id = isset($post->ID) ? $post->ID : ''; |
|
832 | + $post_id = isset($post->ID) ? $post->ID : ''; |
|
833 | 833 | |
834 | - if ((geodir_is_page('add-listing') || is_admin()) && !empty($post_categories[$cat_taxonomy])) { |
|
834 | + if ((geodir_is_page('add-listing') || is_admin()) && !empty($post_categories[$cat_taxonomy])) { |
|
835 | 835 | |
836 | - geodir_editpost_categories_html($cat_taxonomy, $post_id, $post_categories); |
|
837 | - } |
|
838 | - ?> |
|
836 | + geodir_editpost_categories_html($cat_taxonomy, $post_id, $post_categories); |
|
837 | + } |
|
838 | + ?> |
|
839 | 839 | </div> |
840 | 840 | <script type="text/javascript"> |
841 | 841 | |
@@ -958,22 +958,22 @@ discard block |
||
958 | 958 | |
959 | 959 | </script> |
960 | 960 | <?php |
961 | - if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) { |
|
962 | - $post_cat_str = $post_categories[$cat_taxonomy]; |
|
963 | - $post_cat_array = explode("#", $post_cat_str); |
|
964 | - if (count($post_cat_array) >= $cat_limit && $cat_limit != 0) |
|
965 | - $style = "display:none;"; |
|
966 | - } |
|
967 | - ?> |
|
961 | + if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) { |
|
962 | + $post_cat_str = $post_categories[$cat_taxonomy]; |
|
963 | + $post_cat_array = explode("#", $post_cat_str); |
|
964 | + if (count($post_cat_array) >= $cat_limit && $cat_limit != 0) |
|
965 | + $style = "display:none;"; |
|
966 | + } |
|
967 | + ?> |
|
968 | 968 | <div class="main_cat_list" style=" <?php if (isset($style)) { |
969 | - echo $style; |
|
970 | - }?> "> |
|
969 | + echo $style; |
|
970 | + }?> "> |
|
971 | 971 | <?php geodir_get_catlist($cat_taxonomy, 0); // print main categories list |
972 | - ?> |
|
972 | + ?> |
|
973 | 973 | </div> |
974 | 974 | <?php |
975 | 975 | |
976 | - } |
|
976 | + } |
|
977 | 977 | } |
978 | 978 | |
979 | 979 | /** |
@@ -990,23 +990,23 @@ discard block |
||
990 | 990 | */ |
991 | 991 | function geodir_addpost_categories_html($request_taxonomy, $parrent, $selected = false, $main_selected = true, $default = false, $exclude = '') |
992 | 992 | { |
993 | - global $exclude_cats; |
|
993 | + global $exclude_cats; |
|
994 | 994 | |
995 | - if ($exclude != '') { |
|
996 | - $exclude_cats = maybe_unserialize(base64_decode($exclude)); |
|
995 | + if ($exclude != '') { |
|
996 | + $exclude_cats = maybe_unserialize(base64_decode($exclude)); |
|
997 | 997 | |
998 | - if(is_array( $exclude_cats)){ |
|
999 | - $exclude_cats = array_map( 'intval', $exclude_cats ); |
|
1000 | - }else{ |
|
1001 | - $exclude_cats = intval($exclude_cats); |
|
1002 | - } |
|
998 | + if(is_array( $exclude_cats)){ |
|
999 | + $exclude_cats = array_map( 'intval', $exclude_cats ); |
|
1000 | + }else{ |
|
1001 | + $exclude_cats = intval($exclude_cats); |
|
1002 | + } |
|
1003 | 1003 | |
1004 | - } |
|
1004 | + } |
|
1005 | 1005 | |
1006 | - if ((is_array($exclude_cats) && !empty($exclude_cats) && !in_array($parrent, $exclude_cats)) || |
|
1007 | - (!is_array($exclude_cats) || empty($exclude_cats)) |
|
1008 | - ) { |
|
1009 | - ?> |
|
1006 | + if ((is_array($exclude_cats) && !empty($exclude_cats) && !in_array($parrent, $exclude_cats)) || |
|
1007 | + (!is_array($exclude_cats) || empty($exclude_cats)) |
|
1008 | + ) { |
|
1009 | + ?> |
|
1010 | 1010 | |
1011 | 1011 | <?php $main_cat = get_term($parrent, $request_taxonomy); ?> |
1012 | 1012 | |
@@ -1035,8 +1035,8 @@ discard block |
||
1035 | 1035 | |
1036 | 1036 | <br/> |
1037 | 1037 | <?php |
1038 | - $cat_terms = get_terms($request_taxonomy, array('parent' => $main_cat->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats)); |
|
1039 | - if (!empty($cat_terms)) { ?> |
|
1038 | + $cat_terms = get_terms($request_taxonomy, array('parent' => $main_cat->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats)); |
|
1039 | + if (!empty($cat_terms)) { ?> |
|
1040 | 1040 | <span> <?php printf(__('Add listing in category', 'geodirectory')); ?></span> |
1041 | 1041 | <?php geodir_get_catlist($request_taxonomy, $parrent, $selected) ?> |
1042 | 1042 | <?php } ?> |
@@ -1058,53 +1058,53 @@ discard block |
||
1058 | 1058 | function geodir_editpost_categories_html($request_taxonomy, $request_postid, $post_categories) |
1059 | 1059 | { |
1060 | 1060 | |
1061 | - if (!empty($post_categories) && array_key_exists($request_taxonomy, $post_categories)) { |
|
1062 | - $post_cat_str = $post_categories[$request_taxonomy]; |
|
1063 | - $post_cat_array = explode("#", $post_cat_str); |
|
1064 | - if (is_array($post_cat_array)) { |
|
1065 | - $post_cat_array = array_unique( $post_cat_array ); |
|
1061 | + if (!empty($post_categories) && array_key_exists($request_taxonomy, $post_categories)) { |
|
1062 | + $post_cat_str = $post_categories[$request_taxonomy]; |
|
1063 | + $post_cat_array = explode("#", $post_cat_str); |
|
1064 | + if (is_array($post_cat_array)) { |
|
1065 | + $post_cat_array = array_unique( $post_cat_array ); |
|
1066 | 1066 | |
1067 | 1067 | foreach ($post_cat_array as $post_cat_html) { |
1068 | 1068 | |
1069 | - $post_cat_info = explode(":", $post_cat_html); |
|
1070 | - $post_maincat_str = $post_cat_info[0]; |
|
1069 | + $post_cat_info = explode(":", $post_cat_html); |
|
1070 | + $post_maincat_str = $post_cat_info[0]; |
|
1071 | 1071 | |
1072 | - if (!empty($post_maincat_str)) { |
|
1073 | - $post_maincat_info = explode(",", $post_maincat_str); |
|
1074 | - $post_maincat_id = $post_maincat_info[0]; |
|
1075 | - ($post_maincat_info[1] == 'y') ? $post_maincat_selected = true : $post_maincat_selected = false; |
|
1076 | - (end($post_maincat_info) == 'd') ? $post_maincat_default = true : $post_maincat_default = false; |
|
1077 | - } |
|
1078 | - $post_sub_catid = ''; |
|
1079 | - if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) { |
|
1080 | - $post_sub_catid = (int)$post_cat_info[1]; |
|
1081 | - } |
|
1072 | + if (!empty($post_maincat_str)) { |
|
1073 | + $post_maincat_info = explode(",", $post_maincat_str); |
|
1074 | + $post_maincat_id = $post_maincat_info[0]; |
|
1075 | + ($post_maincat_info[1] == 'y') ? $post_maincat_selected = true : $post_maincat_selected = false; |
|
1076 | + (end($post_maincat_info) == 'd') ? $post_maincat_default = true : $post_maincat_default = false; |
|
1077 | + } |
|
1078 | + $post_sub_catid = ''; |
|
1079 | + if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) { |
|
1080 | + $post_sub_catid = (int)$post_cat_info[1]; |
|
1081 | + } |
|
1082 | 1082 | |
1083 | - geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
|
1083 | + geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
|
1084 | 1084 | |
1085 | - } |
|
1086 | - } else { |
|
1085 | + } |
|
1086 | + } else { |
|
1087 | 1087 | |
1088 | - $post_cat_info = explode(":", $post_cat_str); |
|
1089 | - $post_maincat_str = $post_cat_info[0]; |
|
1088 | + $post_cat_info = explode(":", $post_cat_str); |
|
1089 | + $post_maincat_str = $post_cat_info[0]; |
|
1090 | 1090 | |
1091 | - $post_sub_catid = ''; |
|
1091 | + $post_sub_catid = ''; |
|
1092 | 1092 | |
1093 | - if (!empty($post_maincat_str)) { |
|
1094 | - $post_maincat_info = explode(",", $post_maincat_str); |
|
1095 | - $post_maincat_id = $post_maincat_info[0]; |
|
1096 | - ($post_maincat_info[1] == 'y') ? $post_maincat_selected = true : $post_maincat_selected = false; |
|
1097 | - (end($post_maincat_info) == 'd') ? $post_maincat_default = true : $post_maincat_default = false; |
|
1098 | - } |
|
1093 | + if (!empty($post_maincat_str)) { |
|
1094 | + $post_maincat_info = explode(",", $post_maincat_str); |
|
1095 | + $post_maincat_id = $post_maincat_info[0]; |
|
1096 | + ($post_maincat_info[1] == 'y') ? $post_maincat_selected = true : $post_maincat_selected = false; |
|
1097 | + (end($post_maincat_info) == 'd') ? $post_maincat_default = true : $post_maincat_default = false; |
|
1098 | + } |
|
1099 | 1099 | |
1100 | - if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) { |
|
1101 | - $post_sub_catid = (int)$post_cat_info[1]; |
|
1102 | - } |
|
1100 | + if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) { |
|
1101 | + $post_sub_catid = (int)$post_cat_info[1]; |
|
1102 | + } |
|
1103 | 1103 | |
1104 | - geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
|
1104 | + geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
|
1105 | 1105 | |
1106 | - } |
|
1107 | - } |
|
1106 | + } |
|
1107 | + } |
|
1108 | 1108 | } |
1109 | 1109 | |
1110 | 1110 | /** |
@@ -1118,35 +1118,35 @@ discard block |
||
1118 | 1118 | */ |
1119 | 1119 | function geodir_get_catlist($cat_taxonomy, $parrent = 0, $selected = false) |
1120 | 1120 | { |
1121 | - global $exclude_cats; |
|
1121 | + global $exclude_cats; |
|
1122 | 1122 | |
1123 | - $cat_terms = get_terms($cat_taxonomy, array('parent' => $parrent, 'hide_empty' => false, 'exclude' => $exclude_cats)); |
|
1123 | + $cat_terms = get_terms($cat_taxonomy, array('parent' => $parrent, 'hide_empty' => false, 'exclude' => $exclude_cats)); |
|
1124 | 1124 | |
1125 | - if (!empty($cat_terms)) { |
|
1126 | - $onchange = ''; |
|
1127 | - $onchange = ' onchange="show_subcatlist(this.value, this)" '; |
|
1125 | + if (!empty($cat_terms)) { |
|
1126 | + $onchange = ''; |
|
1127 | + $onchange = ' onchange="show_subcatlist(this.value, this)" '; |
|
1128 | 1128 | |
1129 | - $option_selected = ''; |
|
1130 | - if (!$selected) |
|
1131 | - $option_slected = ' selected="selected" '; |
|
1129 | + $option_selected = ''; |
|
1130 | + if (!$selected) |
|
1131 | + $option_slected = ' selected="selected" '; |
|
1132 | 1132 | |
1133 | - echo '<select field_type="select" id="' . sanitize_text_field($cat_taxonomy) . '" class="chosen_select" ' . $onchange . ' option-ajaxChosen="false" >'; |
|
1133 | + echo '<select field_type="select" id="' . sanitize_text_field($cat_taxonomy) . '" class="chosen_select" ' . $onchange . ' option-ajaxChosen="false" >'; |
|
1134 | 1134 | |
1135 | - echo '<option value="" ' . $option_selected . ' >' . __('Select Category', 'geodirectory') . '</option>'; |
|
1135 | + echo '<option value="" ' . $option_selected . ' >' . __('Select Category', 'geodirectory') . '</option>'; |
|
1136 | 1136 | |
1137 | - foreach ($cat_terms as $cat_term) { |
|
1138 | - $option_selected = ''; |
|
1139 | - if ($selected == $cat_term->term_id) |
|
1140 | - $option_selected = ' selected="selected" '; |
|
1137 | + foreach ($cat_terms as $cat_term) { |
|
1138 | + $option_selected = ''; |
|
1139 | + if ($selected == $cat_term->term_id) |
|
1140 | + $option_selected = ' selected="selected" '; |
|
1141 | 1141 | |
1142 | - // Count child terms |
|
1143 | - $child_terms = get_terms( $cat_taxonomy, array( 'parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1 ) ); |
|
1144 | - $has_child = !empty( $child_terms ) ? 't' : 'f'; |
|
1142 | + // Count child terms |
|
1143 | + $child_terms = get_terms( $cat_taxonomy, array( 'parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1 ) ); |
|
1144 | + $has_child = !empty( $child_terms ) ? 't' : 'f'; |
|
1145 | 1145 | |
1146 | - echo '<option ' . $option_selected . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" _hc="' . $has_child . '" >' . ucfirst($cat_term->name) . '</option>'; |
|
1147 | - } |
|
1148 | - echo '</select>'; |
|
1149 | - } |
|
1146 | + echo '<option ' . $option_selected . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" _hc="' . $has_child . '" >' . ucfirst($cat_term->name) . '</option>'; |
|
1147 | + } |
|
1148 | + echo '</select>'; |
|
1149 | + } |
|
1150 | 1150 | } |
1151 | 1151 | |
1152 | 1152 | /** |
@@ -1162,28 +1162,28 @@ discard block |
||
1162 | 1162 | */ |
1163 | 1163 | function geodir_custom_update_messages($messages) |
1164 | 1164 | { |
1165 | - global $post, $post_ID; |
|
1166 | - |
|
1167 | - $post_types = get_post_types(array('show_ui' => true, '_builtin' => false), 'objects'); |
|
1168 | - |
|
1169 | - foreach ($post_types as $post_type => $post_object) { |
|
1170 | - |
|
1171 | - $messages[$post_type] = array( |
|
1172 | - 0 => '', // Unused. Messages start at index 1. |
|
1173 | - 1 => sprintf(__('%s updated. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name), |
|
1174 | - 2 => __('Custom field updated.', 'geodirectory'), |
|
1175 | - 3 => __('Custom field deleted.', 'geodirectory'), |
|
1176 | - 4 => sprintf(__('%s updated.', 'geodirectory'), $post_object->labels->singular_name), |
|
1177 | - 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'geodirectory'), $post_object->labels->singular_name, wp_post_revision_title((int)$_GET['revision'], false)) : false, |
|
1178 | - 6 => sprintf(__('%s published. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name), |
|
1179 | - 7 => sprintf(__('%s saved.', 'geodirectory'), $post_object->labels->singular_name), |
|
1180 | - 8 => sprintf(__('%s submitted. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name), |
|
1181 | - 9 => sprintf(__('%s scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, date_i18n(__('M j, Y @ G:i', 'geodirectory'), strtotime($post->post_date)), esc_url(get_permalink($post_ID)), $post_object->labels->singular_name), |
|
1182 | - 10 => sprintf(__('%s draft updated. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name), |
|
1183 | - ); |
|
1184 | - } |
|
1185 | - |
|
1186 | - return $messages; |
|
1165 | + global $post, $post_ID; |
|
1166 | + |
|
1167 | + $post_types = get_post_types(array('show_ui' => true, '_builtin' => false), 'objects'); |
|
1168 | + |
|
1169 | + foreach ($post_types as $post_type => $post_object) { |
|
1170 | + |
|
1171 | + $messages[$post_type] = array( |
|
1172 | + 0 => '', // Unused. Messages start at index 1. |
|
1173 | + 1 => sprintf(__('%s updated. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name), |
|
1174 | + 2 => __('Custom field updated.', 'geodirectory'), |
|
1175 | + 3 => __('Custom field deleted.', 'geodirectory'), |
|
1176 | + 4 => sprintf(__('%s updated.', 'geodirectory'), $post_object->labels->singular_name), |
|
1177 | + 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'geodirectory'), $post_object->labels->singular_name, wp_post_revision_title((int)$_GET['revision'], false)) : false, |
|
1178 | + 6 => sprintf(__('%s published. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name), |
|
1179 | + 7 => sprintf(__('%s saved.', 'geodirectory'), $post_object->labels->singular_name), |
|
1180 | + 8 => sprintf(__('%s submitted. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name), |
|
1181 | + 9 => sprintf(__('%s scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, date_i18n(__('M j, Y @ G:i', 'geodirectory'), strtotime($post->post_date)), esc_url(get_permalink($post_ID)), $post_object->labels->singular_name), |
|
1182 | + 10 => sprintf(__('%s draft updated. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name), |
|
1183 | + ); |
|
1184 | + } |
|
1185 | + |
|
1186 | + return $messages; |
|
1187 | 1187 | } |
1188 | 1188 | |
1189 | 1189 | |
@@ -1198,181 +1198,181 @@ discard block |
||
1198 | 1198 | function geodir_register_defaults() |
1199 | 1199 | { |
1200 | 1200 | |
1201 | - global $wpdb; |
|
1202 | - |
|
1203 | - $menu_icon = geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico'; |
|
1204 | - |
|
1205 | - if (!$listing_slug = get_option('geodir_listing_prefix')) |
|
1206 | - $listing_slug = 'places'; |
|
1207 | - |
|
1208 | - /** |
|
1209 | - * Taxonomies |
|
1210 | - **/ |
|
1211 | - //if ( ! taxonomy_exists('gd_place_tags') ) |
|
1212 | - { |
|
1213 | - |
|
1214 | - $gd_placetags = array(); |
|
1215 | - $gd_placetags['object_type'] = 'gd_place'; |
|
1216 | - $gd_placetags['listing_slug'] = $listing_slug . '/tags'; |
|
1217 | - $gd_placetags['args'] = array( |
|
1218 | - 'public' => true, |
|
1219 | - 'hierarchical' => false, |
|
1220 | - 'rewrite' => array('slug' => $listing_slug . '/tags', 'with_front' => false, 'hierarchical' => true), |
|
1221 | - 'query_var' => true, |
|
1222 | - |
|
1223 | - 'labels' => array( |
|
1224 | - 'name' => __('Place Tags', 'geodirectory'), |
|
1225 | - 'singular_name' => __('Place Tag', 'geodirectory'), |
|
1226 | - 'search_items' => __('Search Place Tags', 'geodirectory'), |
|
1227 | - 'popular_items' => __('Popular Place Tags', 'geodirectory'), |
|
1228 | - 'all_items' => __('All Place Tags', 'geodirectory'), |
|
1229 | - 'edit_item' => __('Edit Place Tag', 'geodirectory'), |
|
1230 | - 'update_item' => __('Update Place Tag', 'geodirectory'), |
|
1231 | - 'add_new_item' => __('Add New Place Tag', 'geodirectory'), |
|
1232 | - 'new_item_name' => __('New Place Tag Name', 'geodirectory'), |
|
1233 | - 'add_or_remove_items' => __('Add or remove Place tags', 'geodirectory'), |
|
1234 | - 'choose_from_most_used' => __('Choose from the most used Place tags', 'geodirectory'), |
|
1235 | - 'separate_items_with_commas' => __('Separate Place tags with commas', 'geodirectory'), |
|
1236 | - ), |
|
1237 | - ); |
|
1238 | - |
|
1239 | - |
|
1240 | - $geodir_taxonomies = get_option('geodir_taxonomies'); |
|
1241 | - $geodir_taxonomies['gd_place_tags'] = $gd_placetags; |
|
1242 | - update_option('geodir_taxonomies', $geodir_taxonomies); |
|
1243 | - |
|
1244 | - |
|
1245 | - // Update post types and delete tmp options |
|
1246 | - flush_rewrite_rules(); |
|
1247 | - |
|
1248 | - } |
|
1249 | - |
|
1250 | - //if ( ! taxonomy_exists('gd_placecategory') ) |
|
1251 | - { |
|
1252 | - |
|
1253 | - $gd_placecategory = array(); |
|
1254 | - $gd_placecategory['object_type'] = 'gd_place'; |
|
1255 | - $gd_placecategory['listing_slug'] = $listing_slug; |
|
1256 | - $gd_placecategory['args'] = array( |
|
1257 | - 'public' => true, |
|
1258 | - 'hierarchical' => true, |
|
1259 | - 'rewrite' => array('slug' => $listing_slug, 'with_front' => false, 'hierarchical' => true), |
|
1260 | - 'query_var' => true, |
|
1261 | - 'labels' => array( |
|
1262 | - 'name' => __('Place Categories', 'geodirectory'), |
|
1263 | - 'singular_name' => __('Place Category', 'geodirectory'), |
|
1264 | - 'search_items' => __('Search Place Categories', 'geodirectory'), |
|
1265 | - 'popular_items' => __('Popular Place Categories', 'geodirectory'), |
|
1266 | - 'all_items' => __('All Place Categories', 'geodirectory'), |
|
1267 | - 'edit_item' => __('Edit Place Category', 'geodirectory'), |
|
1268 | - 'update_item' => __('Update Place Category', 'geodirectory'), |
|
1269 | - 'add_new_item' => __('Add New Place Category', 'geodirectory'), |
|
1270 | - 'new_item_name' => __('New Place Category', 'geodirectory'), |
|
1271 | - 'add_or_remove_items' => __('Add or remove Place categories', 'geodirectory'), |
|
1272 | - ), |
|
1273 | - ); |
|
1274 | - |
|
1275 | - |
|
1276 | - $geodir_taxonomies = get_option('geodir_taxonomies'); |
|
1277 | - $geodir_taxonomies['gd_placecategory'] = $gd_placecategory; |
|
1278 | - update_option('geodir_taxonomies', $geodir_taxonomies); |
|
1279 | - |
|
1280 | - |
|
1281 | - flush_rewrite_rules(); |
|
1282 | - } |
|
1283 | - |
|
1284 | - /** |
|
1285 | - * Post Types |
|
1286 | - **/ |
|
1287 | - |
|
1288 | - //if ( ! post_type_exists('gd_place') ) |
|
1289 | - { |
|
1290 | - |
|
1291 | - $labels = array( |
|
1292 | - 'name' => __('Places', 'geodirectory'), |
|
1293 | - 'singular_name' => __('Place', 'geodirectory'), |
|
1294 | - 'add_new' => __('Add New', 'geodirectory'), |
|
1295 | - 'add_new_item' => __('Add New Place', 'geodirectory'), |
|
1296 | - 'edit_item' => __('Edit Place', 'geodirectory'), |
|
1297 | - 'new_item' => __('New Place', 'geodirectory'), |
|
1298 | - 'view_item' => __('View Place', 'geodirectory'), |
|
1299 | - 'search_items' => __('Search Places', 'geodirectory'), |
|
1300 | - 'not_found' => __('No Place Found', 'geodirectory'), |
|
1301 | - 'not_found_in_trash' => __('No Place Found In Trash', 'geodirectory')); |
|
1302 | - |
|
1303 | - $place_default = array( |
|
1304 | - 'labels' => $labels, |
|
1305 | - 'can_export' => true, |
|
1306 | - 'capability_type' => 'post', |
|
1307 | - 'description' => 'Place post type.', |
|
1308 | - 'has_archive' => $listing_slug, |
|
1309 | - 'hierarchical' => false, |
|
1310 | - 'map_meta_cap' => true, |
|
1311 | - 'menu_icon' => $menu_icon, |
|
1312 | - 'public' => true, |
|
1313 | - 'query_var' => true, |
|
1314 | - 'rewrite' => array('slug' => $listing_slug , 'with_front' => false, 'hierarchical' => true), |
|
1315 | - 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'comments', /*'revisions', 'post-formats'*/), |
|
1316 | - 'taxonomies' => array('gd_placecategory', 'gd_place_tags')); |
|
1317 | - |
|
1318 | - //Update custom post types |
|
1319 | - $geodir_post_types = get_option('geodir_post_types'); |
|
1320 | - $geodir_post_types['gd_place'] = $place_default; |
|
1321 | - update_option('geodir_post_types', $geodir_post_types); |
|
1322 | - |
|
1323 | - // Update post types and delete tmp options |
|
1324 | - flush_rewrite_rules(); |
|
1325 | - } |
|
1326 | - |
|
1327 | - |
|
1328 | - geodir_register_taxonomies(); |
|
1329 | - geodir_register_post_types(); |
|
1330 | - |
|
1331 | - //die; |
|
1201 | + global $wpdb; |
|
1202 | + |
|
1203 | + $menu_icon = geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico'; |
|
1204 | + |
|
1205 | + if (!$listing_slug = get_option('geodir_listing_prefix')) |
|
1206 | + $listing_slug = 'places'; |
|
1207 | + |
|
1208 | + /** |
|
1209 | + * Taxonomies |
|
1210 | + **/ |
|
1211 | + //if ( ! taxonomy_exists('gd_place_tags') ) |
|
1212 | + { |
|
1213 | + |
|
1214 | + $gd_placetags = array(); |
|
1215 | + $gd_placetags['object_type'] = 'gd_place'; |
|
1216 | + $gd_placetags['listing_slug'] = $listing_slug . '/tags'; |
|
1217 | + $gd_placetags['args'] = array( |
|
1218 | + 'public' => true, |
|
1219 | + 'hierarchical' => false, |
|
1220 | + 'rewrite' => array('slug' => $listing_slug . '/tags', 'with_front' => false, 'hierarchical' => true), |
|
1221 | + 'query_var' => true, |
|
1222 | + |
|
1223 | + 'labels' => array( |
|
1224 | + 'name' => __('Place Tags', 'geodirectory'), |
|
1225 | + 'singular_name' => __('Place Tag', 'geodirectory'), |
|
1226 | + 'search_items' => __('Search Place Tags', 'geodirectory'), |
|
1227 | + 'popular_items' => __('Popular Place Tags', 'geodirectory'), |
|
1228 | + 'all_items' => __('All Place Tags', 'geodirectory'), |
|
1229 | + 'edit_item' => __('Edit Place Tag', 'geodirectory'), |
|
1230 | + 'update_item' => __('Update Place Tag', 'geodirectory'), |
|
1231 | + 'add_new_item' => __('Add New Place Tag', 'geodirectory'), |
|
1232 | + 'new_item_name' => __('New Place Tag Name', 'geodirectory'), |
|
1233 | + 'add_or_remove_items' => __('Add or remove Place tags', 'geodirectory'), |
|
1234 | + 'choose_from_most_used' => __('Choose from the most used Place tags', 'geodirectory'), |
|
1235 | + 'separate_items_with_commas' => __('Separate Place tags with commas', 'geodirectory'), |
|
1236 | + ), |
|
1237 | + ); |
|
1238 | + |
|
1239 | + |
|
1240 | + $geodir_taxonomies = get_option('geodir_taxonomies'); |
|
1241 | + $geodir_taxonomies['gd_place_tags'] = $gd_placetags; |
|
1242 | + update_option('geodir_taxonomies', $geodir_taxonomies); |
|
1243 | + |
|
1244 | + |
|
1245 | + // Update post types and delete tmp options |
|
1246 | + flush_rewrite_rules(); |
|
1247 | + |
|
1248 | + } |
|
1249 | + |
|
1250 | + //if ( ! taxonomy_exists('gd_placecategory') ) |
|
1251 | + { |
|
1252 | + |
|
1253 | + $gd_placecategory = array(); |
|
1254 | + $gd_placecategory['object_type'] = 'gd_place'; |
|
1255 | + $gd_placecategory['listing_slug'] = $listing_slug; |
|
1256 | + $gd_placecategory['args'] = array( |
|
1257 | + 'public' => true, |
|
1258 | + 'hierarchical' => true, |
|
1259 | + 'rewrite' => array('slug' => $listing_slug, 'with_front' => false, 'hierarchical' => true), |
|
1260 | + 'query_var' => true, |
|
1261 | + 'labels' => array( |
|
1262 | + 'name' => __('Place Categories', 'geodirectory'), |
|
1263 | + 'singular_name' => __('Place Category', 'geodirectory'), |
|
1264 | + 'search_items' => __('Search Place Categories', 'geodirectory'), |
|
1265 | + 'popular_items' => __('Popular Place Categories', 'geodirectory'), |
|
1266 | + 'all_items' => __('All Place Categories', 'geodirectory'), |
|
1267 | + 'edit_item' => __('Edit Place Category', 'geodirectory'), |
|
1268 | + 'update_item' => __('Update Place Category', 'geodirectory'), |
|
1269 | + 'add_new_item' => __('Add New Place Category', 'geodirectory'), |
|
1270 | + 'new_item_name' => __('New Place Category', 'geodirectory'), |
|
1271 | + 'add_or_remove_items' => __('Add or remove Place categories', 'geodirectory'), |
|
1272 | + ), |
|
1273 | + ); |
|
1274 | + |
|
1275 | + |
|
1276 | + $geodir_taxonomies = get_option('geodir_taxonomies'); |
|
1277 | + $geodir_taxonomies['gd_placecategory'] = $gd_placecategory; |
|
1278 | + update_option('geodir_taxonomies', $geodir_taxonomies); |
|
1279 | + |
|
1280 | + |
|
1281 | + flush_rewrite_rules(); |
|
1282 | + } |
|
1283 | + |
|
1284 | + /** |
|
1285 | + * Post Types |
|
1286 | + **/ |
|
1287 | + |
|
1288 | + //if ( ! post_type_exists('gd_place') ) |
|
1289 | + { |
|
1290 | + |
|
1291 | + $labels = array( |
|
1292 | + 'name' => __('Places', 'geodirectory'), |
|
1293 | + 'singular_name' => __('Place', 'geodirectory'), |
|
1294 | + 'add_new' => __('Add New', 'geodirectory'), |
|
1295 | + 'add_new_item' => __('Add New Place', 'geodirectory'), |
|
1296 | + 'edit_item' => __('Edit Place', 'geodirectory'), |
|
1297 | + 'new_item' => __('New Place', 'geodirectory'), |
|
1298 | + 'view_item' => __('View Place', 'geodirectory'), |
|
1299 | + 'search_items' => __('Search Places', 'geodirectory'), |
|
1300 | + 'not_found' => __('No Place Found', 'geodirectory'), |
|
1301 | + 'not_found_in_trash' => __('No Place Found In Trash', 'geodirectory')); |
|
1302 | + |
|
1303 | + $place_default = array( |
|
1304 | + 'labels' => $labels, |
|
1305 | + 'can_export' => true, |
|
1306 | + 'capability_type' => 'post', |
|
1307 | + 'description' => 'Place post type.', |
|
1308 | + 'has_archive' => $listing_slug, |
|
1309 | + 'hierarchical' => false, |
|
1310 | + 'map_meta_cap' => true, |
|
1311 | + 'menu_icon' => $menu_icon, |
|
1312 | + 'public' => true, |
|
1313 | + 'query_var' => true, |
|
1314 | + 'rewrite' => array('slug' => $listing_slug , 'with_front' => false, 'hierarchical' => true), |
|
1315 | + 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'comments', /*'revisions', 'post-formats'*/), |
|
1316 | + 'taxonomies' => array('gd_placecategory', 'gd_place_tags')); |
|
1317 | + |
|
1318 | + //Update custom post types |
|
1319 | + $geodir_post_types = get_option('geodir_post_types'); |
|
1320 | + $geodir_post_types['gd_place'] = $place_default; |
|
1321 | + update_option('geodir_post_types', $geodir_post_types); |
|
1322 | + |
|
1323 | + // Update post types and delete tmp options |
|
1324 | + flush_rewrite_rules(); |
|
1325 | + } |
|
1326 | + |
|
1327 | + |
|
1328 | + geodir_register_taxonomies(); |
|
1329 | + geodir_register_post_types(); |
|
1330 | + |
|
1331 | + //die; |
|
1332 | 1332 | |
1333 | 1333 | } |
1334 | 1334 | |
1335 | 1335 | $gd_wpml_get_languages = ""; |
1336 | 1336 | function gd_wpml_get_lang_from_url($url){ |
1337 | 1337 | |
1338 | - global $gd_wpml_get_languages; |
|
1339 | - if(isset($_REQUEST['lang']) && $_REQUEST['lang']){return $_REQUEST['lang'];} |
|
1338 | + global $gd_wpml_get_languages; |
|
1339 | + if(isset($_REQUEST['lang']) && $_REQUEST['lang']){return $_REQUEST['lang'];} |
|
1340 | 1340 | |
1341 | 1341 | |
1342 | - // |
|
1343 | - $url = str_replace(array("http://","https://"),"",$url); |
|
1344 | - $site_url = str_replace(array("http://","https://"),"",get_bloginfo('url')); |
|
1342 | + // |
|
1343 | + $url = str_replace(array("http://","https://"),"",$url); |
|
1344 | + $site_url = str_replace(array("http://","https://"),"",get_bloginfo('url')); |
|
1345 | 1345 | |
1346 | - $url = str_replace($site_url,"",$url); |
|
1346 | + $url = str_replace($site_url,"",$url); |
|
1347 | 1347 | |
1348 | 1348 | |
1349 | - $segments = explode('/', trim($url, '/')); |
|
1349 | + $segments = explode('/', trim($url, '/')); |
|
1350 | 1350 | |
1351 | - //print_r( $segments); |
|
1352 | - if($gd_wpml_get_languages){ |
|
1353 | - $langs = $gd_wpml_get_languages; |
|
1354 | - }else{ |
|
1355 | - global $sitepress; |
|
1356 | - $gd_wpml_get_languages = $sitepress->get_active_languages(); |
|
1357 | - } |
|
1351 | + //print_r( $segments); |
|
1352 | + if($gd_wpml_get_languages){ |
|
1353 | + $langs = $gd_wpml_get_languages; |
|
1354 | + }else{ |
|
1355 | + global $sitepress; |
|
1356 | + $gd_wpml_get_languages = $sitepress->get_active_languages(); |
|
1357 | + } |
|
1358 | 1358 | |
1359 | - if (isset($segments[0]) && $segments[0] && array_key_exists($segments[0], $gd_wpml_get_languages)) { |
|
1360 | - return $segments[0]; |
|
1361 | - } |
|
1359 | + if (isset($segments[0]) && $segments[0] && array_key_exists($segments[0], $gd_wpml_get_languages)) { |
|
1360 | + return $segments[0]; |
|
1361 | + } |
|
1362 | 1362 | |
1363 | - return false; |
|
1363 | + return false; |
|
1364 | 1364 | |
1365 | 1365 | |
1366 | 1366 | } |
1367 | 1367 | |
1368 | 1368 | function gd_wpml_slug_translation_turned_on($post_type) { |
1369 | 1369 | |
1370 | - global $sitepress; |
|
1371 | - $settings = $sitepress->get_settings(); |
|
1372 | - return isset($settings['posts_slug_translation']['types'][$post_type]) |
|
1373 | - && $settings['posts_slug_translation']['types'][$post_type] |
|
1374 | - && isset($settings['posts_slug_translation']['on']) |
|
1375 | - && $settings['posts_slug_translation']['on']; |
|
1370 | + global $sitepress; |
|
1371 | + $settings = $sitepress->get_settings(); |
|
1372 | + return isset($settings['posts_slug_translation']['types'][$post_type]) |
|
1373 | + && $settings['posts_slug_translation']['types'][$post_type] |
|
1374 | + && isset($settings['posts_slug_translation']['on']) |
|
1375 | + && $settings['posts_slug_translation']['on']; |
|
1376 | 1376 | } |
1377 | 1377 | |
1378 | 1378 | |
@@ -1397,150 +1397,150 @@ discard block |
||
1397 | 1397 | */ |
1398 | 1398 | function geodir_listing_permalink_structure($post_link, $post_obj, $leavename, $sample) |
1399 | 1399 | { |
1400 | - //echo $post_link."<br />".$sample ; |
|
1400 | + //echo $post_link."<br />".$sample ; |
|
1401 | 1401 | |
1402 | 1402 | |
1403 | - global $wpdb, $wp_query, $plugin_prefix, $post, $comment_post_cache, $gd_permalink_cache; |
|
1404 | - if (isset($post_obj->ID) && isset($post->ID) && $post_obj->ID == $post->ID) { |
|
1405 | - } elseif (isset($post_obj->post_status) && $post_obj->post_status == 'auto-draft') { |
|
1406 | - return $post_link; |
|
1407 | - } else { |
|
1408 | - $orig_post = $post; |
|
1409 | - $post = $post_obj; |
|
1410 | - } |
|
1403 | + global $wpdb, $wp_query, $plugin_prefix, $post, $comment_post_cache, $gd_permalink_cache; |
|
1404 | + if (isset($post_obj->ID) && isset($post->ID) && $post_obj->ID == $post->ID) { |
|
1405 | + } elseif (isset($post_obj->post_status) && $post_obj->post_status == 'auto-draft') { |
|
1406 | + return $post_link; |
|
1407 | + } else { |
|
1408 | + $orig_post = $post; |
|
1409 | + $post = $post_obj; |
|
1410 | + } |
|
1411 | 1411 | |
1412 | - if (in_array($post->post_type, geodir_get_posttypes())) { |
|
1412 | + if (in_array($post->post_type, geodir_get_posttypes())) { |
|
1413 | 1413 | |
1414 | 1414 | |
1415 | - $post_types = get_option('geodir_post_types'); |
|
1416 | - $slug = $post_types[$post->post_type]['rewrite']['slug']; |
|
1415 | + $post_types = get_option('geodir_post_types'); |
|
1416 | + $slug = $post_types[$post->post_type]['rewrite']['slug']; |
|
1417 | 1417 | |
1418 | - // Alter the CPT slug if WPML is set to do so |
|
1419 | - if(function_exists('icl_object_id')){ |
|
1420 | - if ( gd_wpml_slug_translation_turned_on( $post->post_type ) && $language_code = gd_wpml_get_lang_from_url($post_link)) { |
|
1418 | + // Alter the CPT slug if WPML is set to do so |
|
1419 | + if(function_exists('icl_object_id')){ |
|
1420 | + if ( gd_wpml_slug_translation_turned_on( $post->post_type ) && $language_code = gd_wpml_get_lang_from_url($post_link)) { |
|
1421 | 1421 | |
1422 | - $org_slug = $slug; |
|
1423 | - $slug = apply_filters( 'wpml_translate_single_string', |
|
1424 | - $slug, |
|
1425 | - 'WordPress', |
|
1426 | - 'URL slug: ' . $slug, |
|
1427 | - $language_code); |
|
1422 | + $org_slug = $slug; |
|
1423 | + $slug = apply_filters( 'wpml_translate_single_string', |
|
1424 | + $slug, |
|
1425 | + 'WordPress', |
|
1426 | + 'URL slug: ' . $slug, |
|
1427 | + $language_code); |
|
1428 | 1428 | |
1429 | - if(!$slug){$slug = $org_slug;} |
|
1429 | + if(!$slug){$slug = $org_slug;} |
|
1430 | 1430 | |
1431 | - } |
|
1432 | - } |
|
1431 | + } |
|
1432 | + } |
|
1433 | 1433 | |
1434 | - if (function_exists('geodir_location_geo_home_link')) { |
|
1435 | - remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
1436 | - } |
|
1434 | + if (function_exists('geodir_location_geo_home_link')) { |
|
1435 | + remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
1436 | + } |
|
1437 | 1437 | |
1438 | - // Fix slug problem when slug matches part of host or base url/ Ex: url -> www.abcxyz.com & slug -> xyz. |
|
1439 | - $site_url = trailingslashit(get_bloginfo('url')); |
|
1438 | + // Fix slug problem when slug matches part of host or base url/ Ex: url -> www.abcxyz.com & slug -> xyz. |
|
1439 | + $site_url = trailingslashit(get_bloginfo('url')); |
|
1440 | 1440 | |
1441 | - if (function_exists('geodir_location_geo_home_link')) { |
|
1442 | - add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
1443 | - } |
|
1444 | - |
|
1445 | - $fix_url = strpos($post_link, $site_url) === 0 ? true : false; |
|
1446 | - if ($fix_url) { |
|
1447 | - $post_link = str_replace($site_url, '', $post_link); |
|
1448 | - } |
|
1441 | + if (function_exists('geodir_location_geo_home_link')) { |
|
1442 | + add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
1443 | + } |
|
1444 | + |
|
1445 | + $fix_url = strpos($post_link, $site_url) === 0 ? true : false; |
|
1446 | + if ($fix_url) { |
|
1447 | + $post_link = str_replace($site_url, '', $post_link); |
|
1448 | + } |
|
1449 | 1449 | |
1450 | - $post_link = trailingslashit( |
|
1451 | - preg_replace( "/" . preg_quote( $slug, "/" ) . "/", $slug ."/%gd_taxonomy%",$post_link, 1 ) |
|
1452 | - ); |
|
1453 | - |
|
1454 | - if ($fix_url) { |
|
1455 | - $post_link = $site_url . $post_link; |
|
1456 | - } |
|
1457 | - |
|
1458 | - if (isset($comment_post_cache[$post->ID])) { |
|
1459 | - $post = $comment_post_cache[$post->ID]; |
|
1460 | - } |
|
1461 | - if (isset($gd_permalink_cache[$post->ID]) && $gd_permalink_cache[$post->ID] && !$sample) { |
|
1462 | - $post_id = $post->ID; |
|
1463 | - if (isset($orig_post)) { |
|
1464 | - $post = $orig_post; |
|
1465 | - } |
|
1466 | - return $gd_permalink_cache[$post_id]; |
|
1467 | - } |
|
1450 | + $post_link = trailingslashit( |
|
1451 | + preg_replace( "/" . preg_quote( $slug, "/" ) . "/", $slug ."/%gd_taxonomy%",$post_link, 1 ) |
|
1452 | + ); |
|
1468 | 1453 | |
1469 | - if (!isset($post->post_locations)) { |
|
1470 | - $post_type = $post->post_type; |
|
1471 | - $ID = $post->ID; |
|
1472 | - $post2 = $wpdb->get_row( |
|
1473 | - $wpdb->prepare( |
|
1474 | - "SELECT * from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
1475 | - array($post->ID) |
|
1476 | - ) |
|
1477 | - ); |
|
1454 | + if ($fix_url) { |
|
1455 | + $post_link = $site_url . $post_link; |
|
1456 | + } |
|
1478 | 1457 | |
1479 | - $post = (object)array_merge((array)$post, (array)$post2); |
|
1458 | + if (isset($comment_post_cache[$post->ID])) { |
|
1459 | + $post = $comment_post_cache[$post->ID]; |
|
1460 | + } |
|
1461 | + if (isset($gd_permalink_cache[$post->ID]) && $gd_permalink_cache[$post->ID] && !$sample) { |
|
1462 | + $post_id = $post->ID; |
|
1463 | + if (isset($orig_post)) { |
|
1464 | + $post = $orig_post; |
|
1465 | + } |
|
1466 | + return $gd_permalink_cache[$post_id]; |
|
1467 | + } |
|
1480 | 1468 | |
1481 | - $comment_post_cache[$post->ID] = $post; |
|
1482 | - } |
|
1469 | + if (!isset($post->post_locations)) { |
|
1470 | + $post_type = $post->post_type; |
|
1471 | + $ID = $post->ID; |
|
1472 | + $post2 = $wpdb->get_row( |
|
1473 | + $wpdb->prepare( |
|
1474 | + "SELECT * from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
1475 | + array($post->ID) |
|
1476 | + ) |
|
1477 | + ); |
|
1483 | 1478 | |
1479 | + $post = (object)array_merge((array)$post, (array)$post2); |
|
1484 | 1480 | |
1481 | + $comment_post_cache[$post->ID] = $post; |
|
1482 | + } |
|
1485 | 1483 | |
1486 | - if (false !== strpos($post_link, '%gd_taxonomy%')) { |
|
1487 | 1484 | |
1488 | - if ( apply_filters("geodir_add_location_url_to_url",get_option('geodir_add_location_url'),$post->post_type,$post)) { |
|
1489 | - $location_request = ''; |
|
1490 | 1485 | |
1486 | + if (false !== strpos($post_link, '%gd_taxonomy%')) { |
|
1491 | 1487 | |
1492 | - if (!empty($post->post_locations)) { |
|
1493 | - $geodir_arr_locations = explode(',', $post->post_locations); |
|
1494 | - if (count($geodir_arr_locations) == 3) { |
|
1495 | - $post->city_slug = str_replace('[', '', $geodir_arr_locations[0]); |
|
1496 | - $post->city_slug = str_replace(']', '', $post->city_slug); |
|
1497 | - $post->region_slug = str_replace('[', '', $geodir_arr_locations[1]); |
|
1498 | - $post->region_slug = str_replace(']', '', $post->region_slug); |
|
1499 | - $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]); |
|
1500 | - $post->country_slug = str_replace(']', '', $post->country_slug); |
|
1488 | + if ( apply_filters("geodir_add_location_url_to_url",get_option('geodir_add_location_url'),$post->post_type,$post)) { |
|
1489 | + $location_request = ''; |
|
1501 | 1490 | |
1502 | - $post_location = (object)array('country_slug' => $post->country_slug, |
|
1503 | - 'region_slug' => $post->region_slug, |
|
1504 | - 'city_slug' => $post->city_slug |
|
1505 | - ); |
|
1506 | 1491 | |
1507 | - } else |
|
1508 | - $post_location = geodir_get_location(); |
|
1492 | + if (!empty($post->post_locations)) { |
|
1493 | + $geodir_arr_locations = explode(',', $post->post_locations); |
|
1494 | + if (count($geodir_arr_locations) == 3) { |
|
1495 | + $post->city_slug = str_replace('[', '', $geodir_arr_locations[0]); |
|
1496 | + $post->city_slug = str_replace(']', '', $post->city_slug); |
|
1497 | + $post->region_slug = str_replace('[', '', $geodir_arr_locations[1]); |
|
1498 | + $post->region_slug = str_replace(']', '', $post->region_slug); |
|
1499 | + $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]); |
|
1500 | + $post->country_slug = str_replace(']', '', $post->country_slug); |
|
1509 | 1501 | |
1502 | + $post_location = (object)array('country_slug' => $post->country_slug, |
|
1503 | + 'region_slug' => $post->region_slug, |
|
1504 | + 'city_slug' => $post->city_slug |
|
1505 | + ); |
|
1510 | 1506 | |
1511 | - } else { |
|
1507 | + } else |
|
1508 | + $post_location = geodir_get_location(); |
|
1512 | 1509 | |
1513 | - $post_location_sql = $wpdb->get_results( |
|
1514 | - $wpdb->prepare( |
|
1515 | - "SELECT post_locations from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
1516 | - array($post->ID) |
|
1517 | - ) |
|
1518 | - ); |
|
1519 | - |
|
1520 | - if (!empty($post_location_sql) && is_array($post_location_sql) && !empty($post_location_sql[0]->post_locations)) { |
|
1521 | - |
|
1522 | - $geodir_arr_locations = explode(',', $post_location_sql[0]->post_locations); |
|
1523 | - if (count($geodir_arr_locations) == 3) { |
|
1524 | - $post->city_slug = str_replace('[', '', $geodir_arr_locations[0]); |
|
1525 | - $post->city_slug = str_replace(']', '', $post->city_slug); |
|
1526 | - $post->region_slug = str_replace('[', '', $geodir_arr_locations[1]); |
|
1527 | - $post->region_slug = str_replace(']', '', $post->region_slug); |
|
1528 | - $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]); |
|
1529 | - $post->country_slug = str_replace(']', '', $post->country_slug); |
|
1530 | - |
|
1531 | - $post_location = (object)array('country_slug' => $post->country_slug, |
|
1532 | - 'region_slug' => $post->region_slug, |
|
1533 | - 'city_slug' => $post->city_slug |
|
1534 | - ); |
|
1535 | 1510 | |
1536 | - } |
|
1537 | - } else |
|
1538 | - $post_location = geodir_get_location(); |
|
1539 | - } |
|
1511 | + } else { |
|
1512 | + |
|
1513 | + $post_location_sql = $wpdb->get_results( |
|
1514 | + $wpdb->prepare( |
|
1515 | + "SELECT post_locations from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
1516 | + array($post->ID) |
|
1517 | + ) |
|
1518 | + ); |
|
1519 | + |
|
1520 | + if (!empty($post_location_sql) && is_array($post_location_sql) && !empty($post_location_sql[0]->post_locations)) { |
|
1521 | + |
|
1522 | + $geodir_arr_locations = explode(',', $post_location_sql[0]->post_locations); |
|
1523 | + if (count($geodir_arr_locations) == 3) { |
|
1524 | + $post->city_slug = str_replace('[', '', $geodir_arr_locations[0]); |
|
1525 | + $post->city_slug = str_replace(']', '', $post->city_slug); |
|
1526 | + $post->region_slug = str_replace('[', '', $geodir_arr_locations[1]); |
|
1527 | + $post->region_slug = str_replace(']', '', $post->region_slug); |
|
1528 | + $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]); |
|
1529 | + $post->country_slug = str_replace(']', '', $post->country_slug); |
|
1530 | + |
|
1531 | + $post_location = (object)array('country_slug' => $post->country_slug, |
|
1532 | + 'region_slug' => $post->region_slug, |
|
1533 | + 'city_slug' => $post->city_slug |
|
1534 | + ); |
|
1535 | + |
|
1536 | + } |
|
1537 | + } else |
|
1538 | + $post_location = geodir_get_location(); |
|
1539 | + } |
|
1540 | 1540 | |
1541 | 1541 | |
1542 | - if (!empty($post_location)) { |
|
1543 | - $country_slug = isset($post_location->country_slug) ? $post_location->country_slug : ''; |
|
1542 | + if (!empty($post_location)) { |
|
1543 | + $country_slug = isset($post_location->country_slug) ? $post_location->country_slug : ''; |
|
1544 | 1544 | $region_slug = isset($post_location->region_slug) ? $post_location->region_slug : ''; |
1545 | 1545 | $city_slug = isset($post_location->city_slug) ? $post_location->city_slug : ''; |
1546 | 1546 | |
@@ -1558,78 +1558,78 @@ discard block |
||
1558 | 1558 | $location_slug[] = $city_slug; |
1559 | 1559 | |
1560 | 1560 | $location_request .= implode('/', $location_slug) . '/'; |
1561 | - } |
|
1562 | - } |
|
1561 | + } |
|
1562 | + } |
|
1563 | 1563 | |
1564 | - if (get_option('geodir_add_categories_url')) { |
|
1564 | + if (get_option('geodir_add_categories_url')) { |
|
1565 | 1565 | |
1566 | - $term_request = ''; |
|
1567 | - $taxonomies = geodir_get_taxonomies($post->post_type); |
|
1566 | + $term_request = ''; |
|
1567 | + $taxonomies = geodir_get_taxonomies($post->post_type); |
|
1568 | 1568 | |
1569 | - $taxonomies = end($taxonomies); |
|
1569 | + $taxonomies = end($taxonomies); |
|
1570 | 1570 | |
1571 | - if (!empty($post->default_category)) { |
|
1572 | - $post_terms = $post->default_category; |
|
1573 | - } else { |
|
1574 | - $post_terms = ''; |
|
1571 | + if (!empty($post->default_category)) { |
|
1572 | + $post_terms = $post->default_category; |
|
1573 | + } else { |
|
1574 | + $post_terms = ''; |
|
1575 | 1575 | |
1576 | - if (isset($post->$taxonomies)) { |
|
1577 | - $post_terms = explode(",", trim($post->$taxonomies, ",")); |
|
1578 | - $post_terms = $post_terms[0]; |
|
1579 | - } |
|
1576 | + if (isset($post->$taxonomies)) { |
|
1577 | + $post_terms = explode(",", trim($post->$taxonomies, ",")); |
|
1578 | + $post_terms = $post_terms[0]; |
|
1579 | + } |
|
1580 | 1580 | |
1581 | - if (!$post_terms) |
|
1582 | - $post_terms = geodir_get_post_meta($post->ID, 'default_category', true); |
|
1581 | + if (!$post_terms) |
|
1582 | + $post_terms = geodir_get_post_meta($post->ID, 'default_category', true); |
|
1583 | 1583 | |
1584 | - if (!$post_terms) { |
|
1585 | - $post_terms = geodir_get_post_meta($post->ID, $taxonomies, true); |
|
1584 | + if (!$post_terms) { |
|
1585 | + $post_terms = geodir_get_post_meta($post->ID, $taxonomies, true); |
|
1586 | 1586 | |
1587 | - if ($post_terms) { |
|
1588 | - $post_terms = explode(",", trim($post_terms, ",")); |
|
1589 | - $post_terms = $post_terms[0]; |
|
1590 | - } |
|
1591 | - } |
|
1592 | - } |
|
1587 | + if ($post_terms) { |
|
1588 | + $post_terms = explode(",", trim($post_terms, ",")); |
|
1589 | + $post_terms = $post_terms[0]; |
|
1590 | + } |
|
1591 | + } |
|
1592 | + } |
|
1593 | 1593 | |
1594 | - $term = get_term_by('id', $post_terms, $taxonomies); |
|
1594 | + $term = get_term_by('id', $post_terms, $taxonomies); |
|
1595 | 1595 | |
1596 | - if (!empty($term)) |
|
1597 | - $term_request = $term->slug; |
|
1598 | - //$term_request = $term->slug.'/'; |
|
1599 | - } |
|
1596 | + if (!empty($term)) |
|
1597 | + $term_request = $term->slug; |
|
1598 | + //$term_request = $term->slug.'/'; |
|
1599 | + } |
|
1600 | 1600 | |
1601 | - $request_term = ''; |
|
1602 | - $listingurl_separator = ''; |
|
1603 | - //$detailurl_separator = get_option('geodir_detailurl_separator'); |
|
1604 | - $detailurl_separator = ''; |
|
1605 | - if (isset($location_request) && $location_request != '' && isset($term_request) && $term_request != '') { |
|
1606 | - $request_term = $location_request; |
|
1607 | - //$listingurl_separator = get_option('geodir_listingurl_separator'); |
|
1608 | - //$request_term .= $listingurl_separator.'/'.$term_request; |
|
1609 | - $request_term .= $term_request; |
|
1601 | + $request_term = ''; |
|
1602 | + $listingurl_separator = ''; |
|
1603 | + //$detailurl_separator = get_option('geodir_detailurl_separator'); |
|
1604 | + $detailurl_separator = ''; |
|
1605 | + if (isset($location_request) && $location_request != '' && isset($term_request) && $term_request != '') { |
|
1606 | + $request_term = $location_request; |
|
1607 | + //$listingurl_separator = get_option('geodir_listingurl_separator'); |
|
1608 | + //$request_term .= $listingurl_separator.'/'.$term_request; |
|
1609 | + $request_term .= $term_request; |
|
1610 | 1610 | |
1611 | - } else { |
|
1612 | - if (isset($location_request) && $location_request != '') $request_term = $location_request; |
|
1611 | + } else { |
|
1612 | + if (isset($location_request) && $location_request != '') $request_term = $location_request; |
|
1613 | 1613 | |
1614 | - if (isset($term_request) && $term_request != '') $request_term .= $term_request; |
|
1615 | - } |
|
1616 | - $request_term = trim($request_term, '/'); |
|
1617 | - if (!empty($request_term)) |
|
1618 | - $post_link = str_replace('%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1619 | - else |
|
1620 | - $post_link = str_replace('/%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1621 | - //echo $post_link ; |
|
1622 | - } |
|
1623 | - // temp cache the permalink |
|
1624 | - if (!$sample && (!isset($_REQUEST['geodir_ajax']) || (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] != 'add_listing'))) { |
|
1625 | - $gd_permalink_cache[$post->ID] = $post_link; |
|
1626 | - } |
|
1627 | - } |
|
1628 | - if (isset($orig_post)) { |
|
1629 | - $post = $orig_post; |
|
1630 | - } |
|
1631 | - //echo $post_link ; |
|
1632 | - return $post_link; |
|
1614 | + if (isset($term_request) && $term_request != '') $request_term .= $term_request; |
|
1615 | + } |
|
1616 | + $request_term = trim($request_term, '/'); |
|
1617 | + if (!empty($request_term)) |
|
1618 | + $post_link = str_replace('%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1619 | + else |
|
1620 | + $post_link = str_replace('/%gd_taxonomy%', $request_term . $detailurl_separator, $post_link); |
|
1621 | + //echo $post_link ; |
|
1622 | + } |
|
1623 | + // temp cache the permalink |
|
1624 | + if (!$sample && (!isset($_REQUEST['geodir_ajax']) || (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] != 'add_listing'))) { |
|
1625 | + $gd_permalink_cache[$post->ID] = $post_link; |
|
1626 | + } |
|
1627 | + } |
|
1628 | + if (isset($orig_post)) { |
|
1629 | + $post = $orig_post; |
|
1630 | + } |
|
1631 | + //echo $post_link ; |
|
1632 | + return $post_link; |
|
1633 | 1633 | |
1634 | 1634 | } |
1635 | 1635 | |
@@ -1646,103 +1646,103 @@ discard block |
||
1646 | 1646 | * @return string The term link. |
1647 | 1647 | */ |
1648 | 1648 | function geodir_term_link($termlink, $term, $taxonomy) { |
1649 | - $geodir_taxonomies = geodir_get_taxonomies('', true); |
|
1649 | + $geodir_taxonomies = geodir_get_taxonomies('', true); |
|
1650 | 1650 | |
1651 | - if (isset($taxonomy) && !empty($geodir_taxonomies) && in_array($taxonomy, $geodir_taxonomies)) { |
|
1652 | - global $geodir_add_location_url, $gd_session; |
|
1653 | - $include_location = false; |
|
1654 | - $request_term = array(); |
|
1651 | + if (isset($taxonomy) && !empty($geodir_taxonomies) && in_array($taxonomy, $geodir_taxonomies)) { |
|
1652 | + global $geodir_add_location_url, $gd_session; |
|
1653 | + $include_location = false; |
|
1654 | + $request_term = array(); |
|
1655 | 1655 | |
1656 | - $listing_slug = geodir_get_listing_slug($taxonomy); |
|
1656 | + $listing_slug = geodir_get_listing_slug($taxonomy); |
|
1657 | 1657 | |
1658 | - if ($geodir_add_location_url != NULL && $geodir_add_location_url != '') { |
|
1659 | - if ($geodir_add_location_url && get_option('geodir_add_location_url')) { |
|
1660 | - $include_location = true; |
|
1661 | - } |
|
1662 | - } elseif (get_option('geodir_add_location_url') && $gd_session->get('gd_multi_location') == 1) |
|
1663 | - $include_location = true; |
|
1658 | + if ($geodir_add_location_url != NULL && $geodir_add_location_url != '') { |
|
1659 | + if ($geodir_add_location_url && get_option('geodir_add_location_url')) { |
|
1660 | + $include_location = true; |
|
1661 | + } |
|
1662 | + } elseif (get_option('geodir_add_location_url') && $gd_session->get('gd_multi_location') == 1) |
|
1663 | + $include_location = true; |
|
1664 | 1664 | |
1665 | - if ($include_location) { |
|
1666 | - global $post; |
|
1665 | + if ($include_location) { |
|
1666 | + global $post; |
|
1667 | 1667 | |
1668 | 1668 | $location_manager = defined('POST_LOCATION_TABLE') ? true : false; |
1669 | 1669 | $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false; |
1670 | 1670 | |
1671 | 1671 | if(geodir_is_page('detail') && isset($post->country_slug)){ |
1672 | - $location_terms = array( |
|
1673 | - 'gd_country' => $post->country_slug, |
|
1674 | - 'gd_region' => $post->region_slug, |
|
1675 | - 'gd_city' => $post->city_slug |
|
1676 | - ); |
|
1672 | + $location_terms = array( |
|
1673 | + 'gd_country' => $post->country_slug, |
|
1674 | + 'gd_region' => $post->region_slug, |
|
1675 | + 'gd_city' => $post->city_slug |
|
1676 | + ); |
|
1677 | 1677 | |
1678 | 1678 | if ($neighbourhood_active && !empty($location_terms['gd_city']) && $gd_ses_neighbourhood = $gd_session->get('gd_neighbourhood')) { |
1679 | 1679 | $location_terms['gd_neighbourhood'] = $gd_ses_neighbourhood; |
1680 | 1680 | } |
1681 | - } else { |
|
1682 | - $location_terms = geodir_get_current_location_terms('query_vars'); |
|
1683 | - } |
|
1681 | + } else { |
|
1682 | + $location_terms = geodir_get_current_location_terms('query_vars'); |
|
1683 | + } |
|
1684 | 1684 | |
1685 | - $geodir_show_location_url = get_option('geodir_show_location_url'); |
|
1686 | - $location_terms = geodir_remove_location_terms($location_terms); |
|
1685 | + $geodir_show_location_url = get_option('geodir_show_location_url'); |
|
1686 | + $location_terms = geodir_remove_location_terms($location_terms); |
|
1687 | 1687 | |
1688 | - if (!empty($location_terms)) { |
|
1688 | + if (!empty($location_terms)) { |
|
1689 | 1689 | |
1690 | - $url_separator = '';//get_option('geodir_listingurl_separator'); |
|
1690 | + $url_separator = '';//get_option('geodir_listingurl_separator'); |
|
1691 | 1691 | |
1692 | - if (get_option('permalink_structure') != '') { |
|
1693 | - $old_listing_slug = '/' . $listing_slug . '/'; |
|
1694 | - $request_term = implode("/", $location_terms); |
|
1695 | - $new_listing_slug = '/' . $listing_slug . '/' . $request_term . '/'; |
|
1692 | + if (get_option('permalink_structure') != '') { |
|
1693 | + $old_listing_slug = '/' . $listing_slug . '/'; |
|
1694 | + $request_term = implode("/", $location_terms); |
|
1695 | + $new_listing_slug = '/' . $listing_slug . '/' . $request_term . '/'; |
|
1696 | 1696 | |
1697 | - $termlink = substr_replace($termlink, $new_listing_slug, strpos($termlink, $old_listing_slug), strlen($old_listing_slug)); |
|
1698 | - } else { |
|
1699 | - $termlink = geodir_getlink($termlink, $request_term); |
|
1700 | - } |
|
1701 | - } |
|
1702 | - } |
|
1697 | + $termlink = substr_replace($termlink, $new_listing_slug, strpos($termlink, $old_listing_slug), strlen($old_listing_slug)); |
|
1698 | + } else { |
|
1699 | + $termlink = geodir_getlink($termlink, $request_term); |
|
1700 | + } |
|
1701 | + } |
|
1702 | + } |
|
1703 | 1703 | |
1704 | - // Alter the CPT slug is WPML is set to do so |
|
1705 | - /* we can replace this with the below function |
|
1704 | + // Alter the CPT slug is WPML is set to do so |
|
1705 | + /* we can replace this with the below function |
|
1706 | 1706 | if(function_exists('icl_object_id')){ |
1707 | 1707 | global $sitepress; |
1708 | 1708 | $post_type = str_replace("category","",$taxonomy); |
1709 | 1709 | $termlink = $sitepress->post_type_archive_link_filter( $termlink, $post_type); |
1710 | 1710 | }*/ |
1711 | 1711 | |
1712 | - // Alter the CPT slug if WPML is set to do so |
|
1713 | - if(function_exists('icl_object_id')){ |
|
1714 | - $post_types = get_option('geodir_post_types'); |
|
1715 | - $post_type = str_replace("category","",$taxonomy); |
|
1712 | + // Alter the CPT slug if WPML is set to do so |
|
1713 | + if(function_exists('icl_object_id')){ |
|
1714 | + $post_types = get_option('geodir_post_types'); |
|
1715 | + $post_type = str_replace("category","",$taxonomy); |
|
1716 | 1716 | $post_type = str_replace("_tags","",$post_type); |
1717 | - $slug = $post_types[$post_type]['rewrite']['slug']; |
|
1718 | - if ( gd_wpml_slug_translation_turned_on( $post_type )) { |
|
1717 | + $slug = $post_types[$post_type]['rewrite']['slug']; |
|
1718 | + if ( gd_wpml_slug_translation_turned_on( $post_type )) { |
|
1719 | 1719 | |
1720 | - global $sitepress; |
|
1721 | - $default_lang = $sitepress->get_default_language(); |
|
1722 | - $language_code = gd_wpml_get_lang_from_url($termlink); |
|
1723 | - if(!$language_code ){$language_code = $default_lang;} |
|
1720 | + global $sitepress; |
|
1721 | + $default_lang = $sitepress->get_default_language(); |
|
1722 | + $language_code = gd_wpml_get_lang_from_url($termlink); |
|
1723 | + if(!$language_code ){$language_code = $default_lang;} |
|
1724 | 1724 | |
1725 | - $org_slug = $slug; |
|
1726 | - $slug = apply_filters( 'wpml_translate_single_string', |
|
1727 | - $slug, |
|
1728 | - 'WordPress', |
|
1729 | - 'URL slug: ' . $slug, |
|
1730 | - $language_code); |
|
1725 | + $org_slug = $slug; |
|
1726 | + $slug = apply_filters( 'wpml_translate_single_string', |
|
1727 | + $slug, |
|
1728 | + 'WordPress', |
|
1729 | + 'URL slug: ' . $slug, |
|
1730 | + $language_code); |
|
1731 | 1731 | |
1732 | 1732 | |
1733 | - if(!$slug){$slug = $org_slug;} |
|
1733 | + if(!$slug){$slug = $org_slug;} |
|
1734 | 1734 | |
1735 | - $termlink = trailingslashit( |
|
1735 | + $termlink = trailingslashit( |
|
1736 | 1736 | |
1737 | - preg_replace( "/" . preg_quote( $org_slug, "/" ) . "/", $slug ,$termlink, 1 ) |
|
1738 | - ); |
|
1737 | + preg_replace( "/" . preg_quote( $org_slug, "/" ) . "/", $slug ,$termlink, 1 ) |
|
1738 | + ); |
|
1739 | 1739 | |
1740 | - } |
|
1741 | - } |
|
1740 | + } |
|
1741 | + } |
|
1742 | 1742 | |
1743 | - } |
|
1743 | + } |
|
1744 | 1744 | |
1745 | - return $termlink; |
|
1745 | + return $termlink; |
|
1746 | 1746 | } |
1747 | 1747 | |
1748 | 1748 | /** |
@@ -1768,14 +1768,14 @@ discard block |
||
1768 | 1768 | if (in_array($post_type, geodir_get_posttypes())) { |
1769 | 1769 | if (get_option('geodir_add_location_url') && $gd_session->get('gd_multi_location') == 1) { |
1770 | 1770 | if(geodir_is_page('detail') && !empty($post) && isset($post->country_slug)) { |
1771 | - $location_terms = array( |
|
1772 | - 'gd_country' => $post->country_slug, |
|
1773 | - 'gd_region' => $post->region_slug, |
|
1774 | - 'gd_city' => $post->city_slug |
|
1775 | - ); |
|
1776 | - } else { |
|
1777 | - $location_terms = geodir_get_current_location_terms('query_vars'); |
|
1778 | - } |
|
1771 | + $location_terms = array( |
|
1772 | + 'gd_country' => $post->country_slug, |
|
1773 | + 'gd_region' => $post->region_slug, |
|
1774 | + 'gd_city' => $post->city_slug |
|
1775 | + ); |
|
1776 | + } else { |
|
1777 | + $location_terms = geodir_get_current_location_terms('query_vars'); |
|
1778 | + } |
|
1779 | 1779 | |
1780 | 1780 | $location_terms = geodir_remove_location_terms($location_terms); |
1781 | 1781 | |
@@ -1806,14 +1806,14 @@ discard block |
||
1806 | 1806 | */ |
1807 | 1807 | function get_post_type_singular_label($post_type, $echo = false) |
1808 | 1808 | { |
1809 | - $obj_post_type = get_post_type_object($post_type); |
|
1810 | - if (!is_object($obj_post_type)) { |
|
1811 | - return; |
|
1812 | - } |
|
1813 | - if ($echo) |
|
1814 | - echo $obj_post_type->labels->singular_name; |
|
1815 | - else |
|
1816 | - return $obj_post_type->labels->singular_name; |
|
1809 | + $obj_post_type = get_post_type_object($post_type); |
|
1810 | + if (!is_object($obj_post_type)) { |
|
1811 | + return; |
|
1812 | + } |
|
1813 | + if ($echo) |
|
1814 | + echo $obj_post_type->labels->singular_name; |
|
1815 | + else |
|
1816 | + return $obj_post_type->labels->singular_name; |
|
1817 | 1817 | |
1818 | 1818 | } |
1819 | 1819 | |
@@ -1828,16 +1828,16 @@ discard block |
||
1828 | 1828 | */ |
1829 | 1829 | function get_post_type_plural_label($post_type, $echo = false) |
1830 | 1830 | { |
1831 | - $all_postypes = geodir_get_posttypes(); |
|
1831 | + $all_postypes = geodir_get_posttypes(); |
|
1832 | 1832 | |
1833 | - if (!in_array($post_type, $all_postypes)) |
|
1834 | - return false; |
|
1833 | + if (!in_array($post_type, $all_postypes)) |
|
1834 | + return false; |
|
1835 | 1835 | |
1836 | - $obj_post_type = get_post_type_object($post_type); |
|
1837 | - if ($echo) |
|
1838 | - echo $obj_post_type->labels->name; |
|
1839 | - else |
|
1840 | - return $obj_post_type->labels->name; |
|
1836 | + $obj_post_type = get_post_type_object($post_type); |
|
1837 | + if ($echo) |
|
1838 | + echo $obj_post_type->labels->name; |
|
1839 | + else |
|
1840 | + return $obj_post_type->labels->name; |
|
1841 | 1841 | |
1842 | 1842 | } |
1843 | 1843 | |
@@ -1856,51 +1856,51 @@ discard block |
||
1856 | 1856 | */ |
1857 | 1857 | function geodir_term_exists($term, $taxonomy = '', $parent = 0) |
1858 | 1858 | { |
1859 | - global $wpdb; |
|
1860 | - |
|
1861 | - $select = "SELECT term_id FROM $wpdb->terms as t WHERE "; |
|
1862 | - $tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE "; |
|
1863 | - |
|
1864 | - if (is_int($term)) { |
|
1865 | - if (0 == $term) |
|
1866 | - return 0; |
|
1867 | - $where = 't.term_id = %d'; |
|
1868 | - if (!empty($taxonomy)) |
|
1869 | - return $wpdb->get_row($wpdb->prepare($tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); |
|
1870 | - else |
|
1871 | - return $wpdb->get_var($wpdb->prepare($select . $where, $term)); |
|
1872 | - } |
|
1859 | + global $wpdb; |
|
1860 | + |
|
1861 | + $select = "SELECT term_id FROM $wpdb->terms as t WHERE "; |
|
1862 | + $tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE "; |
|
1863 | + |
|
1864 | + if (is_int($term)) { |
|
1865 | + if (0 == $term) |
|
1866 | + return 0; |
|
1867 | + $where = 't.term_id = %d'; |
|
1868 | + if (!empty($taxonomy)) |
|
1869 | + return $wpdb->get_row($wpdb->prepare($tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); |
|
1870 | + else |
|
1871 | + return $wpdb->get_var($wpdb->prepare($select . $where, $term)); |
|
1872 | + } |
|
1873 | 1873 | |
1874 | - $term = trim(wp_unslash($term)); |
|
1874 | + $term = trim(wp_unslash($term)); |
|
1875 | 1875 | |
1876 | - if ('' === $slug = sanitize_title($term)) |
|
1877 | - return 0; |
|
1876 | + if ('' === $slug = sanitize_title($term)) |
|
1877 | + return 0; |
|
1878 | 1878 | |
1879 | - $where = 't.slug = %s'; |
|
1879 | + $where = 't.slug = %s'; |
|
1880 | 1880 | |
1881 | - $where_fields = array($slug); |
|
1882 | - if (!empty($taxonomy)) { |
|
1883 | - $parent = (int)$parent; |
|
1884 | - if ($parent > 0) { |
|
1885 | - $where_fields[] = $parent; |
|
1886 | - $else_where_fields[] = $parent; |
|
1887 | - $where .= ' AND tt.parent = %d'; |
|
1881 | + $where_fields = array($slug); |
|
1882 | + if (!empty($taxonomy)) { |
|
1883 | + $parent = (int)$parent; |
|
1884 | + if ($parent > 0) { |
|
1885 | + $where_fields[] = $parent; |
|
1886 | + $else_where_fields[] = $parent; |
|
1887 | + $where .= ' AND tt.parent = %d'; |
|
1888 | 1888 | |
1889 | - } |
|
1889 | + } |
|
1890 | 1890 | |
1891 | - $where_fields[] = $taxonomy; |
|
1891 | + $where_fields[] = $taxonomy; |
|
1892 | 1892 | |
1893 | 1893 | |
1894 | - if ($result = $wpdb->get_row($wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $where_fields), ARRAY_A)) |
|
1895 | - return $result; |
|
1894 | + if ($result = $wpdb->get_row($wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $where_fields), ARRAY_A)) |
|
1895 | + return $result; |
|
1896 | 1896 | |
1897 | - return false; |
|
1898 | - } |
|
1897 | + return false; |
|
1898 | + } |
|
1899 | 1899 | |
1900 | - if ($result = $wpdb->get_var($wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where", $where_fields))) |
|
1901 | - return $result; |
|
1900 | + if ($result = $wpdb->get_var($wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where", $where_fields))) |
|
1901 | + return $result; |
|
1902 | 1902 | |
1903 | - return false; |
|
1903 | + return false; |
|
1904 | 1904 | } |
1905 | 1905 | |
1906 | 1906 | /** |
@@ -1912,7 +1912,7 @@ discard block |
||
1912 | 1912 | function geodir_get_term_icon_rebuild() |
1913 | 1913 | { |
1914 | 1914 | |
1915 | - update_option('gd_term_icons', ''); |
|
1915 | + update_option('gd_term_icons', ''); |
|
1916 | 1916 | |
1917 | 1917 | } |
1918 | 1918 | |
@@ -1930,60 +1930,60 @@ discard block |
||
1930 | 1930 | */ |
1931 | 1931 | function geodir_get_term_icon($term_id = false, $rebuild = false) |
1932 | 1932 | { |
1933 | - global $wpdb; |
|
1934 | - if (!$rebuild) { |
|
1935 | - $terms_icons = get_option('gd_term_icons'); |
|
1936 | - } else { |
|
1937 | - $terms_icons = ''; |
|
1938 | - } |
|
1939 | - |
|
1940 | - if (empty($terms_icons)) { |
|
1941 | - $default_icon_url = get_option('geodir_default_marker_icon'); |
|
1942 | - $taxonomy = geodir_get_taxonomies(); |
|
1943 | - $post_types = geodir_get_posttypes(); |
|
1944 | - $tax_arr = array(); |
|
1945 | - foreach ($post_types as $post_type) { |
|
1946 | - $tax_arr[] = "'" . $post_type . "category'"; |
|
1947 | - } |
|
1948 | - $tax_c = implode(',', $tax_arr); |
|
1949 | - $terms = $wpdb->get_results("SELECT * FROM $wpdb->term_taxonomy WHERE taxonomy IN ($tax_c)"); |
|
1950 | - //$terms = get_terms( $taxonomy ); |
|
1951 | - |
|
1952 | - if($terms) { |
|
1953 | - foreach ($terms as $term) { |
|
1954 | - $post_type = str_replace("category", "", $term->taxonomy); |
|
1955 | - $a_terms[$post_type][] = $term; |
|
1933 | + global $wpdb; |
|
1934 | + if (!$rebuild) { |
|
1935 | + $terms_icons = get_option('gd_term_icons'); |
|
1936 | + } else { |
|
1937 | + $terms_icons = ''; |
|
1938 | + } |
|
1956 | 1939 | |
1957 | - } |
|
1958 | - } |
|
1940 | + if (empty($terms_icons)) { |
|
1941 | + $default_icon_url = get_option('geodir_default_marker_icon'); |
|
1942 | + $taxonomy = geodir_get_taxonomies(); |
|
1943 | + $post_types = geodir_get_posttypes(); |
|
1944 | + $tax_arr = array(); |
|
1945 | + foreach ($post_types as $post_type) { |
|
1946 | + $tax_arr[] = "'" . $post_type . "category'"; |
|
1947 | + } |
|
1948 | + $tax_c = implode(',', $tax_arr); |
|
1949 | + $terms = $wpdb->get_results("SELECT * FROM $wpdb->term_taxonomy WHERE taxonomy IN ($tax_c)"); |
|
1950 | + //$terms = get_terms( $taxonomy ); |
|
1959 | 1951 | |
1960 | - if($a_terms) { |
|
1961 | - foreach ($a_terms as $pt => $t2) { |
|
1952 | + if($terms) { |
|
1953 | + foreach ($terms as $term) { |
|
1954 | + $post_type = str_replace("category", "", $term->taxonomy); |
|
1955 | + $a_terms[$post_type][] = $term; |
|
1962 | 1956 | |
1963 | - foreach ($t2 as $term) { |
|
1964 | - $term_icon = get_tax_meta($term->term_id, 'ct_cat_icon', false, $pt); |
|
1965 | - if ($term_icon) { |
|
1966 | - $term_icon_url = $term_icon["src"]; |
|
1967 | - } else { |
|
1968 | - $term_icon_url = $default_icon_url; |
|
1969 | - } |
|
1970 | - $terms_icons[$term->term_id] = $term_icon_url; |
|
1971 | - } |
|
1972 | - } |
|
1973 | - } |
|
1957 | + } |
|
1958 | + } |
|
1959 | + |
|
1960 | + if($a_terms) { |
|
1961 | + foreach ($a_terms as $pt => $t2) { |
|
1962 | + |
|
1963 | + foreach ($t2 as $term) { |
|
1964 | + $term_icon = get_tax_meta($term->term_id, 'ct_cat_icon', false, $pt); |
|
1965 | + if ($term_icon) { |
|
1966 | + $term_icon_url = $term_icon["src"]; |
|
1967 | + } else { |
|
1968 | + $term_icon_url = $default_icon_url; |
|
1969 | + } |
|
1970 | + $terms_icons[$term->term_id] = $term_icon_url; |
|
1971 | + } |
|
1972 | + } |
|
1973 | + } |
|
1974 | 1974 | |
1975 | - update_option('gd_term_icons', $terms_icons); |
|
1976 | - } |
|
1975 | + update_option('gd_term_icons', $terms_icons); |
|
1976 | + } |
|
1977 | 1977 | |
1978 | - if ($term_id && isset($terms_icons[$term_id])) { |
|
1979 | - return $terms_icons[$term_id]; |
|
1980 | - } elseif ($term_id && !isset($terms_icons[$term_id])) { |
|
1981 | - return get_option('geodir_default_marker_icon'); |
|
1982 | - } |
|
1978 | + if ($term_id && isset($terms_icons[$term_id])) { |
|
1979 | + return $terms_icons[$term_id]; |
|
1980 | + } elseif ($term_id && !isset($terms_icons[$term_id])) { |
|
1981 | + return get_option('geodir_default_marker_icon'); |
|
1982 | + } |
|
1983 | 1983 | |
1984 | - if (is_ssl()) { |
|
1985 | - $terms_icons = str_replace("http:","https:",$terms_icons ); |
|
1986 | - } |
|
1984 | + if (is_ssl()) { |
|
1985 | + $terms_icons = str_replace("http:","https:",$terms_icons ); |
|
1986 | + } |
|
1987 | 1987 | |
1988 | - return $terms_icons; |
|
1988 | + return $terms_icons; |
|
1989 | 1989 | } |
1990 | 1990 | \ No newline at end of file |