Test Failed
Pull Request — master (#283)
by Kiran
07:36
created
geodirectory-admin/geodir_admin_ajax.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 	 *
13 13
 	 * @since 1.0.0
14 14
 	 */
15
-	include_once(geodir_plugin_path() . '/geodirectory-admin/option-pages/create_field.php');
15
+	include_once(geodir_plugin_path().'/geodirectory-admin/option-pages/create_field.php');
16 16
     die;
17 17
 }
18 18
 
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@
 block discarded – undo
13 13
 	 * @since 1.0.0
14 14
 	 */
15 15
 	include_once(geodir_plugin_path() . '/geodirectory-admin/option-pages/create_field.php');
16
-    gd_die();
16
+	gd_die();
17 17
 }
18 18
 
19 19
 
20 20
 if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] != '') {
21
-    switch ($_REQUEST['ajax_action']):
22
-        case 'get_cat_dl':
23
-            geodir_get_categories_dl($_REQUEST['post_type'], $_REQUEST['selected'], false, true);
24
-            break;
25
-    endswitch;
21
+	switch ($_REQUEST['ajax_action']):
22
+		case 'get_cat_dl':
23
+			geodir_get_categories_dl($_REQUEST['post_type'], $_REQUEST['selected'], false, true);
24
+			break;
25
+	endswitch;
26 26
 }
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory_widgets.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
             public function form($instance)
302 302
             {
303 303
                 //widgetform in backend
304
-                $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
304
+                $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
305 305
                 $title = strip_tags($instance['title']);
306 306
 
307 307
                 ?>
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
                 ?>
374 374
 
375 375
                 <a href="http://twitter.com/share"
376
-                   class="twitter-share-button"><?php _e('Tweet', 'geodirectory');?></a>
376
+                   class="twitter-share-button"><?php _e('Tweet', 'geodirectory'); ?></a>
377 377
 
378 378
                 <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
379 379
 
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
             public function form($instance)
444 444
             {
445 445
                 //widgetform in backend
446
-                $instance = wp_parse_args((array)$instance, array('title' => ''));
446
+                $instance = wp_parse_args((array) $instance, array('title' => ''));
447 447
                 $title = strip_tags($instance['title']);
448 448
                 ?>
449 449
                 <p>No settings for this widget</p>
@@ -515,11 +515,11 @@  discard block
 block discarded – undo
515 515
                 echo $before_widget;
516 516
                 ?>
517 517
 
518
-                <?php echo $before_title . $title; ?>  <a href="<?php if ($id) {
519
-                echo 'http://feeds2.feedburner.com/' . $id;
518
+                <?php echo $before_title.$title; ?>  <a href="<?php if ($id) {
519
+                echo 'http://feeds2.feedburner.com/'.$id;
520 520
             } else {
521 521
                 bloginfo('rss_url');
522
-            } ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title;?>
522
+            } ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title; ?>
523 523
 
524 524
                 <?php if ($text <> "") { ?>
525 525
 
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
             public function form($instance)
585 585
             {
586 586
                 //widgetform in backend
587
-                $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => ''));
587
+                $instance = wp_parse_args((array) $instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => ''));
588 588
 
589 589
                 $id = strip_tags($instance['id']);
590 590
 
@@ -596,19 +596,19 @@  discard block
 block discarded – undo
596 596
 
597 597
                 ?>
598 598
                 <p><label
599
-                        for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'geodirectory');?>:
599
+                        for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'geodirectory'); ?>:
600 600
                         <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
601 601
                                name="<?php echo $this->get_field_name('title'); ?>" type="text"
602 602
                                value="<?php echo esc_attr($title); ?>"/></label></p>
603 603
 
604 604
                 <p><label
605
-                        for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Feedburner ID (ex :- geotheme)', 'geodirectory');?>
605
+                        for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Feedburner ID (ex :- geotheme)', 'geodirectory'); ?>
606 606
                         : <input class="widefat" id="<?php echo $this->get_field_id('id'); ?>"
607 607
                                  name="<?php echo $this->get_field_name('id'); ?>" type="text"
608 608
                                  value="<?php echo esc_attr($id); ?>"/></label></p>
609 609
 
610 610
                 <p><label
611
-                        for="<?php echo $this->get_field_id('text'); ?>"><?php _e('Short Description', 'geodirectory');?>
611
+                        for="<?php echo $this->get_field_id('text'); ?>"><?php _e('Short Description', 'geodirectory'); ?>
612 612
                         <textarea class="widefat" rows="6" cols="20" id="<?php echo $this->get_field_id('text'); ?>"
613 613
                                   name="<?php echo $this->get_field_name('text'); ?>"><?php echo esc_attr($text); ?></textarea></label>
614 614
                 </p>
@@ -704,12 +704,12 @@  discard block
 block discarded – undo
704 704
             public function form($instance)
705 705
             {
706 706
                 //widgetform in backend
707
-                $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
707
+                $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
708 708
 
709 709
                 $desc1 = ($instance['desc1']);
710 710
                 ?>
711 711
                 <p><label
712
-                        for="<?php echo $this->get_field_id('desc1'); ?>"><?php _e('Your Advt code (ex.google adsense, etc.)', 'geodirectory');?>
712
+                        for="<?php echo $this->get_field_id('desc1'); ?>"><?php _e('Your Advt code (ex.google adsense, etc.)', 'geodirectory'); ?>
713 713
                         <textarea class="widefat" rows="6" cols="20" id="<?php echo $this->get_field_id('desc1'); ?>"
714 714
                                   name="<?php echo $this->get_field_name('desc1'); ?>"><?php echo esc_attr($desc1); ?></textarea></label>
715 715
                 </p>
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
                  * @param string $number The image count.
773 773
                  */
774 774
                 $number = empty($instance['number']) ? '&nbsp;' : apply_filters('widget_number', $instance['number']);
775
-                echo $before_title . __('Photo Gallery', 'geodirectory') . $after_title;
775
+                echo $before_title.__('Photo Gallery', 'geodirectory').$after_title;
776 776
                 ?>
777 777
 
778 778
                 <div class="geodir-flickr clearfix">
@@ -819,14 +819,14 @@  discard block
 block discarded – undo
819 819
             {
820 820
 
821 821
                 //widgetform in backend
822
-                $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'number' => ''));
822
+                $instance = wp_parse_args((array) $instance, array('title' => '', 'id' => '', 'number' => ''));
823 823
                 $id = strip_tags($instance['id']);
824 824
                 $number = strip_tags($instance['number']);
825 825
                 ?>
826 826
 
827 827
                 <p>
828 828
                     <label
829
-                        for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Flickr ID', 'geodirectory');?>
829
+                        for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Flickr ID', 'geodirectory'); ?>
830 830
                         (<a href="http://www.idgettr.com">idGettr</a>):
831 831
                         <input class="widefat" id="<?php echo $this->get_field_id('id'); ?>"
832 832
                                name="<?php echo $this->get_field_name('id'); ?>" type="text"
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 
837 837
                 <p>
838 838
                     <label
839
-                        for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of photos:', 'geodirectory');?>
839
+                        for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of photos:', 'geodirectory'); ?>
840 840
                         <input class="widefat" id="<?php echo $this->get_field_id('number'); ?>"
841 841
                                name="<?php echo $this->get_field_name('number'); ?>" type="text"
842 842
                                value="<?php echo esc_attr($number); ?>"/>
@@ -932,12 +932,12 @@  discard block
 block discarded – undo
932 932
             public function form($instance)
933 933
             {
934 934
                 //widgetform in backend
935
-                $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => ''));
935
+                $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => ''));
936 936
 
937 937
                 $desc1 = ($instance['gd_tw_desc1']);
938 938
                 ?>
939 939
                 <p><label
940
-                        for="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"><?php _e('Your twitter code', 'geodirectory');?>
940
+                        for="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"><?php _e('Your twitter code', 'geodirectory'); ?>
941 941
                         <textarea class="widefat" rows="6" cols="20"
942 942
                                   id="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"
943 943
                                   name="<?php echo $this->get_field_name('gd_tw_desc1'); ?>"><?php echo esc_attr($desc1); ?></textarea></label>
@@ -990,7 +990,7 @@  discard block
 block discarded – undo
990 990
                  * @param array $args The widget arguments.
991 991
                  * @param array $instance The widget instance.
992 992
                  */
993
-                $args = apply_filters('widget_geodir_advance_search_args',$args,$instance);
993
+                $args = apply_filters('widget_geodir_advance_search_args', $args, $instance);
994 994
 
995 995
                 // prints the widget
996 996
                 extract($args, EXTR_SKIP);
Please login to merge, or discard this patch.
Indentation   +888 added lines, -888 removed lines patch added patch discarded remove patch
@@ -15,296 +15,296 @@  discard block
 block discarded – undo
15 15
  */
16 16
 function geodir_register_sidebar()
17 17
 {
18
-    global $geodir_sidebars;
19
-
20
-    if (function_exists('register_sidebar')) {
21
-        /*===========================*/
22
-        /* Home page sidebars start*/
23
-        /*===========================*/
24
-
25
-        /**
26
-         * Filter the `$before_widget` widget opening HTML tag.
27
-         *
28
-         * @since 1.0.0
29
-         * @param string $var The HTML string to filter. Default = '<section id="%1$s" class="widget geodir-widget %2$s">'.
30
-         * @see 'geodir_after_widget'
31
-         */
32
-        $before_widget = apply_filters('geodir_before_widget', '<section id="%1$s" class="widget geodir-widget %2$s">');
33
-        /**
34
-         * Filter the `$after_widget` widget closing HTML tag.
35
-         *
36
-         * @since 1.0.0
37
-         * @param string $var The HTML string to filter. Default = '</section>'.
38
-         * @see 'geodir_before_widget'
39
-         */
40
-        $after_widget = apply_filters('geodir_after_widget', '</section>');
41
-        /**
42
-         * Filter the `$before_title` widget title opening HTML tag.
43
-         *
44
-         * @since 1.0.0
45
-         * @param string $var The HTML string to filter. Default = '<h3 class="widget-title">'.
46
-         * @see 'geodir_after_title'
47
-         */
48
-        $before_title = apply_filters('geodir_before_title', '<h3 class="widget-title">');
49
-        /**
50
-         * Filter the `$after_title` widget title closing HTML tag.
51
-         *
52
-         * @since 1.0.0
53
-         * @param string $var The HTML string to filter. Default = '</h3>'.
54
-         * @see 'geodir_before_title'
55
-         */
56
-        $after_title = apply_filters('geodir_after_title', '</h3>');
57
-
58
-        if (get_option('geodir_show_home_top_section')) {
59
-            register_sidebars(1, array('id' => 'geodir_home_top', 'name' => __('GD Home Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
60
-
61
-            $geodir_sidebars[] = 'geodir_home_top';
62
-        }
63
-
64
-        if (get_option('geodir_show_home_contant_section')) {
65
-            register_sidebars(1, array('id' => 'geodir_home_content', 'name' => __('GD Home Content Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
18
+	global $geodir_sidebars;
66 19
 
67
-            $geodir_sidebars[] = 'geodir_home_content';
68
-        }
20
+	if (function_exists('register_sidebar')) {
21
+		/*===========================*/
22
+		/* Home page sidebars start*/
23
+		/*===========================*/
69 24
 
70
-        if (get_option('geodir_show_home_right_section')) {
71
-            register_sidebars(1, array('id' => 'geodir_home_right', 'name' => __('GD Home Right Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
25
+		/**
26
+		 * Filter the `$before_widget` widget opening HTML tag.
27
+		 *
28
+		 * @since 1.0.0
29
+		 * @param string $var The HTML string to filter. Default = '<section id="%1$s" class="widget geodir-widget %2$s">'.
30
+		 * @see 'geodir_after_widget'
31
+		 */
32
+		$before_widget = apply_filters('geodir_before_widget', '<section id="%1$s" class="widget geodir-widget %2$s">');
33
+		/**
34
+		 * Filter the `$after_widget` widget closing HTML tag.
35
+		 *
36
+		 * @since 1.0.0
37
+		 * @param string $var The HTML string to filter. Default = '</section>'.
38
+		 * @see 'geodir_before_widget'
39
+		 */
40
+		$after_widget = apply_filters('geodir_after_widget', '</section>');
41
+		/**
42
+		 * Filter the `$before_title` widget title opening HTML tag.
43
+		 *
44
+		 * @since 1.0.0
45
+		 * @param string $var The HTML string to filter. Default = '<h3 class="widget-title">'.
46
+		 * @see 'geodir_after_title'
47
+		 */
48
+		$before_title = apply_filters('geodir_before_title', '<h3 class="widget-title">');
49
+		/**
50
+		 * Filter the `$after_title` widget title closing HTML tag.
51
+		 *
52
+		 * @since 1.0.0
53
+		 * @param string $var The HTML string to filter. Default = '</h3>'.
54
+		 * @see 'geodir_before_title'
55
+		 */
56
+		$after_title = apply_filters('geodir_after_title', '</h3>');
57
+
58
+		if (get_option('geodir_show_home_top_section')) {
59
+			register_sidebars(1, array('id' => 'geodir_home_top', 'name' => __('GD Home Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
72 60
 
73
-            $geodir_sidebars[] = 'geodir_home_right';
74
-        }
61
+			$geodir_sidebars[] = 'geodir_home_top';
62
+		}
75 63
 
76
-        if (get_option('geodir_show_home_left_section')) {
77
-            register_sidebars(1, array('id' => 'geodir_home_left', 'name' => __('GD Home Left Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
64
+		if (get_option('geodir_show_home_contant_section')) {
65
+			register_sidebars(1, array('id' => 'geodir_home_content', 'name' => __('GD Home Content Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
78 66
 
79
-            $geodir_sidebars[] = 'geodir_home_left';
80
-        }
67
+			$geodir_sidebars[] = 'geodir_home_content';
68
+		}
81 69
 
82
-        if (get_option('geodir_show_home_bottom_section')) {
83
-            register_sidebars(1, array('id' => 'geodir_home_bottom', 'name' => __('GD Home Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
70
+		if (get_option('geodir_show_home_right_section')) {
71
+			register_sidebars(1, array('id' => 'geodir_home_right', 'name' => __('GD Home Right Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
84 72
 
85
-            $geodir_sidebars[] = 'geodir_home_bottom';
86
-        }
73
+			$geodir_sidebars[] = 'geodir_home_right';
74
+		}
87 75
 
88
-        /*===========================*/
89
-        /* Home page sidebars end*/
90
-        /*===========================*/
76
+		if (get_option('geodir_show_home_left_section')) {
77
+			register_sidebars(1, array('id' => 'geodir_home_left', 'name' => __('GD Home Left Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
91 78
 
92
-        /*===========================*/
93
-        /* Listing page sidebars start*/
94
-        /*===========================*/
79
+			$geodir_sidebars[] = 'geodir_home_left';
80
+		}
95 81
 
96
-        if (get_option('geodir_show_listing_top_section')) {
97
-            register_sidebars(1, array('id' => 'geodir_listing_top', 'name' => __('GD Listing Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
82
+		if (get_option('geodir_show_home_bottom_section')) {
83
+			register_sidebars(1, array('id' => 'geodir_home_bottom', 'name' => __('GD Home Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
98 84
 
99
-            $geodir_sidebars[] = 'geodir_listing_top';
100
-        }
85
+			$geodir_sidebars[] = 'geodir_home_bottom';
86
+		}
101 87
 
102
-        if (get_option('geodir_show_listing_left_section')) {
103
-            register_sidebars(1, array('id' => 'geodir_listing_left_sidebar', 'name' => __('GD Listing Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
88
+		/*===========================*/
89
+		/* Home page sidebars end*/
90
+		/*===========================*/
104 91
 
105
-            $geodir_sidebars[] = 'geodir_listing_left_sidebar';
106
-        }
92
+		/*===========================*/
93
+		/* Listing page sidebars start*/
94
+		/*===========================*/
107 95
 
108
-        if (get_option('geodir_show_listing_right_section')) {
109
-            register_sidebars(1, array('id' => 'geodir_listing_right_sidebar', 'name' => __('GD Listing Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
96
+		if (get_option('geodir_show_listing_top_section')) {
97
+			register_sidebars(1, array('id' => 'geodir_listing_top', 'name' => __('GD Listing Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
110 98
 
111
-            $geodir_sidebars[] = 'geodir_listing_right_sidebar';
112
-        }
99
+			$geodir_sidebars[] = 'geodir_listing_top';
100
+		}
113 101
 
114
-        if (get_option('geodir_show_listing_bottom_section')) {
115
-            register_sidebars(1, array('id' => 'geodir_listing_bottom', 'name' => __('GD Listing Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
102
+		if (get_option('geodir_show_listing_left_section')) {
103
+			register_sidebars(1, array('id' => 'geodir_listing_left_sidebar', 'name' => __('GD Listing Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
116 104
 
117
-            $geodir_sidebars[] = 'geodir_listing_bottom';
118
-        }
105
+			$geodir_sidebars[] = 'geodir_listing_left_sidebar';
106
+		}
119 107
 
120
-        /*===========================*/
121
-        /* Listing page sidebars start*/
122
-        /*===========================*/
108
+		if (get_option('geodir_show_listing_right_section')) {
109
+			register_sidebars(1, array('id' => 'geodir_listing_right_sidebar', 'name' => __('GD Listing Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
123 110
 
124
-        /*===========================*/
125
-        /* Search page sidebars start*/
126
-        /*===========================*/
111
+			$geodir_sidebars[] = 'geodir_listing_right_sidebar';
112
+		}
127 113
 
128
-        if (get_option('geodir_show_search_top_section')) {
129
-            register_sidebars(1, array('id' => 'geodir_search_top', 'name' => __('GD Search Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
114
+		if (get_option('geodir_show_listing_bottom_section')) {
115
+			register_sidebars(1, array('id' => 'geodir_listing_bottom', 'name' => __('GD Listing Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
130 116
 
131
-            $geodir_sidebars[] = 'geodir_search_top';
132
-        }
117
+			$geodir_sidebars[] = 'geodir_listing_bottom';
118
+		}
133 119
 
134
-        if (get_option('geodir_show_search_left_section')) {
135
-            register_sidebars(1, array('id' => 'geodir_search_left_sidebar', 'name' => __('GD Search Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
120
+		/*===========================*/
121
+		/* Listing page sidebars start*/
122
+		/*===========================*/
136 123
 
137
-            $geodir_sidebars[] = 'geodir_search_left_sidebar';
138
-        }
124
+		/*===========================*/
125
+		/* Search page sidebars start*/
126
+		/*===========================*/
139 127
 
140
-        if (get_option('geodir_show_search_right_section')) {
141
-            register_sidebars(1, array('id' => 'geodir_search_right_sidebar', 'name' => __('GD Search Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
128
+		if (get_option('geodir_show_search_top_section')) {
129
+			register_sidebars(1, array('id' => 'geodir_search_top', 'name' => __('GD Search Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
142 130
 
143
-            $geodir_sidebars[] = 'geodir_search_right_sidebar';
144
-        }
131
+			$geodir_sidebars[] = 'geodir_search_top';
132
+		}
145 133
 
146
-        if (get_option('geodir_show_search_bottom_section')) {
147
-            register_sidebars(1, array('id' => 'geodir_search_bottom', 'name' => __('GD Search Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
134
+		if (get_option('geodir_show_search_left_section')) {
135
+			register_sidebars(1, array('id' => 'geodir_search_left_sidebar', 'name' => __('GD Search Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
148 136
 
149
-            $geodir_sidebars[] = 'geodir_search_bottom';
150
-        }
137
+			$geodir_sidebars[] = 'geodir_search_left_sidebar';
138
+		}
151 139
 
152
-        /*===========================*/
153
-        /* Search page sidebars end*/
154
-        /*===========================*/
140
+		if (get_option('geodir_show_search_right_section')) {
141
+			register_sidebars(1, array('id' => 'geodir_search_right_sidebar', 'name' => __('GD Search Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
155 142
 
156
-        /*==================================*/
157
-        /* Detail/Single page sidebars start*/
158
-        /*==================================*/
159
-        if (get_option('geodir_show_detail_top_section')) {
160
-            register_sidebars(1, array('id' => 'geodir_detail_top', 'name' => __('GD Detail Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
143
+			$geodir_sidebars[] = 'geodir_search_right_sidebar';
144
+		}
161 145
 
162
-            $geodir_sidebars[] = 'geodir_detail_top';
163
-        }
146
+		if (get_option('geodir_show_search_bottom_section')) {
147
+			register_sidebars(1, array('id' => 'geodir_search_bottom', 'name' => __('GD Search Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
164 148
 
165
-        register_sidebars(1, array('id' => 'geodir_detail_sidebar', 'name' => __('GD Detail Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
149
+			$geodir_sidebars[] = 'geodir_search_bottom';
150
+		}
166 151
 
167
-        $geodir_sidebars[] = 'geodir_detail_sidebar';
152
+		/*===========================*/
153
+		/* Search page sidebars end*/
154
+		/*===========================*/
168 155
 
169
-        if (get_option('geodir_show_detail_bottom_section')) {
170
-            register_sidebars(1, array('id' => 'geodir_detail_bottom', 'name' => __('GD Detail Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
156
+		/*==================================*/
157
+		/* Detail/Single page sidebars start*/
158
+		/*==================================*/
159
+		if (get_option('geodir_show_detail_top_section')) {
160
+			register_sidebars(1, array('id' => 'geodir_detail_top', 'name' => __('GD Detail Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
171 161
 
172
-            $geodir_sidebars[] = 'geodir_detail_bottom';
173
-        }
162
+			$geodir_sidebars[] = 'geodir_detail_top';
163
+		}
174 164
 
175
-        /*==================================*/
176
-        /* Detail/Single page sidebars end*/
177
-        /*==================================*/
165
+		register_sidebars(1, array('id' => 'geodir_detail_sidebar', 'name' => __('GD Detail Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
178 166
 
179
-        /*==================================*/
180
-        /* Author page sidebars start       */
181
-        /*==================================*/
167
+		$geodir_sidebars[] = 'geodir_detail_sidebar';
182 168
 
183
-        if (get_option('geodir_show_author_top_section')) {
184
-            register_sidebars(1, array('id' => 'geodir_author_top', 'name' => __('GD Author Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
169
+		if (get_option('geodir_show_detail_bottom_section')) {
170
+			register_sidebars(1, array('id' => 'geodir_detail_bottom', 'name' => __('GD Detail Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
185 171
 
186
-            $geodir_sidebars[] = 'geodir_author_top';
187
-        }
172
+			$geodir_sidebars[] = 'geodir_detail_bottom';
173
+		}
188 174
 
189
-        if (get_option('geodir_show_author_left_section')) {
190
-            register_sidebars(1, array('id' => 'geodir_author_left_sidebar', 'name' => __('GD Author Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
175
+		/*==================================*/
176
+		/* Detail/Single page sidebars end*/
177
+		/*==================================*/
191 178
 
192
-            $geodir_sidebars[] = 'geodir_author_left_sidebar';
193
-        }
179
+		/*==================================*/
180
+		/* Author page sidebars start       */
181
+		/*==================================*/
194 182
 
195
-        if (get_option('geodir_show_author_right_section')) {
196
-            register_sidebars(1, array('id' => 'geodir_author_right_sidebar', 'name' => __('GD Author Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
183
+		if (get_option('geodir_show_author_top_section')) {
184
+			register_sidebars(1, array('id' => 'geodir_author_top', 'name' => __('GD Author Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
197 185
 
198
-            $geodir_sidebars[] = 'geodir_author_right_sidebar';
199
-        }
186
+			$geodir_sidebars[] = 'geodir_author_top';
187
+		}
200 188
 
201
-        if (get_option('geodir_show_author_bottom_section')) {
202
-            register_sidebars(1, array('id' => 'geodir_author_bottom', 'name' => __('GD Author Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
189
+		if (get_option('geodir_show_author_left_section')) {
190
+			register_sidebars(1, array('id' => 'geodir_author_left_sidebar', 'name' => __('GD Author Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
203 191
 
204
-            $geodir_sidebars[] = 'geodir_author_bottom';
205
-        }
192
+			$geodir_sidebars[] = 'geodir_author_left_sidebar';
193
+		}
206 194
 
207
-        /*==================================*/
208
-        /* Author page sidebars end         */
209
-        /*==================================*/
195
+		if (get_option('geodir_show_author_right_section')) {
196
+			register_sidebars(1, array('id' => 'geodir_author_right_sidebar', 'name' => __('GD Author Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
210 197
 
211
-        /*==================================*/
212
-        /* Add listing page sidebars start       */
213
-        /*==================================*/
198
+			$geodir_sidebars[] = 'geodir_author_right_sidebar';
199
+		}
214 200
 
215
-        register_sidebars(1, array('id' => 'geodir_add_listing_sidebar', 'name' => __('GD Add Listing Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
201
+		if (get_option('geodir_show_author_bottom_section')) {
202
+			register_sidebars(1, array('id' => 'geodir_author_bottom', 'name' => __('GD Author Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
216 203
 
217
-        $geodir_sidebars[] = 'geodir_add_listing_sidebar';
204
+			$geodir_sidebars[] = 'geodir_author_bottom';
205
+		}
218 206
 
219
-        /*==================================*/
220
-        /* Add listing page sidebars end         */
221
-        /*==================================*/
207
+		/*==================================*/
208
+		/* Author page sidebars end         */
209
+		/*==================================*/
222 210
 
223
-    }
211
+		/*==================================*/
212
+		/* Add listing page sidebars start       */
213
+		/*==================================*/
214
+
215
+		register_sidebars(1, array('id' => 'geodir_add_listing_sidebar', 'name' => __('GD Add Listing Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
216
+
217
+		$geodir_sidebars[] = 'geodir_add_listing_sidebar';
218
+
219
+		/*==================================*/
220
+		/* Add listing page sidebars end         */
221
+		/*==================================*/
222
+
223
+	}
224 224
 }
225 225
 
226 226
 
227 227
 if (!function_exists('register_geodir_widgets')) {
228
-    /**
229
-     * Registers all Widgets.
230
-     *
231
-     * @since 1.0.0
232
-     * @package GeoDirectory
233
-     */
234
-    function register_geodir_widgets()
235
-    {
236
-        /**
237
-         * Login Widget.
238
-         *
239
-         * @since 1.0.0
240
-         */
241
-        class geodir_loginwidget extends WP_Widget
242
-        {
243
-            /**
244
-             * Register the login widget with WordPress.
245
-             *
246
-             * @since 1.0.0
247
-             * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
248
-             */
249
-            public function __construct() {
250
-                $widget_ops = array('classname' => 'geodir_loginbox', 'description' => __('Geodirectory Loginbox Widget', 'geodirectory'));
251
-                parent::__construct(
252
-                    'geodir_loginbox', // Base ID
253
-                    __('GD > Loginbox', 'geodirectory'), // Name
254
-                    $widget_ops// Args
255
-                );
256
-            }
257
-
258
-            /**
259
-             * Front-end display content for login widget.
260
-             *
261
-             * @since 1.0.0
262
-             * @since 1.5.1 Declare function public.
263
-             *
264
-             * @param array $args     Widget arguments.
265
-             * @param array $instance Saved values from database.
266
-             */
267
-            public function widget($args, $instance)
268
-            {
269
-                geodir_loginwidget_output($args, $instance);
270
-            }
271
-
272
-            /**
273
-             * Sanitize login widget form values as they are saved.
274
-             *
275
-             * @since 1.0.0
276
-             * @since 1.5.1 Declare function public.
277
-             *
278
-             * @param array $new_instance Values just sent to be saved.
279
-             * @param array $old_instance Previously saved values from database.
280
-             *
281
-             * @return array Updated safe values to be saved.
282
-             */
283
-            public function update($new_instance, $old_instance)
284
-            {
285
-                //save the widget
286
-                $instance = $old_instance;
287
-                $instance['title'] = strip_tags($new_instance['title']);
288
-
289
-                return $instance;
290
-            }
291
-
292
-            /**
293
-             * Back-end login widget settings form.
294
-             *
295
-             * @since 1.0.0
296
-             * @since 1.5.1 Declare function public.
297
-             *
298
-             * @param array $instance Previously saved values from database.
299
-             * @return string|void
300
-             */
301
-            public function form($instance)
302
-            {
303
-                //widgetform in backend
304
-                $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
305
-                $title = strip_tags($instance['title']);
306
-
307
-                ?>
228
+	/**
229
+	 * Registers all Widgets.
230
+	 *
231
+	 * @since 1.0.0
232
+	 * @package GeoDirectory
233
+	 */
234
+	function register_geodir_widgets()
235
+	{
236
+		/**
237
+		 * Login Widget.
238
+		 *
239
+		 * @since 1.0.0
240
+		 */
241
+		class geodir_loginwidget extends WP_Widget
242
+		{
243
+			/**
244
+			 * Register the login widget with WordPress.
245
+			 *
246
+			 * @since 1.0.0
247
+			 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
248
+			 */
249
+			public function __construct() {
250
+				$widget_ops = array('classname' => 'geodir_loginbox', 'description' => __('Geodirectory Loginbox Widget', 'geodirectory'));
251
+				parent::__construct(
252
+					'geodir_loginbox', // Base ID
253
+					__('GD > Loginbox', 'geodirectory'), // Name
254
+					$widget_ops// Args
255
+				);
256
+			}
257
+
258
+			/**
259
+			 * Front-end display content for login widget.
260
+			 *
261
+			 * @since 1.0.0
262
+			 * @since 1.5.1 Declare function public.
263
+			 *
264
+			 * @param array $args     Widget arguments.
265
+			 * @param array $instance Saved values from database.
266
+			 */
267
+			public function widget($args, $instance)
268
+			{
269
+				geodir_loginwidget_output($args, $instance);
270
+			}
271
+
272
+			/**
273
+			 * Sanitize login widget form values as they are saved.
274
+			 *
275
+			 * @since 1.0.0
276
+			 * @since 1.5.1 Declare function public.
277
+			 *
278
+			 * @param array $new_instance Values just sent to be saved.
279
+			 * @param array $old_instance Previously saved values from database.
280
+			 *
281
+			 * @return array Updated safe values to be saved.
282
+			 */
283
+			public function update($new_instance, $old_instance)
284
+			{
285
+				//save the widget
286
+				$instance = $old_instance;
287
+				$instance['title'] = strip_tags($new_instance['title']);
288
+
289
+				return $instance;
290
+			}
291
+
292
+			/**
293
+			 * Back-end login widget settings form.
294
+			 *
295
+			 * @since 1.0.0
296
+			 * @since 1.5.1 Declare function public.
297
+			 *
298
+			 * @param array $instance Previously saved values from database.
299
+			 * @return string|void
300
+			 */
301
+			public function form($instance)
302
+			{
303
+				//widgetform in backend
304
+				$instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
305
+				$title = strip_tags($instance['title']);
306
+
307
+				?>
308 308
                 <p><label
309 309
                         for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Widget Title', 'geodirectory'); ?>
310 310
                         : <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
@@ -313,64 +313,64 @@  discard block
 block discarded – undo
313 313
 
314 314
 
315 315
             <?php
316
-            }
317
-        }
318
-
319
-        register_widget('geodir_loginwidget');
320
-
321
-
322
-        /**
323
-         * GeoDirectory Social Like Widget.
324
-         *
325
-         * @since 1.0.0
326
-         */
327
-        class geodir_social_like_widget extends WP_Widget
328
-        {
329
-
330
-            /**
331
-             * Register the social like widget with WordPress.
332
-             *
333
-             * @since 1.0.0
334
-             * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
335
-             */
336
-            public function __construct() {
337
-                $widget_ops = array('classname' => 'geodir_social_like_widget', 'description' => __('GD > Twitter,Facebook and Google+ buttons', 'geodirectory'));
338
-                parent::__construct(
339
-                    'social_like_widget', // Base ID
340
-                    __('GD > Social Like', 'geodirectory'), // Name
341
-                    $widget_ops// Args
342
-                );
343
-            }
344
-
345
-            /**
346
-             * Front-end display content for social like widget.
347
-             *
348
-             * @since 1.0.0
349
-             * @since 1.5.1 Declare function public.
350
-             *
351
-             * @param array $args     Widget arguments.
352
-             * @param array $instance Saved values from database.
353
-             */
354
-            public function widget($args, $instance)
355
-            {
356
-                // prints the widget
357
-                extract($args, EXTR_SKIP);
358
-
359
-                /**
360
-                 * Filter the widget title text.
361
-                 *
362
-                 * @since 1.0.0
363
-                 * @global object $current_user Current user object.
364
-                 * @param string $title The widget title text.
365
-                 */
366
-                $title = empty($instance['title']) ? '&nbsp;' : apply_filters('widget_title', $instance['title']);
367
-
368
-                global $current_user, $post;
369
-                echo $before_widget;
370
-                ?>
316
+			}
317
+		}
318
+
319
+		register_widget('geodir_loginwidget');
320
+
321
+
322
+		/**
323
+		 * GeoDirectory Social Like Widget.
324
+		 *
325
+		 * @since 1.0.0
326
+		 */
327
+		class geodir_social_like_widget extends WP_Widget
328
+		{
329
+
330
+			/**
331
+			 * Register the social like widget with WordPress.
332
+			 *
333
+			 * @since 1.0.0
334
+			 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
335
+			 */
336
+			public function __construct() {
337
+				$widget_ops = array('classname' => 'geodir_social_like_widget', 'description' => __('GD > Twitter,Facebook and Google+ buttons', 'geodirectory'));
338
+				parent::__construct(
339
+					'social_like_widget', // Base ID
340
+					__('GD > Social Like', 'geodirectory'), // Name
341
+					$widget_ops// Args
342
+				);
343
+			}
344
+
345
+			/**
346
+			 * Front-end display content for social like widget.
347
+			 *
348
+			 * @since 1.0.0
349
+			 * @since 1.5.1 Declare function public.
350
+			 *
351
+			 * @param array $args     Widget arguments.
352
+			 * @param array $instance Saved values from database.
353
+			 */
354
+			public function widget($args, $instance)
355
+			{
356
+				// prints the widget
357
+				extract($args, EXTR_SKIP);
358
+
359
+				/**
360
+				 * Filter the widget title text.
361
+				 *
362
+				 * @since 1.0.0
363
+				 * @global object $current_user Current user object.
364
+				 * @param string $title The widget title text.
365
+				 */
366
+				$title = empty($instance['title']) ? '&nbsp;' : apply_filters('widget_title', $instance['title']);
367
+
368
+				global $current_user, $post;
369
+				echo $before_widget;
370
+				?>
371 371
 
372 372
                 <?php //if ( get_option('gd_tweet_button') ) {
373
-                ?>
373
+				?>
374 374
 
375 375
                 <a href="http://twitter.com/share"
376 376
                    class="twitter-share-button"><?php _e('Tweet', 'geodirectory');?></a>
@@ -378,23 +378,23 @@  discard block
 block discarded – undo
378 378
                 <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
379 379
 
380 380
                 <?php //}
381
-                ?>
381
+				?>
382 382
 
383 383
                 <?php // if ( get_option('gd_facebook_button') ) {
384
-                ?>
384
+				?>
385 385
 
386 386
                 <iframe <?php if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) {
387
-                    echo 'allowtransparency="true"';
388
-                }?> class="facebook"
387
+					echo 'allowtransparency="true"';
388
+				}?> class="facebook"
389 389
                     src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode(geodir_curPageURL()); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light"
390 390
                     style="border:none; overflow:hidden; width:100px; height:20px"></iframe>
391 391
 
392 392
 
393 393
                 <?php //}
394
-                ?>
394
+				?>
395 395
 
396 396
                 <?php //if ( get_option('gd_google_button') ) {
397
-                ?>
397
+				?>
398 398
                 <script>
399 399
                     window.___gcfg = {
400 400
                         parsetags: 'explicit'
@@ -408,118 +408,118 @@  discard block
 block discarded – undo
408 408
                         "count": "true"
409 409
                     });</script>
410 410
                 <?php //}
411
-                echo $after_widget;
412
-
413
-            }
414
-
415
-            /**
416
-             * Sanitize social like widget form values as they are saved.
417
-             *
418
-             * @since 1.0.0
419
-             * @since 1.5.1 Declare function public.
420
-             *
421
-             * @param array $new_instance Values just sent to be saved.
422
-             * @param array $old_instance Previously saved values from database.
423
-             *
424
-             * @return array Updated safe values to be saved.
425
-             */
426
-            public function update($new_instance, $old_instance)
427
-            {
428
-                //save the widget
429
-                $instance = $old_instance;
430
-                $instance['title'] = strip_tags($new_instance['title']);
431
-                return $instance;
432
-            }
433
-
434
-            /**
435
-             * Back-end social like widget settings form.
436
-             *
437
-             * @since 1.0.0
438
-             * @since 1.5.1 Declare function public.
439
-             *
440
-             * @param array $instance Previously saved values from database.
441
-             * @return string|void
442
-             */
443
-            public function form($instance)
444
-            {
445
-                //widgetform in backend
446
-                $instance = wp_parse_args((array)$instance, array('title' => ''));
447
-                $title = strip_tags($instance['title']);
448
-                ?>
411
+				echo $after_widget;
412
+
413
+			}
414
+
415
+			/**
416
+			 * Sanitize social like widget form values as they are saved.
417
+			 *
418
+			 * @since 1.0.0
419
+			 * @since 1.5.1 Declare function public.
420
+			 *
421
+			 * @param array $new_instance Values just sent to be saved.
422
+			 * @param array $old_instance Previously saved values from database.
423
+			 *
424
+			 * @return array Updated safe values to be saved.
425
+			 */
426
+			public function update($new_instance, $old_instance)
427
+			{
428
+				//save the widget
429
+				$instance = $old_instance;
430
+				$instance['title'] = strip_tags($new_instance['title']);
431
+				return $instance;
432
+			}
433
+
434
+			/**
435
+			 * Back-end social like widget settings form.
436
+			 *
437
+			 * @since 1.0.0
438
+			 * @since 1.5.1 Declare function public.
439
+			 *
440
+			 * @param array $instance Previously saved values from database.
441
+			 * @return string|void
442
+			 */
443
+			public function form($instance)
444
+			{
445
+				//widgetform in backend
446
+				$instance = wp_parse_args((array)$instance, array('title' => ''));
447
+				$title = strip_tags($instance['title']);
448
+				?>
449 449
                 <p>No settings for this widget</p>
450 450
 
451 451
 
452 452
             <?php
453
-            }
454
-        }
455
-
456
-        register_widget('geodir_social_like_widget');
457
-
458
-
459
-        /**
460
-         * GeoDirectory Feedburner Subscribe widget.
461
-         *
462
-         * @since 1.0.0
463
-         */
464
-        class geodirsubscribeWidget extends WP_Widget
465
-        {
466
-
467
-            /**
468
-             * Register the feedburner subscribe widget with WordPress.
469
-             *
470
-             * @since 1.0.0
471
-             * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
472
-             */
473
-            public function __construct() {
474
-                $widget_ops = array('classname' => 'geodir-subscribe', 'description' => __('GD > Google Feedburner Subscribe', 'geodirectory'));
475
-                parent::__construct(
476
-                    'widget_subscribeWidget', // Base ID
477
-                    __('GD > Subscribe', 'geodirectory'), // Name
478
-                    $widget_ops// Args
479
-                );
480
-            }
481
-
482
-            /**
483
-             * Front-end display content for feedburner subscribe widget.
484
-             *
485
-             * @since 1.0.0
486
-             * @since 1.5.1 Declare function public.
487
-             *
488
-             * @param array $args     Widget arguments.
489
-             * @param array $instance Saved values from database.
490
-             */
491
-            public function widget($args, $instance)
492
-            {
493
-                // prints the widget
494
-                extract($args, EXTR_SKIP);
495
-
496
-                /**
497
-                 * Filter the widget instance id.
498
-                 *
499
-                 * @since 1.0.0
500
-                 * @param string $id The widget instance id.
501
-                 */
502
-                $id = empty($instance['id']) ? '' : apply_filters('widget_id', $instance['id']);
503
-
504
-                /** This filter is documented in geodirectory_widgets.php */
505
-                $title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
506
-
507
-                /**
508
-                 * Filter the widget text.
509
-                 *
510
-                 * @since 1.0.0
511
-                 * @param string $text The widget text.
512
-                 */
513
-                $text = empty($instance['text']) ? '' : apply_filters('widget_text', $instance['text']);
514
-
515
-                echo $before_widget;
516
-                ?>
453
+			}
454
+		}
455
+
456
+		register_widget('geodir_social_like_widget');
457
+
458
+
459
+		/**
460
+		 * GeoDirectory Feedburner Subscribe widget.
461
+		 *
462
+		 * @since 1.0.0
463
+		 */
464
+		class geodirsubscribeWidget extends WP_Widget
465
+		{
466
+
467
+			/**
468
+			 * Register the feedburner subscribe widget with WordPress.
469
+			 *
470
+			 * @since 1.0.0
471
+			 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
472
+			 */
473
+			public function __construct() {
474
+				$widget_ops = array('classname' => 'geodir-subscribe', 'description' => __('GD > Google Feedburner Subscribe', 'geodirectory'));
475
+				parent::__construct(
476
+					'widget_subscribeWidget', // Base ID
477
+					__('GD > Subscribe', 'geodirectory'), // Name
478
+					$widget_ops// Args
479
+				);
480
+			}
481
+
482
+			/**
483
+			 * Front-end display content for feedburner subscribe widget.
484
+			 *
485
+			 * @since 1.0.0
486
+			 * @since 1.5.1 Declare function public.
487
+			 *
488
+			 * @param array $args     Widget arguments.
489
+			 * @param array $instance Saved values from database.
490
+			 */
491
+			public function widget($args, $instance)
492
+			{
493
+				// prints the widget
494
+				extract($args, EXTR_SKIP);
495
+
496
+				/**
497
+				 * Filter the widget instance id.
498
+				 *
499
+				 * @since 1.0.0
500
+				 * @param string $id The widget instance id.
501
+				 */
502
+				$id = empty($instance['id']) ? '' : apply_filters('widget_id', $instance['id']);
503
+
504
+				/** This filter is documented in geodirectory_widgets.php */
505
+				$title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
506
+
507
+				/**
508
+				 * Filter the widget text.
509
+				 *
510
+				 * @since 1.0.0
511
+				 * @param string $text The widget text.
512
+				 */
513
+				$text = empty($instance['text']) ? '' : apply_filters('widget_text', $instance['text']);
514
+
515
+				echo $before_widget;
516
+				?>
517 517
 
518 518
                 <?php echo $before_title . $title; ?>  <a href="<?php if ($id) {
519
-                echo 'http://feeds2.feedburner.com/' . $id;
520
-            } else {
521
-                bloginfo('rss_url');
522
-            } ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title;?>
519
+				echo 'http://feeds2.feedburner.com/' . $id;
520
+			} else {
521
+				bloginfo('rss_url');
522
+			} ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title;?>
523 523
 
524 524
                 <?php if ($text <> "") { ?>
525 525
 
@@ -544,57 +544,57 @@  discard block
 block discarded – undo
544 544
                 </form>
545 545
 
546 546
                 <?php
547
-                echo $after_widget;
547
+				echo $after_widget;
548 548
 
549
-            }
549
+			}
550 550
 
551
-            /**
552
-             * Sanitize feedburner subscribe widget form values as they are saved.
553
-             *
554
-             * @since 1.0.0
555
-             * @since 1.5.1 Declare function public.
556
-             *
557
-             * @param array $new_instance Values just sent to be saved.
558
-             * @param array $old_instance Previously saved values from database.
559
-             *
560
-             * @return array Updated safe values to be saved.
561
-             */
562
-            public function update($new_instance, $old_instance)
563
-            {
551
+			/**
552
+			 * Sanitize feedburner subscribe widget form values as they are saved.
553
+			 *
554
+			 * @since 1.0.0
555
+			 * @since 1.5.1 Declare function public.
556
+			 *
557
+			 * @param array $new_instance Values just sent to be saved.
558
+			 * @param array $old_instance Previously saved values from database.
559
+			 *
560
+			 * @return array Updated safe values to be saved.
561
+			 */
562
+			public function update($new_instance, $old_instance)
563
+			{
564 564
 
565
-                //save the widget
566
-                $instance = $old_instance;
567
-                $instance['id'] = strip_tags($new_instance['id']);
568
-                $instance['title'] = ($new_instance['title']);
569
-                $instance['text'] = ($new_instance['text']);
565
+				//save the widget
566
+				$instance = $old_instance;
567
+				$instance['id'] = strip_tags($new_instance['id']);
568
+				$instance['title'] = ($new_instance['title']);
569
+				$instance['text'] = ($new_instance['text']);
570 570
 
571 571
 
572
-                return $instance;
573
-            }
572
+				return $instance;
573
+			}
574 574
 
575
-            /**
576
-             * Back-end feedburner subscribe widget settings form.
577
-             *
578
-             * @since 1.0.0
579
-             * @since 1.5.1 Declare function public.
580
-             *
581
-             * @param array $instance Previously saved values from database.
582
-             * @return string|void
583
-             */
584
-            public function form($instance)
585
-            {
586
-                //widgetform in backend
587
-                $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => ''));
575
+			/**
576
+			 * Back-end feedburner subscribe widget settings form.
577
+			 *
578
+			 * @since 1.0.0
579
+			 * @since 1.5.1 Declare function public.
580
+			 *
581
+			 * @param array $instance Previously saved values from database.
582
+			 * @return string|void
583
+			 */
584
+			public function form($instance)
585
+			{
586
+				//widgetform in backend
587
+				$instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => ''));
588 588
 
589
-                $id = strip_tags($instance['id']);
589
+				$id = strip_tags($instance['id']);
590 590
 
591
-                $title = strip_tags($instance['title']);
591
+				$title = strip_tags($instance['title']);
592 592
 
593
-                $text = strip_tags($instance['text']);
593
+				$text = strip_tags($instance['text']);
594 594
 
595 595
 
596 596
 
597
-                ?>
597
+				?>
598 598
                 <p><label
599 599
                         for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'geodirectory');?>:
600 600
                         <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
@@ -613,101 +613,101 @@  discard block
 block discarded – undo
613 613
                                   name="<?php echo $this->get_field_name('text'); ?>"><?php echo esc_attr($text); ?></textarea></label>
614 614
                 </p>
615 615
             <?php
616
-            }
617
-        }
618
-
619
-        register_widget('geodirsubscribeWidget');
620
-
621
-        /**
622
-         * GeoDirectory advertise widget.
623
-         *
624
-         * @since 1.0.0
625
-         */
626
-        class geodiradvtwidget extends WP_Widget
627
-        {
628
-
629
-            /**
630
-             * Register the advertise widget with WordPress.
631
-             *
632
-             * @since 1.0.0
633
-             * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
634
-             */
635
-            public function __construct() {
636
-                $widget_ops = array('classname' => 'GeoDirectory Advertise', 'description' => __('GD > common advertise widget in sidebar, bottom section', 'geodirectory'));
637
-                parent::__construct(
638
-                    'advtwidget', // Base ID
639
-                    __('GD > Advertise', 'geodirectory'), // Name
640
-                    $widget_ops// Args
641
-                );
642
-            }
643
-
644
-
645
-            /**
646
-             * Front-end display content for advertise widget.
647
-             *
648
-             * @since 1.0.0
649
-             * @since 1.5.1 Declare function public.
650
-             *
651
-             * @param array $args     Widget arguments.
652
-             * @param array $instance Saved values from database.
653
-             */
654
-            public function widget($args, $instance)
655
-            {
656
-
657
-                // prints the widget
658
-
659
-                extract($args, EXTR_SKIP);
660
-
661
-                /**
662
-                 * Filter the description text.
663
-                 *
664
-                 * @since 1.0.0
665
-                 * @param string $desc1 The widget description text.
666
-                 */
667
-                $desc1 = empty($instance['desc1']) ? '&nbsp;' : apply_filters('widget_desc1', $instance['desc1']);
668
-                echo $before_widget;
669
-                ?>
616
+			}
617
+		}
618
+
619
+		register_widget('geodirsubscribeWidget');
620
+
621
+		/**
622
+		 * GeoDirectory advertise widget.
623
+		 *
624
+		 * @since 1.0.0
625
+		 */
626
+		class geodiradvtwidget extends WP_Widget
627
+		{
628
+
629
+			/**
630
+			 * Register the advertise widget with WordPress.
631
+			 *
632
+			 * @since 1.0.0
633
+			 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
634
+			 */
635
+			public function __construct() {
636
+				$widget_ops = array('classname' => 'GeoDirectory Advertise', 'description' => __('GD > common advertise widget in sidebar, bottom section', 'geodirectory'));
637
+				parent::__construct(
638
+					'advtwidget', // Base ID
639
+					__('GD > Advertise', 'geodirectory'), // Name
640
+					$widget_ops// Args
641
+				);
642
+			}
643
+
644
+
645
+			/**
646
+			 * Front-end display content for advertise widget.
647
+			 *
648
+			 * @since 1.0.0
649
+			 * @since 1.5.1 Declare function public.
650
+			 *
651
+			 * @param array $args     Widget arguments.
652
+			 * @param array $instance Saved values from database.
653
+			 */
654
+			public function widget($args, $instance)
655
+			{
656
+
657
+				// prints the widget
658
+
659
+				extract($args, EXTR_SKIP);
660
+
661
+				/**
662
+				 * Filter the description text.
663
+				 *
664
+				 * @since 1.0.0
665
+				 * @param string $desc1 The widget description text.
666
+				 */
667
+				$desc1 = empty($instance['desc1']) ? '&nbsp;' : apply_filters('widget_desc1', $instance['desc1']);
668
+				echo $before_widget;
669
+				?>
670 670
                 <?php if ($desc1 <> "") { ?>
671 671
                 <?php echo $desc1; ?>
672 672
             <?php }
673
-                echo $after_widget;
674
-            }
675
-
676
-            /**
677
-             * Sanitize advertise widget form values as they are saved.
678
-             *
679
-             * @since 1.0.0
680
-             * @since 1.5.1 Declare function public.
681
-             *
682
-             * @param array $new_instance Values just sent to be saved.
683
-             * @param array $old_instance Previously saved values from database.
684
-             *
685
-             * @return array Updated safe values to be saved.
686
-             */
687
-            public function update($new_instance, $old_instance)
688
-            {
689
-                //save the widget
690
-                $instance = $old_instance;
691
-                $instance['desc1'] = ($new_instance['desc1']);
692
-                return $instance;
693
-            }
694
-
695
-            /**
696
-             * Back-end advertise widget settings form.
697
-             *
698
-             * @since 1.0.0
699
-             * @since 1.5.1 Declare function public.
700
-             *
701
-             * @param array $instance Previously saved values from database.
702
-             * @return string|void
703
-             */
704
-            public function form($instance)
705
-            {
706
-                //widgetform in backend
707
-                $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
708
-
709
-                $desc1 = ($instance['desc1']);
710
-                ?>
673
+				echo $after_widget;
674
+			}
675
+
676
+			/**
677
+			 * Sanitize advertise widget form values as they are saved.
678
+			 *
679
+			 * @since 1.0.0
680
+			 * @since 1.5.1 Declare function public.
681
+			 *
682
+			 * @param array $new_instance Values just sent to be saved.
683
+			 * @param array $old_instance Previously saved values from database.
684
+			 *
685
+			 * @return array Updated safe values to be saved.
686
+			 */
687
+			public function update($new_instance, $old_instance)
688
+			{
689
+				//save the widget
690
+				$instance = $old_instance;
691
+				$instance['desc1'] = ($new_instance['desc1']);
692
+				return $instance;
693
+			}
694
+
695
+			/**
696
+			 * Back-end advertise widget settings form.
697
+			 *
698
+			 * @since 1.0.0
699
+			 * @since 1.5.1 Declare function public.
700
+			 *
701
+			 * @param array $instance Previously saved values from database.
702
+			 * @return string|void
703
+			 */
704
+			public function form($instance)
705
+			{
706
+				//widgetform in backend
707
+				$instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
708
+
709
+				$desc1 = ($instance['desc1']);
710
+				?>
711 711
                 <p><label
712 712
                         for="<?php echo $this->get_field_id('desc1'); ?>"><?php _e('Your Advt code (ex.google adsense, etc.)', 'geodirectory');?>
713 713
                         <textarea class="widefat" rows="6" cols="20" id="<?php echo $this->get_field_id('desc1'); ?>"
@@ -715,65 +715,65 @@  discard block
 block discarded – undo
715 715
                 </p>
716 716
 
717 717
             <?php
718
-            }
719
-        }
720
-
721
-        register_widget('geodiradvtwidget');
722
-
723
-        /**
724
-         * GeoDirectory Flickr widget.
725
-         *
726
-         * @since 1.0.0
727
-         */
728
-        class GeodirFlickrWidget extends WP_Widget
729
-        {
730
-
731
-            /**
732
-             * Register the flickr widget with WordPress.
733
-             *
734
-             * @since 1.0.0
735
-             * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
736
-             */
737
-            public function __construct() {
738
-                $widget_ops = array('classname' => 'Geo Dir Flickr Photos ', 'description' => __('GD > Flickr Photos', 'geodirectory'));
739
-                parent::__construct(
740
-                    'widget_flickrwidget', // Base ID
741
-                    __('GD > Flickr Photos', 'geodirectory'), // Name
742
-                    $widget_ops// Args
743
-                );
744
-            }
745
-
746
-            /**
747
-             * Front-end display content for flickr widget.
748
-             *
749
-             * @since 1.0.0
750
-             * @since 1.5.1 Declare function public.
751
-             *
752
-             * @param array $args     Widget arguments.
753
-             * @param array $instance Saved values from database.
754
-             */
755
-            public function widget($args, $instance)
756
-            {
757
-
758
-                // prints the widget
759
-                extract($args, EXTR_SKIP);
760
-
761
-                echo $before_widget;
762
-
763
-                /** This filter is documented in geodirectory_widgets.php */
764
-                $id = empty($instance['id']) ? '&nbsp;' : apply_filters('widget_id', $instance['id']);
765
-
766
-                /**
767
-                 * Filter the widget number.
768
-                 *
769
-                 * This is used in the flicker widget to show how many images to show.
770
-                 *
771
-                 * @since 1.0.0
772
-                 * @param string $number The image count.
773
-                 */
774
-                $number = empty($instance['number']) ? '&nbsp;' : apply_filters('widget_number', $instance['number']);
775
-                echo $before_title . __('Photo Gallery', 'geodirectory') . $after_title;
776
-                ?>
718
+			}
719
+		}
720
+
721
+		register_widget('geodiradvtwidget');
722
+
723
+		/**
724
+		 * GeoDirectory Flickr widget.
725
+		 *
726
+		 * @since 1.0.0
727
+		 */
728
+		class GeodirFlickrWidget extends WP_Widget
729
+		{
730
+
731
+			/**
732
+			 * Register the flickr widget with WordPress.
733
+			 *
734
+			 * @since 1.0.0
735
+			 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
736
+			 */
737
+			public function __construct() {
738
+				$widget_ops = array('classname' => 'Geo Dir Flickr Photos ', 'description' => __('GD > Flickr Photos', 'geodirectory'));
739
+				parent::__construct(
740
+					'widget_flickrwidget', // Base ID
741
+					__('GD > Flickr Photos', 'geodirectory'), // Name
742
+					$widget_ops// Args
743
+				);
744
+			}
745
+
746
+			/**
747
+			 * Front-end display content for flickr widget.
748
+			 *
749
+			 * @since 1.0.0
750
+			 * @since 1.5.1 Declare function public.
751
+			 *
752
+			 * @param array $args     Widget arguments.
753
+			 * @param array $instance Saved values from database.
754
+			 */
755
+			public function widget($args, $instance)
756
+			{
757
+
758
+				// prints the widget
759
+				extract($args, EXTR_SKIP);
760
+
761
+				echo $before_widget;
762
+
763
+				/** This filter is documented in geodirectory_widgets.php */
764
+				$id = empty($instance['id']) ? '&nbsp;' : apply_filters('widget_id', $instance['id']);
765
+
766
+				/**
767
+				 * Filter the widget number.
768
+				 *
769
+				 * This is used in the flicker widget to show how many images to show.
770
+				 *
771
+				 * @since 1.0.0
772
+				 * @param string $number The image count.
773
+				 */
774
+				$number = empty($instance['number']) ? '&nbsp;' : apply_filters('widget_number', $instance['number']);
775
+				echo $before_title . __('Photo Gallery', 'geodirectory') . $after_title;
776
+				?>
777 777
 
778 778
                 <div class="geodir-flickr clearfix">
779 779
 
@@ -784,45 +784,45 @@  discard block
 block discarded – undo
784 784
 
785 785
 
786 786
                 <?php echo $after_widget;
787
-            }
788
-
789
-            /**
790
-             * Sanitize flickr widget form values as they are saved.
791
-             *
792
-             * @since 1.0.0
793
-             * @since 1.5.1 Declare function public.
794
-             *
795
-             * @param array $new_instance Values just sent to be saved.
796
-             * @param array $old_instance Previously saved values from database.
797
-             *
798
-             * @return array Updated safe values to be saved.
799
-             */
800
-            public function update($new_instance, $old_instance)
801
-            {
802
-                //save the widget
803
-                $instance = $old_instance;
804
-                $instance['id'] = strip_tags($new_instance['id']);
805
-                $instance['number'] = strip_tags($new_instance['number']);
806
-                return $instance;
807
-            }
808
-
809
-            /**
810
-             * Back-end flickr widget settings form.
811
-             *
812
-             * @since 1.0.0
813
-             * @since 1.5.1 Declare function public.
814
-             *
815
-             * @param array $instance Previously saved values from database.
816
-             * @return string|void
817
-             */
818
-            public function form($instance)
819
-            {
820
-
821
-                //widgetform in backend
822
-                $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'number' => ''));
823
-                $id = strip_tags($instance['id']);
824
-                $number = strip_tags($instance['number']);
825
-                ?>
787
+			}
788
+
789
+			/**
790
+			 * Sanitize flickr widget form values as they are saved.
791
+			 *
792
+			 * @since 1.0.0
793
+			 * @since 1.5.1 Declare function public.
794
+			 *
795
+			 * @param array $new_instance Values just sent to be saved.
796
+			 * @param array $old_instance Previously saved values from database.
797
+			 *
798
+			 * @return array Updated safe values to be saved.
799
+			 */
800
+			public function update($new_instance, $old_instance)
801
+			{
802
+				//save the widget
803
+				$instance = $old_instance;
804
+				$instance['id'] = strip_tags($new_instance['id']);
805
+				$instance['number'] = strip_tags($new_instance['number']);
806
+				return $instance;
807
+			}
808
+
809
+			/**
810
+			 * Back-end flickr widget settings form.
811
+			 *
812
+			 * @since 1.0.0
813
+			 * @since 1.5.1 Declare function public.
814
+			 *
815
+			 * @param array $instance Previously saved values from database.
816
+			 * @return string|void
817
+			 */
818
+			public function form($instance)
819
+			{
820
+
821
+				//widgetform in backend
822
+				$instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'number' => ''));
823
+				$id = strip_tags($instance['id']);
824
+				$number = strip_tags($instance['number']);
825
+				?>
826 826
 
827 827
                 <p>
828 828
                     <label
@@ -843,99 +843,99 @@  discard block
 block discarded – undo
843 843
                     </label>
844 844
                 </p>
845 845
             <?php
846
-            }
847
-        }
848
-
849
-        register_widget('GeodirFlickrWidget');
850
-
851
-        /**
852
-         * GeoDirectory Twitter widget.
853
-         *
854
-         * @since 1.0.0
855
-         */
856
-        class geodir_twitter extends WP_Widget
857
-        {
858
-            /**
859
-             * Register the Twitter widget with WordPress.
860
-             *
861
-             * @since 1.0.0
862
-             * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
863
-             */
864
-            public function __construct() {
865
-                $widget_ops = array('classname' => 'Twitter', 'description' => __('GD > Twitter Feed', 'geodirectory'));
866
-                parent::__construct(
867
-                    'widget_Twidget', // Base ID
868
-                    __('GD > Twitter', 'geodirectory'), // Name
869
-                    $widget_ops// Args
870
-                );
871
-            }
872
-
873
-
874
-            /**
875
-             * Front-end display content for Twitter widget.
876
-             *
877
-             * @since 1.0.0
878
-             * @since 1.5.1 Declare function public.
879
-             *
880
-             * @param array $args     Widget arguments.
881
-             * @param array $instance Saved values from database.
882
-             */
883
-            public function widget($args, $instance)
884
-            {
885
-
886
-                // prints the widget
887
-
888
-                extract($args, EXTR_SKIP);
889
-
890
-                /**
891
-                 * Filter the twitter widget description text.
892
-                 *
893
-                 * @since 1.0.0
894
-                 * @param string $desc1 The widget description text.
895
-                 */
896
-                $desc1 = empty($instance['gd_tw_desc1']) ? '&nbsp;' : apply_filters('gd_tw_widget_desc1', $instance['gd_tw_desc1']);
897
-                echo $before_widget;
898
-                if ($desc1 <> "") {
899
-                    echo $desc1;
900
-                }
901
-                echo $after_widget;
902
-            }
903
-
904
-            /**
905
-             * Sanitize twitter widget form values as they are saved.
906
-             *
907
-             * @since 1.0.0
908
-             * @since 1.5.1 Declare function public.
909
-             *
910
-             * @param array $new_instance Values just sent to be saved.
911
-             * @param array $old_instance Previously saved values from database.
912
-             *
913
-             * @return array Updated safe values to be saved.
914
-             */
915
-            public function update($new_instance, $old_instance)
916
-            {
917
-                //save the widget
918
-                $instance = $old_instance;
919
-                $instance['gd_tw_desc1'] = ($new_instance['gd_tw_desc1']);
920
-                return $instance;
921
-            }
922
-
923
-            /**
924
-             * Back-end twitter widget settings form.
925
-             *
926
-             * @since 1.0.0
927
-             * @since 1.5.1 Declare function public.
928
-             *
929
-             * @param array $instance Previously saved values from database.
930
-             * @return string|void
931
-             */
932
-            public function form($instance)
933
-            {
934
-                //widgetform in backend
935
-                $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => ''));
936
-
937
-                $desc1 = ($instance['gd_tw_desc1']);
938
-                ?>
846
+			}
847
+		}
848
+
849
+		register_widget('GeodirFlickrWidget');
850
+
851
+		/**
852
+		 * GeoDirectory Twitter widget.
853
+		 *
854
+		 * @since 1.0.0
855
+		 */
856
+		class geodir_twitter extends WP_Widget
857
+		{
858
+			/**
859
+			 * Register the Twitter widget with WordPress.
860
+			 *
861
+			 * @since 1.0.0
862
+			 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
863
+			 */
864
+			public function __construct() {
865
+				$widget_ops = array('classname' => 'Twitter', 'description' => __('GD > Twitter Feed', 'geodirectory'));
866
+				parent::__construct(
867
+					'widget_Twidget', // Base ID
868
+					__('GD > Twitter', 'geodirectory'), // Name
869
+					$widget_ops// Args
870
+				);
871
+			}
872
+
873
+
874
+			/**
875
+			 * Front-end display content for Twitter widget.
876
+			 *
877
+			 * @since 1.0.0
878
+			 * @since 1.5.1 Declare function public.
879
+			 *
880
+			 * @param array $args     Widget arguments.
881
+			 * @param array $instance Saved values from database.
882
+			 */
883
+			public function widget($args, $instance)
884
+			{
885
+
886
+				// prints the widget
887
+
888
+				extract($args, EXTR_SKIP);
889
+
890
+				/**
891
+				 * Filter the twitter widget description text.
892
+				 *
893
+				 * @since 1.0.0
894
+				 * @param string $desc1 The widget description text.
895
+				 */
896
+				$desc1 = empty($instance['gd_tw_desc1']) ? '&nbsp;' : apply_filters('gd_tw_widget_desc1', $instance['gd_tw_desc1']);
897
+				echo $before_widget;
898
+				if ($desc1 <> "") {
899
+					echo $desc1;
900
+				}
901
+				echo $after_widget;
902
+			}
903
+
904
+			/**
905
+			 * Sanitize twitter widget form values as they are saved.
906
+			 *
907
+			 * @since 1.0.0
908
+			 * @since 1.5.1 Declare function public.
909
+			 *
910
+			 * @param array $new_instance Values just sent to be saved.
911
+			 * @param array $old_instance Previously saved values from database.
912
+			 *
913
+			 * @return array Updated safe values to be saved.
914
+			 */
915
+			public function update($new_instance, $old_instance)
916
+			{
917
+				//save the widget
918
+				$instance = $old_instance;
919
+				$instance['gd_tw_desc1'] = ($new_instance['gd_tw_desc1']);
920
+				return $instance;
921
+			}
922
+
923
+			/**
924
+			 * Back-end twitter widget settings form.
925
+			 *
926
+			 * @since 1.0.0
927
+			 * @since 1.5.1 Declare function public.
928
+			 *
929
+			 * @param array $instance Previously saved values from database.
930
+			 * @return string|void
931
+			 */
932
+			public function form($instance)
933
+			{
934
+				//widgetform in backend
935
+				$instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => ''));
936
+
937
+				$desc1 = ($instance['gd_tw_desc1']);
938
+				?>
939 939
                 <p><label
940 940
                         for="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"><?php _e('Your twitter code', 'geodirectory');?>
941 941
                         <textarea class="widefat" rows="6" cols="20"
@@ -944,169 +944,169 @@  discard block
 block discarded – undo
944 944
                 </p>
945 945
 
946 946
             <?php
947
-            }
948
-        }
949
-
950
-        register_widget('geodir_twitter');
951
-
952
-        /**
953
-         * GeoDirectory Advanced Search widget.
954
-         *
955
-         * @since 1.0.0
956
-         */
957
-        class geodir_advance_search_widget extends WP_Widget
958
-        {
959
-            /**
960
-             * Register the advanced search widget with WordPress.
961
-             *
962
-             * @since 1.0.0
963
-             * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
964
-             */
965
-            public function __construct() {
966
-                $widget_ops = array('classname' => 'geodir_advance_search_widget', 'description' => __('GD > Search', 'geodirectory'));
967
-                parent::__construct(
968
-                    'geodir_advance_search', // Base ID
969
-                    __('GD > Search', 'geodirectory'), // Name
970
-                    $widget_ops// Args
971
-                );
972
-            }
973
-
974
-
975
-            /**
976
-             * Front-end display content for advanced search widget.
977
-             *
978
-             * @since 1.0.0
979
-             * @since 1.5.1 Declare function public.
980
-             *
981
-             * @param array $args     Widget arguments.
982
-             * @param array $instance Saved values from database.
983
-             */
984
-            public function widget($args, $instance)
985
-            {
986
-                /**
987
-                 * Filter the search widget arguments.
988
-                 *
989
-                 * @since 1.5.7
990
-                 * @param array $args The widget arguments.
991
-                 * @param array $instance The widget instance.
992
-                 */
993
-                $args = apply_filters('widget_geodir_advance_search_args',$args,$instance);
994
-
995
-                // prints the widget
996
-                extract($args, EXTR_SKIP);
997
-
998
-                echo $before_widget;
999
-
1000
-                /** This filter is documented in geodirectory_widgets.php */
1001
-                $title = empty($instance['title']) ? __('Search', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
1002
-
1003
-                geodir_get_template_part('listing', 'filter-form');
1004
-
1005
-                echo $after_widget;
1006
-            }
1007
-
1008
-            /**
1009
-             * Sanitize advanced search widget form values as they are saved.
1010
-             *
1011
-             * @since 1.0.0
1012
-             * @since 1.5.1 Declare function public.
1013
-             *
1014
-             * @param array $new_instance Values just sent to be saved.
1015
-             * @param array $old_instance Previously saved values from database.
1016
-             *
1017
-             * @return array Updated safe values to be saved.
1018
-             */
1019
-            public function update($new_instance, $old_instance)
1020
-            {
1021
-                //save the widget
1022
-                //Nothing to save
1023
-                return isset($instance) ? $instance : array();
1024
-            }
1025
-
1026
-            /**
1027
-             * Back-end advanced search widget settings form.
1028
-             *
1029
-             * @since 1.0.0
1030
-             * @since 1.5.1 Declare function public.
1031
-             *
1032
-             * @param array $instance Previously saved values from database.
1033
-             * @return string|void
1034
-             */
1035
-            public function form($instance)
1036
-            {
1037
-                //widgetform in backend
1038
-                echo __("This is a search widget to show advance search for gedodirectory listings.", 'geodirectory');
1039
-            }
1040
-        }
1041
-
1042
-        register_widget('geodir_advance_search_widget');
1043
-
1044
-
1045
-        /**
1046
-         * Contains all functions for popular widget.
1047
-         *
1048
-         * @since 1.0.0
1049
-         * @package GeoDirectory
1050
-         */
1051
-        include_once('geodirectory-widgets/geodirectory_popular_widget.php');
1052
-        /**
1053
-         * Contains all functions for listing slider widget.
1054
-         *
1055
-         * @since 1.0.0
1056
-         * @package GeoDirectory
1057
-         */
1058
-        include_once('geodirectory-widgets/geodirectory_listing_slider_widget.php');
1059
-        /**
1060
-         * Contains all functions for home map widget.
1061
-         *
1062
-         * @since 1.0.0
1063
-         * @package GeoDirectory
1064
-         */
1065
-        include_once('geodirectory-widgets/home_map_widget.php');
1066
-        /**
1067
-         * Contains all functions for listing map widget.
1068
-         *
1069
-         * @since 1.0.0
1070
-         * @package GeoDirectory
1071
-         */
1072
-        include_once('geodirectory-widgets/listing_map_widget.php');
1073
-        /**
1074
-         * Contains all functions for reviews widget.
1075
-         *
1076
-         * @since 1.0.0
1077
-         * @package GeoDirectory
1078
-         */
1079
-        include_once('geodirectory-widgets/geodirectory_reviews_widget.php');
1080
-        /**
1081
-         * Contains all functions for related listing widget.
1082
-         *
1083
-         * @since 1.0.0
1084
-         * @package GeoDirectory
1085
-         */
1086
-        include_once('geodirectory-widgets/geodirectory_related_listing_widget.php');
1087
-        /**
1088
-         * Contains all functions for bestof widget.
1089
-         *
1090
-         * @since 1.0.0
1091
-         * @package GeoDirectory
1092
-         */
1093
-        include_once('geodirectory-widgets/geodirectory_bestof_widget.php');
947
+			}
948
+		}
949
+
950
+		register_widget('geodir_twitter');
951
+
952
+		/**
953
+		 * GeoDirectory Advanced Search widget.
954
+		 *
955
+		 * @since 1.0.0
956
+		 */
957
+		class geodir_advance_search_widget extends WP_Widget
958
+		{
959
+			/**
960
+			 * Register the advanced search widget with WordPress.
961
+			 *
962
+			 * @since 1.0.0
963
+			 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
964
+			 */
965
+			public function __construct() {
966
+				$widget_ops = array('classname' => 'geodir_advance_search_widget', 'description' => __('GD > Search', 'geodirectory'));
967
+				parent::__construct(
968
+					'geodir_advance_search', // Base ID
969
+					__('GD > Search', 'geodirectory'), // Name
970
+					$widget_ops// Args
971
+				);
972
+			}
973
+
974
+
975
+			/**
976
+			 * Front-end display content for advanced search widget.
977
+			 *
978
+			 * @since 1.0.0
979
+			 * @since 1.5.1 Declare function public.
980
+			 *
981
+			 * @param array $args     Widget arguments.
982
+			 * @param array $instance Saved values from database.
983
+			 */
984
+			public function widget($args, $instance)
985
+			{
986
+				/**
987
+				 * Filter the search widget arguments.
988
+				 *
989
+				 * @since 1.5.7
990
+				 * @param array $args The widget arguments.
991
+				 * @param array $instance The widget instance.
992
+				 */
993
+				$args = apply_filters('widget_geodir_advance_search_args',$args,$instance);
994
+
995
+				// prints the widget
996
+				extract($args, EXTR_SKIP);
997
+
998
+				echo $before_widget;
999
+
1000
+				/** This filter is documented in geodirectory_widgets.php */
1001
+				$title = empty($instance['title']) ? __('Search', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
1002
+
1003
+				geodir_get_template_part('listing', 'filter-form');
1004
+
1005
+				echo $after_widget;
1006
+			}
1007
+
1008
+			/**
1009
+			 * Sanitize advanced search widget form values as they are saved.
1010
+			 *
1011
+			 * @since 1.0.0
1012
+			 * @since 1.5.1 Declare function public.
1013
+			 *
1014
+			 * @param array $new_instance Values just sent to be saved.
1015
+			 * @param array $old_instance Previously saved values from database.
1016
+			 *
1017
+			 * @return array Updated safe values to be saved.
1018
+			 */
1019
+			public function update($new_instance, $old_instance)
1020
+			{
1021
+				//save the widget
1022
+				//Nothing to save
1023
+				return isset($instance) ? $instance : array();
1024
+			}
1025
+
1026
+			/**
1027
+			 * Back-end advanced search widget settings form.
1028
+			 *
1029
+			 * @since 1.0.0
1030
+			 * @since 1.5.1 Declare function public.
1031
+			 *
1032
+			 * @param array $instance Previously saved values from database.
1033
+			 * @return string|void
1034
+			 */
1035
+			public function form($instance)
1036
+			{
1037
+				//widgetform in backend
1038
+				echo __("This is a search widget to show advance search for gedodirectory listings.", 'geodirectory');
1039
+			}
1040
+		}
1041
+
1042
+		register_widget('geodir_advance_search_widget');
1043
+
1044
+
1045
+		/**
1046
+		 * Contains all functions for popular widget.
1047
+		 *
1048
+		 * @since 1.0.0
1049
+		 * @package GeoDirectory
1050
+		 */
1051
+		include_once('geodirectory-widgets/geodirectory_popular_widget.php');
1052
+		/**
1053
+		 * Contains all functions for listing slider widget.
1054
+		 *
1055
+		 * @since 1.0.0
1056
+		 * @package GeoDirectory
1057
+		 */
1058
+		include_once('geodirectory-widgets/geodirectory_listing_slider_widget.php');
1059
+		/**
1060
+		 * Contains all functions for home map widget.
1061
+		 *
1062
+		 * @since 1.0.0
1063
+		 * @package GeoDirectory
1064
+		 */
1065
+		include_once('geodirectory-widgets/home_map_widget.php');
1066
+		/**
1067
+		 * Contains all functions for listing map widget.
1068
+		 *
1069
+		 * @since 1.0.0
1070
+		 * @package GeoDirectory
1071
+		 */
1072
+		include_once('geodirectory-widgets/listing_map_widget.php');
1073
+		/**
1074
+		 * Contains all functions for reviews widget.
1075
+		 *
1076
+		 * @since 1.0.0
1077
+		 * @package GeoDirectory
1078
+		 */
1079
+		include_once('geodirectory-widgets/geodirectory_reviews_widget.php');
1080
+		/**
1081
+		 * Contains all functions for related listing widget.
1082
+		 *
1083
+		 * @since 1.0.0
1084
+		 * @package GeoDirectory
1085
+		 */
1086
+		include_once('geodirectory-widgets/geodirectory_related_listing_widget.php');
1087
+		/**
1088
+		 * Contains all functions for bestof widget.
1089
+		 *
1090
+		 * @since 1.0.0
1091
+		 * @package GeoDirectory
1092
+		 */
1093
+		include_once('geodirectory-widgets/geodirectory_bestof_widget.php');
1094
+		/**
1095
+		 * Contains all functions for cpt categories widget.
1096
+		 *
1097
+		 * @since 1.5.4
1098
+		 * @package GeoDirectory
1099
+		 */
1100
+		include_once('geodirectory-widgets/geodirectory_cpt_categories_widget.php');
1094 1101
 		/**
1095
-         * Contains all functions for cpt categories widget.
1096
-         *
1097
-         * @since 1.5.4
1098
-         * @package GeoDirectory
1099
-         */
1100
-        include_once('geodirectory-widgets/geodirectory_cpt_categories_widget.php');
1101
-        /**
1102
-         * Contains all functions for features widget.
1103
-         *
1104
-         * @since 1.5.6
1105
-         * @package GeoDirectory
1106
-         * @todo make the image field recurring
1107
-         */
1108
-        include_once('geodirectory-widgets/geodirectory_features_widget.php');
1109
-    }
1102
+		 * Contains all functions for features widget.
1103
+		 *
1104
+		 * @since 1.5.6
1105
+		 * @package GeoDirectory
1106
+		 * @todo make the image field recurring
1107
+		 */
1108
+		include_once('geodirectory-widgets/geodirectory_features_widget.php');
1109
+	}
1110 1110
 
1111 1111
 }
1112 1112
 
Please login to merge, or discard this patch.
geodirectory-widgets/geodirectory_features_widget.php 2 patches
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         ?>
34 34
         <?php if ($title) {
35 35
         echo '<div class="geodir_list_heading clearfix">';
36
-        echo $before_title . $title . $after_title;
36
+        echo $before_title.$title.$after_title;
37 37
         echo '</div>';
38 38
     } ?>
39 39
         <?php
@@ -42,16 +42,16 @@  discard block
 block discarded – undo
42 42
         $i = 1;
43 43
         while ($i < 100) {
44 44
 
45
-            if (isset($instance['title' . $i]) || isset($instance['image' . $i]) || isset($instance['desc' . $i])) {
45
+            if (isset($instance['title'.$i]) || isset($instance['image'.$i]) || isset($instance['desc'.$i])) {
46 46
                 echo "<li>";
47
-                if ($instance['title' . $i]) {
48
-                    echo "<h3 class='gd-fe-title'>" . $instance['title' . $i] . "</h3>";
47
+                if ($instance['title'.$i]) {
48
+                    echo "<h3 class='gd-fe-title'>".$instance['title'.$i]."</h3>";
49 49
                 }
50
-                if ($instance['image' . $i]) {
51
-                    echo "<div class='gd-fe-image'>" . gd_features_parse_image($instance['image' . $i], $icon_color) . "</div>";
50
+                if ($instance['image'.$i]) {
51
+                    echo "<div class='gd-fe-image'>".gd_features_parse_image($instance['image'.$i], $icon_color)."</div>";
52 52
                 }
53
-                if ($instance['desc' . $i]) {
54
-                    echo "<div class='gd-fe-desc'>" . gd_features_parse_desc($instance['desc' . $i]) . "</div>";
53
+                if ($instance['desc'.$i]) {
54
+                    echo "<div class='gd-fe-desc'>".gd_features_parse_desc($instance['desc'.$i])."</div>";
55 55
                 }
56 56
                 echo "</li>";
57 57
             } else {
@@ -78,15 +78,15 @@  discard block
 block discarded – undo
78 78
         $i = 1;
79 79
         while ($i < 100) {
80 80
 
81
-            if (isset($new_instance['title' . $i]) || isset($new_instance['image' . $i]) || isset($new_instance['desc' . $i])) {
82
-                if ($new_instance['title' . $i]) {
83
-                    $instance['title' . $i] = $new_instance['title' . $i];
81
+            if (isset($new_instance['title'.$i]) || isset($new_instance['image'.$i]) || isset($new_instance['desc'.$i])) {
82
+                if ($new_instance['title'.$i]) {
83
+                    $instance['title'.$i] = $new_instance['title'.$i];
84 84
                 }
85
-                if ($new_instance['image' . $i]) {
86
-                    $instance['image' . $i] = $new_instance['image' . $i];
85
+                if ($new_instance['image'.$i]) {
86
+                    $instance['image'.$i] = $new_instance['image'.$i];
87 87
                 }
88
-                if ($new_instance['desc' . $i]) {
89
-                    $instance['desc' . $i] = $new_instance['desc' . $i];
88
+                if ($new_instance['desc'.$i]) {
89
+                    $instance['desc'.$i] = $new_instance['desc'.$i];
90 90
                 }
91 91
             } else {
92 92
                 break;
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     public function form($instance)
102 102
     {
103 103
         //widgetform in backend
104
-        $instance = wp_parse_args((array)$instance, array(
104
+        $instance = wp_parse_args((array) $instance, array(
105 105
             'title' => '',
106 106
             'icon_color' => '#757575',
107 107
             'title1' => '',
@@ -138,35 +138,35 @@  discard block
 block discarded – undo
138 138
         </p>
139 139
 
140 140
 
141
-        <div class="gd-fet-rep-<?php echo $this->get_field_id('xxx');?>">
141
+        <div class="gd-fet-rep-<?php echo $this->get_field_id('xxx'); ?>">
142 142
             <?php
143 143
 
144 144
             $i = 1;
145 145
             while ($i < 100) {
146 146
 
147
-                if ( $i==1 || (isset($instance['title' . $i]) || isset($instance['image' . $i]) || isset($instance['desc' . $i])) && ($instance['title' . $i] || $instance['image' . $i] || $instance['desc' . $i])) {
147
+                if ($i == 1 || (isset($instance['title'.$i]) || isset($instance['image'.$i]) || isset($instance['desc'.$i])) && ($instance['title'.$i] || $instance['image'.$i] || $instance['desc'.$i])) {
148 148
                     ?>
149
-                    <div class="gdrep<?php echo $i;?>">
149
+                    <div class="gdrep<?php echo $i; ?>">
150 150
                         <p class="features-title">
151 151
                             <label
152 152
                                 data-gdrep-title-num="1"><?php printf(__('Title %d:', 'geodirectory'), $i); ?></label>
153
-                            <input data-gdrep-title="1" name="<?php echo $this->get_field_name('title' . $i); ?>"
154
-                                   type="text" value="<?php echo esc_attr(strip_tags($instance['title' . $i])); ?>"
153
+                            <input data-gdrep-title="1" name="<?php echo $this->get_field_name('title'.$i); ?>"
154
+                                   type="text" value="<?php echo esc_attr(strip_tags($instance['title'.$i])); ?>"
155 155
                                    class="widefat"/>
156 156
                         </p>
157 157
 
158 158
                         <p class="features-image">
159 159
                             <label><?php echo __('Image URL:', 'geodirectory'); ?></label>
160 160
                             <input data-gdrep-image="1" type="text" class="widefat"
161
-                                   name="<?php echo $this->get_field_name('image' . $i); ?>"
162
-                                   value="<?php echo esc_attr(strip_tags($instance['image' . $i])); ?>"/>
161
+                                   name="<?php echo $this->get_field_name('image'.$i); ?>"
162
+                                   value="<?php echo esc_attr(strip_tags($instance['image'.$i])); ?>"/>
163 163
                         </p>
164 164
 
165 165
                         <p class="features-desc">
166 166
                             <label><?php echo __('Description:', 'geodirectory'); ?></label>
167
-                            <textarea data-gdrep-desc="1" name="<?php echo $this->get_field_name('desc' . $i); ?>"
167
+                            <textarea data-gdrep-desc="1" name="<?php echo $this->get_field_name('desc'.$i); ?>"
168 168
                                       rows="3"
169
-                                      class="widefat"><?php echo esc_attr(strip_tags($instance['desc' . $i])); ?></textarea>
169
+                                      class="widefat"><?php echo esc_attr(strip_tags($instance['desc'.$i])); ?></textarea>
170 170
                         </p>
171 171
                     </div>
172 172
                 <?php
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
 
180 180
             ?>
181 181
             <input class="button button-primary left"
182
-                   onclick="gd_featured_widget_repeat('gd-fet-rep-<?php echo $this->get_field_id('xxx');?>','<?php echo $this->get_field_name('xxx');?>')"
183
-                   type="button" value="<?php _e('Add item', 'geodirectory');?>"/>
182
+                   onclick="gd_featured_widget_repeat('gd-fet-rep-<?php echo $this->get_field_id('xxx'); ?>','<?php echo $this->get_field_name('xxx'); ?>')"
183
+                   type="button" value="<?php _e('Add item', 'geodirectory'); ?>"/>
184 184
         </div>
185 185
 
186 186
 
@@ -193,12 +193,12 @@  discard block
 block discarded – undo
193 193
 function gd_features_parse_image($image, $icon_color)
194 194
 {
195 195
     if (substr($image, 0, 4) === "http") {
196
-        $image = '<img src="' . $image . '" />';
196
+        $image = '<img src="'.$image.'" />';
197 197
     } elseif (substr($image, 0, 3) === "fa-") {
198 198
         if (empty($icon_color)) {
199 199
             $icon_color = '#757575';
200 200
         }
201
-        $image = '<i style="color:' . $icon_color . '" class="fa ' . $image . '"></i>';
201
+        $image = '<i style="color:'.$icon_color.'" class="fa '.$image.'"></i>';
202 202
     }
203 203
     return $image;
204 204
 }
Please login to merge, or discard this patch.
Indentation   +128 added lines, -128 removed lines patch added patch discarded remove patch
@@ -3,117 +3,117 @@  discard block
 block discarded – undo
3 3
 class Geodir_Features_Widget extends WP_Widget
4 4
 {
5 5
 
6
-    /**
7
-     * Class constructor.
8
-     */
9
-    public function __construct()
10
-    {
11
-        $widget_ops = array(
12
-            'description' => __('Displays "GD Features" widget', 'geodirectory'),
13
-            'classname' => 'widget_gd_features',
14
-        );
15
-        parent::__construct(false, $name = _x('GD > Features', 'widget name', 'geodirectory'), $widget_ops);
16
-
17
-    }
18
-
19
-    /**
20
-     * Display the widget.
21
-     *
22
-     * @param array $args Widget arguments.
23
-     * @param array $instance The widget settings, as saved by the user.
24
-     */
25
-    public function widget($args, $instance)
26
-    {
27
-        extract($args);
28
-
29
-        $title = empty($instance['title']) ? '' : apply_filters('gd_features_widget_title', __($instance['title'], 'geodirectory'));
30
-        $icon_color = empty($instance['icon_color']) ? '#757575' : apply_filters('gd_features_widget_icon_color', __($instance['icon_color'], 'geodirectory'));
31
-
32
-        echo $before_widget;
33
-        ?>
6
+	/**
7
+	 * Class constructor.
8
+	 */
9
+	public function __construct()
10
+	{
11
+		$widget_ops = array(
12
+			'description' => __('Displays "GD Features" widget', 'geodirectory'),
13
+			'classname' => 'widget_gd_features',
14
+		);
15
+		parent::__construct(false, $name = _x('GD > Features', 'widget name', 'geodirectory'), $widget_ops);
16
+
17
+	}
18
+
19
+	/**
20
+	 * Display the widget.
21
+	 *
22
+	 * @param array $args Widget arguments.
23
+	 * @param array $instance The widget settings, as saved by the user.
24
+	 */
25
+	public function widget($args, $instance)
26
+	{
27
+		extract($args);
28
+
29
+		$title = empty($instance['title']) ? '' : apply_filters('gd_features_widget_title', __($instance['title'], 'geodirectory'));
30
+		$icon_color = empty($instance['icon_color']) ? '#757575' : apply_filters('gd_features_widget_icon_color', __($instance['icon_color'], 'geodirectory'));
31
+
32
+		echo $before_widget;
33
+		?>
34 34
         <?php if ($title) {
35
-        echo '<div class="geodir_list_heading clearfix">';
36
-        echo $before_title . $title . $after_title;
37
-        echo '</div>';
38
-    } ?>
35
+		echo '<div class="geodir_list_heading clearfix">';
36
+		echo $before_title . $title . $after_title;
37
+		echo '</div>';
38
+	} ?>
39 39
         <?php
40
-        echo "<ul class='gd-features'>";
41
-
42
-        $i = 1;
43
-        while ($i < 100) {
44
-
45
-            if (isset($instance['title' . $i]) || isset($instance['image' . $i]) || isset($instance['desc' . $i])) {
46
-                echo "<li>";
47
-                if ($instance['title' . $i]) {
48
-                    echo "<h3 class='gd-fe-title'>" . $instance['title' . $i] . "</h3>";
49
-                }
50
-                if ($instance['image' . $i]) {
51
-                    echo "<div class='gd-fe-image'>" . gd_features_parse_image($instance['image' . $i], $icon_color) . "</div>";
52
-                }
53
-                if ($instance['desc' . $i]) {
54
-                    echo "<div class='gd-fe-desc'>" . gd_features_parse_desc($instance['desc' . $i]) . "</div>";
55
-                }
56
-                echo "</li>";
57
-            } else {
58
-                break;
59
-            }
60
-
61
-            $i++;
62
-        }
63
-
64
-        echo "</ul>";
65
-        ?>
40
+		echo "<ul class='gd-features'>";
41
+
42
+		$i = 1;
43
+		while ($i < 100) {
44
+
45
+			if (isset($instance['title' . $i]) || isset($instance['image' . $i]) || isset($instance['desc' . $i])) {
46
+				echo "<li>";
47
+				if ($instance['title' . $i]) {
48
+					echo "<h3 class='gd-fe-title'>" . $instance['title' . $i] . "</h3>";
49
+				}
50
+				if ($instance['image' . $i]) {
51
+					echo "<div class='gd-fe-image'>" . gd_features_parse_image($instance['image' . $i], $icon_color) . "</div>";
52
+				}
53
+				if ($instance['desc' . $i]) {
54
+					echo "<div class='gd-fe-desc'>" . gd_features_parse_desc($instance['desc' . $i]) . "</div>";
55
+				}
56
+				echo "</li>";
57
+			} else {
58
+				break;
59
+			}
60
+
61
+			$i++;
62
+		}
63
+
64
+		echo "</ul>";
65
+		?>
66 66
         <?php echo $after_widget; ?>
67 67
     <?php
68
-    }
69
-
70
-    public function update($new_instance, $old_instance)
71
-    {
72
-        //save the widget
73
-        $instance = $old_instance;
74
-
75
-        $instance['title'] = strip_tags($new_instance['title']);
76
-        $instance['icon_color'] = strip_tags($new_instance['icon_color']);
77
-
78
-        $i = 1;
79
-        while ($i < 100) {
80
-
81
-            if (isset($new_instance['title' . $i]) || isset($new_instance['image' . $i]) || isset($new_instance['desc' . $i])) {
82
-                if ($new_instance['title' . $i]) {
83
-                    $instance['title' . $i] = $new_instance['title' . $i];
84
-                }
85
-                if ($new_instance['image' . $i]) {
86
-                    $instance['image' . $i] = $new_instance['image' . $i];
87
-                }
88
-                if ($new_instance['desc' . $i]) {
89
-                    $instance['desc' . $i] = $new_instance['desc' . $i];
90
-                }
91
-            } else {
92
-                break;
93
-            }
94
-
95
-            $i++;
96
-        }
97
-
98
-        return $instance;
99
-    }
100
-
101
-    public function form($instance)
102
-    {
103
-        //widgetform in backend
104
-        $instance = wp_parse_args((array)$instance, array(
105
-            'title' => '',
106
-            'icon_color' => '#757575',
107
-            'title1' => '',
108
-            'image1' => '',
109
-            'desc1' => '',
110
-        ));
111
-
112
-
113
-        $title = strip_tags($instance['title']);
114
-        $icon_color = strip_tags($instance['icon_color']);
115
-
116
-        ?>
68
+	}
69
+
70
+	public function update($new_instance, $old_instance)
71
+	{
72
+		//save the widget
73
+		$instance = $old_instance;
74
+
75
+		$instance['title'] = strip_tags($new_instance['title']);
76
+		$instance['icon_color'] = strip_tags($new_instance['icon_color']);
77
+
78
+		$i = 1;
79
+		while ($i < 100) {
80
+
81
+			if (isset($new_instance['title' . $i]) || isset($new_instance['image' . $i]) || isset($new_instance['desc' . $i])) {
82
+				if ($new_instance['title' . $i]) {
83
+					$instance['title' . $i] = $new_instance['title' . $i];
84
+				}
85
+				if ($new_instance['image' . $i]) {
86
+					$instance['image' . $i] = $new_instance['image' . $i];
87
+				}
88
+				if ($new_instance['desc' . $i]) {
89
+					$instance['desc' . $i] = $new_instance['desc' . $i];
90
+				}
91
+			} else {
92
+				break;
93
+			}
94
+
95
+			$i++;
96
+		}
97
+
98
+		return $instance;
99
+	}
100
+
101
+	public function form($instance)
102
+	{
103
+		//widgetform in backend
104
+		$instance = wp_parse_args((array)$instance, array(
105
+			'title' => '',
106
+			'icon_color' => '#757575',
107
+			'title1' => '',
108
+			'image1' => '',
109
+			'desc1' => '',
110
+		));
111
+
112
+
113
+		$title = strip_tags($instance['title']);
114
+		$icon_color = strip_tags($instance['icon_color']);
115
+
116
+		?>
117 117
         <p>
118 118
             <b>Heads Up!</b> If you don't have enough content, You can keep some boxes blank.
119 119
         </p>
@@ -141,11 +141,11 @@  discard block
 block discarded – undo
141 141
         <div class="gd-fet-rep-<?php echo $this->get_field_id('xxx');?>">
142 142
             <?php
143 143
 
144
-            $i = 1;
145
-            while ($i < 100) {
144
+			$i = 1;
145
+			while ($i < 100) {
146 146
 
147
-                if ( $i==1 || (isset($instance['title' . $i]) || isset($instance['image' . $i]) || isset($instance['desc' . $i])) && ($instance['title' . $i] || $instance['image' . $i] || $instance['desc' . $i])) {
148
-                    ?>
147
+				if ( $i==1 || (isset($instance['title' . $i]) || isset($instance['image' . $i]) || isset($instance['desc' . $i])) && ($instance['title' . $i] || $instance['image' . $i] || $instance['desc' . $i])) {
148
+					?>
149 149
                     <div class="gdrep<?php echo $i;?>">
150 150
                         <p class="features-title">
151 151
                             <label
@@ -170,14 +170,14 @@  discard block
 block discarded – undo
170 170
                         </p>
171 171
                     </div>
172 172
                 <?php
173
-                } else {
174
-                    break;
175
-                }
173
+				} else {
174
+					break;
175
+				}
176 176
 
177
-                $i++;
178
-            }
177
+				$i++;
178
+			}
179 179
 
180
-            ?>
180
+			?>
181 181
             <input class="button button-primary left"
182 182
                    onclick="gd_featured_widget_repeat('gd-fet-rep-<?php echo $this->get_field_id('xxx');?>','<?php echo $this->get_field_name('xxx');?>')"
183 183
                    type="button" value="<?php _e('Add item', 'geodirectory');?>"/>
@@ -185,25 +185,25 @@  discard block
 block discarded – undo
185 185
 
186 186
 
187 187
     <?php
188
-    }
188
+	}
189 189
 
190 190
 }
191 191
 
192 192
 register_widget("Geodir_Features_Widget");
193 193
 function gd_features_parse_image($image, $icon_color)
194 194
 {
195
-    if (substr($image, 0, 4) === "http") {
196
-        $image = '<img src="' . $image . '" />';
197
-    } elseif (substr($image, 0, 3) === "fa-") {
198
-        if (empty($icon_color)) {
199
-            $icon_color = '#757575';
200
-        }
201
-        $image = '<i style="color:' . $icon_color . '" class="fa ' . $image . '"></i>';
202
-    }
203
-    return $image;
195
+	if (substr($image, 0, 4) === "http") {
196
+		$image = '<img src="' . $image . '" />';
197
+	} elseif (substr($image, 0, 3) === "fa-") {
198
+		if (empty($icon_color)) {
199
+			$icon_color = '#757575';
200
+		}
201
+		$image = '<i style="color:' . $icon_color . '" class="fa ' . $image . '"></i>';
202
+	}
203
+	return $image;
204 204
 }
205 205
 
206 206
 function gd_features_parse_desc($desc)
207 207
 {
208
-    return $desc;
208
+	return $desc;
209 209
 }
Please login to merge, or discard this patch.
tests/lib/wordpress-tests-lib/includes/mock-mailer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-require_once( ABSPATH . '/wp-includes/class-phpmailer.php' );
2
+require_once(ABSPATH.'/wp-includes/class-phpmailer.php');
3 3
 
4 4
 class MockPHPMailer extends PHPMailer {
5 5
 	var $mock_sent = array();
Please login to merge, or discard this patch.
tests/lib/wordpress-tests-lib/includes/testcase-xmlrpc.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-include_once(ABSPATH . 'wp-admin/includes/admin.php');
3
-include_once(ABSPATH . WPINC . '/class-IXR.php');
4
-include_once(ABSPATH . WPINC . '/class-wp-xmlrpc-server.php');
2
+include_once(ABSPATH.'wp-admin/includes/admin.php');
3
+include_once(ABSPATH.WPINC.'/class-IXR.php');
4
+include_once(ABSPATH.WPINC.'/class-wp-xmlrpc-server.php');
5 5
 
6 6
 class WP_XMLRPC_UnitTestCase extends WP_UnitTestCase {
7 7
 	protected $myxmlrpcserver;
@@ -9,21 +9,21 @@  discard block
 block discarded – undo
9 9
 	function setUp() {
10 10
 		parent::setUp();
11 11
 
12
-		add_filter( 'pre_option_enable_xmlrpc', '__return_true' );
12
+		add_filter('pre_option_enable_xmlrpc', '__return_true');
13 13
 
14 14
 		$this->myxmlrpcserver = new wp_xmlrpc_server();
15 15
 	}
16 16
 
17 17
 	function tearDown() {
18
-		remove_filter( 'pre_option_enable_xmlrpc', '__return_true' );
18
+		remove_filter('pre_option_enable_xmlrpc', '__return_true');
19 19
 
20 20
 		$this->remove_added_uploads();
21 21
 
22 22
 		parent::tearDown();
23 23
 	}
24 24
 
25
-	protected function make_user_by_role( $role ) {
26
-		return self::factory()->user->create( array(
25
+	protected function make_user_by_role($role) {
26
+		return self::factory()->user->create(array(
27 27
 			'user_login' => $role,
28 28
 			'user_pass'  => $role,
29 29
 			'role'       => $role
Please login to merge, or discard this patch.
tests/lib/wordpress-tests-lib/includes/trac.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -13,46 +13,46 @@
 block discarded – undo
13 13
 	 *
14 14
 	 * @return bool|null true if the ticket is resolved, false if not resolved, null on error
15 15
 	 */
16
-	public static function isTracTicketClosed( $trac_url, $ticket_id ) {
17
-		if ( ! extension_loaded( 'openssl' ) ) {
18
-			$trac_url = preg_replace( "/^https:/", "http:", $trac_url );
16
+	public static function isTracTicketClosed($trac_url, $ticket_id) {
17
+		if (!extension_loaded('openssl')) {
18
+			$trac_url = preg_replace("/^https:/", "http:", $trac_url);
19 19
 		}
20 20
 
21
-		if ( ! isset( self::$trac_ticket_cache[ $trac_url ] ) ) {
21
+		if (!isset(self::$trac_ticket_cache[$trac_url])) {
22 22
 			// In case you're running the tests offline, keep track of open tickets.
23
-			$file = DIR_TESTDATA . '/.trac-ticket-cache.' . str_replace( array( 'http://', 'https://', '/' ), array( '', '', '-' ), rtrim( $trac_url, '/' ) );
24
-			$tickets = @file_get_contents( $trac_url . '/query?status=%21closed&format=csv&col=id' );
23
+			$file = DIR_TESTDATA.'/.trac-ticket-cache.'.str_replace(array('http://', 'https://', '/'), array('', '', '-'), rtrim($trac_url, '/'));
24
+			$tickets = @file_get_contents($trac_url.'/query?status=%21closed&format=csv&col=id');
25 25
 			// Check if our HTTP request failed.
26
-			if ( false === $tickets ) {
27
-				if ( file_exists( $file ) ) {
28
-					register_shutdown_function( array( 'TracTickets', 'usingLocalCache' ) );
29
-					$tickets = file_get_contents( $file );
26
+			if (false === $tickets) {
27
+				if (file_exists($file)) {
28
+					register_shutdown_function(array('TracTickets', 'usingLocalCache'));
29
+					$tickets = file_get_contents($file);
30 30
 				} else {
31
-					register_shutdown_function( array( 'TracTickets', 'forcingKnownBugs' ) );
32
-					self::$trac_ticket_cache[ $trac_url ] = array();
31
+					register_shutdown_function(array('TracTickets', 'forcingKnownBugs'));
32
+					self::$trac_ticket_cache[$trac_url] = array();
33 33
 					return true; // Assume the ticket is closed, which means it gets run.
34 34
 				}
35 35
 			} else {
36
-				$tickets = substr( $tickets, 2 ); // remove 'id' column header
37
-				$tickets = trim( $tickets );
38
-				file_put_contents( $file, $tickets );
36
+				$tickets = substr($tickets, 2); // remove 'id' column header
37
+				$tickets = trim($tickets);
38
+				file_put_contents($file, $tickets);
39 39
 			}
40
-			$tickets = explode( "\r\n", $tickets );
41
-			self::$trac_ticket_cache[ $trac_url ] = $tickets;
40
+			$tickets = explode("\r\n", $tickets);
41
+			self::$trac_ticket_cache[$trac_url] = $tickets;
42 42
 		}
43 43
 
44
-		return ! in_array( $ticket_id, self::$trac_ticket_cache[ $trac_url ] );
44
+		return !in_array($ticket_id, self::$trac_ticket_cache[$trac_url]);
45 45
 	}
46 46
 
47 47
 	public static function usingLocalCache() {
48
-		echo PHP_EOL . "\x1b[0m\x1b[30;43m\x1b[2K";
49
-		echo 'INFO: Trac was inaccessible, so a local ticket status cache was used.' . PHP_EOL;
48
+		echo PHP_EOL."\x1b[0m\x1b[30;43m\x1b[2K";
49
+		echo 'INFO: Trac was inaccessible, so a local ticket status cache was used.'.PHP_EOL;
50 50
 		echo "\x1b[0m\x1b[2K";
51 51
 	}
52 52
 
53 53
 	public static function forcingKnownBugs() {
54
-		echo PHP_EOL . "\x1b[0m\x1b[37;41m\x1b[2K";
55
-		echo "ERROR: Trac was inaccessible, so known bugs weren't able to be skipped." . PHP_EOL;
54
+		echo PHP_EOL."\x1b[0m\x1b[37;41m\x1b[2K";
55
+		echo "ERROR: Trac was inaccessible, so known bugs weren't able to be skipped.".PHP_EOL;
56 56
 		echo "\x1b[0m\x1b[2K";
57 57
 	}
58 58
 }
Please login to merge, or discard this patch.
geodirectory-admin/admin_template_tags.php 3 patches
Braces   +21 added lines, -13 removed lines patch added patch discarded remove patch
@@ -74,17 +74,20 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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.
Please login to merge, or discard this patch.
Indentation   +529 added lines, -529 removed lines patch added patch discarded remove patch
@@ -7,33 +7,33 @@  discard block
 block discarded – undo
7 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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
267 267
         </script>
268 268
     <?php
269 269
 
270
-    }
270
+	}
271 271
 }
272 272
 
273 273
 
@@ -283,48 +283,48 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 //supported 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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
                 <h3><?php _e('Setup New Field','geodirectory');?></h3>
@@ -1496,13 +1496,13 @@  discard block
 block discarded – undo
1496 1496
                     <div id="gt-form-builder-tab" class="gt-tabs-panel">
1497 1497
 
1498 1498
                         <?php
1499
-                        /**
1500
-                         * Adds the available fields to the custom fields settings page per post type.
1501
-                         *
1502
-                         * @since 1.0.0
1503
-                         * @param string $sub_tab The current settings tab name.
1504
-                         */
1505
-                        do_action('geodir_manage_available_fields', $sub_tab); ?>
1499
+						/**
1500
+						 * Adds the available fields to the custom fields settings page per post type.
1501
+						 *
1502
+						 * @since 1.0.0
1503
+						 * @param string $sub_tab The current settings tab name.
1504
+						 */
1505
+						do_action('geodir_manage_available_fields', $sub_tab); ?>
1506 1506
 
1507 1507
                         <div style="clear:both"></div>
1508 1508
                     </div>
@@ -1515,13 +1515,13 @@  discard block
 block discarded – undo
1515 1515
                     <div id="gt-form-builder-tab" class="gt-tabs-panel">
1516 1516
 
1517 1517
                         <?php
1518
-                        /**
1519
-                         * Adds the available fields to the custom fields predefined settings page per post type.
1520
-                         *
1521
-                         * @since 1.6.9
1522
-                         * @param string $sub_tab The current settings tab name.
1523
-                         */
1524
-                        do_action('geodir_manage_available_fields_predefined', $sub_tab); ?>
1518
+						/**
1519
+						 * Adds the available fields to the custom fields predefined settings page per post type.
1520
+						 *
1521
+						 * @since 1.6.9
1522
+						 * @param string $sub_tab The current settings tab name.
1523
+						 */
1524
+						do_action('geodir_manage_available_fields_predefined', $sub_tab); ?>
1525 1525
 
1526 1526
                         <div style="clear:both"></div>
1527 1527
                     </div>
@@ -1534,13 +1534,13 @@  discard block
 block discarded – undo
1534 1534
                     <div id="gt-form-builder-tab" class="gt-tabs-panel">
1535 1535
 
1536 1536
                         <?php
1537
-                        /**
1538
-                         * Adds the available fields to the custom fields custom added settings page per post type.
1539
-                         *
1540
-                         * @since 1.6.9
1541
-                         * @param string $sub_tab The current settings tab name.
1542
-                         */
1543
-                        do_action('geodir_manage_available_fields_custom', $sub_tab); ?>
1537
+						/**
1538
+						 * Adds the available fields to the custom fields custom added settings page per post type.
1539
+						 *
1540
+						 * @since 1.6.9
1541
+						 * @param string $sub_tab The current settings tab name.
1542
+						 */
1543
+						do_action('geodir_manage_available_fields_custom', $sub_tab); ?>
1544 1544
 
1545 1545
                         <div style="clear:both"></div>
1546 1546
                     </div>
@@ -1554,25 +1554,25 @@  discard block
 block discarded – undo
1554 1554
             <div class="side-sortables" id="geodir-selected-fields">
1555 1555
                 <h3 class="hndle">
1556 1556
                     <?php
1557
-                    /**
1558
-                     * Filter custom field selected fields heading.
1559
-                     *
1560
-                     * @since 1.0.0
1561
-                     * @param string $sub_tab Sub tab name.
1562
-                     * @param string $listing_type Post type.
1563
-                     */
1564
-                    ?>
1557
+					/**
1558
+					 * Filter custom field selected fields heading.
1559
+					 *
1560
+					 * @since 1.0.0
1561
+					 * @param string $sub_tab Sub tab name.
1562
+					 * @param string $listing_type Post type.
1563
+					 */
1564
+					?>
1565 1565
                     <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type);?></span>
1566 1566
                 </h3>
1567 1567
                 <?php
1568
-                /**
1569
-                 * Filter custom field selected fields note text.
1570
-                 *
1571
-                 * @since 1.0.0
1572
-                 * @param string $sub_tab Sub tab name.
1573
-                 * @param string $listing_type Post type.
1574
-                 */
1575
-                ?>
1568
+				/**
1569
+				 * Filter custom field selected fields note text.
1570
+				 *
1571
+				 * @since 1.0.0
1572
+				 * @param string $sub_tab Sub tab name.
1573
+				 * @param string $listing_type Post type.
1574
+				 */
1575
+				?>
1576 1576
                 <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type);?></p>
1577 1577
 
1578 1578
                 <div class="inside">
@@ -1580,13 +1580,13 @@  discard block
 block discarded – undo
1580 1580
                     <div id="gt-form-builder-tab" class="gt-tabs-panel">
1581 1581
                         <div class="field_row_main">
1582 1582
                             <?php
1583
-                            /**
1584
-                             * Adds the selected fields and setting to the custom fields settings page per post type.
1585
-                             *
1586
-                             * @since 1.0.0
1587
-                             * @param string $sub_tab The current settings tab name.
1588
-                             */
1589
-                            do_action('geodir_manage_selected_fields', $sub_tab); ?>
1583
+							/**
1584
+							 * Adds the selected fields and setting to the custom fields settings page per post type.
1585
+							 *
1586
+							 * @since 1.0.0
1587
+							 * @param string $sub_tab The current settings tab name.
1588
+							 */
1589
+							do_action('geodir_manage_selected_fields', $sub_tab); ?>
1590 1590
                         </div>
1591 1591
                         <div style="clear:both"></div>
1592 1592
                     </div>
@@ -1609,7 +1609,7 @@  discard block
 block discarded – undo
1609 1609
  */
1610 1610
 function geodir_diagnostic_tools_setting_page()
1611 1611
 {
1612
-    ?>
1612
+	?>
1613 1613
     <div class="inner_content_tab_main">
1614 1614
         <div class="gd-content-heading">
1615 1615
 
@@ -1711,13 +1711,13 @@  discard block
 block discarded – undo
1711 1711
 					</td>
1712 1712
 				</tr>
1713 1713
                 <?php
1714
-                /**
1715
-                 * Allows you to add more setting to the GD>Tools settings page.
1716
-                 *
1717
-                 * Called after the last setting on the GD>Tools page.
1718
-                 * @since 1.0.0
1719
-                 */
1720
-                do_action('geodir_diagnostic_tool');?>
1714
+				/**
1715
+				 * Allows you to add more setting to the GD>Tools settings page.
1716
+				 *
1717
+				 * Called after the last setting on the GD>Tools page.
1718
+				 * @since 1.0.0
1719
+				 */
1720
+				do_action('geodir_diagnostic_tool');?>
1721 1721
 
1722 1722
                 </tbody>
1723 1723
             </table>
Please login to merge, or discard this patch.
Spacing   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
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'];
@@ -63,12 +63,12 @@  discard block
 block discarded – undo
63 63
 
64 64
                                 $subtabs = $args['subtabs'];
65 65
 
66
-                                $query_string = '&subtab=' . $subtabs[0]['subtab'];
66
+                                $query_string = '&subtab='.$subtabs[0]['subtab'];
67 67
 
68 68
                             endif;
69 69
 
70 70
 
71
-                            $tab_link = admin_url('admin.php?page=geodirectory&tab=' . $name . $query_string);
71
+                            $tab_link = admin_url('admin.php?page=geodirectory&tab='.$name.$query_string);
72 72
 
73 73
                             if (isset($args['url']) && $args['url'] != '') {
74 74
                                 $tab_link = $args['url'];
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
                                 $tab_link = geodir_getlink($tab_link, $args['request']);
79 79
 
80 80
                             if (isset($args['target']) && $args['target'] != '') {
81
-                                $tab_target = " target='" . sanitize_text_field($args['target']) . "' ";
81
+                                $tab_target = " target='".sanitize_text_field($args['target'])."' ";
82 82
                             } else
83 83
                                 $tab_target = '';
84 84
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                              * @see 'geodir_after_settings_tabs'
94 94
                              */
95 95
                             do_action('geodir_before_settings_tabs', $name);
96
-                            echo '<li ' . $tab_active . ' ><a href="' . esc_url($tab_link) . '"  ' . $tab_target . ' >' . $label . '</a></li>';
96
+                            echo '<li '.$tab_active.' ><a href="'.esc_url($tab_link).'"  '.$tab_target.' >'.$label.'</a></li>';
97 97
                             /**
98 98
                              * Called after the individual settings tabs are output.
99 99
                              *
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
                                         $form_action = isset($sub['form_action']) ? $sub['form_action'] : '';
138 138
                                     }
139 139
 
140
-                                    $sub_tabs_link = admin_url() . 'admin.php?page=geodirectory&tab=' . $current_tab . '&subtab=' . $sub['subtab'];
140
+                                    $sub_tabs_link = admin_url().'admin.php?page=geodirectory&tab='.$current_tab.'&subtab='.$sub['subtab'];
141 141
                                     if (isset($sub['request']) && is_array($sub['request']) && !empty($sub['request'])) {
142 142
                                         $sub_tabs_link = geodir_getlink($sub_tabs_link, $sub['request']);
143 143
                                     }
144
-                                    echo '<dd ' . $subtab_active . ' id="claim_listing"><a href="' . esc_url($sub_tabs_link) . '" >' . sanitize_text_field($sub['label']) . '</a></dd>';
144
+                                    echo '<dd '.$subtab_active.' id="claim_listing"><a href="'.esc_url($sub_tabs_link).'" >'.sanitize_text_field($sub['label']).'</a></dd>';
145 145
                                 }
146 146
                                 ?>
147 147
                             </dl>
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                             echo "inner_contet_tabs";
152 152
                         } ?>">
153 153
                             <form method="post" id="mainform"
154
-                                  class="geodir_optionform <?php echo $current_tab . ' '; ?><?php if (isset($sub['subtab'])) {
154
+                                  class="geodir_optionform <?php echo $current_tab.' '; ?><?php if (isset($sub['subtab'])) {
155 155
                                       echo sanitize_text_field($sub['subtab']);
156 156
                                   } ?>" action="<?php echo $form_action; ?>" enctype="multipart/form-data">
157 157
                                 <input type="hidden" class="active_tab" name="active_tab"
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                                            echo sanitize_text_field($_REQUEST['active_tab']);
160 160
                                        } ?>"/>
161 161
                                 <?php wp_nonce_field('geodir-settings', '_wpnonce', true, true); ?>
162
-                                <?php wp_nonce_field('geodir-settings-' . $current_tab, '_wpnonce-' . $current_tab, true, true); ?>
162
+                                <?php wp_nonce_field('geodir-settings-'.$current_tab, '_wpnonce-'.$current_tab, true, true); ?>
163 163
                                 <?php
164 164
                                 /**
165 165
                                  * Used to call the content of each GD settings tab page.
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                      jQuery('#last_tab').val( jQuery(this).attr('href') );
190 190
                      return false;*/
191 191
                 });
192
-                <?php if (isset($_GET['subtab']) && $_GET['subtab']) echo 'jQuery(\'ul.subsubsub li a[href="#' . sanitize_text_field($_GET['subtab']) . '"]\').click();'; ?>
192
+                <?php if (isset($_GET['subtab']) && $_GET['subtab']) echo 'jQuery(\'ul.subsubsub li a[href="#'.sanitize_text_field($_GET['subtab']).'"]\').click();'; ?>
193 193
                 // Countries
194 194
                 jQuery('select#geodirectory_allowed_countries').change(function () {
195 195
                     if (jQuery(this).val() == "specific") {
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
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 = '';
@@ -285,14 +285,14 @@  discard block
 block discarded – undo
285 285
 
286 286
     //echo $tab_name.'_array.php' ;
287 287
     global $geodir_settings, $is_default, $mapzoom;
288
-    if (file_exists(dirname(__FILE__) . '/option-pages/' . $tab_name . '_array.php')) {
288
+    if (file_exists(dirname(__FILE__).'/option-pages/'.$tab_name.'_array.php')) {
289 289
         /**
290 290
          * Contains settings array for given tab.
291 291
          *
292 292
          * @since 1.0.0
293 293
          * @package GeoDirectory
294 294
          */
295
-        include_once('option-pages/' . $tab_name . '_array.php');
295
+        include_once('option-pages/'.$tab_name.'_array.php');
296 296
     }
297 297
 
298 298
     $listing_type = isset($_REQUEST['listing_type']) ? $_REQUEST['listing_type'] : '';
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
467 467
                         </tr>
468 468
                         <tr valign="top" class="single_select_page gd-add-location-map">
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
 block discarded – undo
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
 block discarded – undo
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
                                            } ?>"/>
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
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 540
             geodir_custom_post_type_form();
541 541
 
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
     }
688 688
 
689 689
 
690
-    $theme_name = $theme_name . "_custom";
690
+    $theme_name = $theme_name."_custom";
691 691
     $theme_arr = get_option('gd_theme_compats');
692 692
     update_option('gd_theme_compat', $theme_name);
693 693
     /**
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
         <div class="gd-content-heading">
777 777
 
778 778
 
779
-            <h3><?php _e('Theme Compatibility Settings', 'geodirectory');?></h3>
779
+            <h3><?php _e('Theme Compatibility Settings', 'geodirectory'); ?></h3>
780 780
             <style>
781 781
                 .gd-theme-compat-table {
782 782
                     width: 100%;
@@ -807,11 +807,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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,9 +1488,9 @@  discard block
 block discarded – undo
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
-                <h3><?php _e('Setup New Field','geodirectory');?></h3>
1493
+                <h3><?php _e('Setup New Field', 'geodirectory'); ?></h3>
1494 1494
                 <div class="inside">
1495 1495
 
1496 1496
                     <div id="gt-form-builder-tab" class="gt-tabs-panel">
@@ -1509,7 +1509,7 @@  discard block
 block discarded – undo
1509 1509
 
1510 1510
                 </div>
1511 1511
 
1512
-                <h3><?php _e('Predefined Fields','geodirectory');?></h3>
1512
+                <h3><?php _e('Predefined Fields', 'geodirectory'); ?></h3>
1513 1513
                 <div class="inside">
1514 1514
 
1515 1515
                     <div id="gt-form-builder-tab" class="gt-tabs-panel">
@@ -1528,7 +1528,7 @@  discard block
 block discarded – undo
1528 1528
 
1529 1529
                 </div>
1530 1530
 
1531
-                <h3><?php _e('Custom Fields','geodirectory');?></h3>
1531
+                <h3><?php _e('Custom Fields', 'geodirectory'); ?></h3>
1532 1532
                 <div class="inside">
1533 1533
 
1534 1534
                     <div id="gt-form-builder-tab" class="gt-tabs-panel">
@@ -1562,7 +1562,7 @@  discard block
 block discarded – undo
1562 1562
                      * @param string $listing_type Post type.
1563 1563
                      */
1564 1564
                     ?>
1565
-                    <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type);?></span>
1565
+                    <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type); ?></span>
1566 1566
                 </h3>
1567 1567
                 <?php
1568 1568
                 /**
@@ -1573,7 +1573,7 @@  discard block
 block discarded – undo
1573 1573
                  * @param string $listing_type Post type.
1574 1574
                  */
1575 1575
                 ?>
1576
-                <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type);?></p>
1576
+                <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type); ?></p>
1577 1577
 
1578 1578
                 <div class="inside">
1579 1579
 
@@ -1614,7 +1614,7 @@  discard block
 block discarded – undo
1614 1614
         <div class="gd-content-heading">
1615 1615
 
1616 1616
 
1617
-            <h3><?php _e('GD Diagnostic Tools', 'geodirectory');?></h3>
1617
+            <h3><?php _e('GD Diagnostic Tools', 'geodirectory'); ?></h3>
1618 1618
             <style>
1619 1619
                 .gd-tools-table {
1620 1620
                     width: 100%;
@@ -1633,81 +1633,81 @@  discard block
 block discarded – undo
1633 1633
             <table class="form-table gd-tools-table">
1634 1634
                 <tbody>
1635 1635
                 <tr>
1636
-                    <td><strong><?php _e('Tool', 'geodirectory');?></strong></td>
1637
-                    <td><strong><?php _e('Description', 'geodirectory');?></strong></td>
1638
-                    <td><strong><?php _e('Action', 'geodirectory');?></strong></td>
1636
+                    <td><strong><?php _e('Tool', 'geodirectory'); ?></strong></td>
1637
+                    <td><strong><?php _e('Description', 'geodirectory'); ?></strong></td>
1638
+                    <td><strong><?php _e('Action', 'geodirectory'); ?></strong></td>
1639 1639
                 </tr>
1640 1640
 
1641 1641
 
1642 1642
                 <tr>
1643
-                    <td><?php _e('GD pages check', 'geodirectory');?></td>
1643
+                    <td><?php _e('GD pages check', 'geodirectory'); ?></td>
1644 1644
                     <td>
1645
-                        <small><?php _e('Checks if the GD pages are installed correctly or not.', 'geodirectory');?></small>
1645
+                        <small><?php _e('Checks if the GD pages are installed correctly or not.', 'geodirectory'); ?></small>
1646 1646
                     </td>
1647 1647
                     <td>
1648
-                        <input type="button" value="<?php _e('Run', 'geodirectory');?>"
1648
+                        <input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
1649 1649
                                class="button-primary geodir_diagnosis_button" data-diagnose="default_pages"/>
1650 1650
                     </td>
1651 1651
                 </tr>
1652 1652
 
1653 1653
 
1654 1654
                 <tr>
1655
-                    <td><?php _e('Multisite DB conversion check', 'geodirectory');?></td>
1655
+                    <td><?php _e('Multisite DB conversion check', 'geodirectory'); ?></td>
1656 1656
                     <td>
1657
-                        <small><?php _e('Checks if the GD database tables have been converted to use multisite correctly.', 'geodirectory');?></small>
1657
+                        <small><?php _e('Checks if the GD database tables have been converted to use multisite correctly.', 'geodirectory'); ?></small>
1658 1658
                     </td>
1659
-                    <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
1659
+                    <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
1660 1660
                                class="button-primary geodir_diagnosis_button" data-diagnose="multisite_conversion"/>
1661 1661
                     </td>
1662 1662
                 </tr>
1663 1663
 
1664 1664
                 <tr>
1665
-                    <td><?php _e('Ratings check', 'geodirectory');?></td>
1665
+                    <td><?php _e('Ratings check', 'geodirectory'); ?></td>
1666 1666
                     <td>
1667
-                        <small><?php _e('Checks ratings for correct location and content settings', 'geodirectory');?></small>
1667
+                        <small><?php _e('Checks ratings for correct location and content settings', 'geodirectory'); ?></small>
1668 1668
                     </td>
1669
-                    <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
1669
+                    <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
1670 1670
                                class="button-primary geodir_diagnosis_button" data-diagnose="ratings"/>
1671 1671
                     </td>
1672 1672
                 </tr>
1673 1673
 
1674 1674
                 <tr>
1675
-                    <td><?php _e('Sync GD tags', 'geodirectory');?></td>
1675
+                    <td><?php _e('Sync GD tags', 'geodirectory'); ?></td>
1676 1676
                     <td>
1677
-                        <small><?php _e('This tool can be used when tags are showing in the backend but missing from the front end.', 'geodirectory');?></small>
1677
+                        <small><?php _e('This tool can be used when tags are showing in the backend but missing from the front end.', 'geodirectory'); ?></small>
1678 1678
                     </td>
1679
-                    <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
1679
+                    <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
1680 1680
                                class="button-primary geodir_diagnosis_button" data-diagnose="tags_sync"/>
1681 1681
                     </td>
1682 1682
                 </tr>
1683 1683
 
1684 1684
                 <tr>
1685
-                    <td><?php _e('Sync GD Categories', 'geodirectory');?></td>
1685
+                    <td><?php _e('Sync GD Categories', 'geodirectory'); ?></td>
1686 1686
                     <td>
1687
-                        <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>
1687
+                        <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>
1688 1688
                     </td>
1689
-                    <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
1689
+                    <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
1690 1690
                                class="button-primary geodir_diagnosis_button" data-diagnose="cats_sync"/>
1691 1691
                     </td>
1692 1692
                 </tr>
1693 1693
 
1694 1694
 
1695 1695
                 <tr>
1696
-                    <td><?php _e('Clear all GD version numbers', 'geodirectory');?></td>
1696
+                    <td><?php _e('Clear all GD version numbers', 'geodirectory'); ?></td>
1697 1697
                     <td>
1698
-                        <small><?php _e('This tool will clear all GD version numbers so any upgrade functions will run again.', 'geodirectory');?></small>
1698
+                        <small><?php _e('This tool will clear all GD version numbers so any upgrade functions will run again.', 'geodirectory'); ?></small>
1699 1699
                     </td>
1700
-                    <td><input type="button" value="<?php _e('Run', 'geodirectory');?>"
1700
+                    <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>"
1701 1701
                                class="button-primary geodir_diagnosis_button" data-diagnose="version_clear"/>
1702 1702
                     </td>
1703 1703
                 </tr>
1704 1704
 				<tr>
1705
-					<td><?php _e('Load custom fields translation', 'geodirectory');?></td>
1705
+					<td><?php _e('Load custom fields translation', 'geodirectory'); ?></td>
1706 1706
 					<td>
1707
-						<small><?php _e('This tool will load strings from the database into a file to translate via po editor.Ex: custom fields', 'geodirectory');?></small>
1707
+						<small><?php _e('This tool will load strings from the database into a file to translate via po editor.Ex: custom fields', 'geodirectory'); ?></small>
1708 1708
 					</td>
1709 1709
 					<td>
1710
-						<input type="button" value="<?php _e('Run', 'geodirectory');?>" class="button-primary geodir_diagnosis_button" data-diagnose="load_db_language"/>
1710
+						<input type="button" value="<?php _e('Run', 'geodirectory'); ?>" class="button-primary geodir_diagnosis_button" data-diagnose="load_db_language"/>
1711 1711
 					</td>
1712 1712
 				</tr>
1713 1713
                 <?php
@@ -1717,7 +1717,7 @@  discard block
 block discarded – undo
1717 1717
                  * Called after the last setting on the GD>Tools page.
1718 1718
                  * @since 1.0.0
1719 1719
                  */
1720
-                do_action('geodir_diagnostic_tool');?>
1720
+                do_action('geodir_diagnostic_tool'); ?>
1721 1721
 
1722 1722
                 </tbody>
1723 1723
             </table>
Please login to merge, or discard this patch.
tests/test-GeoDirectory.php 4 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -956,6 +956,9 @@  discard block
 block discarded – undo
956 956
         flush_rewrite_rules( true );
957 957
     }
958 958
 
959
+    /**
960
+     * @param string $widget
961
+     */
959 962
     function the_widget_form( $widget, $instance = array() ) {
960 963
         global $wp_widget_factory;
961 964
 
@@ -968,6 +971,9 @@  discard block
 block discarded – undo
968 971
         $widget_obj->form($instance);
969 972
     }
970 973
 
974
+    /**
975
+     * @param string $widget
976
+     */
971 977
     function the_widget_form_update( $widget, $new_instance = array(), $old_instance = array() ) {
972 978
         global $wp_widget_factory;
973 979
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -167,8 +167,9 @@  discard block
 block discarded – undo
167 167
         $geodir_is_widget_listing = false;
168 168
 
169 169
         $GLOBALS['post'] = $current_post;
170
-        if (!empty($current_post))
171
-            setup_postdata($current_post);
170
+        if (!empty($current_post)) {
171
+                    setup_postdata($current_post);
172
+        }
172 173
         $map_jason = $current_map_jason;
173 174
         $map_canvas_arr = $current_map_canvas_arr;
174 175
 
@@ -916,8 +917,10 @@  discard block
 block discarded – undo
916 917
         elseif ( is_date()		   && $template = get_date_template()		   ) :
917 918
         elseif ( is_archive()		&& $template = get_archive_template()		) :
918 919
         elseif ( is_paged()		  && $template = get_paged_template()		  ) :
919
-        else :
920
+        else {
921
+        	:
920 922
             $template = get_index_template();
923
+        }
921 924
         endif;
922 925
         /**
923 926
          * Filter the path of the current template before including it.
Please login to merge, or discard this patch.
Spacing   +134 added lines, -134 removed lines patch added patch discarded remove patch
@@ -16,15 +16,15 @@  discard block
 block discarded – undo
16 16
             'posts_per_page' => 1,
17 17
         );
18 18
 
19
-        $all_posts = new WP_Query( $query_args );
19
+        $all_posts = new WP_Query($query_args);
20 20
         $post_id = null;
21
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
21
+        while ($all_posts->have_posts()) : $all_posts->the_post();
22 22
             $post_id = get_the_ID();
23 23
         endwhile;
24 24
 
25 25
         $this->assertTrue(is_int($post_id));
26 26
 
27
-        $this->go_to( get_permalink($post_id) );
27
+        $this->go_to(get_permalink($post_id));
28 28
 
29 29
         ob_start();
30 30
         geodir_breadcrumb();
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 //            'before_title' => '<ul>',
120 120
 //            'after_title' => '<ul>'
121 121
 //        );
122
-        include_once geodir_plugin_path() . "/geodirectory-widgets/geodirectory_cpt_categories_widget.php";
122
+        include_once geodir_plugin_path()."/geodirectory-widgets/geodirectory_cpt_categories_widget.php";
123 123
         $params = array(
124 124
             'title' => '',
125 125
             'post_type' => array(), // NULL for all
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
     public function testRegTemplate() {
178 178
 //        var_dump(geodir_login_page_id());
179 179
         wp_set_current_user(0);
180
-        $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php';
180
+        $template = geodir_plugin_path().'/geodirectory-templates/geodir-signup.php';
181 181
 
182 182
         ob_start();
183 183
         include($template);
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         global $information;
192 192
         $information = "hello world";
193 193
 
194
-        $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
194
+        $template = geodir_plugin_path().'/geodirectory-templates/geodir-information.php';
195 195
 
196 196
         ob_start();
197 197
         include($template);
@@ -209,9 +209,9 @@  discard block
 block discarded – undo
209 209
             'posts_per_page' => 1,
210 210
         );
211 211
 
212
-        $all_posts = new WP_Query( $query_args );
212
+        $all_posts = new WP_Query($query_args);
213 213
         $post_id = null;
214
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
214
+        while ($all_posts->have_posts()) : $all_posts->the_post();
215 215
             $post_id = get_the_ID();
216 216
         endwhile;
217 217
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         $_REQUEST['listing_type'] = 'gd_place';
221 221
         $_REQUEST['pid'] = $post_id;
222 222
         ob_start();
223
-        $this->go_to( get_permalink(geodir_success_page_id()) );
223
+        $this->go_to(get_permalink(geodir_success_page_id()));
224 224
         $this->load_template();
225 225
         $output = ob_get_contents();
226 226
         ob_end_clean();
@@ -236,9 +236,9 @@  discard block
 block discarded – undo
236 236
             'posts_per_page' => 1,
237 237
         );
238 238
 
239
-        $all_posts = new WP_Query( $query_args );
239
+        $all_posts = new WP_Query($query_args);
240 240
         $post_id = null;
241
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
241
+        while ($all_posts->have_posts()) : $all_posts->the_post();
242 242
             $post_id = get_the_ID();
243 243
         endwhile;
244 244
 
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
         );
271 271
 
272 272
         ob_start();
273
-        $this->go_to( get_permalink(geodir_preview_page_id()) );
273
+        $this->go_to(get_permalink(geodir_preview_page_id()));
274 274
         $this->load_template();
275 275
         $output = ob_get_contents();
276 276
         ob_end_clean();
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         wp_set_current_user(1);
282 282
 
283 283
         ob_start();
284
-        $this->go_to( get_permalink(geodir_add_listing_page_id()) );
284
+        $this->go_to(get_permalink(geodir_add_listing_page_id()));
285 285
         $this->load_template();
286 286
         $output = ob_get_contents();
287 287
         ob_end_clean();
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
         wp_set_current_user(1);
293 293
 
294 294
         ob_start();
295
-        $this->go_to( get_permalink(geodir_location_page_id()) );
295
+        $this->go_to(get_permalink(geodir_location_page_id()));
296 296
         $this->load_template();
297 297
         $output = ob_get_contents();
298 298
         ob_end_clean();
@@ -307,15 +307,15 @@  discard block
 block discarded – undo
307 307
 
308 308
         $this->setPermalinkStructure();
309 309
 
310
-        $homepage = get_page_by_title( 'GD Home page' );
311
-        if ( $homepage )
310
+        $homepage = get_page_by_title('GD Home page');
311
+        if ($homepage)
312 312
         {
313
-            update_option( 'page_on_front', $homepage->ID );
314
-            update_option( 'show_on_front', 'page' );
313
+            update_option('page_on_front', $homepage->ID);
314
+            update_option('show_on_front', 'page');
315 315
         }
316 316
 
317 317
         ob_start();
318
-        $this->go_to( home_url('/') );
318
+        $this->go_to(home_url('/'));
319 319
         $this->load_template();
320 320
         $output = ob_get_contents();
321 321
         ob_end_clean();
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 
324 324
 
325 325
         ob_start();
326
-        $this->go_to( home_url('/?post_type=gd_place') );
326
+        $this->go_to(home_url('/?post_type=gd_place'));
327 327
         $this->load_template();
328 328
         $output = ob_get_contents();
329 329
         ob_end_clean();
@@ -335,9 +335,9 @@  discard block
 block discarded – undo
335 335
             'posts_per_page' => 1,
336 336
         );
337 337
 
338
-        $all_posts = new WP_Query( $query_args );
338
+        $all_posts = new WP_Query($query_args);
339 339
         $post_id = null;
340
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
340
+        while ($all_posts->have_posts()) : $all_posts->the_post();
341 341
             $post_id = get_the_ID();
342 342
         endwhile;
343 343
 
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
         global $preview;
347 347
         $preview = false;
348 348
         ob_start();
349
-        $this->go_to( get_permalink($post_id) );
349
+        $this->go_to(get_permalink($post_id));
350 350
         $this->load_template();
351 351
         $output = ob_get_contents();
352 352
         ob_end_clean();
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
         ob_start();
356 356
         $_REQUEST['stype'] = 'gd_place';
357 357
         $_REQUEST['geodir_dashbord'] = true;
358
-        $this->go_to( get_author_posts_url($user_id) );
358
+        $this->go_to(get_author_posts_url($user_id));
359 359
         $this->load_template();
360 360
         $output = ob_get_contents();
361 361
         ob_end_clean();
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
         ob_start();
368 368
         $_REQUEST['geodir_search'] = "1";
369 369
         $_REQUEST['stype'] = 'gd_place';
370
-        $this->go_to( home_url('/?geodir_search=1&stype=gd_place&s=test&snear=&sgeo_lat=&sgeo_lon=') );
370
+        $this->go_to(home_url('/?geodir_search=1&stype=gd_place&s=test&snear=&sgeo_lat=&sgeo_lon='));
371 371
         $this->load_template();
372 372
         $output = ob_get_contents();
373 373
         ob_end_clean();
@@ -383,9 +383,9 @@  discard block
 block discarded – undo
383 383
             'posts_per_page' => 1,
384 384
         );
385 385
 
386
-        $all_posts = new WP_Query( $query_args );
386
+        $all_posts = new WP_Query($query_args);
387 387
         $post_id = null;
388
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
388
+        while ($all_posts->have_posts()) : $all_posts->the_post();
389 389
             $post_id = get_the_ID();
390 390
         endwhile;
391 391
 
@@ -413,9 +413,9 @@  discard block
 block discarded – undo
413 413
             'posts_per_page' => 1,
414 414
         );
415 415
 
416
-        $all_posts = new WP_Query( $query_args );
416
+        $all_posts = new WP_Query($query_args);
417 417
         $post_id = null;
418
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
418
+        while ($all_posts->have_posts()) : $all_posts->the_post();
419 419
             $post_id = get_the_ID();
420 420
         endwhile;
421 421
 
@@ -436,23 +436,23 @@  discard block
 block discarded – undo
436 436
         $menuname = 'Primary Menu';
437 437
         $menulocation = 'primary';
438 438
         // Does the menu exist already?
439
-        $menu_exists = wp_get_nav_menu_object( $menuname );
439
+        $menu_exists = wp_get_nav_menu_object($menuname);
440 440
 
441 441
         // If it doesn't exist, let's create it.
442
-        if( !$menu_exists){
442
+        if (!$menu_exists) {
443 443
             $menu_id = wp_create_nav_menu($menuname);
444 444
 
445 445
             // Set up default BuddyPress links and add them to the menu.
446 446
             wp_update_nav_menu_item($menu_id, 0, array(
447 447
                 'menu-item-title' =>  __('Home'),
448 448
                 'menu-item-classes' => 'home',
449
-                'menu-item-url' => home_url( '/' ),
449
+                'menu-item-url' => home_url('/'),
450 450
                 'menu-item-status' => 'publish'));
451 451
 
452
-            if( !has_nav_menu( $menulocation ) ){
452
+            if (!has_nav_menu($menulocation)) {
453 453
                 $locations = get_theme_mod('nav_menu_locations');
454 454
                 $locations[$menulocation] = $menu_id;
455
-                set_theme_mod( 'nav_menu_locations', $locations );
455
+                set_theme_mod('nav_menu_locations', $locations);
456 456
             }
457 457
 
458 458
             update_option('geodir_theme_location_nav', array('primary'));
@@ -469,20 +469,20 @@  discard block
 block discarded – undo
469 469
     }
470 470
 
471 471
     public function testBestOfWidget() {
472
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php';
472
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_bestof_widget.php';
473 473
         include_once($template);
474 474
 
475 475
         ob_start();
476 476
         $instance = array();
477 477
         $instance['use_viewing_post_type'] = '1';
478 478
         $instance['excerpt_type'] = 'show-reviews';
479
-        the_widget( 'geodir_bestof_widget' );
479
+        the_widget('geodir_bestof_widget');
480 480
         $output = ob_get_contents();
481 481
         ob_end_clean();
482 482
         $this->assertContains('bestof-widget-tab-layout', $output);
483 483
 
484 484
         ob_start();
485
-        $this->the_widget_form( 'geodir_bestof_widget' );
485
+        $this->the_widget_form('geodir_bestof_widget');
486 486
         $output = ob_get_contents();
487 487
         ob_end_clean();
488 488
         $this->assertContains('Number of categories', $output);
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
             'excerpt_type' => 'show-desc',
499 499
             'use_viewing_post_type' => '1'
500 500
         );
501
-        $output = $this->the_widget_form_update( 'geodir_bestof_widget', $new_instance );
501
+        $output = $this->the_widget_form_update('geodir_bestof_widget', $new_instance);
502 502
         $this->assertContains('20', $output['character_count']);
503 503
 
504 504
         ob_start();
@@ -510,17 +510,17 @@  discard block
 block discarded – undo
510 510
     }
511 511
 
512 512
     public function testCptCatsWidget() {
513
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_cpt_categories_widget.php';
513
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_cpt_categories_widget.php';
514 514
         include_once($template);
515 515
 
516 516
         ob_start();
517
-        the_widget( 'geodir_cpt_categories_widget' );
517
+        the_widget('geodir_cpt_categories_widget');
518 518
         $output = ob_get_contents();
519 519
         ob_end_clean();
520 520
         $this->assertContains('geodir_cpt_categories_widget', $output);
521 521
 
522 522
         ob_start();
523
-        $this->the_widget_form( 'geodir_cpt_categories_widget' );
523
+        $this->the_widget_form('geodir_cpt_categories_widget');
524 524
         $output = ob_get_contents();
525 525
         ob_end_clean();
526 526
         $this->assertContains('Select CPT', $output);
@@ -536,13 +536,13 @@  discard block
 block discarded – undo
536 536
             'max_count' => 'all',
537 537
             'max_level' => '1'
538 538
         );
539
-        $output = $this->the_widget_form_update( 'geodir_cpt_categories_widget', $new_instance );
539
+        $output = $this->the_widget_form_update('geodir_cpt_categories_widget', $new_instance);
540 540
         $this->assertContains('count', $output['sort_by']);
541 541
 
542 542
     }
543 543
 
544 544
     public function testFeaturesWidget() {
545
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_features_widget.php';
545
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_features_widget.php';
546 546
         include_once($template);
547 547
 
548 548
         $instance = array(
@@ -554,13 +554,13 @@  discard block
 block discarded – undo
554 554
         );
555 555
 
556 556
         ob_start();
557
-        the_widget( 'Geodir_Features_Widget', $instance);
557
+        the_widget('Geodir_Features_Widget', $instance);
558 558
         $output = ob_get_contents();
559 559
         ob_end_clean();
560 560
         $this->assertContains('widget_gd_features', $output);
561 561
 
562 562
         ob_start();
563
-        $this->the_widget_form( 'Geodir_Features_Widget', $instance );
563
+        $this->the_widget_form('Geodir_Features_Widget', $instance);
564 564
         $output = ob_get_contents();
565 565
         ob_end_clean();
566 566
         $this->assertContains('Font Awesome Icon Color', $output);
@@ -572,23 +572,23 @@  discard block
 block discarded – undo
572 572
             'image1' => 'fa-recycle',
573 573
             'desc1' => 'cool',
574 574
         );
575
-        $output = $this->the_widget_form_update( 'Geodir_Features_Widget', $new_instance );
575
+        $output = $this->the_widget_form_update('Geodir_Features_Widget', $new_instance);
576 576
         $this->assertContains('Features', $output['title']);
577 577
 
578 578
     }
579 579
 
580 580
     public function testSliderWidget() {
581
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_listing_slider_widget.php';
581
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_listing_slider_widget.php';
582 582
         include_once($template);
583 583
 
584 584
         ob_start();
585
-        the_widget( 'geodir_listing_slider_widget' );
585
+        the_widget('geodir_listing_slider_widget');
586 586
         $output = ob_get_contents();
587 587
         ob_end_clean();
588 588
         $this->assertContains('geodir_listing_slider_view', $output);
589 589
 
590 590
         ob_start();
591
-        $this->the_widget_form( 'geodir_listing_slider_widget' );
591
+        $this->the_widget_form('geodir_listing_slider_widget');
592 592
         $output = ob_get_contents();
593 593
         ob_end_clean();
594 594
         $this->assertContains('Slide Show Speed', $output);
@@ -610,23 +610,23 @@  discard block
 block discarded – undo
610 610
             'list_sort' => 'latest',
611 611
             'show_featured_only' => '',
612 612
         );
613
-        $output = $this->the_widget_form_update( 'geodir_listing_slider_widget', $new_instance );
613
+        $output = $this->the_widget_form_update('geodir_listing_slider_widget', $new_instance);
614 614
         $this->assertContains('latest', $output['list_sort']);
615 615
 
616 616
     }
617 617
 
618 618
     public function testPopularWidget() {
619
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_popular_widget.php';
619
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_popular_widget.php';
620 620
         include_once($template);
621 621
 
622 622
         ob_start();
623
-        the_widget( 'geodir_popular_post_category' );
623
+        the_widget('geodir_popular_post_category');
624 624
         $output = ob_get_contents();
625 625
         ob_end_clean();
626 626
         $this->assertContains('geodir_popular_post_category', $output);
627 627
 
628 628
         ob_start();
629
-        $this->the_widget_form( 'geodir_popular_post_category' );
629
+        $this->the_widget_form('geodir_popular_post_category');
630 630
         $output = ob_get_contents();
631 631
         ob_end_clean();
632 632
         $this->assertContains('Default post type to use', $output);
@@ -636,19 +636,19 @@  discard block
 block discarded – undo
636 636
             'category_limit' => 15,
637 637
             'default_post_type' => ''
638 638
         );
639
-        $output = $this->the_widget_form_update( 'geodir_popular_post_category', $new_instance );
639
+        $output = $this->the_widget_form_update('geodir_popular_post_category', $new_instance);
640 640
         $this->assertEquals(15, $output['category_limit']);
641 641
 
642 642
         ob_start();
643 643
         $instance = array();
644 644
         $instance['category_title'] = '';
645
-        the_widget( 'geodir_popular_postview', $instance );
645
+        the_widget('geodir_popular_postview', $instance);
646 646
         $output = ob_get_contents();
647 647
         ob_end_clean();
648 648
         $this->assertContains('geodir_popular_post_view', $output);
649 649
 
650 650
         ob_start();
651
-        $this->the_widget_form( 'geodir_popular_postview' );
651
+        $this->the_widget_form('geodir_popular_postview');
652 652
         $output = ob_get_contents();
653 653
         ob_end_clean();
654 654
         $this->assertContains('Post Category', $output);
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
             'with_videos_only' => '',
672 672
             'use_viewing_post_type' => ''
673 673
         );
674
-        $output = $this->the_widget_form_update( 'geodir_popular_postview', $new_instance );
674
+        $output = $this->the_widget_form_update('geodir_popular_postview', $new_instance);
675 675
         $this->assertContains('gridview_onehalf', $output['layout']);
676 676
 
677 677
     }
@@ -683,9 +683,9 @@  discard block
 block discarded – undo
683 683
             'posts_per_page' => 1,
684 684
         );
685 685
 
686
-        $all_posts = new WP_Query( $query_args );
686
+        $all_posts = new WP_Query($query_args);
687 687
         $post_id = null;
688
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
688
+        while ($all_posts->have_posts()) : $all_posts->the_post();
689 689
             global $post;
690 690
             $post_id = get_the_ID();
691 691
             $post = geodir_get_post_info($post->ID);
@@ -693,17 +693,17 @@  discard block
 block discarded – undo
693 693
 //            $term_list = wp_get_post_terms($post->ID, 'gd_placecategory');
694 694
 //            $post->gd_placecategory = (string) $term_list[0]->term_id;
695 695
 
696
-            $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_related_listing_widget.php';
696
+            $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_related_listing_widget.php';
697 697
             include_once($template);
698 698
 
699 699
             ob_start();
700
-            the_widget( 'geodir_related_listing_postview' );
700
+            the_widget('geodir_related_listing_postview');
701 701
             $output = ob_get_contents();
702 702
             ob_end_clean();
703 703
             $this->assertContains('Related Listing', $output);
704 704
 
705 705
             ob_start();
706
-            $this->the_widget_form( 'geodir_related_listing_postview' );
706
+            $this->the_widget_form('geodir_related_listing_postview');
707 707
             $output = ob_get_contents();
708 708
             ob_end_clean();
709 709
             $this->assertContains('Relate to', $output);
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
                 'add_location_filter' => '1',
720 720
                 'character_count' => '20'
721 721
             );
722
-            $output = $this->the_widget_form_update( 'geodir_related_listing_postview', $new_instance );
722
+            $output = $this->the_widget_form_update('geodir_related_listing_postview', $new_instance);
723 723
             $this->assertContains('gridview_onehalf', $output['layout']);
724 724
         endwhile;
725 725
 
@@ -775,17 +775,17 @@  discard block
 block discarded – undo
775 775
 
776 776
         $this->assertTrue(is_int($comment_id));
777 777
 
778
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_reviews_widget.php';
778
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_reviews_widget.php';
779 779
         include_once($template);
780 780
 
781 781
         ob_start();
782
-        the_widget( 'geodir_recent_reviews_widget' );
782
+        the_widget('geodir_recent_reviews_widget');
783 783
         $output = ob_get_contents();
784 784
         ob_end_clean();
785 785
         $this->assertContains('geodir_recent_reviews', $output);
786 786
 
787 787
         ob_start();
788
-        $this->the_widget_form( 'geodir_recent_reviews_widget' );
788
+        $this->the_widget_form('geodir_recent_reviews_widget');
789 789
         $output = ob_get_contents();
790 790
         ob_end_clean();
791 791
         $this->assertContains('Number of Reviews', $output);
@@ -798,25 +798,25 @@  discard block
 block discarded – undo
798 798
             'img1' => '',
799 799
             'count' => ''
800 800
         );
801
-        $output = $this->the_widget_form_update( 'geodir_recent_reviews_widget', $new_instance );
801
+        $output = $this->the_widget_form_update('geodir_recent_reviews_widget', $new_instance);
802 802
         $this->assertTrue(empty($output['count']));
803 803
     }
804 804
 
805 805
     public function testHomeMapWidget() {
806
-        $template = geodir_plugin_path() . '/geodirectory-widgets/home_map_widget.php';
806
+        $template = geodir_plugin_path().'/geodirectory-widgets/home_map_widget.php';
807 807
         include_once($template);
808 808
 
809 809
         ob_start();
810 810
         $instance = array();
811 811
         $args = array();
812 812
         $args["widget_id"] = "geodir_map_v3_home_map-2";
813
-        the_widget( 'geodir_homepage_map', $instance, $args );
813
+        the_widget('geodir_homepage_map', $instance, $args);
814 814
         $output = ob_get_contents();
815 815
         ob_end_clean();
816 816
         $this->assertContains('geodir-map-home-page', $output);
817 817
 
818 818
         ob_start();
819
-        $this->the_widget_form( 'geodir_homepage_map' );
819
+        $this->the_widget_form('geodir_homepage_map');
820 820
         $output = ob_get_contents();
821 821
         ob_end_clean();
822 822
         $this->assertContains('Map Zoom level', $output);
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
             'child_collapse' => '0',
831 831
             'scrollwheel' => '0'
832 832
         );
833
-        $output = $this->the_widget_form_update( 'geodir_homepage_map', $new_instance );
833
+        $output = $this->the_widget_form_update('geodir_homepage_map', $new_instance);
834 834
         $this->assertContains('0', $output['scrollwheel']);
835 835
 
836 836
     }
@@ -840,13 +840,13 @@  discard block
 block discarded – undo
840 840
         register_geodir_widgets();
841 841
 
842 842
         ob_start();
843
-        the_widget( 'geodir_loginwidget' );
843
+        the_widget('geodir_loginwidget');
844 844
         $output = ob_get_contents();
845 845
         ob_end_clean();
846 846
         $this->assertContains('geodir_loginbox', $output);
847 847
 
848 848
         ob_start();
849
-        $this->the_widget_form( 'geodir_loginwidget' );
849
+        $this->the_widget_form('geodir_loginwidget');
850 850
         $output = ob_get_contents();
851 851
         ob_end_clean();
852 852
         $this->assertContains('Widget Title', $output);
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
             'img1' => '',
860 860
             'desc1' => ''
861 861
         );
862
-        $output = $this->the_widget_form_update( 'geodir_loginwidget', $new_instance );
862
+        $output = $this->the_widget_form_update('geodir_loginwidget', $new_instance);
863 863
         $this->assertContains('Login', $output['title']);
864 864
 
865 865
     }
@@ -867,13 +867,13 @@  discard block
 block discarded – undo
867 867
     public function testSocialWidget() {
868 868
 
869 869
         ob_start();
870
-        the_widget( 'geodir_social_like_widget' );
870
+        the_widget('geodir_social_like_widget');
871 871
         $output = ob_get_contents();
872 872
         ob_end_clean();
873 873
         $this->assertContains('twitter.com', $output);
874 874
 
875 875
         ob_start();
876
-        $this->the_widget_form( 'geodir_social_like_widget' );
876
+        $this->the_widget_form('geodir_social_like_widget');
877 877
         $output = ob_get_contents();
878 878
         ob_end_clean();
879 879
         $this->assertContains('No settings for this widget', $output);
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
         $new_instance = array(
882 882
             'title' => 'Social',
883 883
         );
884
-        $output = $this->the_widget_form_update( 'geodir_social_like_widget', $new_instance );
884
+        $output = $this->the_widget_form_update('geodir_social_like_widget', $new_instance);
885 885
         $this->assertContains('Social', $output['title']);
886 886
 
887 887
     }
@@ -889,13 +889,13 @@  discard block
 block discarded – undo
889 889
     public function testSubscribeWidget() {
890 890
 
891 891
         ob_start();
892
-        the_widget( 'geodirsubscribeWidget' );
892
+        the_widget('geodirsubscribeWidget');
893 893
         $output = ob_get_contents();
894 894
         ob_end_clean();
895 895
         $this->assertContains('geodir-subscribe-form', $output);
896 896
 
897 897
         ob_start();
898
-        $this->the_widget_form( 'geodirsubscribeWidget' );
898
+        $this->the_widget_form('geodirsubscribeWidget');
899 899
         $output = ob_get_contents();
900 900
         ob_end_clean();
901 901
         $this->assertContains('Feedburner ID', $output);
@@ -910,7 +910,7 @@  discard block
 block discarded – undo
910 910
             'digg' => '',
911 911
             'myspace' => ''
912 912
         );
913
-        $output = $this->the_widget_form_update( 'geodirsubscribeWidget', $new_instance );
913
+        $output = $this->the_widget_form_update('geodirsubscribeWidget', $new_instance);
914 914
         $this->assertContains('Subscribe', $output['title']);
915 915
 
916 916
     }
@@ -920,13 +920,13 @@  discard block
 block discarded – undo
920 920
         ob_start();
921 921
         $instance = array();
922 922
         $instance['desc1'] = 'hello';
923
-        the_widget( 'geodiradvtwidget', $instance );
923
+        the_widget('geodiradvtwidget', $instance);
924 924
         $output = ob_get_contents();
925 925
         ob_end_clean();
926 926
         $this->assertContains('hello', $output);
927 927
 
928 928
         ob_start();
929
-        $this->the_widget_form( 'geodiradvtwidget' );
929
+        $this->the_widget_form('geodiradvtwidget');
930 930
         $output = ob_get_contents();
931 931
         ob_end_clean();
932 932
         $this->assertContains('Your Advt code', $output);
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
         $new_instance = array(
935 935
             'desc1' => 'Advertise'
936 936
         );
937
-        $output = $this->the_widget_form_update( 'geodiradvtwidget', $new_instance );
937
+        $output = $this->the_widget_form_update('geodiradvtwidget', $new_instance);
938 938
         $this->assertContains('Advertise', $output['desc1']);
939 939
 
940 940
     }
@@ -942,13 +942,13 @@  discard block
 block discarded – undo
942 942
     public function testFlickrWidget() {
943 943
 
944 944
         ob_start();
945
-        the_widget( 'GeodirFlickrWidget' );
945
+        the_widget('GeodirFlickrWidget');
946 946
         $output = ob_get_contents();
947 947
         ob_end_clean();
948 948
         $this->assertContains('geodir-flickr', $output);
949 949
 
950 950
         ob_start();
951
-        $this->the_widget_form( 'GeodirFlickrWidget' );
951
+        $this->the_widget_form('GeodirFlickrWidget');
952 952
         $output = ob_get_contents();
953 953
         ob_end_clean();
954 954
         $this->assertContains('Flickr ID', $output);
@@ -957,7 +957,7 @@  discard block
 block discarded – undo
957 957
             'id' => '',
958 958
             'number' => '34'
959 959
         );
960
-        $output = $this->the_widget_form_update( 'GeodirFlickrWidget', $new_instance );
960
+        $output = $this->the_widget_form_update('GeodirFlickrWidget', $new_instance);
961 961
         $this->assertContains('34', $output['number']);
962 962
 
963 963
     }
@@ -967,13 +967,13 @@  discard block
 block discarded – undo
967 967
         ob_start();
968 968
         $instance = array();
969 969
         $instance['gd_tw_desc1'] = 'hello';
970
-        the_widget( 'geodir_twitter', $instance );
970
+        the_widget('geodir_twitter', $instance);
971 971
         $output = ob_get_contents();
972 972
         ob_end_clean();
973 973
         $this->assertContains('hello', $output);
974 974
 
975 975
         ob_start();
976
-        $this->the_widget_form( 'geodir_twitter' );
976
+        $this->the_widget_form('geodir_twitter');
977 977
         $output = ob_get_contents();
978 978
         ob_end_clean();
979 979
         $this->assertContains('Your twitter code', $output);
@@ -981,7 +981,7 @@  discard block
 block discarded – undo
981 981
         $new_instance = array(
982 982
             'gd_tw_desc1' => 'hello'
983 983
         );
984
-        $output = $this->the_widget_form_update( 'geodir_twitter', $new_instance );
984
+        $output = $this->the_widget_form_update('geodir_twitter', $new_instance);
985 985
         $this->assertContains('hello', $output['gd_tw_desc1']);
986 986
 
987 987
     }
@@ -989,13 +989,13 @@  discard block
 block discarded – undo
989 989
     public function testAdvSearchWidget() {
990 990
 
991 991
         ob_start();
992
-        the_widget( 'geodir_advance_search_widget' );
992
+        the_widget('geodir_advance_search_widget');
993 993
         $output = ob_get_contents();
994 994
         ob_end_clean();
995 995
         $this->assertContains('geodir-loc-bar', $output);
996 996
 
997 997
         ob_start();
998
-        $this->the_widget_form( 'geodir_advance_search_widget' );
998
+        $this->the_widget_form('geodir_advance_search_widget');
999 999
         $output = ob_get_contents();
1000 1000
         ob_end_clean();
1001 1001
         $this->assertContains('This is a search widget', $output);
@@ -1009,17 +1009,17 @@  discard block
 block discarded – undo
1009 1009
 
1010 1010
     public function testListingMapWidget() {
1011 1011
 
1012
-        $template = geodir_plugin_path() . '/geodirectory-widgets/listing_map_widget.php';
1012
+        $template = geodir_plugin_path().'/geodirectory-widgets/listing_map_widget.php';
1013 1013
         include_once($template);
1014 1014
 
1015 1015
         //listing page
1016
-        $this->go_to( home_url('/?post_type=gd_place') );
1016
+        $this->go_to(home_url('/?post_type=gd_place'));
1017 1017
 
1018 1018
         ob_start();
1019 1019
         $instance = array();
1020 1020
         $args = array();
1021 1021
         $args["widget_id"] = "geodir_map_v3_listing_map-2";
1022
-        the_widget( 'geodir_map_listingpage', $instance, $args );
1022
+        the_widget('geodir_map_listingpage', $instance, $args);
1023 1023
         $output = ob_get_contents();
1024 1024
         ob_end_clean();
1025 1025
         $this->assertContains('geodir-map-listing-page', $output);
@@ -1031,27 +1031,27 @@  discard block
 block discarded – undo
1031 1031
             'posts_per_page' => 1,
1032 1032
         );
1033 1033
 
1034
-        $all_posts = new WP_Query( $query_args );
1034
+        $all_posts = new WP_Query($query_args);
1035 1035
         $post_id = null;
1036
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
1036
+        while ($all_posts->have_posts()) : $all_posts->the_post();
1037 1037
             $post_id = get_the_ID();
1038 1038
         endwhile;
1039 1039
 
1040 1040
         $this->assertTrue(is_int($post_id));
1041 1041
 
1042
-        $this->go_to( get_permalink($post_id) );
1042
+        $this->go_to(get_permalink($post_id));
1043 1043
 
1044 1044
         ob_start();
1045 1045
         $instance = array();
1046 1046
         $args = array();
1047 1047
         $args["widget_id"] = "geodir_map_v3_listing_map-2";
1048
-        the_widget( 'geodir_map_listingpage', $instance, $args );
1048
+        the_widget('geodir_map_listingpage', $instance, $args);
1049 1049
         $output = ob_get_contents();
1050 1050
         ob_end_clean();
1051 1051
         $this->assertContains('geodir-map-listing-page', $output);
1052 1052
 
1053 1053
         ob_start();
1054
-        $this->the_widget_form( 'geodir_map_listingpage' );
1054
+        $this->the_widget_form('geodir_map_listingpage');
1055 1055
         $output = ob_get_contents();
1056 1056
         ob_end_clean();
1057 1057
         $this->assertContains('Select Map View', $output);
@@ -1066,31 +1066,31 @@  discard block
 block discarded – undo
1066 1066
             'scrollwheel' => '0',
1067 1067
             'showall' => '0'
1068 1068
         );
1069
-        $output = $this->the_widget_form_update( 'geodir_map_listingpage', $new_instance );
1069
+        $output = $this->the_widget_form_update('geodir_map_listingpage', $new_instance);
1070 1070
         $this->assertContains('0', $output['scrollwheel']);
1071 1071
 
1072 1072
 
1073 1073
     }
1074 1074
 
1075 1075
     private function load_template() {
1076
-        do_action( 'template_redirect' );
1076
+        do_action('template_redirect');
1077 1077
         $template = false;
1078
-        if	 ( is_404()			&& $template = get_404_template()			) :
1079
-        elseif ( is_search()		 && $template = get_search_template()		 ) :
1080
-        elseif ( is_front_page()	 && $template = get_front_page_template()	 ) :
1081
-        elseif ( is_home()		   && $template = get_home_template()		   ) :
1082
-        elseif ( is_post_type_archive() && $template = get_post_type_archive_template() ) :
1083
-        elseif ( is_tax()			&& $template = get_taxonomy_template()	   ) :
1084
-        elseif ( is_attachment()	 && $template = get_attachment_template()	 ) :
1078
+        if (is_404() && $template = get_404_template()) :
1079
+        elseif (is_search() && $template = get_search_template()) :
1080
+        elseif (is_front_page() && $template = get_front_page_template()) :
1081
+        elseif (is_home() && $template = get_home_template()) :
1082
+        elseif (is_post_type_archive() && $template = get_post_type_archive_template()) :
1083
+        elseif (is_tax() && $template = get_taxonomy_template()) :
1084
+        elseif (is_attachment() && $template = get_attachment_template()) :
1085 1085
             remove_filter('the_content', 'prepend_attachment');
1086
-        elseif ( is_single()		 && $template = get_single_template()		 ) :
1087
-        elseif ( is_page()		   && $template = get_page_template()		   ) :
1088
-        elseif ( is_category()	   && $template = get_category_template()	   ) :
1089
-        elseif ( is_tag()			&& $template = get_tag_template()			) :
1090
-        elseif ( is_author()		 && $template = get_author_template()		 ) :
1091
-        elseif ( is_date()		   && $template = get_date_template()		   ) :
1092
-        elseif ( is_archive()		&& $template = get_archive_template()		) :
1093
-        elseif ( is_paged()		  && $template = get_paged_template()		  ) :
1086
+        elseif (is_single() && $template = get_single_template()) :
1087
+        elseif (is_page() && $template = get_page_template()) :
1088
+        elseif (is_category() && $template = get_category_template()) :
1089
+        elseif (is_tag() && $template = get_tag_template()) :
1090
+        elseif (is_author() && $template = get_author_template()) :
1091
+        elseif (is_date() && $template = get_date_template()) :
1092
+        elseif (is_archive() && $template = get_archive_template()) :
1093
+        elseif (is_paged() && $template = get_paged_template()) :
1094 1094
         else :
1095 1095
             $template = get_index_template();
1096 1096
         endif;
@@ -1101,21 +1101,21 @@  discard block
 block discarded – undo
1101 1101
          *
1102 1102
          * @param string $template The path of the template to include.
1103 1103
          */
1104
-        if ( $template = apply_filters( 'template_include', $template ) ) {
1105
-            $template_contents = file_get_contents( $template );
1104
+        if ($template = apply_filters('template_include', $template)) {
1105
+            $template_contents = file_get_contents($template);
1106 1106
             $included_header = $included_footer = false;
1107
-            if ( false !== stripos( $template_contents, 'get_header();' ) ) {
1108
-                do_action( 'get_header', null );
1109
-                locate_template( 'header.php', true, false );
1107
+            if (false !== stripos($template_contents, 'get_header();')) {
1108
+                do_action('get_header', null);
1109
+                locate_template('header.php', true, false);
1110 1110
                 $included_header = true;
1111 1111
             }
1112
-            include( $template );
1113
-            if ( false !== stripos( $template_contents, 'get_footer();' ) ) {
1114
-                do_action( 'get_footer', null );
1115
-                locate_template( 'footer.php', true, false );
1112
+            include($template);
1113
+            if (false !== stripos($template_contents, 'get_footer();')) {
1114
+                do_action('get_footer', null);
1115
+                locate_template('footer.php', true, false);
1116 1116
                 $included_footer = true;
1117 1117
             }
1118
-            if ( $included_header && $included_footer ) {
1118
+            if ($included_header && $included_footer) {
1119 1119
                 global $wp_scripts;
1120 1120
                 $wp_scripts->done = array();
1121 1121
             }
@@ -1123,19 +1123,19 @@  discard block
 block discarded – undo
1123 1123
         return;
1124 1124
     }
1125 1125
 
1126
-    public static function setPermalinkStructure( $struc = '/%postname%/' ) {
1126
+    public static function setPermalinkStructure($struc = '/%postname%/') {
1127 1127
         global $wp_rewrite;
1128
-        $wp_rewrite->set_permalink_structure( $struc );
1128
+        $wp_rewrite->set_permalink_structure($struc);
1129 1129
         $wp_rewrite->flush_rules();
1130
-        update_option( 'permalink_structure', $struc );
1131
-        flush_rewrite_rules( true );
1130
+        update_option('permalink_structure', $struc);
1131
+        flush_rewrite_rules(true);
1132 1132
     }
1133 1133
 
1134
-    function the_widget_form( $widget, $instance = array() ) {
1134
+    function the_widget_form($widget, $instance = array()) {
1135 1135
         global $wp_widget_factory;
1136 1136
 
1137 1137
         $widget_obj = $wp_widget_factory->widgets[$widget];
1138
-        if ( ! ( $widget_obj instanceof WP_Widget ) ) {
1138
+        if (!($widget_obj instanceof WP_Widget)) {
1139 1139
             return;
1140 1140
         }
1141 1141
 
@@ -1143,11 +1143,11 @@  discard block
 block discarded – undo
1143 1143
         $widget_obj->form($instance);
1144 1144
     }
1145 1145
 
1146
-    function the_widget_form_update( $widget, $new_instance = array(), $old_instance = array() ) {
1146
+    function the_widget_form_update($widget, $new_instance = array(), $old_instance = array()) {
1147 1147
         global $wp_widget_factory;
1148 1148
 
1149 1149
         $widget_obj = $wp_widget_factory->widgets[$widget];
1150
-        if ( ! ( $widget_obj instanceof WP_Widget ) ) {
1150
+        if (!($widget_obj instanceof WP_Widget)) {
1151 1151
             return;
1152 1152
         }
1153 1153
 
Please login to merge, or discard this patch.
Indentation   +1142 added lines, -1142 removed lines patch added patch discarded remove patch
@@ -1,1164 +1,1164 @@
 block discarded – undo
1 1
 <?php
2 2
 class GeoDirectoryTests extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-        wp_set_current_user(1);
8
-
9
-        geodir_register_sidebar();
10
-    }
11
-
12
-    public function testBreadcrumbs() {
13
-        $query_args = array(
14
-            'post_status' => 'publish',
15
-            'post_type' => 'gd_place',
16
-            'posts_per_page' => 1,
17
-        );
18
-
19
-        $all_posts = new WP_Query( $query_args );
20
-        $post_id = null;
21
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
22
-            $post_id = get_the_ID();
23
-        endwhile;
24
-
25
-        $this->assertTrue(is_int($post_id));
26
-
27
-        $this->go_to( get_permalink($post_id) );
28
-
29
-        ob_start();
30
-        geodir_breadcrumb();
31
-        $output = ob_get_contents();
32
-        ob_end_clean();
33
-        $this->assertContains('Places', $output);
34
-    }
35
-
36
-    public function testAdminSettingForms() {
37
-        $_REQUEST['listing_type'] = 'gd_place';
38
-        ob_start();
39
-        geodir_admin_option_form('general_settings');
40
-        $output = ob_get_contents();
41
-        ob_end_clean();
42
-        $this->assertContains('General Options', $output);
43
-
44
-        ob_start();
45
-        geodir_admin_option_form('design_settings');
46
-        $output = ob_get_contents();
47
-        ob_end_clean();
48
-        $this->assertContains('Home Top Section Settings', $output);
49
-
50
-        ob_start();
51
-        geodir_admin_option_form('permalink_settings');
52
-        $output = ob_get_contents();
53
-        ob_end_clean();
54
-        $this->assertContains('Listing Detail Permalink Settings', $output);
55
-
56
-        ob_start();
57
-        geodir_admin_option_form('title_meta_settings');
58
-        $output = ob_get_contents();
59
-        ob_end_clean();
60
-        $this->assertContains('Homepage Meta Settings', $output);
61
-
62
-        ob_start();
63
-        geodir_admin_option_form('notifications_settings');
64
-        $output = ob_get_contents();
65
-        ob_end_clean();
66
-        $this->assertContains('Notification Options', $output);
67
-
68
-        ob_start();
69
-        geodir_admin_option_form('default_location_settings');
70
-        $output = ob_get_contents();
71
-        ob_end_clean();
72
-        $this->assertContains('Set Default Location', $output);
73
-
74
-        ob_start();
75
-        geodir_admin_option_form('tools_settings');
76
-        $output = ob_get_contents();
77
-        ob_end_clean();
78
-        $this->assertContains('GD Diagnostic Tools', $output);
79
-
80
-        ob_start();
81
-        geodir_admin_option_form('compatibility_settings');
82
-        $output = ob_get_contents();
83
-        ob_end_clean();
84
-        $this->assertContains('Theme Compatibility Settings', $output);
85
-
86
-        ob_start();
87
-        geodir_admin_option_form('import_export');
88
-        $output = ob_get_contents();
89
-        ob_end_clean();
90
-        $this->assertContains('GD Import & Export CSV', $output);
91
-
92
-        $_REQUEST['subtab'] = 'custom_fields';
93
-        ob_start();
94
-        geodir_admin_option_form('gd_place_fields_settings');
95
-        $output = ob_get_contents();
96
-        ob_end_clean();
97
-        $this->assertContains('general-form-builder-frame', $output);
98
-
99
-    }
100
-
101
-    public function testPopPostWidget() {
102
-        $args = array(
103
-            'before_widget' => '<ul>',
104
-            'after_widget' => '<ul>',
105
-            'before_title' => '<ul>',
106
-            'after_title' => '<ul>'
107
-        );
108
-        ob_start();
109
-        geodir_popular_post_category_output($args);
110
-        $output = ob_get_contents();
111
-        ob_end_clean();
112
-        $this->assertContains('Popular Categories', $output);
113
-    }
114
-
115
-    public function texstBestOfWidget() {
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+		wp_set_current_user(1);
8
+
9
+		geodir_register_sidebar();
10
+	}
11
+
12
+	public function testBreadcrumbs() {
13
+		$query_args = array(
14
+			'post_status' => 'publish',
15
+			'post_type' => 'gd_place',
16
+			'posts_per_page' => 1,
17
+		);
18
+
19
+		$all_posts = new WP_Query( $query_args );
20
+		$post_id = null;
21
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
22
+			$post_id = get_the_ID();
23
+		endwhile;
24
+
25
+		$this->assertTrue(is_int($post_id));
26
+
27
+		$this->go_to( get_permalink($post_id) );
28
+
29
+		ob_start();
30
+		geodir_breadcrumb();
31
+		$output = ob_get_contents();
32
+		ob_end_clean();
33
+		$this->assertContains('Places', $output);
34
+	}
35
+
36
+	public function testAdminSettingForms() {
37
+		$_REQUEST['listing_type'] = 'gd_place';
38
+		ob_start();
39
+		geodir_admin_option_form('general_settings');
40
+		$output = ob_get_contents();
41
+		ob_end_clean();
42
+		$this->assertContains('General Options', $output);
43
+
44
+		ob_start();
45
+		geodir_admin_option_form('design_settings');
46
+		$output = ob_get_contents();
47
+		ob_end_clean();
48
+		$this->assertContains('Home Top Section Settings', $output);
49
+
50
+		ob_start();
51
+		geodir_admin_option_form('permalink_settings');
52
+		$output = ob_get_contents();
53
+		ob_end_clean();
54
+		$this->assertContains('Listing Detail Permalink Settings', $output);
55
+
56
+		ob_start();
57
+		geodir_admin_option_form('title_meta_settings');
58
+		$output = ob_get_contents();
59
+		ob_end_clean();
60
+		$this->assertContains('Homepage Meta Settings', $output);
61
+
62
+		ob_start();
63
+		geodir_admin_option_form('notifications_settings');
64
+		$output = ob_get_contents();
65
+		ob_end_clean();
66
+		$this->assertContains('Notification Options', $output);
67
+
68
+		ob_start();
69
+		geodir_admin_option_form('default_location_settings');
70
+		$output = ob_get_contents();
71
+		ob_end_clean();
72
+		$this->assertContains('Set Default Location', $output);
73
+
74
+		ob_start();
75
+		geodir_admin_option_form('tools_settings');
76
+		$output = ob_get_contents();
77
+		ob_end_clean();
78
+		$this->assertContains('GD Diagnostic Tools', $output);
79
+
80
+		ob_start();
81
+		geodir_admin_option_form('compatibility_settings');
82
+		$output = ob_get_contents();
83
+		ob_end_clean();
84
+		$this->assertContains('Theme Compatibility Settings', $output);
85
+
86
+		ob_start();
87
+		geodir_admin_option_form('import_export');
88
+		$output = ob_get_contents();
89
+		ob_end_clean();
90
+		$this->assertContains('GD Import & Export CSV', $output);
91
+
92
+		$_REQUEST['subtab'] = 'custom_fields';
93
+		ob_start();
94
+		geodir_admin_option_form('gd_place_fields_settings');
95
+		$output = ob_get_contents();
96
+		ob_end_clean();
97
+		$this->assertContains('general-form-builder-frame', $output);
98
+
99
+	}
100
+
101
+	public function testPopPostWidget() {
102
+		$args = array(
103
+			'before_widget' => '<ul>',
104
+			'after_widget' => '<ul>',
105
+			'before_title' => '<ul>',
106
+			'after_title' => '<ul>'
107
+		);
108
+		ob_start();
109
+		geodir_popular_post_category_output($args);
110
+		$output = ob_get_contents();
111
+		ob_end_clean();
112
+		$this->assertContains('Popular Categories', $output);
113
+	}
114
+
115
+	public function texstBestOfWidget() {
116 116
 //        $args = array(
117 117
 //            'before_widget' => '<ul>',
118 118
 //            'after_widget' => '<ul>',
119 119
 //            'before_title' => '<ul>',
120 120
 //            'after_title' => '<ul>'
121 121
 //        );
122
-        include_once geodir_plugin_path() . "/geodirectory-widgets/geodirectory_cpt_categories_widget.php";
123
-        $params = array(
124
-            'title' => '',
125
-            'post_type' => array(), // NULL for all
126
-            'hide_empty' => '',
127
-            'show_count' => '',
128
-            'hide_icon' => '',
129
-            'cpt_left' => '',
130
-            'sort_by' => 'count',
131
-            'max_count' => 'all',
132
-            'max_level' => '1'
133
-        );
134
-        ob_start();
135
-        geodir_cpt_categories_output($params);
136
-        $output = ob_get_contents();
137
-        ob_end_clean();
138
-        $this->assertContains('gd-cptcat-title', $output);
139
-    }
140
-
141
-    public function testGDWidgetListView() {
142
-        global $gridview_columns_widget, $geodir_is_widget_listing;
143
-
144
-        $_REQUEST['sgeo_lat'] = '40.7127837';
145
-        $_REQUEST['sgeo_lon'] = '-74.00594130000002';
146
-        $query_args = array(
147
-            'posts_per_page' => 1,
148
-            'is_geodir_loop' => true,
149
-            'gd_location' => false,
150
-            'post_type' => 'gd_place',
151
-        );
152
-        $widget_listings = geodir_get_widget_listings($query_args);
153
-        $template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
154
-        global $post, $map_jason, $map_canvas_arr;
155
-
156
-        $current_post = $post;
157
-        $current_map_jason = $map_jason;
158
-        $current_map_canvas_arr = $map_canvas_arr;
159
-        $geodir_is_widget_listing = true;
160
-
161
-        ob_start();
162
-        include($template);
163
-        $output = ob_get_contents();
164
-        ob_end_clean();
165
-        $this->assertContains('geodir-entry-content', $output);
166
-
167
-        $geodir_is_widget_listing = false;
168
-
169
-        $GLOBALS['post'] = $current_post;
170
-        if (!empty($current_post))
171
-            setup_postdata($current_post);
172
-        $map_jason = $current_map_jason;
173
-        $map_canvas_arr = $current_map_canvas_arr;
174
-
175
-    }
176
-
177
-    public function testRegTemplate() {
122
+		include_once geodir_plugin_path() . "/geodirectory-widgets/geodirectory_cpt_categories_widget.php";
123
+		$params = array(
124
+			'title' => '',
125
+			'post_type' => array(), // NULL for all
126
+			'hide_empty' => '',
127
+			'show_count' => '',
128
+			'hide_icon' => '',
129
+			'cpt_left' => '',
130
+			'sort_by' => 'count',
131
+			'max_count' => 'all',
132
+			'max_level' => '1'
133
+		);
134
+		ob_start();
135
+		geodir_cpt_categories_output($params);
136
+		$output = ob_get_contents();
137
+		ob_end_clean();
138
+		$this->assertContains('gd-cptcat-title', $output);
139
+	}
140
+
141
+	public function testGDWidgetListView() {
142
+		global $gridview_columns_widget, $geodir_is_widget_listing;
143
+
144
+		$_REQUEST['sgeo_lat'] = '40.7127837';
145
+		$_REQUEST['sgeo_lon'] = '-74.00594130000002';
146
+		$query_args = array(
147
+			'posts_per_page' => 1,
148
+			'is_geodir_loop' => true,
149
+			'gd_location' => false,
150
+			'post_type' => 'gd_place',
151
+		);
152
+		$widget_listings = geodir_get_widget_listings($query_args);
153
+		$template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
154
+		global $post, $map_jason, $map_canvas_arr;
155
+
156
+		$current_post = $post;
157
+		$current_map_jason = $map_jason;
158
+		$current_map_canvas_arr = $map_canvas_arr;
159
+		$geodir_is_widget_listing = true;
160
+
161
+		ob_start();
162
+		include($template);
163
+		$output = ob_get_contents();
164
+		ob_end_clean();
165
+		$this->assertContains('geodir-entry-content', $output);
166
+
167
+		$geodir_is_widget_listing = false;
168
+
169
+		$GLOBALS['post'] = $current_post;
170
+		if (!empty($current_post))
171
+			setup_postdata($current_post);
172
+		$map_jason = $current_map_jason;
173
+		$map_canvas_arr = $current_map_canvas_arr;
174
+
175
+	}
176
+
177
+	public function testRegTemplate() {
178 178
 //        var_dump(geodir_login_page_id());
179
-        wp_set_current_user(0);
180
-        $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php';
181
-
182
-        ob_start();
183
-        include($template);
184
-        $output = ob_get_contents();
185
-        ob_end_clean();
186
-        $this->assertContains('Sign In', $output);
187
-    }
188
-
189
-    public function testInfoTemplate() {
190
-        wp_set_current_user(1);
191
-        global $information;
192
-        $information = "hello world";
193
-
194
-        $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
195
-
196
-        ob_start();
197
-        include($template);
198
-        $output = ob_get_contents();
199
-        ob_end_clean();
200
-        $this->assertContains('hello world', $output);
201
-    }
202
-
203
-    public function testSuccessPage() {
204
-        wp_set_current_user(1);
205
-
206
-        $query_args = array(
207
-            'post_status' => 'publish',
208
-            'post_type' => 'gd_place',
209
-            'posts_per_page' => 1,
210
-        );
211
-
212
-        $all_posts = new WP_Query( $query_args );
213
-        $post_id = null;
214
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
215
-            $post_id = get_the_ID();
216
-        endwhile;
217
-
218
-        $this->assertTrue(is_int($post_id));
219
-
220
-        $_REQUEST['listing_type'] = 'gd_place';
221
-        $_REQUEST['pid'] = $post_id;
222
-        ob_start();
223
-        $this->go_to( get_permalink(geodir_success_page_id()) );
224
-        $this->load_template();
225
-        $output = ob_get_contents();
226
-        ob_end_clean();
227
-        $this->assertContains('View your submitted information', $output);
228
-    }
229
-
230
-    public function testPreviewPage() {
231
-        wp_set_current_user(1);
232
-
233
-        $query_args = array(
234
-            'post_status' => 'publish',
235
-            'post_type' => 'gd_place',
236
-            'posts_per_page' => 1,
237
-        );
238
-
239
-        $all_posts = new WP_Query( $query_args );
240
-        $post_id = null;
241
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
242
-            $post_id = get_the_ID();
243
-        endwhile;
244
-
245
-        $this->assertTrue(is_int($post_id));
246
-
247
-        $_REQUEST = array(
248
-            'pid' => $post_id,
249
-            'listing_type' => 'gd_place',
250
-            'post_title' => 'Test Listing Title Modified',
251
-            'post_desc' => 'Test Desc',
252
-            'post_tags' => 'test1,test2',
253
-            'post_address' => 'New York City Hall',
254
-            'post_zip' => '10007',
255
-            'post_latitude' => '40.7127837',
256
-            'post_longitude' => '-74.00594130000002',
257
-            'post_mapview' => 'ROADMAP',
258
-            'post_mapzoom' => '10',
259
-            'geodir_timing' => '10.00 am to 6 pm every day',
260
-            'geodir_contact' => '1234567890',
261
-            'geodir_email' => '[email protected]',
262
-            'geodir_website' => 'http://test.com',
263
-            'geodir_twitter' => 'http://twitter.com/test',
264
-            'geodir_facebook' => 'http://facebook.com/test',
265
-            'geodir_special_offers' => 'Test offer',
266
-            'preview' => true,
267
-            'post_category' => array(
268
-                'gd_placecategory' => ''
269
-            )
270
-        );
271
-
272
-        ob_start();
273
-        $this->go_to( get_permalink(geodir_preview_page_id()) );
274
-        $this->load_template();
275
-        $output = ob_get_contents();
276
-        ob_end_clean();
277
-        $this->assertContains('This is a preview of your listing', $output);
278
-    }
279
-
280
-    public function testAddListingPage() {
281
-        wp_set_current_user(1);
282
-
283
-        ob_start();
284
-        $this->go_to( get_permalink(geodir_add_listing_page_id()) );
285
-        $this->load_template();
286
-        $output = ob_get_contents();
287
-        ob_end_clean();
288
-        $this->assertContains('Enter Listing Details', $output);
289
-    }
290
-
291
-    public function testLocationPage() {
292
-        wp_set_current_user(1);
293
-
294
-        ob_start();
295
-        $this->go_to( get_permalink(geodir_location_page_id()) );
296
-        $this->load_template();
297
-        $output = ob_get_contents();
298
-        ob_end_clean();
299
-        $this->assertContains('Location', $output);
300
-    }
301
-
302
-    public function testTemplates() {
303
-
304
-        global $current_user;
305
-
306
-        $user_id = $current_user->ID;
307
-
308
-        $this->setPermalinkStructure();
309
-
310
-        $homepage = get_page_by_title( 'GD Home page' );
311
-        if ( $homepage )
312
-        {
313
-            update_option( 'page_on_front', $homepage->ID );
314
-            update_option( 'show_on_front', 'page' );
315
-        }
316
-
317
-        ob_start();
318
-        $this->go_to( home_url('/') );
319
-        $this->load_template();
320
-        $output = ob_get_contents();
321
-        ob_end_clean();
322
-        $this->assertContains('body class="home', $output);
323
-
324
-
325
-        ob_start();
326
-        $this->go_to( home_url('/?post_type=gd_place') );
327
-        $this->load_template();
328
-        $output = ob_get_contents();
329
-        ob_end_clean();
330
-        $this->assertContains('All Places', $output);
331
-
332
-        $query_args = array(
333
-            'post_status' => 'publish',
334
-            'post_type' => 'gd_place',
335
-            'posts_per_page' => 1,
336
-        );
337
-
338
-        $all_posts = new WP_Query( $query_args );
339
-        $post_id = null;
340
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
341
-            $post_id = get_the_ID();
342
-        endwhile;
343
-
344
-        $this->assertTrue(is_int($post_id));
345
-
346
-        global $preview;
347
-        $preview = false;
348
-        ob_start();
349
-        $this->go_to( get_permalink($post_id) );
350
-        $this->load_template();
351
-        $output = ob_get_contents();
352
-        ob_end_clean();
353
-        $this->assertContains('post_profileTab', $output);
354
-
355
-        ob_start();
356
-        $_REQUEST['stype'] = 'gd_place';
357
-        $_REQUEST['geodir_dashbord'] = true;
358
-        $this->go_to( get_author_posts_url($user_id) );
359
-        $this->load_template();
360
-        $output = ob_get_contents();
361
-        ob_end_clean();
362
-        $this->assertContains('gd_list_view', $output);
363
-
364
-    }
365
-
366
-    public function testSearchPage() {
367
-        ob_start();
368
-        $_REQUEST['geodir_search'] = "1";
369
-        $_REQUEST['stype'] = 'gd_place';
370
-        $this->go_to( home_url('/?geodir_search=1&stype=gd_place&s=test&snear=&sgeo_lat=&sgeo_lon=') );
371
-        $this->load_template();
372
-        $output = ob_get_contents();
373
-        ob_end_clean();
374
-        $this->assertContains('Search Results for', $output);
375
-
376
-    }
377
-
378
-    public function testPopupSendEnquiryTemplate() {
379
-
380
-        $query_args = array(
381
-            'post_status' => 'publish',
382
-            'post_type' => 'gd_place',
383
-            'posts_per_page' => 1,
384
-        );
385
-
386
-        $all_posts = new WP_Query( $query_args );
387
-        $post_id = null;
388
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
389
-            $post_id = get_the_ID();
390
-        endwhile;
391
-
392
-        $this->assertTrue(is_int($post_id));
393
-
394
-        $_REQUEST['popuptype'] = 'b_send_inquiry';
395
-        $_REQUEST['post_id'] = $post_id;
396
-        add_filter('wp_redirect', '__return_false');
397
-        ob_start();
398
-        geodir_ajax_handler();
399
-        $output = ob_get_contents();
400
-        ob_end_clean();
401
-        $this->assertContains('send_inqury', $output);
402
-        remove_filter('wp_redirect', '__return_false');
403
-
404
-    }
405
-
406
-    public function texstPopupSendToFrndTemplate() {
407
-
408
-        //include template problem. its already loaded. find a way to fix this
409
-
410
-        $query_args = array(
411
-            'post_status' => 'publish',
412
-            'post_type' => 'gd_place',
413
-            'posts_per_page' => 1,
414
-        );
415
-
416
-        $all_posts = new WP_Query( $query_args );
417
-        $post_id = null;
418
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
419
-            $post_id = get_the_ID();
420
-        endwhile;
421
-
422
-        $this->assertTrue(is_int($post_id));
423
-
424
-        $_REQUEST['popuptype'] = 'b_sendtofriend';
425
-        $_REQUEST['post_id'] = $post_id;
426
-        add_filter('wp_redirect', '__return_false');
427
-        ob_start();
428
-        geodir_ajax_handler();
429
-        $output = ob_get_contents();
430
-        ob_end_clean();
431
-        $this->assertContains('send_inqury', $output);
432
-        remove_filter('wp_redirect', '__return_false');
433
-    }
434
-
435
-    public function testNavMenus() {
436
-        $menuname = 'Primary Menu';
437
-        $menulocation = 'primary';
438
-        // Does the menu exist already?
439
-        $menu_exists = wp_get_nav_menu_object( $menuname );
440
-
441
-        // If it doesn't exist, let's create it.
442
-        if( !$menu_exists){
443
-            $menu_id = wp_create_nav_menu($menuname);
444
-
445
-            // Set up default BuddyPress links and add them to the menu.
446
-            wp_update_nav_menu_item($menu_id, 0, array(
447
-                'menu-item-title' =>  __('Home'),
448
-                'menu-item-classes' => 'home',
449
-                'menu-item-url' => home_url( '/' ),
450
-                'menu-item-status' => 'publish'));
451
-
452
-            if( !has_nav_menu( $menulocation ) ){
453
-                $locations = get_theme_mod('nav_menu_locations');
454
-                $locations[$menulocation] = $menu_id;
455
-                set_theme_mod( 'nav_menu_locations', $locations );
456
-            }
457
-
458
-            update_option('geodir_theme_location_nav', array('primary'));
459
-
460
-            $menu = wp_nav_menu(array(
461
-                'theme_location' => 'primary',
462
-                'echo' => false,
463
-            ));
464
-
465
-            $this->assertContains('Add Listing', $menu);
466
-
467
-
468
-        }
469
-    }
470
-
471
-    public function testBestOfWidget() {
472
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php';
473
-        include_once($template);
474
-
475
-        ob_start();
476
-        $instance = array();
477
-        $instance['use_viewing_post_type'] = '1';
478
-        $instance['excerpt_type'] = 'show-reviews';
479
-        the_widget( 'geodir_bestof_widget' );
480
-        $output = ob_get_contents();
481
-        ob_end_clean();
482
-        $this->assertContains('bestof-widget-tab-layout', $output);
483
-
484
-        ob_start();
485
-        $this->the_widget_form( 'geodir_bestof_widget' );
486
-        $output = ob_get_contents();
487
-        ob_end_clean();
488
-        $this->assertContains('Number of categories', $output);
489
-
490
-        $new_instance = array(
491
-            'title' => '',
492
-            'post_type' => '',
493
-            'post_limit' => '5',
494
-            'categ_limit' => '3',
495
-            'character_count' => '20',
496
-            'add_location_filter' => '1',
497
-            'tab_layout' => 'bestof-tabs-on-top',
498
-            'excerpt_type' => 'show-desc',
499
-            'use_viewing_post_type' => '1'
500
-        );
501
-        $output = $this->the_widget_form_update( 'geodir_bestof_widget', $new_instance );
502
-        $this->assertContains('20', $output['character_count']);
503
-
504
-        ob_start();
505
-        geodir_bestof_js();
506
-        $output = ob_get_contents();
507
-        ob_end_clean();
508
-        $this->assertContains('bestof-widget-tab-layout', $output);
509
-
510
-    }
511
-
512
-    public function testCptCatsWidget() {
513
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_cpt_categories_widget.php';
514
-        include_once($template);
515
-
516
-        ob_start();
517
-        the_widget( 'geodir_cpt_categories_widget' );
518
-        $output = ob_get_contents();
519
-        ob_end_clean();
520
-        $this->assertContains('geodir_cpt_categories_widget', $output);
521
-
522
-        ob_start();
523
-        $this->the_widget_form( 'geodir_cpt_categories_widget' );
524
-        $output = ob_get_contents();
525
-        ob_end_clean();
526
-        $this->assertContains('Select CPT', $output);
527
-
528
-        $new_instance = array(
529
-            'title' => '',
530
-            'post_type' => array(), // NULL for all
531
-            'hide_empty' => '',
532
-            'show_count' => '',
533
-            'hide_icon' => '',
534
-            'cpt_left' => '',
535
-            'sort_by' => 'count',
536
-            'max_count' => 'all',
537
-            'max_level' => '1'
538
-        );
539
-        $output = $this->the_widget_form_update( 'geodir_cpt_categories_widget', $new_instance );
540
-        $this->assertContains('count', $output['sort_by']);
541
-
542
-    }
543
-
544
-    public function testFeaturesWidget() {
545
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_features_widget.php';
546
-        include_once($template);
547
-
548
-        $instance = array(
549
-            'title' => 'Features',
550
-            'icon_color' => '',
551
-            'title1' => 'Hello World',
552
-            'image1' => 'fa-recycle',
553
-            'desc1' => 'cool',
554
-        );
555
-
556
-        ob_start();
557
-        the_widget( 'Geodir_Features_Widget', $instance);
558
-        $output = ob_get_contents();
559
-        ob_end_clean();
560
-        $this->assertContains('widget_gd_features', $output);
561
-
562
-        ob_start();
563
-        $this->the_widget_form( 'Geodir_Features_Widget', $instance );
564
-        $output = ob_get_contents();
565
-        ob_end_clean();
566
-        $this->assertContains('Font Awesome Icon Color', $output);
567
-
568
-        $new_instance = array(
569
-            'title' => 'Features',
570
-            'icon_color' => '',
571
-            'title1' => 'Hello World',
572
-            'image1' => 'fa-recycle',
573
-            'desc1' => 'cool',
574
-        );
575
-        $output = $this->the_widget_form_update( 'Geodir_Features_Widget', $new_instance );
576
-        $this->assertContains('Features', $output['title']);
577
-
578
-    }
579
-
580
-    public function testSliderWidget() {
581
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_listing_slider_widget.php';
582
-        include_once($template);
583
-
584
-        ob_start();
585
-        the_widget( 'geodir_listing_slider_widget' );
586
-        $output = ob_get_contents();
587
-        ob_end_clean();
588
-        $this->assertContains('geodir_listing_slider_view', $output);
589
-
590
-        ob_start();
591
-        $this->the_widget_form( 'geodir_listing_slider_widget' );
592
-        $output = ob_get_contents();
593
-        ob_end_clean();
594
-        $this->assertContains('Slide Show Speed', $output);
595
-
596
-        $new_instance = array(
597
-            'title' => '',
598
-            'post_type' => '',
599
-            'category' => '',
600
-            'post_number' => '5',
601
-            'max_show' => '1',
602
-            'slide_width' => '',
603
-            'show_title' => '',
604
-            'slideshow' => '',
605
-            'animationLoop' => '',
606
-            'directionNav' => '',
607
-            'slideshowSpeed' => 5000,
608
-            'animationSpeed' => 600,
609
-            'animation' => '',
610
-            'list_sort' => 'latest',
611
-            'show_featured_only' => '',
612
-        );
613
-        $output = $this->the_widget_form_update( 'geodir_listing_slider_widget', $new_instance );
614
-        $this->assertContains('latest', $output['list_sort']);
615
-
616
-    }
617
-
618
-    public function testPopularWidget() {
619
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_popular_widget.php';
620
-        include_once($template);
621
-
622
-        ob_start();
623
-        the_widget( 'geodir_popular_post_category' );
624
-        $output = ob_get_contents();
625
-        ob_end_clean();
626
-        $this->assertContains('geodir_popular_post_category', $output);
627
-
628
-        ob_start();
629
-        $this->the_widget_form( 'geodir_popular_post_category' );
630
-        $output = ob_get_contents();
631
-        ob_end_clean();
632
-        $this->assertContains('Default post type to use', $output);
633
-
634
-        $new_instance = array(
635
-            'title' => '',
636
-            'category_limit' => 15,
637
-            'default_post_type' => ''
638
-        );
639
-        $output = $this->the_widget_form_update( 'geodir_popular_post_category', $new_instance );
640
-        $this->assertEquals(15, $output['category_limit']);
641
-
642
-        ob_start();
643
-        $instance = array();
644
-        $instance['category_title'] = '';
645
-        the_widget( 'geodir_popular_postview', $instance );
646
-        $output = ob_get_contents();
647
-        ob_end_clean();
648
-        $this->assertContains('geodir_popular_post_view', $output);
649
-
650
-        ob_start();
651
-        $this->the_widget_form( 'geodir_popular_postview' );
652
-        $output = ob_get_contents();
653
-        ob_end_clean();
654
-        $this->assertContains('Post Category', $output);
655
-
656
-        $new_instance = array(
657
-            'title' => '',
658
-            'post_type' => '',
659
-            'category' => array(),
660
-            'category_title' => '',
661
-            'list_sort' => '',
662
-            'list_order' => '',
663
-            'post_number' => '5',
664
-            'layout' => 'gridview_onehalf',
665
-            'listing_width' => '',
666
-            'add_location_filter' => '1',
667
-            'character_count' => '20',
668
-            'show_featured_only' => '',
669
-            'show_special_only' => '',
670
-            'with_pics_only' => '',
671
-            'with_videos_only' => '',
672
-            'use_viewing_post_type' => ''
673
-        );
674
-        $output = $this->the_widget_form_update( 'geodir_popular_postview', $new_instance );
675
-        $this->assertContains('gridview_onehalf', $output['layout']);
676
-
677
-    }
678
-
679
-    public function testRelatedWidget() {
680
-        $query_args = array(
681
-            'post_status' => 'publish',
682
-            'post_type' => 'gd_place',
683
-            'posts_per_page' => 1,
684
-        );
685
-
686
-        $all_posts = new WP_Query( $query_args );
687
-        $post_id = null;
688
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
689
-            global $post;
690
-            $post_id = get_the_ID();
691
-            $post = geodir_get_post_info($post->ID);
179
+		wp_set_current_user(0);
180
+		$template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php';
181
+
182
+		ob_start();
183
+		include($template);
184
+		$output = ob_get_contents();
185
+		ob_end_clean();
186
+		$this->assertContains('Sign In', $output);
187
+	}
188
+
189
+	public function testInfoTemplate() {
190
+		wp_set_current_user(1);
191
+		global $information;
192
+		$information = "hello world";
193
+
194
+		$template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php';
195
+
196
+		ob_start();
197
+		include($template);
198
+		$output = ob_get_contents();
199
+		ob_end_clean();
200
+		$this->assertContains('hello world', $output);
201
+	}
202
+
203
+	public function testSuccessPage() {
204
+		wp_set_current_user(1);
205
+
206
+		$query_args = array(
207
+			'post_status' => 'publish',
208
+			'post_type' => 'gd_place',
209
+			'posts_per_page' => 1,
210
+		);
211
+
212
+		$all_posts = new WP_Query( $query_args );
213
+		$post_id = null;
214
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
215
+			$post_id = get_the_ID();
216
+		endwhile;
217
+
218
+		$this->assertTrue(is_int($post_id));
219
+
220
+		$_REQUEST['listing_type'] = 'gd_place';
221
+		$_REQUEST['pid'] = $post_id;
222
+		ob_start();
223
+		$this->go_to( get_permalink(geodir_success_page_id()) );
224
+		$this->load_template();
225
+		$output = ob_get_contents();
226
+		ob_end_clean();
227
+		$this->assertContains('View your submitted information', $output);
228
+	}
229
+
230
+	public function testPreviewPage() {
231
+		wp_set_current_user(1);
232
+
233
+		$query_args = array(
234
+			'post_status' => 'publish',
235
+			'post_type' => 'gd_place',
236
+			'posts_per_page' => 1,
237
+		);
238
+
239
+		$all_posts = new WP_Query( $query_args );
240
+		$post_id = null;
241
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
242
+			$post_id = get_the_ID();
243
+		endwhile;
244
+
245
+		$this->assertTrue(is_int($post_id));
246
+
247
+		$_REQUEST = array(
248
+			'pid' => $post_id,
249
+			'listing_type' => 'gd_place',
250
+			'post_title' => 'Test Listing Title Modified',
251
+			'post_desc' => 'Test Desc',
252
+			'post_tags' => 'test1,test2',
253
+			'post_address' => 'New York City Hall',
254
+			'post_zip' => '10007',
255
+			'post_latitude' => '40.7127837',
256
+			'post_longitude' => '-74.00594130000002',
257
+			'post_mapview' => 'ROADMAP',
258
+			'post_mapzoom' => '10',
259
+			'geodir_timing' => '10.00 am to 6 pm every day',
260
+			'geodir_contact' => '1234567890',
261
+			'geodir_email' => '[email protected]',
262
+			'geodir_website' => 'http://test.com',
263
+			'geodir_twitter' => 'http://twitter.com/test',
264
+			'geodir_facebook' => 'http://facebook.com/test',
265
+			'geodir_special_offers' => 'Test offer',
266
+			'preview' => true,
267
+			'post_category' => array(
268
+				'gd_placecategory' => ''
269
+			)
270
+		);
271
+
272
+		ob_start();
273
+		$this->go_to( get_permalink(geodir_preview_page_id()) );
274
+		$this->load_template();
275
+		$output = ob_get_contents();
276
+		ob_end_clean();
277
+		$this->assertContains('This is a preview of your listing', $output);
278
+	}
279
+
280
+	public function testAddListingPage() {
281
+		wp_set_current_user(1);
282
+
283
+		ob_start();
284
+		$this->go_to( get_permalink(geodir_add_listing_page_id()) );
285
+		$this->load_template();
286
+		$output = ob_get_contents();
287
+		ob_end_clean();
288
+		$this->assertContains('Enter Listing Details', $output);
289
+	}
290
+
291
+	public function testLocationPage() {
292
+		wp_set_current_user(1);
293
+
294
+		ob_start();
295
+		$this->go_to( get_permalink(geodir_location_page_id()) );
296
+		$this->load_template();
297
+		$output = ob_get_contents();
298
+		ob_end_clean();
299
+		$this->assertContains('Location', $output);
300
+	}
301
+
302
+	public function testTemplates() {
303
+
304
+		global $current_user;
305
+
306
+		$user_id = $current_user->ID;
307
+
308
+		$this->setPermalinkStructure();
309
+
310
+		$homepage = get_page_by_title( 'GD Home page' );
311
+		if ( $homepage )
312
+		{
313
+			update_option( 'page_on_front', $homepage->ID );
314
+			update_option( 'show_on_front', 'page' );
315
+		}
316
+
317
+		ob_start();
318
+		$this->go_to( home_url('/') );
319
+		$this->load_template();
320
+		$output = ob_get_contents();
321
+		ob_end_clean();
322
+		$this->assertContains('body class="home', $output);
323
+
324
+
325
+		ob_start();
326
+		$this->go_to( home_url('/?post_type=gd_place') );
327
+		$this->load_template();
328
+		$output = ob_get_contents();
329
+		ob_end_clean();
330
+		$this->assertContains('All Places', $output);
331
+
332
+		$query_args = array(
333
+			'post_status' => 'publish',
334
+			'post_type' => 'gd_place',
335
+			'posts_per_page' => 1,
336
+		);
337
+
338
+		$all_posts = new WP_Query( $query_args );
339
+		$post_id = null;
340
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
341
+			$post_id = get_the_ID();
342
+		endwhile;
343
+
344
+		$this->assertTrue(is_int($post_id));
345
+
346
+		global $preview;
347
+		$preview = false;
348
+		ob_start();
349
+		$this->go_to( get_permalink($post_id) );
350
+		$this->load_template();
351
+		$output = ob_get_contents();
352
+		ob_end_clean();
353
+		$this->assertContains('post_profileTab', $output);
354
+
355
+		ob_start();
356
+		$_REQUEST['stype'] = 'gd_place';
357
+		$_REQUEST['geodir_dashbord'] = true;
358
+		$this->go_to( get_author_posts_url($user_id) );
359
+		$this->load_template();
360
+		$output = ob_get_contents();
361
+		ob_end_clean();
362
+		$this->assertContains('gd_list_view', $output);
363
+
364
+	}
365
+
366
+	public function testSearchPage() {
367
+		ob_start();
368
+		$_REQUEST['geodir_search'] = "1";
369
+		$_REQUEST['stype'] = 'gd_place';
370
+		$this->go_to( home_url('/?geodir_search=1&stype=gd_place&s=test&snear=&sgeo_lat=&sgeo_lon=') );
371
+		$this->load_template();
372
+		$output = ob_get_contents();
373
+		ob_end_clean();
374
+		$this->assertContains('Search Results for', $output);
375
+
376
+	}
377
+
378
+	public function testPopupSendEnquiryTemplate() {
379
+
380
+		$query_args = array(
381
+			'post_status' => 'publish',
382
+			'post_type' => 'gd_place',
383
+			'posts_per_page' => 1,
384
+		);
385
+
386
+		$all_posts = new WP_Query( $query_args );
387
+		$post_id = null;
388
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
389
+			$post_id = get_the_ID();
390
+		endwhile;
391
+
392
+		$this->assertTrue(is_int($post_id));
393
+
394
+		$_REQUEST['popuptype'] = 'b_send_inquiry';
395
+		$_REQUEST['post_id'] = $post_id;
396
+		add_filter('wp_redirect', '__return_false');
397
+		ob_start();
398
+		geodir_ajax_handler();
399
+		$output = ob_get_contents();
400
+		ob_end_clean();
401
+		$this->assertContains('send_inqury', $output);
402
+		remove_filter('wp_redirect', '__return_false');
403
+
404
+	}
405
+
406
+	public function texstPopupSendToFrndTemplate() {
407
+
408
+		//include template problem. its already loaded. find a way to fix this
409
+
410
+		$query_args = array(
411
+			'post_status' => 'publish',
412
+			'post_type' => 'gd_place',
413
+			'posts_per_page' => 1,
414
+		);
415
+
416
+		$all_posts = new WP_Query( $query_args );
417
+		$post_id = null;
418
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
419
+			$post_id = get_the_ID();
420
+		endwhile;
421
+
422
+		$this->assertTrue(is_int($post_id));
423
+
424
+		$_REQUEST['popuptype'] = 'b_sendtofriend';
425
+		$_REQUEST['post_id'] = $post_id;
426
+		add_filter('wp_redirect', '__return_false');
427
+		ob_start();
428
+		geodir_ajax_handler();
429
+		$output = ob_get_contents();
430
+		ob_end_clean();
431
+		$this->assertContains('send_inqury', $output);
432
+		remove_filter('wp_redirect', '__return_false');
433
+	}
434
+
435
+	public function testNavMenus() {
436
+		$menuname = 'Primary Menu';
437
+		$menulocation = 'primary';
438
+		// Does the menu exist already?
439
+		$menu_exists = wp_get_nav_menu_object( $menuname );
440
+
441
+		// If it doesn't exist, let's create it.
442
+		if( !$menu_exists){
443
+			$menu_id = wp_create_nav_menu($menuname);
444
+
445
+			// Set up default BuddyPress links and add them to the menu.
446
+			wp_update_nav_menu_item($menu_id, 0, array(
447
+				'menu-item-title' =>  __('Home'),
448
+				'menu-item-classes' => 'home',
449
+				'menu-item-url' => home_url( '/' ),
450
+				'menu-item-status' => 'publish'));
451
+
452
+			if( !has_nav_menu( $menulocation ) ){
453
+				$locations = get_theme_mod('nav_menu_locations');
454
+				$locations[$menulocation] = $menu_id;
455
+				set_theme_mod( 'nav_menu_locations', $locations );
456
+			}
457
+
458
+			update_option('geodir_theme_location_nav', array('primary'));
459
+
460
+			$menu = wp_nav_menu(array(
461
+				'theme_location' => 'primary',
462
+				'echo' => false,
463
+			));
464
+
465
+			$this->assertContains('Add Listing', $menu);
466
+
467
+
468
+		}
469
+	}
470
+
471
+	public function testBestOfWidget() {
472
+		$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php';
473
+		include_once($template);
474
+
475
+		ob_start();
476
+		$instance = array();
477
+		$instance['use_viewing_post_type'] = '1';
478
+		$instance['excerpt_type'] = 'show-reviews';
479
+		the_widget( 'geodir_bestof_widget' );
480
+		$output = ob_get_contents();
481
+		ob_end_clean();
482
+		$this->assertContains('bestof-widget-tab-layout', $output);
483
+
484
+		ob_start();
485
+		$this->the_widget_form( 'geodir_bestof_widget' );
486
+		$output = ob_get_contents();
487
+		ob_end_clean();
488
+		$this->assertContains('Number of categories', $output);
489
+
490
+		$new_instance = array(
491
+			'title' => '',
492
+			'post_type' => '',
493
+			'post_limit' => '5',
494
+			'categ_limit' => '3',
495
+			'character_count' => '20',
496
+			'add_location_filter' => '1',
497
+			'tab_layout' => 'bestof-tabs-on-top',
498
+			'excerpt_type' => 'show-desc',
499
+			'use_viewing_post_type' => '1'
500
+		);
501
+		$output = $this->the_widget_form_update( 'geodir_bestof_widget', $new_instance );
502
+		$this->assertContains('20', $output['character_count']);
503
+
504
+		ob_start();
505
+		geodir_bestof_js();
506
+		$output = ob_get_contents();
507
+		ob_end_clean();
508
+		$this->assertContains('bestof-widget-tab-layout', $output);
509
+
510
+	}
511
+
512
+	public function testCptCatsWidget() {
513
+		$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_cpt_categories_widget.php';
514
+		include_once($template);
515
+
516
+		ob_start();
517
+		the_widget( 'geodir_cpt_categories_widget' );
518
+		$output = ob_get_contents();
519
+		ob_end_clean();
520
+		$this->assertContains('geodir_cpt_categories_widget', $output);
521
+
522
+		ob_start();
523
+		$this->the_widget_form( 'geodir_cpt_categories_widget' );
524
+		$output = ob_get_contents();
525
+		ob_end_clean();
526
+		$this->assertContains('Select CPT', $output);
527
+
528
+		$new_instance = array(
529
+			'title' => '',
530
+			'post_type' => array(), // NULL for all
531
+			'hide_empty' => '',
532
+			'show_count' => '',
533
+			'hide_icon' => '',
534
+			'cpt_left' => '',
535
+			'sort_by' => 'count',
536
+			'max_count' => 'all',
537
+			'max_level' => '1'
538
+		);
539
+		$output = $this->the_widget_form_update( 'geodir_cpt_categories_widget', $new_instance );
540
+		$this->assertContains('count', $output['sort_by']);
541
+
542
+	}
543
+
544
+	public function testFeaturesWidget() {
545
+		$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_features_widget.php';
546
+		include_once($template);
547
+
548
+		$instance = array(
549
+			'title' => 'Features',
550
+			'icon_color' => '',
551
+			'title1' => 'Hello World',
552
+			'image1' => 'fa-recycle',
553
+			'desc1' => 'cool',
554
+		);
555
+
556
+		ob_start();
557
+		the_widget( 'Geodir_Features_Widget', $instance);
558
+		$output = ob_get_contents();
559
+		ob_end_clean();
560
+		$this->assertContains('widget_gd_features', $output);
561
+
562
+		ob_start();
563
+		$this->the_widget_form( 'Geodir_Features_Widget', $instance );
564
+		$output = ob_get_contents();
565
+		ob_end_clean();
566
+		$this->assertContains('Font Awesome Icon Color', $output);
567
+
568
+		$new_instance = array(
569
+			'title' => 'Features',
570
+			'icon_color' => '',
571
+			'title1' => 'Hello World',
572
+			'image1' => 'fa-recycle',
573
+			'desc1' => 'cool',
574
+		);
575
+		$output = $this->the_widget_form_update( 'Geodir_Features_Widget', $new_instance );
576
+		$this->assertContains('Features', $output['title']);
577
+
578
+	}
579
+
580
+	public function testSliderWidget() {
581
+		$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_listing_slider_widget.php';
582
+		include_once($template);
583
+
584
+		ob_start();
585
+		the_widget( 'geodir_listing_slider_widget' );
586
+		$output = ob_get_contents();
587
+		ob_end_clean();
588
+		$this->assertContains('geodir_listing_slider_view', $output);
589
+
590
+		ob_start();
591
+		$this->the_widget_form( 'geodir_listing_slider_widget' );
592
+		$output = ob_get_contents();
593
+		ob_end_clean();
594
+		$this->assertContains('Slide Show Speed', $output);
595
+
596
+		$new_instance = array(
597
+			'title' => '',
598
+			'post_type' => '',
599
+			'category' => '',
600
+			'post_number' => '5',
601
+			'max_show' => '1',
602
+			'slide_width' => '',
603
+			'show_title' => '',
604
+			'slideshow' => '',
605
+			'animationLoop' => '',
606
+			'directionNav' => '',
607
+			'slideshowSpeed' => 5000,
608
+			'animationSpeed' => 600,
609
+			'animation' => '',
610
+			'list_sort' => 'latest',
611
+			'show_featured_only' => '',
612
+		);
613
+		$output = $this->the_widget_form_update( 'geodir_listing_slider_widget', $new_instance );
614
+		$this->assertContains('latest', $output['list_sort']);
615
+
616
+	}
617
+
618
+	public function testPopularWidget() {
619
+		$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_popular_widget.php';
620
+		include_once($template);
621
+
622
+		ob_start();
623
+		the_widget( 'geodir_popular_post_category' );
624
+		$output = ob_get_contents();
625
+		ob_end_clean();
626
+		$this->assertContains('geodir_popular_post_category', $output);
627
+
628
+		ob_start();
629
+		$this->the_widget_form( 'geodir_popular_post_category' );
630
+		$output = ob_get_contents();
631
+		ob_end_clean();
632
+		$this->assertContains('Default post type to use', $output);
633
+
634
+		$new_instance = array(
635
+			'title' => '',
636
+			'category_limit' => 15,
637
+			'default_post_type' => ''
638
+		);
639
+		$output = $this->the_widget_form_update( 'geodir_popular_post_category', $new_instance );
640
+		$this->assertEquals(15, $output['category_limit']);
641
+
642
+		ob_start();
643
+		$instance = array();
644
+		$instance['category_title'] = '';
645
+		the_widget( 'geodir_popular_postview', $instance );
646
+		$output = ob_get_contents();
647
+		ob_end_clean();
648
+		$this->assertContains('geodir_popular_post_view', $output);
649
+
650
+		ob_start();
651
+		$this->the_widget_form( 'geodir_popular_postview' );
652
+		$output = ob_get_contents();
653
+		ob_end_clean();
654
+		$this->assertContains('Post Category', $output);
655
+
656
+		$new_instance = array(
657
+			'title' => '',
658
+			'post_type' => '',
659
+			'category' => array(),
660
+			'category_title' => '',
661
+			'list_sort' => '',
662
+			'list_order' => '',
663
+			'post_number' => '5',
664
+			'layout' => 'gridview_onehalf',
665
+			'listing_width' => '',
666
+			'add_location_filter' => '1',
667
+			'character_count' => '20',
668
+			'show_featured_only' => '',
669
+			'show_special_only' => '',
670
+			'with_pics_only' => '',
671
+			'with_videos_only' => '',
672
+			'use_viewing_post_type' => ''
673
+		);
674
+		$output = $this->the_widget_form_update( 'geodir_popular_postview', $new_instance );
675
+		$this->assertContains('gridview_onehalf', $output['layout']);
676
+
677
+	}
678
+
679
+	public function testRelatedWidget() {
680
+		$query_args = array(
681
+			'post_status' => 'publish',
682
+			'post_type' => 'gd_place',
683
+			'posts_per_page' => 1,
684
+		);
685
+
686
+		$all_posts = new WP_Query( $query_args );
687
+		$post_id = null;
688
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
689
+			global $post;
690
+			$post_id = get_the_ID();
691
+			$post = geodir_get_post_info($post->ID);
692 692
 
693 693
 //            $term_list = wp_get_post_terms($post->ID, 'gd_placecategory');
694 694
 //            $post->gd_placecategory = (string) $term_list[0]->term_id;
695 695
 
696
-            $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_related_listing_widget.php';
697
-            include_once($template);
698
-
699
-            ob_start();
700
-            the_widget( 'geodir_related_listing_postview' );
701
-            $output = ob_get_contents();
702
-            ob_end_clean();
703
-            $this->assertContains('Related Listing', $output);
704
-
705
-            ob_start();
706
-            $this->the_widget_form( 'geodir_related_listing_postview' );
707
-            $output = ob_get_contents();
708
-            ob_end_clean();
709
-            $this->assertContains('Relate to', $output);
710
-
711
-            $new_instance = array(
712
-                'title' => '',
713
-                'list_sort' => '',
714
-                'list_order' => '',
715
-                'post_number' => '5',
716
-                'relate_to' => '',
717
-                'layout' => 'gridview_onehalf',
718
-                'listing_width' => '',
719
-                'add_location_filter' => '1',
720
-                'character_count' => '20'
721
-            );
722
-            $output = $this->the_widget_form_update( 'geodir_related_listing_postview', $new_instance );
723
-            $this->assertContains('gridview_onehalf', $output['layout']);
724
-        endwhile;
725
-
726
-        $this->assertTrue(is_int($post_id));
727
-
728
-
729
-    }
730
-
731
-    public function testReviewsWidget() {
732
-
733
-        $time = current_time('mysql');
734
-
735
-        $args = array(
736
-            'listing_type' => 'gd_place',
737
-            'post_title' => 'Test Listing Title',
738
-            'post_desc' => 'Test Desc',
739
-            'post_tags' => 'test1,test2',
740
-            'post_address' => 'New York City Hall',
741
-            'post_zip' => '10007',
742
-            'post_latitude' => '40.7127837',
743
-            'post_longitude' => '-74.00594130000002',
744
-            'post_mapview' => 'ROADMAP',
745
-            'post_mapzoom' => '10',
746
-            'geodir_timing' => '10.00 am to 6 pm every day',
747
-            'geodir_contact' => '1234567890',
748
-            'geodir_email' => '[email protected]',
749
-            'geodir_website' => 'http://test.com',
750
-            'geodir_twitter' => 'http://twitter.com/test',
751
-            'geodir_facebook' => 'http://facebook.com/test',
752
-            'geodir_special_offers' => 'Test offer'
753
-        );
754
-        $post_id = geodir_save_listing($args, true);
755
-
756
-        $data = array(
757
-            'comment_post_ID' => $post_id,
758
-            'comment_author' => 'admin',
759
-            'comment_author_email' => '[email protected]',
760
-            'comment_author_url' => 'http://wpgeodirectory.com',
761
-            'comment_content' => 'content here',
762
-            'comment_type' => '',
763
-            'comment_parent' => 0,
764
-            'user_id' => 1,
765
-            'comment_author_IP' => '127.0.0.1',
766
-            'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)',
767
-            'comment_date' => $time,
768
-            'comment_approved' => 1,
769
-        );
770
-
771
-        $comment_id = wp_insert_comment($data);
772
-
773
-        $_REQUEST['geodir_overallrating'] = 5.0;
774
-        geodir_save_rating($comment_id);
775
-
776
-        $this->assertTrue(is_int($comment_id));
777
-
778
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_reviews_widget.php';
779
-        include_once($template);
780
-
781
-        ob_start();
782
-        the_widget( 'geodir_recent_reviews_widget' );
783
-        $output = ob_get_contents();
784
-        ob_end_clean();
785
-        $this->assertContains('geodir_recent_reviews', $output);
786
-
787
-        ob_start();
788
-        $this->the_widget_form( 'geodir_recent_reviews_widget' );
789
-        $output = ob_get_contents();
790
-        ob_end_clean();
791
-        $this->assertContains('Number of Reviews', $output);
792
-
793
-        $new_instance = array(
794
-            'title' => '',
795
-            't1' => '',
796
-            't2' => '',
797
-            't3' => '',
798
-            'img1' => '',
799
-            'count' => ''
800
-        );
801
-        $output = $this->the_widget_form_update( 'geodir_recent_reviews_widget', $new_instance );
802
-        $this->assertTrue(empty($output['count']));
803
-    }
804
-
805
-    public function testHomeMapWidget() {
806
-        $template = geodir_plugin_path() . '/geodirectory-widgets/home_map_widget.php';
807
-        include_once($template);
808
-
809
-        ob_start();
810
-        $instance = array();
811
-        $args = array();
812
-        $args["widget_id"] = "geodir_map_v3_home_map-2";
813
-        the_widget( 'geodir_homepage_map', $instance, $args );
814
-        $output = ob_get_contents();
815
-        ob_end_clean();
816
-        $this->assertContains('geodir-map-home-page', $output);
817
-
818
-        ob_start();
819
-        $this->the_widget_form( 'geodir_homepage_map' );
820
-        $output = ob_get_contents();
821
-        ob_end_clean();
822
-        $this->assertContains('Map Zoom level', $output);
823
-
824
-        $new_instance = array(
825
-            'width' => '',
826
-            'heigh' => '',
827
-            'maptype' => '',
828
-            'zoom' => '',
829
-            'autozoom' => '',
830
-            'child_collapse' => '0',
831
-            'scrollwheel' => '0'
832
-        );
833
-        $output = $this->the_widget_form_update( 'geodir_homepage_map', $new_instance );
834
-        $this->assertContains('0', $output['scrollwheel']);
835
-
836
-    }
837
-
838
-    public function testLoginWidget() {
839
-
840
-        register_geodir_widgets();
841
-
842
-        ob_start();
843
-        the_widget( 'geodir_loginwidget' );
844
-        $output = ob_get_contents();
845
-        ob_end_clean();
846
-        $this->assertContains('geodir_loginbox', $output);
847
-
848
-        ob_start();
849
-        $this->the_widget_form( 'geodir_loginwidget' );
850
-        $output = ob_get_contents();
851
-        ob_end_clean();
852
-        $this->assertContains('Widget Title', $output);
853
-
854
-        $new_instance = array(
855
-            'title' => 'Login',
856
-            't1' => '',
857
-            't2' => '',
858
-            't3' => '',
859
-            'img1' => '',
860
-            'desc1' => ''
861
-        );
862
-        $output = $this->the_widget_form_update( 'geodir_loginwidget', $new_instance );
863
-        $this->assertContains('Login', $output['title']);
864
-
865
-    }
866
-
867
-    public function testSocialWidget() {
868
-
869
-        ob_start();
870
-        the_widget( 'geodir_social_like_widget' );
871
-        $output = ob_get_contents();
872
-        ob_end_clean();
873
-        $this->assertContains('twitter.com', $output);
874
-
875
-        ob_start();
876
-        $this->the_widget_form( 'geodir_social_like_widget' );
877
-        $output = ob_get_contents();
878
-        ob_end_clean();
879
-        $this->assertContains('No settings for this widget', $output);
880
-
881
-        $new_instance = array(
882
-            'title' => 'Social',
883
-        );
884
-        $output = $this->the_widget_form_update( 'geodir_social_like_widget', $new_instance );
885
-        $this->assertContains('Social', $output['title']);
886
-
887
-    }
888
-
889
-    public function testSubscribeWidget() {
890
-
891
-        ob_start();
892
-        the_widget( 'geodirsubscribeWidget' );
893
-        $output = ob_get_contents();
894
-        ob_end_clean();
895
-        $this->assertContains('geodir-subscribe-form', $output);
896
-
897
-        ob_start();
898
-        $this->the_widget_form( 'geodirsubscribeWidget' );
899
-        $output = ob_get_contents();
900
-        ob_end_clean();
901
-        $this->assertContains('Feedburner ID', $output);
902
-
903
-        $new_instance = array(
904
-            'title' => 'Subscribe',
905
-            'id' => '',
906
-            'advt1' => '',
907
-            'text' => '',
908
-            'twitter' => '',
909
-            'facebook' => '',
910
-            'digg' => '',
911
-            'myspace' => ''
912
-        );
913
-        $output = $this->the_widget_form_update( 'geodirsubscribeWidget', $new_instance );
914
-        $this->assertContains('Subscribe', $output['title']);
915
-
916
-    }
917
-
918
-    public function testAdvWidget() {
919
-
920
-        ob_start();
921
-        $instance = array();
922
-        $instance['desc1'] = 'hello';
923
-        the_widget( 'geodiradvtwidget', $instance );
924
-        $output = ob_get_contents();
925
-        ob_end_clean();
926
-        $this->assertContains('hello', $output);
927
-
928
-        ob_start();
929
-        $this->the_widget_form( 'geodiradvtwidget' );
930
-        $output = ob_get_contents();
931
-        ob_end_clean();
932
-        $this->assertContains('Your Advt code', $output);
933
-
934
-        $new_instance = array(
935
-            'desc1' => 'Advertise'
936
-        );
937
-        $output = $this->the_widget_form_update( 'geodiradvtwidget', $new_instance );
938
-        $this->assertContains('Advertise', $output['desc1']);
939
-
940
-    }
941
-
942
-    public function testFlickrWidget() {
943
-
944
-        ob_start();
945
-        the_widget( 'GeodirFlickrWidget' );
946
-        $output = ob_get_contents();
947
-        ob_end_clean();
948
-        $this->assertContains('geodir-flickr', $output);
949
-
950
-        ob_start();
951
-        $this->the_widget_form( 'GeodirFlickrWidget' );
952
-        $output = ob_get_contents();
953
-        ob_end_clean();
954
-        $this->assertContains('Flickr ID', $output);
955
-
956
-        $new_instance = array(
957
-            'id' => '',
958
-            'number' => '34'
959
-        );
960
-        $output = $this->the_widget_form_update( 'GeodirFlickrWidget', $new_instance );
961
-        $this->assertContains('34', $output['number']);
962
-
963
-    }
964
-
965
-    public function testTwitterWidget() {
966
-
967
-        ob_start();
968
-        $instance = array();
969
-        $instance['gd_tw_desc1'] = 'hello';
970
-        the_widget( 'geodir_twitter', $instance );
971
-        $output = ob_get_contents();
972
-        ob_end_clean();
973
-        $this->assertContains('hello', $output);
974
-
975
-        ob_start();
976
-        $this->the_widget_form( 'geodir_twitter' );
977
-        $output = ob_get_contents();
978
-        ob_end_clean();
979
-        $this->assertContains('Your twitter code', $output);
980
-
981
-        $new_instance = array(
982
-            'gd_tw_desc1' => 'hello'
983
-        );
984
-        $output = $this->the_widget_form_update( 'geodir_twitter', $new_instance );
985
-        $this->assertContains('hello', $output['gd_tw_desc1']);
986
-
987
-    }
988
-
989
-    public function testAdvSearchWidget() {
990
-
991
-        ob_start();
992
-        the_widget( 'geodir_advance_search_widget' );
993
-        $output = ob_get_contents();
994
-        ob_end_clean();
995
-        $this->assertContains('geodir-loc-bar', $output);
996
-
997
-        ob_start();
998
-        $this->the_widget_form( 'geodir_advance_search_widget' );
999
-        $output = ob_get_contents();
1000
-        ob_end_clean();
1001
-        $this->assertContains('This is a search widget', $output);
696
+			$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_related_listing_widget.php';
697
+			include_once($template);
698
+
699
+			ob_start();
700
+			the_widget( 'geodir_related_listing_postview' );
701
+			$output = ob_get_contents();
702
+			ob_end_clean();
703
+			$this->assertContains('Related Listing', $output);
704
+
705
+			ob_start();
706
+			$this->the_widget_form( 'geodir_related_listing_postview' );
707
+			$output = ob_get_contents();
708
+			ob_end_clean();
709
+			$this->assertContains('Relate to', $output);
710
+
711
+			$new_instance = array(
712
+				'title' => '',
713
+				'list_sort' => '',
714
+				'list_order' => '',
715
+				'post_number' => '5',
716
+				'relate_to' => '',
717
+				'layout' => 'gridview_onehalf',
718
+				'listing_width' => '',
719
+				'add_location_filter' => '1',
720
+				'character_count' => '20'
721
+			);
722
+			$output = $this->the_widget_form_update( 'geodir_related_listing_postview', $new_instance );
723
+			$this->assertContains('gridview_onehalf', $output['layout']);
724
+		endwhile;
725
+
726
+		$this->assertTrue(is_int($post_id));
727
+
728
+
729
+	}
730
+
731
+	public function testReviewsWidget() {
732
+
733
+		$time = current_time('mysql');
734
+
735
+		$args = array(
736
+			'listing_type' => 'gd_place',
737
+			'post_title' => 'Test Listing Title',
738
+			'post_desc' => 'Test Desc',
739
+			'post_tags' => 'test1,test2',
740
+			'post_address' => 'New York City Hall',
741
+			'post_zip' => '10007',
742
+			'post_latitude' => '40.7127837',
743
+			'post_longitude' => '-74.00594130000002',
744
+			'post_mapview' => 'ROADMAP',
745
+			'post_mapzoom' => '10',
746
+			'geodir_timing' => '10.00 am to 6 pm every day',
747
+			'geodir_contact' => '1234567890',
748
+			'geodir_email' => '[email protected]',
749
+			'geodir_website' => 'http://test.com',
750
+			'geodir_twitter' => 'http://twitter.com/test',
751
+			'geodir_facebook' => 'http://facebook.com/test',
752
+			'geodir_special_offers' => 'Test offer'
753
+		);
754
+		$post_id = geodir_save_listing($args, true);
755
+
756
+		$data = array(
757
+			'comment_post_ID' => $post_id,
758
+			'comment_author' => 'admin',
759
+			'comment_author_email' => '[email protected]',
760
+			'comment_author_url' => 'http://wpgeodirectory.com',
761
+			'comment_content' => 'content here',
762
+			'comment_type' => '',
763
+			'comment_parent' => 0,
764
+			'user_id' => 1,
765
+			'comment_author_IP' => '127.0.0.1',
766
+			'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)',
767
+			'comment_date' => $time,
768
+			'comment_approved' => 1,
769
+		);
770
+
771
+		$comment_id = wp_insert_comment($data);
772
+
773
+		$_REQUEST['geodir_overallrating'] = 5.0;
774
+		geodir_save_rating($comment_id);
775
+
776
+		$this->assertTrue(is_int($comment_id));
777
+
778
+		$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_reviews_widget.php';
779
+		include_once($template);
780
+
781
+		ob_start();
782
+		the_widget( 'geodir_recent_reviews_widget' );
783
+		$output = ob_get_contents();
784
+		ob_end_clean();
785
+		$this->assertContains('geodir_recent_reviews', $output);
786
+
787
+		ob_start();
788
+		$this->the_widget_form( 'geodir_recent_reviews_widget' );
789
+		$output = ob_get_contents();
790
+		ob_end_clean();
791
+		$this->assertContains('Number of Reviews', $output);
792
+
793
+		$new_instance = array(
794
+			'title' => '',
795
+			't1' => '',
796
+			't2' => '',
797
+			't3' => '',
798
+			'img1' => '',
799
+			'count' => ''
800
+		);
801
+		$output = $this->the_widget_form_update( 'geodir_recent_reviews_widget', $new_instance );
802
+		$this->assertTrue(empty($output['count']));
803
+	}
804
+
805
+	public function testHomeMapWidget() {
806
+		$template = geodir_plugin_path() . '/geodirectory-widgets/home_map_widget.php';
807
+		include_once($template);
808
+
809
+		ob_start();
810
+		$instance = array();
811
+		$args = array();
812
+		$args["widget_id"] = "geodir_map_v3_home_map-2";
813
+		the_widget( 'geodir_homepage_map', $instance, $args );
814
+		$output = ob_get_contents();
815
+		ob_end_clean();
816
+		$this->assertContains('geodir-map-home-page', $output);
817
+
818
+		ob_start();
819
+		$this->the_widget_form( 'geodir_homepage_map' );
820
+		$output = ob_get_contents();
821
+		ob_end_clean();
822
+		$this->assertContains('Map Zoom level', $output);
823
+
824
+		$new_instance = array(
825
+			'width' => '',
826
+			'heigh' => '',
827
+			'maptype' => '',
828
+			'zoom' => '',
829
+			'autozoom' => '',
830
+			'child_collapse' => '0',
831
+			'scrollwheel' => '0'
832
+		);
833
+		$output = $this->the_widget_form_update( 'geodir_homepage_map', $new_instance );
834
+		$this->assertContains('0', $output['scrollwheel']);
835
+
836
+	}
837
+
838
+	public function testLoginWidget() {
839
+
840
+		register_geodir_widgets();
841
+
842
+		ob_start();
843
+		the_widget( 'geodir_loginwidget' );
844
+		$output = ob_get_contents();
845
+		ob_end_clean();
846
+		$this->assertContains('geodir_loginbox', $output);
847
+
848
+		ob_start();
849
+		$this->the_widget_form( 'geodir_loginwidget' );
850
+		$output = ob_get_contents();
851
+		ob_end_clean();
852
+		$this->assertContains('Widget Title', $output);
853
+
854
+		$new_instance = array(
855
+			'title' => 'Login',
856
+			't1' => '',
857
+			't2' => '',
858
+			't3' => '',
859
+			'img1' => '',
860
+			'desc1' => ''
861
+		);
862
+		$output = $this->the_widget_form_update( 'geodir_loginwidget', $new_instance );
863
+		$this->assertContains('Login', $output['title']);
864
+
865
+	}
866
+
867
+	public function testSocialWidget() {
868
+
869
+		ob_start();
870
+		the_widget( 'geodir_social_like_widget' );
871
+		$output = ob_get_contents();
872
+		ob_end_clean();
873
+		$this->assertContains('twitter.com', $output);
874
+
875
+		ob_start();
876
+		$this->the_widget_form( 'geodir_social_like_widget' );
877
+		$output = ob_get_contents();
878
+		ob_end_clean();
879
+		$this->assertContains('No settings for this widget', $output);
880
+
881
+		$new_instance = array(
882
+			'title' => 'Social',
883
+		);
884
+		$output = $this->the_widget_form_update( 'geodir_social_like_widget', $new_instance );
885
+		$this->assertContains('Social', $output['title']);
886
+
887
+	}
888
+
889
+	public function testSubscribeWidget() {
890
+
891
+		ob_start();
892
+		the_widget( 'geodirsubscribeWidget' );
893
+		$output = ob_get_contents();
894
+		ob_end_clean();
895
+		$this->assertContains('geodir-subscribe-form', $output);
896
+
897
+		ob_start();
898
+		$this->the_widget_form( 'geodirsubscribeWidget' );
899
+		$output = ob_get_contents();
900
+		ob_end_clean();
901
+		$this->assertContains('Feedburner ID', $output);
902
+
903
+		$new_instance = array(
904
+			'title' => 'Subscribe',
905
+			'id' => '',
906
+			'advt1' => '',
907
+			'text' => '',
908
+			'twitter' => '',
909
+			'facebook' => '',
910
+			'digg' => '',
911
+			'myspace' => ''
912
+		);
913
+		$output = $this->the_widget_form_update( 'geodirsubscribeWidget', $new_instance );
914
+		$this->assertContains('Subscribe', $output['title']);
915
+
916
+	}
917
+
918
+	public function testAdvWidget() {
919
+
920
+		ob_start();
921
+		$instance = array();
922
+		$instance['desc1'] = 'hello';
923
+		the_widget( 'geodiradvtwidget', $instance );
924
+		$output = ob_get_contents();
925
+		ob_end_clean();
926
+		$this->assertContains('hello', $output);
927
+
928
+		ob_start();
929
+		$this->the_widget_form( 'geodiradvtwidget' );
930
+		$output = ob_get_contents();
931
+		ob_end_clean();
932
+		$this->assertContains('Your Advt code', $output);
933
+
934
+		$new_instance = array(
935
+			'desc1' => 'Advertise'
936
+		);
937
+		$output = $this->the_widget_form_update( 'geodiradvtwidget', $new_instance );
938
+		$this->assertContains('Advertise', $output['desc1']);
939
+
940
+	}
941
+
942
+	public function testFlickrWidget() {
943
+
944
+		ob_start();
945
+		the_widget( 'GeodirFlickrWidget' );
946
+		$output = ob_get_contents();
947
+		ob_end_clean();
948
+		$this->assertContains('geodir-flickr', $output);
949
+
950
+		ob_start();
951
+		$this->the_widget_form( 'GeodirFlickrWidget' );
952
+		$output = ob_get_contents();
953
+		ob_end_clean();
954
+		$this->assertContains('Flickr ID', $output);
955
+
956
+		$new_instance = array(
957
+			'id' => '',
958
+			'number' => '34'
959
+		);
960
+		$output = $this->the_widget_form_update( 'GeodirFlickrWidget', $new_instance );
961
+		$this->assertContains('34', $output['number']);
962
+
963
+	}
964
+
965
+	public function testTwitterWidget() {
966
+
967
+		ob_start();
968
+		$instance = array();
969
+		$instance['gd_tw_desc1'] = 'hello';
970
+		the_widget( 'geodir_twitter', $instance );
971
+		$output = ob_get_contents();
972
+		ob_end_clean();
973
+		$this->assertContains('hello', $output);
974
+
975
+		ob_start();
976
+		$this->the_widget_form( 'geodir_twitter' );
977
+		$output = ob_get_contents();
978
+		ob_end_clean();
979
+		$this->assertContains('Your twitter code', $output);
980
+
981
+		$new_instance = array(
982
+			'gd_tw_desc1' => 'hello'
983
+		);
984
+		$output = $this->the_widget_form_update( 'geodir_twitter', $new_instance );
985
+		$this->assertContains('hello', $output['gd_tw_desc1']);
986
+
987
+	}
988
+
989
+	public function testAdvSearchWidget() {
990
+
991
+		ob_start();
992
+		the_widget( 'geodir_advance_search_widget' );
993
+		$output = ob_get_contents();
994
+		ob_end_clean();
995
+		$this->assertContains('geodir-loc-bar', $output);
996
+
997
+		ob_start();
998
+		$this->the_widget_form( 'geodir_advance_search_widget' );
999
+		$output = ob_get_contents();
1000
+		ob_end_clean();
1001
+		$this->assertContains('This is a search widget', $output);
1002 1002
 
1003 1003
 //        $new_instance = array(
1004 1004
 //        );
1005 1005
 //        $output = $this->the_widget_form_update( 'geodir_advance_search_widget', $new_instance );
1006 1006
 //        $this->assertContains('Subscribe', $output['title']);
1007 1007
 
1008
-    }
1009
-
1010
-    public function testListingMapWidget() {
1011
-
1012
-        $template = geodir_plugin_path() . '/geodirectory-widgets/listing_map_widget.php';
1013
-        include_once($template);
1014
-
1015
-        //listing page
1016
-        $this->go_to( home_url('/?post_type=gd_place') );
1017
-
1018
-        ob_start();
1019
-        $instance = array();
1020
-        $args = array();
1021
-        $args["widget_id"] = "geodir_map_v3_listing_map-2";
1022
-        the_widget( 'geodir_map_listingpage', $instance, $args );
1023
-        $output = ob_get_contents();
1024
-        ob_end_clean();
1025
-        $this->assertContains('geodir-map-listing-page', $output);
1026
-
1027
-        // detail page
1028
-        $query_args = array(
1029
-            'post_status' => 'publish',
1030
-            'post_type' => 'gd_place',
1031
-            'posts_per_page' => 1,
1032
-        );
1033
-
1034
-        $all_posts = new WP_Query( $query_args );
1035
-        $post_id = null;
1036
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
1037
-            $post_id = get_the_ID();
1038
-        endwhile;
1039
-
1040
-        $this->assertTrue(is_int($post_id));
1041
-
1042
-        $this->go_to( get_permalink($post_id) );
1043
-
1044
-        ob_start();
1045
-        $instance = array();
1046
-        $args = array();
1047
-        $args["widget_id"] = "geodir_map_v3_listing_map-2";
1048
-        the_widget( 'geodir_map_listingpage', $instance, $args );
1049
-        $output = ob_get_contents();
1050
-        ob_end_clean();
1051
-        $this->assertContains('geodir-map-listing-page', $output);
1052
-
1053
-        ob_start();
1054
-        $this->the_widget_form( 'geodir_map_listingpage' );
1055
-        $output = ob_get_contents();
1056
-        ob_end_clean();
1057
-        $this->assertContains('Select Map View', $output);
1058
-
1059
-        $new_instance = array(
1060
-            'width' => '',
1061
-            'heigh' => '',
1062
-            'maptype' => '',
1063
-            'zoom' => '',
1064
-            'autozoom' => '',
1065
-            'sticky' => '',
1066
-            'scrollwheel' => '0',
1067
-            'showall' => '0'
1068
-        );
1069
-        $output = $this->the_widget_form_update( 'geodir_map_listingpage', $new_instance );
1070
-        $this->assertContains('0', $output['scrollwheel']);
1071
-
1072
-
1073
-    }
1074
-
1075
-    private function load_template() {
1076
-        do_action( 'template_redirect' );
1077
-        $template = false;
1078
-        if	 ( is_404()			&& $template = get_404_template()			) :
1079
-        elseif ( is_search()		 && $template = get_search_template()		 ) :
1080
-        elseif ( is_front_page()	 && $template = get_front_page_template()	 ) :
1081
-        elseif ( is_home()		   && $template = get_home_template()		   ) :
1082
-        elseif ( is_post_type_archive() && $template = get_post_type_archive_template() ) :
1083
-        elseif ( is_tax()			&& $template = get_taxonomy_template()	   ) :
1084
-        elseif ( is_attachment()	 && $template = get_attachment_template()	 ) :
1085
-            remove_filter('the_content', 'prepend_attachment');
1086
-        elseif ( is_single()		 && $template = get_single_template()		 ) :
1087
-        elseif ( is_page()		   && $template = get_page_template()		   ) :
1088
-        elseif ( is_category()	   && $template = get_category_template()	   ) :
1089
-        elseif ( is_tag()			&& $template = get_tag_template()			) :
1090
-        elseif ( is_author()		 && $template = get_author_template()		 ) :
1091
-        elseif ( is_date()		   && $template = get_date_template()		   ) :
1092
-        elseif ( is_archive()		&& $template = get_archive_template()		) :
1093
-        elseif ( is_paged()		  && $template = get_paged_template()		  ) :
1094
-        else :
1095
-            $template = get_index_template();
1096
-        endif;
1097
-        /**
1098
-         * Filter the path of the current template before including it.
1099
-         *
1100
-         * @since 3.0.0
1101
-         *
1102
-         * @param string $template The path of the template to include.
1103
-         */
1104
-        if ( $template = apply_filters( 'template_include', $template ) ) {
1105
-            $template_contents = file_get_contents( $template );
1106
-            $included_header = $included_footer = false;
1107
-            if ( false !== stripos( $template_contents, 'get_header();' ) ) {
1108
-                do_action( 'get_header', null );
1109
-                locate_template( 'header.php', true, false );
1110
-                $included_header = true;
1111
-            }
1112
-            include( $template );
1113
-            if ( false !== stripos( $template_contents, 'get_footer();' ) ) {
1114
-                do_action( 'get_footer', null );
1115
-                locate_template( 'footer.php', true, false );
1116
-                $included_footer = true;
1117
-            }
1118
-            if ( $included_header && $included_footer ) {
1119
-                global $wp_scripts;
1120
-                $wp_scripts->done = array();
1121
-            }
1122
-        }
1123
-        return;
1124
-    }
1125
-
1126
-    public static function setPermalinkStructure( $struc = '/%postname%/' ) {
1127
-        global $wp_rewrite;
1128
-        $wp_rewrite->set_permalink_structure( $struc );
1129
-        $wp_rewrite->flush_rules();
1130
-        update_option( 'permalink_structure', $struc );
1131
-        flush_rewrite_rules( true );
1132
-    }
1133
-
1134
-    function the_widget_form( $widget, $instance = array() ) {
1135
-        global $wp_widget_factory;
1136
-
1137
-        $widget_obj = $wp_widget_factory->widgets[$widget];
1138
-        if ( ! ( $widget_obj instanceof WP_Widget ) ) {
1139
-            return;
1140
-        }
1141
-
1142
-        $widget_obj->_set(-1);
1143
-        $widget_obj->form($instance);
1144
-    }
1145
-
1146
-    function the_widget_form_update( $widget, $new_instance = array(), $old_instance = array() ) {
1147
-        global $wp_widget_factory;
1148
-
1149
-        $widget_obj = $wp_widget_factory->widgets[$widget];
1150
-        if ( ! ( $widget_obj instanceof WP_Widget ) ) {
1151
-            return;
1152
-        }
1153
-
1154
-        $widget_obj->_set(-1);
1155
-        return $widget_obj->update($new_instance, $old_instance);
1156
-    }
1157
-
1158
-
1159
-    public function tearDown()
1160
-    {
1161
-        parent::tearDown();
1162
-    }
1008
+	}
1009
+
1010
+	public function testListingMapWidget() {
1011
+
1012
+		$template = geodir_plugin_path() . '/geodirectory-widgets/listing_map_widget.php';
1013
+		include_once($template);
1014
+
1015
+		//listing page
1016
+		$this->go_to( home_url('/?post_type=gd_place') );
1017
+
1018
+		ob_start();
1019
+		$instance = array();
1020
+		$args = array();
1021
+		$args["widget_id"] = "geodir_map_v3_listing_map-2";
1022
+		the_widget( 'geodir_map_listingpage', $instance, $args );
1023
+		$output = ob_get_contents();
1024
+		ob_end_clean();
1025
+		$this->assertContains('geodir-map-listing-page', $output);
1026
+
1027
+		// detail page
1028
+		$query_args = array(
1029
+			'post_status' => 'publish',
1030
+			'post_type' => 'gd_place',
1031
+			'posts_per_page' => 1,
1032
+		);
1033
+
1034
+		$all_posts = new WP_Query( $query_args );
1035
+		$post_id = null;
1036
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
1037
+			$post_id = get_the_ID();
1038
+		endwhile;
1039
+
1040
+		$this->assertTrue(is_int($post_id));
1041
+
1042
+		$this->go_to( get_permalink($post_id) );
1043
+
1044
+		ob_start();
1045
+		$instance = array();
1046
+		$args = array();
1047
+		$args["widget_id"] = "geodir_map_v3_listing_map-2";
1048
+		the_widget( 'geodir_map_listingpage', $instance, $args );
1049
+		$output = ob_get_contents();
1050
+		ob_end_clean();
1051
+		$this->assertContains('geodir-map-listing-page', $output);
1052
+
1053
+		ob_start();
1054
+		$this->the_widget_form( 'geodir_map_listingpage' );
1055
+		$output = ob_get_contents();
1056
+		ob_end_clean();
1057
+		$this->assertContains('Select Map View', $output);
1058
+
1059
+		$new_instance = array(
1060
+			'width' => '',
1061
+			'heigh' => '',
1062
+			'maptype' => '',
1063
+			'zoom' => '',
1064
+			'autozoom' => '',
1065
+			'sticky' => '',
1066
+			'scrollwheel' => '0',
1067
+			'showall' => '0'
1068
+		);
1069
+		$output = $this->the_widget_form_update( 'geodir_map_listingpage', $new_instance );
1070
+		$this->assertContains('0', $output['scrollwheel']);
1071
+
1072
+
1073
+	}
1074
+
1075
+	private function load_template() {
1076
+		do_action( 'template_redirect' );
1077
+		$template = false;
1078
+		if	 ( is_404()			&& $template = get_404_template()			) :
1079
+		elseif ( is_search()		 && $template = get_search_template()		 ) :
1080
+		elseif ( is_front_page()	 && $template = get_front_page_template()	 ) :
1081
+		elseif ( is_home()		   && $template = get_home_template()		   ) :
1082
+		elseif ( is_post_type_archive() && $template = get_post_type_archive_template() ) :
1083
+		elseif ( is_tax()			&& $template = get_taxonomy_template()	   ) :
1084
+		elseif ( is_attachment()	 && $template = get_attachment_template()	 ) :
1085
+			remove_filter('the_content', 'prepend_attachment');
1086
+		elseif ( is_single()		 && $template = get_single_template()		 ) :
1087
+		elseif ( is_page()		   && $template = get_page_template()		   ) :
1088
+		elseif ( is_category()	   && $template = get_category_template()	   ) :
1089
+		elseif ( is_tag()			&& $template = get_tag_template()			) :
1090
+		elseif ( is_author()		 && $template = get_author_template()		 ) :
1091
+		elseif ( is_date()		   && $template = get_date_template()		   ) :
1092
+		elseif ( is_archive()		&& $template = get_archive_template()		) :
1093
+		elseif ( is_paged()		  && $template = get_paged_template()		  ) :
1094
+		else :
1095
+			$template = get_index_template();
1096
+		endif;
1097
+		/**
1098
+		 * Filter the path of the current template before including it.
1099
+		 *
1100
+		 * @since 3.0.0
1101
+		 *
1102
+		 * @param string $template The path of the template to include.
1103
+		 */
1104
+		if ( $template = apply_filters( 'template_include', $template ) ) {
1105
+			$template_contents = file_get_contents( $template );
1106
+			$included_header = $included_footer = false;
1107
+			if ( false !== stripos( $template_contents, 'get_header();' ) ) {
1108
+				do_action( 'get_header', null );
1109
+				locate_template( 'header.php', true, false );
1110
+				$included_header = true;
1111
+			}
1112
+			include( $template );
1113
+			if ( false !== stripos( $template_contents, 'get_footer();' ) ) {
1114
+				do_action( 'get_footer', null );
1115
+				locate_template( 'footer.php', true, false );
1116
+				$included_footer = true;
1117
+			}
1118
+			if ( $included_header && $included_footer ) {
1119
+				global $wp_scripts;
1120
+				$wp_scripts->done = array();
1121
+			}
1122
+		}
1123
+		return;
1124
+	}
1125
+
1126
+	public static function setPermalinkStructure( $struc = '/%postname%/' ) {
1127
+		global $wp_rewrite;
1128
+		$wp_rewrite->set_permalink_structure( $struc );
1129
+		$wp_rewrite->flush_rules();
1130
+		update_option( 'permalink_structure', $struc );
1131
+		flush_rewrite_rules( true );
1132
+	}
1133
+
1134
+	function the_widget_form( $widget, $instance = array() ) {
1135
+		global $wp_widget_factory;
1136
+
1137
+		$widget_obj = $wp_widget_factory->widgets[$widget];
1138
+		if ( ! ( $widget_obj instanceof WP_Widget ) ) {
1139
+			return;
1140
+		}
1141
+
1142
+		$widget_obj->_set(-1);
1143
+		$widget_obj->form($instance);
1144
+	}
1145
+
1146
+	function the_widget_form_update( $widget, $new_instance = array(), $old_instance = array() ) {
1147
+		global $wp_widget_factory;
1148
+
1149
+		$widget_obj = $wp_widget_factory->widgets[$widget];
1150
+		if ( ! ( $widget_obj instanceof WP_Widget ) ) {
1151
+			return;
1152
+		}
1153
+
1154
+		$widget_obj->_set(-1);
1155
+		return $widget_obj->update($new_instance, $old_instance);
1156
+	}
1157
+
1158
+
1159
+	public function tearDown()
1160
+	{
1161
+		parent::tearDown();
1162
+	}
1163 1163
 }
1164 1164
 ?>
1165 1165
\ No newline at end of file
Please login to merge, or discard this patch.
tests/test-Add_Custom_Fields.php 2 patches
Indentation   +280 added lines, -280 removed lines patch added patch discarded remove patch
@@ -1,309 +1,309 @@
 block discarded – undo
1 1
 <?php
2 2
 class AddCustomFields extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-        wp_set_current_user(1);
8
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+		wp_set_current_user(1);
8
+	}
9 9
 
10
-    public function testAddCustomFields()
11
-    {
12
-        $field = array(
13
-            'listing_type'  => 'gd_place',
14
-            'data_type'     => '',
15
-            'field_type'    => 'select',
16
-            'admin_title'   => __( 'Place Type', 'test' ),
17
-            'admin_desc'    => __( 'Select the place type.', 'test' ),
18
-            'site_title'    => __( 'Place Type', 'test' ),
19
-            'htmlvar_name'  => 'test_place_type',
20
-            'default_value' => '',
21
-            'option_values' => 'Hotel,Bar,Restaurant,Pub',
22
-            'is_default'    => '1',
23
-            'is_admin'      => '1',
24
-            'clabels'       => __( 'Place Type', 'test' )
25
-        );
10
+	public function testAddCustomFields()
11
+	{
12
+		$field = array(
13
+			'listing_type'  => 'gd_place',
14
+			'data_type'     => '',
15
+			'field_type'    => 'select',
16
+			'admin_title'   => __( 'Place Type', 'test' ),
17
+			'admin_desc'    => __( 'Select the place type.', 'test' ),
18
+			'site_title'    => __( 'Place Type', 'test' ),
19
+			'htmlvar_name'  => 'test_place_type',
20
+			'default_value' => '',
21
+			'option_values' => 'Hotel,Bar,Restaurant,Pub',
22
+			'is_default'    => '1',
23
+			'is_admin'      => '1',
24
+			'clabels'       => __( 'Place Type', 'test' )
25
+		);
26 26
 
27
-        $lastid = geodir_custom_field_save( $field );
27
+		$lastid = geodir_custom_field_save( $field );
28 28
 
29
-        $this->assertTrue(is_int($lastid));
29
+		$this->assertTrue(is_int($lastid));
30 30
 
31 31
 
32
-        $field2 = array(
33
-            'listing_type'  => 'gd_place',
34
-            'data_type'     => 'VARCHAR',
35
-            'field_type'    => 'url',
36
-            'admin_title'   => __( 'Website Link', 'test' ),
37
-            'admin_desc'    => __( 'Enter the website link.', 'test' ),
38
-            'site_title'    => __( 'Website Link', 'test' ),
39
-            'htmlvar_name'  => 'test_ws_link',
40
-            'default_value' => '',
41
-            'option_values' => '',
42
-            'is_default'    => '1',
43
-            'is_admin'      => '1',
44
-            'clabels'       => __( 'Website Link', 'test' )
45
-        );
32
+		$field2 = array(
33
+			'listing_type'  => 'gd_place',
34
+			'data_type'     => 'VARCHAR',
35
+			'field_type'    => 'url',
36
+			'admin_title'   => __( 'Website Link', 'test' ),
37
+			'admin_desc'    => __( 'Enter the website link.', 'test' ),
38
+			'site_title'    => __( 'Website Link', 'test' ),
39
+			'htmlvar_name'  => 'test_ws_link',
40
+			'default_value' => '',
41
+			'option_values' => '',
42
+			'is_default'    => '1',
43
+			'is_admin'      => '1',
44
+			'clabels'       => __( 'Website Link', 'test' )
45
+		);
46 46
 
47
-        $lastid2 = geodir_custom_field_save( $field2 );
47
+		$lastid2 = geodir_custom_field_save( $field2 );
48 48
 
49
-        $this->assertTrue(is_int($lastid2));
49
+		$this->assertTrue(is_int($lastid2));
50 50
 
51
-        //test error
52
-        $field3 = array(
53
-            'listing_type'  => 'gd_place',
54
-            'data_type'     => '',
55
-            'field_type'    => 'select',
56
-            'admin_title'   => __( 'Place Type', 'test' ),
57
-            'admin_desc'    => __( 'Select the place type.', 'test' ),
58
-            'site_title'    => __( 'Place Type', 'test' ),
59
-            'htmlvar_name'  => 'test_place_type',
60
-            'default_value' => '',
61
-            'option_values' => 'Hotel,Bar,Restaurant,Pub',
62
-            'is_default'    => '1',
63
-            'is_admin'      => '1',
64
-            'clabels'       => __( 'Place Type', 'test' )
65
-        );
51
+		//test error
52
+		$field3 = array(
53
+			'listing_type'  => 'gd_place',
54
+			'data_type'     => '',
55
+			'field_type'    => 'select',
56
+			'admin_title'   => __( 'Place Type', 'test' ),
57
+			'admin_desc'    => __( 'Select the place type.', 'test' ),
58
+			'site_title'    => __( 'Place Type', 'test' ),
59
+			'htmlvar_name'  => 'test_place_type',
60
+			'default_value' => '',
61
+			'option_values' => 'Hotel,Bar,Restaurant,Pub',
62
+			'is_default'    => '1',
63
+			'is_admin'      => '1',
64
+			'clabels'       => __( 'Place Type', 'test' )
65
+		);
66 66
 
67
-        $error = geodir_custom_field_save( $field3 );
67
+		$error = geodir_custom_field_save( $field3 );
68 68
 
69
-        $this->assertContains( 'HTML Variable Name should be a unique name', $error );
70
-    }
69
+		$this->assertContains( 'HTML Variable Name should be a unique name', $error );
70
+	}
71 71
 
72
-    public function testAddMoreCustomFields() {
73
-        $fieldsets  = array();
74
-        $fields  = array();
75
-        $filters = array();
72
+	public function testAddMoreCustomFields() {
73
+		$fieldsets  = array();
74
+		$fields  = array();
75
+		$filters = array();
76 76
 
77
-        // Place Details
78
-        $fieldsets[] = array(
79
-            'listing_type'  => 'gd_place',
80
-            'data_type'     => '',
81
-            'field_type'    => 'fieldset',
82
-            'admin_title'   => __( 'Place Details', 'directory_starter' ),
83
-            'admin_desc'    => __( 'Place Details.', 'directory_starter' ),
84
-            'site_title'    => __( 'Place Details', 'directory_starter' ),
85
-            'default_value' => '',
86
-            'option_values' => '',
87
-            'is_default'    => '1',
88
-            'is_admin'      => '1',
89
-            'clabels'       => __( 'Place Details', 'directory_starter' )
90
-        );
77
+		// Place Details
78
+		$fieldsets[] = array(
79
+			'listing_type'  => 'gd_place',
80
+			'data_type'     => '',
81
+			'field_type'    => 'fieldset',
82
+			'admin_title'   => __( 'Place Details', 'directory_starter' ),
83
+			'admin_desc'    => __( 'Place Details.', 'directory_starter' ),
84
+			'site_title'    => __( 'Place Details', 'directory_starter' ),
85
+			'default_value' => '',
86
+			'option_values' => '',
87
+			'is_default'    => '1',
88
+			'is_admin'      => '1',
89
+			'clabels'       => __( 'Place Details', 'directory_starter' )
90
+		);
91 91
 
92
-        // Salary
93
-        $fields[] = array(
94
-            'listing_type' => 'gd_place',
95
-            'data_type' => 'INT',
96
-            'field_type' => 'text',
97
-            'admin_title' => __('Salary', 'directory_starter'),
98
-            'admin_desc' => __('Enter salary.', 'directory_starter'),
99
-            'site_title' => __('Salary', 'directory_starter'),
100
-            'htmlvar_name' => 'job_salary',
101
-            'default_value' => '',
102
-            'option_values' => '',
103
-            'is_default' => '1',
104
-            'is_admin' => '1',
105
-            'clabels' => __('Salary', 'directory_starter')
106
-        );
92
+		// Salary
93
+		$fields[] = array(
94
+			'listing_type' => 'gd_place',
95
+			'data_type' => 'INT',
96
+			'field_type' => 'text',
97
+			'admin_title' => __('Salary', 'directory_starter'),
98
+			'admin_desc' => __('Enter salary.', 'directory_starter'),
99
+			'site_title' => __('Salary', 'directory_starter'),
100
+			'htmlvar_name' => 'job_salary',
101
+			'default_value' => '',
102
+			'option_values' => '',
103
+			'is_default' => '1',
104
+			'is_admin' => '1',
105
+			'clabels' => __('Salary', 'directory_starter')
106
+		);
107 107
 
108
-        // Salary Filter
109
-        $filters[] = array(
110
-            'create_field' => 'true',
111
-            'listing_type' => 'gd_place',
112
-            'field_id' => '',
113
-            'field_type' => 'text',
114
-            'data_type' => 'RANGE',
115
-            'is_active' => '1',
116
-            'site_field_title' => 'Salary',
117
-            'field_data_type' => 'INT',
118
-            'data_type_change' => 'TEXT',
119
-            'search_condition_select' => 'FROM',
120
-            'search_min_value' => '',
121
-            'search_max_value' => '',
122
-            'search_diff_value' => '',
123
-            'first_search_value' => '',
124
-            'first_search_text' => '',
125
-            'last_search_text' => '',
126
-            'search_condition' => 'FROM',
127
-            'site_htmlvar_name' => 'geodir_job_salary',
128
-            'field_title' => 'geodir_job_salary',
129
-            'expand_custom_value' => '',
130
-            'front_search_title' => 'Salary',
131
-            'field_desc' => ''
132
-        );
108
+		// Salary Filter
109
+		$filters[] = array(
110
+			'create_field' => 'true',
111
+			'listing_type' => 'gd_place',
112
+			'field_id' => '',
113
+			'field_type' => 'text',
114
+			'data_type' => 'RANGE',
115
+			'is_active' => '1',
116
+			'site_field_title' => 'Salary',
117
+			'field_data_type' => 'INT',
118
+			'data_type_change' => 'TEXT',
119
+			'search_condition_select' => 'FROM',
120
+			'search_min_value' => '',
121
+			'search_max_value' => '',
122
+			'search_diff_value' => '',
123
+			'first_search_value' => '',
124
+			'first_search_text' => '',
125
+			'last_search_text' => '',
126
+			'search_condition' => 'FROM',
127
+			'site_htmlvar_name' => 'geodir_job_salary',
128
+			'field_title' => 'geodir_job_salary',
129
+			'expand_custom_value' => '',
130
+			'front_search_title' => 'Salary',
131
+			'field_desc' => ''
132
+		);
133 133
 
134
-        // Field Set
135
-        if (!empty($fieldsets)) {
136
-            foreach ($fieldsets as $fieldset_index => $fieldset) {
137
-                geodir_custom_field_save($fieldset);
138
-            }
139
-        }
134
+		// Field Set
135
+		if (!empty($fieldsets)) {
136
+			foreach ($fieldsets as $fieldset_index => $fieldset) {
137
+				geodir_custom_field_save($fieldset);
138
+			}
139
+		}
140 140
 
141
-        // Custom Fields
142
-        if (!empty($fields)) {
143
-            foreach ($fields as $field_index => $field) {
144
-                $lastid = geodir_custom_field_save( $field );
145
-                $this->assertTrue(is_int($lastid));
146
-            }
147
-        }
141
+		// Custom Fields
142
+		if (!empty($fields)) {
143
+			foreach ($fields as $field_index => $field) {
144
+				$lastid = geodir_custom_field_save( $field );
145
+				$this->assertTrue(is_int($lastid));
146
+			}
147
+		}
148 148
 
149
-    }
149
+	}
150 150
 
151
-    public function testTextCusField() {
152
-        $_REQUEST = array (
153
-            'action' =>  'geodir_ajax_action',
154
-            'create_field' =>  'true',
155
-            'field_ins_upd' =>  'submit',
156
-            '_wpnonce' =>  wp_create_nonce('custom_fields_text_field_99'),
157
-            'listing_type' =>  'gd_place',
158
-            'field_type' =>  'text',
159
-            'field_id' =>  'text_field_99',
160
-            'data_type' =>  'XVARCHAR',
161
-            'is_active' =>  '1',
162
-            'site_title' => "Text Field",
163
-            'admin_title' => "Text Field",
164
-            'admin_desc' => "Text Field",
165
-            'site_field_title' =>  'Category',
166
-            'field_data_type' =>  'VARCHAR',
167
-            'search_condition' =>  'SINGLE',
168
-            'htmlvar_name' =>  'text_field_99',
169
-            'for_admin_use' => '0',
170
-            'is_required' => '0',
171
-            'required_msg'=> '',
172
-            'validation_pattern' => '',
173
-            'validation_msg' => '',
174
-            'decimal_point' => '',
175
-            'clabels' => 'Text Field',
176
-            'is_default' => '1',
177
-            'field_title' =>  'Text Field',
178
-            'expand_custom_value' =>  '',
179
-            'search_operator' =>  'AND',
180
-            'front_search_title' =>  'Category',
181
-            'field_desc' =>  'Cat',
182
-            'geodir_ajax' => 'admin_ajax',
183
-            'manage_field_type' => 'custom_fields',
184
-            'default_value' =>  '' ,
185
-            'sort_order' =>  '11' ,
186
-            'show_on_listing' =>  '1' ,
187
-            'show_on_detail' =>  '1' ,
188
-            'show_as_tab' =>  '0' ,
189
-            'field_icon' =>  '' ,
190
-            'css_class' =>  '' ,
191
-        );
192
-        add_filter('wp_redirect', '__return_false');
193
-        ob_start();
194
-        geodir_ajax_handler();
195
-        $output = ob_get_contents();
196
-        ob_end_clean();
197
-        $this->assertContains('Double Click to toggle', $output);
198
-        remove_filter('wp_redirect', '__return_false');
151
+	public function testTextCusField() {
152
+		$_REQUEST = array (
153
+			'action' =>  'geodir_ajax_action',
154
+			'create_field' =>  'true',
155
+			'field_ins_upd' =>  'submit',
156
+			'_wpnonce' =>  wp_create_nonce('custom_fields_text_field_99'),
157
+			'listing_type' =>  'gd_place',
158
+			'field_type' =>  'text',
159
+			'field_id' =>  'text_field_99',
160
+			'data_type' =>  'XVARCHAR',
161
+			'is_active' =>  '1',
162
+			'site_title' => "Text Field",
163
+			'admin_title' => "Text Field",
164
+			'admin_desc' => "Text Field",
165
+			'site_field_title' =>  'Category',
166
+			'field_data_type' =>  'VARCHAR',
167
+			'search_condition' =>  'SINGLE',
168
+			'htmlvar_name' =>  'text_field_99',
169
+			'for_admin_use' => '0',
170
+			'is_required' => '0',
171
+			'required_msg'=> '',
172
+			'validation_pattern' => '',
173
+			'validation_msg' => '',
174
+			'decimal_point' => '',
175
+			'clabels' => 'Text Field',
176
+			'is_default' => '1',
177
+			'field_title' =>  'Text Field',
178
+			'expand_custom_value' =>  '',
179
+			'search_operator' =>  'AND',
180
+			'front_search_title' =>  'Category',
181
+			'field_desc' =>  'Cat',
182
+			'geodir_ajax' => 'admin_ajax',
183
+			'manage_field_type' => 'custom_fields',
184
+			'default_value' =>  '' ,
185
+			'sort_order' =>  '11' ,
186
+			'show_on_listing' =>  '1' ,
187
+			'show_on_detail' =>  '1' ,
188
+			'show_as_tab' =>  '0' ,
189
+			'field_icon' =>  '' ,
190
+			'css_class' =>  '' ,
191
+		);
192
+		add_filter('wp_redirect', '__return_false');
193
+		ob_start();
194
+		geodir_ajax_handler();
195
+		$output = ob_get_contents();
196
+		ob_end_clean();
197
+		$this->assertContains('Double Click to toggle', $output);
198
+		remove_filter('wp_redirect', '__return_false');
199 199
 
200
-    }
200
+	}
201 201
 
202
-    public function texstDateCusField() {
203
-        $_REQUEST = array (
204
-            'action' =>  'geodir_ajax_action',
205
-            'create_field' =>  'true',
206
-            'field_ins_upd' =>  'submit',
207
-            '_wpnonce' =>  wp_create_nonce('custom_fields_date_field'),
208
-            'listing_type' =>  'gd_place',
209
-            'field_type' =>  'datepicker',
210
-            'field_id' =>  'date_field',
211
-            'data_type' =>  '',
212
-            'is_active' =>  '1',
213
-            'site_title' => "Text Field",
214
-            'admin_title' => "Text Field",
215
-            'admin_desc' => "Text Field",
216
-            'site_field_title' =>  'Category',
217
-            'field_data_type' =>  'VARCHAR',
218
-            'search_condition' =>  'SINGLE',
219
-            'htmlvar_name' =>  'date_field',
220
-            'for_admin_use' => '0',
221
-            'is_required' => '0',
222
-            'required_msg'=> '',
223
-            'validation_pattern' => '',
224
-            'validation_msg' => '',
225
-            'decimal_point' => '',
226
-            'clabels' => 'Text Field',
227
-            'is_default' => '0',
228
-            'field_title' =>  'Text Field',
229
-            'expand_custom_value' =>  '',
230
-            'search_operator' =>  'AND',
231
-            'front_search_title' =>  'Category',
232
-            'field_desc' =>  'Cat',
233
-            'geodir_ajax' => 'admin_ajax',
234
-            'manage_field_type' => 'custom_fields',
235
-            'default_value' =>  '' ,
236
-            'sort_order' =>  '12' ,
237
-            'show_on_listing' =>  '1' ,
238
-            'show_on_detail' =>  '1' ,
239
-            'show_as_tab' =>  '0' ,
240
-            'field_icon' =>  '' ,
241
-            'css_class' =>  '' ,
242
-            'extra' => array(
243
-                'date_format' => 'mm/dd/yy'
244
-            )
245
-        );
246
-        add_filter('wp_redirect', '__return_false');
247
-        ob_start();
248
-        geodir_ajax_handler();
249
-        $output = ob_get_contents();
250
-        ob_end_clean();
251
-        $this->assertContains('Double Click to toggle', $output);
252
-        remove_filter('wp_redirect', '__return_false');
202
+	public function texstDateCusField() {
203
+		$_REQUEST = array (
204
+			'action' =>  'geodir_ajax_action',
205
+			'create_field' =>  'true',
206
+			'field_ins_upd' =>  'submit',
207
+			'_wpnonce' =>  wp_create_nonce('custom_fields_date_field'),
208
+			'listing_type' =>  'gd_place',
209
+			'field_type' =>  'datepicker',
210
+			'field_id' =>  'date_field',
211
+			'data_type' =>  '',
212
+			'is_active' =>  '1',
213
+			'site_title' => "Text Field",
214
+			'admin_title' => "Text Field",
215
+			'admin_desc' => "Text Field",
216
+			'site_field_title' =>  'Category',
217
+			'field_data_type' =>  'VARCHAR',
218
+			'search_condition' =>  'SINGLE',
219
+			'htmlvar_name' =>  'date_field',
220
+			'for_admin_use' => '0',
221
+			'is_required' => '0',
222
+			'required_msg'=> '',
223
+			'validation_pattern' => '',
224
+			'validation_msg' => '',
225
+			'decimal_point' => '',
226
+			'clabels' => 'Text Field',
227
+			'is_default' => '0',
228
+			'field_title' =>  'Text Field',
229
+			'expand_custom_value' =>  '',
230
+			'search_operator' =>  'AND',
231
+			'front_search_title' =>  'Category',
232
+			'field_desc' =>  'Cat',
233
+			'geodir_ajax' => 'admin_ajax',
234
+			'manage_field_type' => 'custom_fields',
235
+			'default_value' =>  '' ,
236
+			'sort_order' =>  '12' ,
237
+			'show_on_listing' =>  '1' ,
238
+			'show_on_detail' =>  '1' ,
239
+			'show_as_tab' =>  '0' ,
240
+			'field_icon' =>  '' ,
241
+			'css_class' =>  '' ,
242
+			'extra' => array(
243
+				'date_format' => 'mm/dd/yy'
244
+			)
245
+		);
246
+		add_filter('wp_redirect', '__return_false');
247
+		ob_start();
248
+		geodir_ajax_handler();
249
+		$output = ob_get_contents();
250
+		ob_end_clean();
251
+		$this->assertContains('Double Click to toggle', $output);
252
+		remove_filter('wp_redirect', '__return_false');
253 253
 
254
-    }
254
+	}
255 255
 
256
-    public function texstTextAreaCusField() {
257
-        $_REQUEST = array (
258
-            'action' =>  'geodir_ajax_action',
259
-            'create_field' =>  'true',
260
-            'field_ins_upd' =>  'submit',
261
-            '_wpnonce' =>  wp_create_nonce('custom_fields_textarea_field'),
262
-            'listing_type' =>  'gd_place',
263
-            'field_type' =>  'textarea',
264
-            'field_id' =>  'textarea_field',
265
-            'data_type' =>  '',
266
-            'is_active' =>  '1',
267
-            'site_title' => "Text Field",
268
-            'admin_title' => "Text Field",
269
-            'admin_desc' => "Text Field",
270
-            'htmlvar_name' =>  'textarea_field',
271
-            'for_admin_use' => '0',
272
-            'is_required' => '0',
273
-            'required_msg'=> '',
274
-            'validation_pattern' => '',
275
-            'validation_msg' => '',
276
-            'decimal_point' => '',
277
-            'clabels' => 'Text Field',
278
-            'is_default' => '1',
279
-            'field_title' =>  'Text Field',
280
-            'expand_custom_value' =>  '',
281
-            'search_operator' =>  'AND',
282
-            'front_search_title' =>  'Category',
283
-            'field_desc' =>  'Cat',
284
-            'geodir_ajax' => 'admin_ajax',
285
-            'manage_field_type' => 'custom_fields',
286
-            'default_value' =>  '' ,
287
-            'sort_order' =>  '12' ,
288
-            'show_on_listing' =>  '1' ,
289
-            'show_on_detail' =>  '1' ,
290
-            'show_as_tab' =>  '0' ,
291
-            'field_icon' =>  '' ,
292
-            'css_class' =>  '' ,
293
-        );
294
-        add_filter('wp_redirect', '__return_false');
295
-        ob_start();
296
-        geodir_ajax_handler();
297
-        $output = ob_get_contents();
298
-        ob_end_clean();
299
-        $this->assertContains('Double Click to toggle', $output);
300
-        remove_filter('wp_redirect', '__return_false');
256
+	public function texstTextAreaCusField() {
257
+		$_REQUEST = array (
258
+			'action' =>  'geodir_ajax_action',
259
+			'create_field' =>  'true',
260
+			'field_ins_upd' =>  'submit',
261
+			'_wpnonce' =>  wp_create_nonce('custom_fields_textarea_field'),
262
+			'listing_type' =>  'gd_place',
263
+			'field_type' =>  'textarea',
264
+			'field_id' =>  'textarea_field',
265
+			'data_type' =>  '',
266
+			'is_active' =>  '1',
267
+			'site_title' => "Text Field",
268
+			'admin_title' => "Text Field",
269
+			'admin_desc' => "Text Field",
270
+			'htmlvar_name' =>  'textarea_field',
271
+			'for_admin_use' => '0',
272
+			'is_required' => '0',
273
+			'required_msg'=> '',
274
+			'validation_pattern' => '',
275
+			'validation_msg' => '',
276
+			'decimal_point' => '',
277
+			'clabels' => 'Text Field',
278
+			'is_default' => '1',
279
+			'field_title' =>  'Text Field',
280
+			'expand_custom_value' =>  '',
281
+			'search_operator' =>  'AND',
282
+			'front_search_title' =>  'Category',
283
+			'field_desc' =>  'Cat',
284
+			'geodir_ajax' => 'admin_ajax',
285
+			'manage_field_type' => 'custom_fields',
286
+			'default_value' =>  '' ,
287
+			'sort_order' =>  '12' ,
288
+			'show_on_listing' =>  '1' ,
289
+			'show_on_detail' =>  '1' ,
290
+			'show_as_tab' =>  '0' ,
291
+			'field_icon' =>  '' ,
292
+			'css_class' =>  '' ,
293
+		);
294
+		add_filter('wp_redirect', '__return_false');
295
+		ob_start();
296
+		geodir_ajax_handler();
297
+		$output = ob_get_contents();
298
+		ob_end_clean();
299
+		$this->assertContains('Double Click to toggle', $output);
300
+		remove_filter('wp_redirect', '__return_false');
301 301
 
302
-    }
302
+	}
303 303
 
304
-    public function tearDown()
305
-    {
306
-        parent::tearDown();
307
-    }
304
+	public function tearDown()
305
+	{
306
+		parent::tearDown();
307
+	}
308 308
 }
309 309
 ?>
310 310
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -13,18 +13,18 @@  discard block
 block discarded – undo
13 13
             'listing_type'  => 'gd_place',
14 14
             'data_type'     => '',
15 15
             'field_type'    => 'select',
16
-            'admin_title'   => __( 'Place Type', 'test' ),
17
-            'admin_desc'    => __( 'Select the place type.', 'test' ),
18
-            'site_title'    => __( 'Place Type', 'test' ),
16
+            'admin_title'   => __('Place Type', 'test'),
17
+            'admin_desc'    => __('Select the place type.', 'test'),
18
+            'site_title'    => __('Place Type', 'test'),
19 19
             'htmlvar_name'  => 'test_place_type',
20 20
             'default_value' => '',
21 21
             'option_values' => 'Hotel,Bar,Restaurant,Pub',
22 22
             'is_default'    => '1',
23 23
             'is_admin'      => '1',
24
-            'clabels'       => __( 'Place Type', 'test' )
24
+            'clabels'       => __('Place Type', 'test')
25 25
         );
26 26
 
27
-        $lastid = geodir_custom_field_save( $field );
27
+        $lastid = geodir_custom_field_save($field);
28 28
 
29 29
         $this->assertTrue(is_int($lastid));
30 30
 
@@ -33,18 +33,18 @@  discard block
 block discarded – undo
33 33
             'listing_type'  => 'gd_place',
34 34
             'data_type'     => 'VARCHAR',
35 35
             'field_type'    => 'url',
36
-            'admin_title'   => __( 'Website Link', 'test' ),
37
-            'admin_desc'    => __( 'Enter the website link.', 'test' ),
38
-            'site_title'    => __( 'Website Link', 'test' ),
36
+            'admin_title'   => __('Website Link', 'test'),
37
+            'admin_desc'    => __('Enter the website link.', 'test'),
38
+            'site_title'    => __('Website Link', 'test'),
39 39
             'htmlvar_name'  => 'test_ws_link',
40 40
             'default_value' => '',
41 41
             'option_values' => '',
42 42
             'is_default'    => '1',
43 43
             'is_admin'      => '1',
44
-            'clabels'       => __( 'Website Link', 'test' )
44
+            'clabels'       => __('Website Link', 'test')
45 45
         );
46 46
 
47
-        $lastid2 = geodir_custom_field_save( $field2 );
47
+        $lastid2 = geodir_custom_field_save($field2);
48 48
 
49 49
         $this->assertTrue(is_int($lastid2));
50 50
 
@@ -53,24 +53,24 @@  discard block
 block discarded – undo
53 53
             'listing_type'  => 'gd_place',
54 54
             'data_type'     => '',
55 55
             'field_type'    => 'select',
56
-            'admin_title'   => __( 'Place Type', 'test' ),
57
-            'admin_desc'    => __( 'Select the place type.', 'test' ),
58
-            'site_title'    => __( 'Place Type', 'test' ),
56
+            'admin_title'   => __('Place Type', 'test'),
57
+            'admin_desc'    => __('Select the place type.', 'test'),
58
+            'site_title'    => __('Place Type', 'test'),
59 59
             'htmlvar_name'  => 'test_place_type',
60 60
             'default_value' => '',
61 61
             'option_values' => 'Hotel,Bar,Restaurant,Pub',
62 62
             'is_default'    => '1',
63 63
             'is_admin'      => '1',
64
-            'clabels'       => __( 'Place Type', 'test' )
64
+            'clabels'       => __('Place Type', 'test')
65 65
         );
66 66
 
67
-        $error = geodir_custom_field_save( $field3 );
67
+        $error = geodir_custom_field_save($field3);
68 68
 
69
-        $this->assertContains( 'HTML Variable Name should be a unique name', $error );
69
+        $this->assertContains('HTML Variable Name should be a unique name', $error);
70 70
     }
71 71
 
72 72
     public function testAddMoreCustomFields() {
73
-        $fieldsets  = array();
73
+        $fieldsets = array();
74 74
         $fields  = array();
75 75
         $filters = array();
76 76
 
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
             'listing_type'  => 'gd_place',
80 80
             'data_type'     => '',
81 81
             'field_type'    => 'fieldset',
82
-            'admin_title'   => __( 'Place Details', 'directory_starter' ),
83
-            'admin_desc'    => __( 'Place Details.', 'directory_starter' ),
84
-            'site_title'    => __( 'Place Details', 'directory_starter' ),
82
+            'admin_title'   => __('Place Details', 'directory_starter'),
83
+            'admin_desc'    => __('Place Details.', 'directory_starter'),
84
+            'site_title'    => __('Place Details', 'directory_starter'),
85 85
             'default_value' => '',
86 86
             'option_values' => '',
87 87
             'is_default'    => '1',
88 88
             'is_admin'      => '1',
89
-            'clabels'       => __( 'Place Details', 'directory_starter' )
89
+            'clabels'       => __('Place Details', 'directory_starter')
90 90
         );
91 91
 
92 92
         // Salary
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         // Custom Fields
142 142
         if (!empty($fields)) {
143 143
             foreach ($fields as $field_index => $field) {
144
-                $lastid = geodir_custom_field_save( $field );
144
+                $lastid = geodir_custom_field_save($field);
145 145
                 $this->assertTrue(is_int($lastid));
146 146
             }
147 147
         }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     }
150 150
 
151 151
     public function testTextCusField() {
152
-        $_REQUEST = array (
152
+        $_REQUEST = array(
153 153
             'action' =>  'geodir_ajax_action',
154 154
             'create_field' =>  'true',
155 155
             'field_ins_upd' =>  'submit',
@@ -181,13 +181,13 @@  discard block
 block discarded – undo
181 181
             'field_desc' =>  'Cat',
182 182
             'geodir_ajax' => 'admin_ajax',
183 183
             'manage_field_type' => 'custom_fields',
184
-            'default_value' =>  '' ,
185
-            'sort_order' =>  '11' ,
186
-            'show_on_listing' =>  '1' ,
187
-            'show_on_detail' =>  '1' ,
188
-            'show_as_tab' =>  '0' ,
189
-            'field_icon' =>  '' ,
190
-            'css_class' =>  '' ,
184
+            'default_value' =>  '',
185
+            'sort_order' =>  '11',
186
+            'show_on_listing' =>  '1',
187
+            'show_on_detail' =>  '1',
188
+            'show_as_tab' =>  '0',
189
+            'field_icon' =>  '',
190
+            'css_class' =>  '',
191 191
         );
192 192
         add_filter('wp_redirect', '__return_false');
193 193
         ob_start();
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     }
201 201
 
202 202
     public function texstDateCusField() {
203
-        $_REQUEST = array (
203
+        $_REQUEST = array(
204 204
             'action' =>  'geodir_ajax_action',
205 205
             'create_field' =>  'true',
206 206
             'field_ins_upd' =>  'submit',
@@ -232,13 +232,13 @@  discard block
 block discarded – undo
232 232
             'field_desc' =>  'Cat',
233 233
             'geodir_ajax' => 'admin_ajax',
234 234
             'manage_field_type' => 'custom_fields',
235
-            'default_value' =>  '' ,
236
-            'sort_order' =>  '12' ,
237
-            'show_on_listing' =>  '1' ,
238
-            'show_on_detail' =>  '1' ,
239
-            'show_as_tab' =>  '0' ,
240
-            'field_icon' =>  '' ,
241
-            'css_class' =>  '' ,
235
+            'default_value' =>  '',
236
+            'sort_order' =>  '12',
237
+            'show_on_listing' =>  '1',
238
+            'show_on_detail' =>  '1',
239
+            'show_as_tab' =>  '0',
240
+            'field_icon' =>  '',
241
+            'css_class' =>  '',
242 242
             'extra' => array(
243 243
                 'date_format' => 'mm/dd/yy'
244 244
             )
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     }
255 255
 
256 256
     public function texstTextAreaCusField() {
257
-        $_REQUEST = array (
257
+        $_REQUEST = array(
258 258
             'action' =>  'geodir_ajax_action',
259 259
             'create_field' =>  'true',
260 260
             'field_ins_upd' =>  'submit',
@@ -283,13 +283,13 @@  discard block
 block discarded – undo
283 283
             'field_desc' =>  'Cat',
284 284
             'geodir_ajax' => 'admin_ajax',
285 285
             'manage_field_type' => 'custom_fields',
286
-            'default_value' =>  '' ,
287
-            'sort_order' =>  '12' ,
288
-            'show_on_listing' =>  '1' ,
289
-            'show_on_detail' =>  '1' ,
290
-            'show_as_tab' =>  '0' ,
291
-            'field_icon' =>  '' ,
292
-            'css_class' =>  '' ,
286
+            'default_value' =>  '',
287
+            'sort_order' =>  '12',
288
+            'show_on_listing' =>  '1',
289
+            'show_on_detail' =>  '1',
290
+            'show_as_tab' =>  '0',
291
+            'field_icon' =>  '',
292
+            'css_class' =>  '',
293 293
         );
294 294
         add_filter('wp_redirect', '__return_false');
295 295
         ob_start();
Please login to merge, or discard this patch.