Test Failed
Push — master ( 067f1e...932518 )
by Stiofan
16:50
created
tests/lib/wordpress-tests-lib/wp-tests-config.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /* Path to the WordPress codebase you'd like to test. Add a backslash in the end. */
4
-define( 'ABSPATH', getenv( 'WP_CORE_DIR' ) . '/' );
4
+define('ABSPATH', getenv('WP_CORE_DIR').'/');
5 5
 
6 6
 // Test with multisite enabled
7
-define( 'WP_TESTS_MULTISITE', (bool) getenv( 'WP_MULTISITE' ) );
7
+define('WP_TESTS_MULTISITE', (bool) getenv('WP_MULTISITE'));
8 8
 
9 9
 // Force known bugs
10 10
 // define( 'WP_TESTS_FORCE_KNOWN_BUGS', true );
11 11
 
12 12
 // Test with WordPress debug mode on
13
-define( 'WP_DEBUG', true );
13
+define('WP_DEBUG', true);
14 14
 
15 15
 // ** MySQL settings ** //
16 16
 
@@ -21,21 +21,21 @@  discard block
 block discarded – undo
21 21
 // These tests will DROP ALL TABLES in the database with the prefix named below.
22 22
 // DO NOT use a production database or one that is shared with something else.
23 23
 
24
-define( 'DB_NAME', 'wordpress_test' );
25
-define( 'DB_USER', 'root' );
26
-define( 'DB_PASSWORD', 'root' );
27
-define( 'DB_HOST', 'localhost' );
28
-define( 'DB_CHARSET', 'utf8' );
29
-define( 'DB_COLLATE', '' );
24
+define('DB_NAME', 'wordpress_test');
25
+define('DB_USER', 'root');
26
+define('DB_PASSWORD', 'root');
27
+define('DB_HOST', 'localhost');
28
+define('DB_CHARSET', 'utf8');
29
+define('DB_COLLATE', '');
30 30
 
31
-define( 'WP_TESTS_DOMAIN', 'example.org' );
32
-define( 'WP_TESTS_EMAIL', '[email protected]' );
33
-define( 'WP_TESTS_TITLE', 'Test Blog' );
31
+define('WP_TESTS_DOMAIN', 'example.org');
32
+define('WP_TESTS_EMAIL', '[email protected]');
33
+define('WP_TESTS_TITLE', 'Test Blog');
34 34
 
35
-define( 'WP_PHP_BINARY', 'php' );
35
+define('WP_PHP_BINARY', 'php');
36 36
 
37
-define( 'FS_CHMOD_DIR', ( 0755 & ~ umask() ) );
38
-define( 'FS_CHMOD_FILE', ( 0644 & ~ umask() ) );
37
+define('FS_CHMOD_DIR', (0755 & ~ umask()));
38
+define('FS_CHMOD_FILE', (0644 & ~ umask()));
39 39
 
40
-define( 'WPLANG', '' );
41
-$table_prefix  = 'wptests_';
42 40
\ No newline at end of file
41
+define('WPLANG', '');
42
+$table_prefix = 'wptests_';
43 43
\ No newline at end of file
Please login to merge, or discard this patch.
tests/test-Check_Shortcodes.php 2 patches
Indentation   +136 added lines, -136 removed lines patch added patch discarded remove patch
@@ -1,141 +1,141 @@
 block discarded – undo
1 1
 <?php
2 2
 class CheckShortcodes extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-        wp_set_current_user(1);
8
-
9
-    }
10
-
11
-    public function testHomeMapShortcode()
12
-    {
13
-        $output = do_shortcode('[gd_homepage_map width=100% height=300 scrollwheel=false]');
14
-        $this->assertContains( 'geodir-map-home-page', $output );
15
-    }
16
-
17
-    public function testListingMapShortcode()
18
-    {
19
-        $output = do_shortcode('[gd_listing_map width=100% height=300 scrollwheel=false sticky=true]');
20
-        $this->assertContains( 'geodir-map-listing-page', $output );
21
-    }
22
-
23
-    public function testListingSliderShortcode()
24
-    {
25
-        $output = do_shortcode('[gd_listing_slider post_number=5 category=3 slideshow=true show_featured_only=true]');
26
-        $this->assertContains( 'geodir_widget_carousel', $output );
27
-    }
28
-
29
-    public function testLoginBoxShortcode()
30
-    {
31
-        $output = do_shortcode('[gd_login_box]');
32
-        $this->assertContains( 'geodir-loginbox-list', $output );
33
-    }
34
-
35
-    public function testPopPostCatShortcode()
36
-    {
37
-        global $geodir_post_type;
38
-        $geodir_post_type = 'gd_place';
39
-        $output = do_shortcode('[gd_popular_post_category category_limit=30]');
40
-        $this->assertContains( 'geodir-popular-cat-list', $output );
41
-    }
42
-
43
-    public function testPopPostViewShortcode()
44
-    {
45
-        $output = do_shortcode('[gd_popular_post_view category=3 layout=5 add_location_filter=true character_count=0 show_featured_only=true]');
46
-        $this->assertContains( 'geodir_category_list_view', $output );
47
-    }
48
-
49
-    public function testRecentReviewsShortcode()
50
-    {
51
-        $query_args = array(
52
-            'post_status' => 'publish',
53
-            'post_type' => 'gd_place',
54
-            'posts_per_page' => 1,
55
-        );
56
-
57
-        $all_posts = new WP_Query( $query_args );
58
-        $post_id = null;
59
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
60
-            $post_id = get_the_ID();
61
-        endwhile;
62
-
63
-        $this->assertTrue(is_int($post_id));
64
-
65
-        $time = current_time('mysql');
66
-
67
-        $data = array(
68
-            'comment_post_ID' => $post_id,
69
-            'comment_author' => 'admin',
70
-            'comment_author_email' => '[email protected]',
71
-            'comment_author_url' => 'http://wpgeodirectory.com',
72
-            'comment_content' => 'content here testtcc',
73
-            'comment_type' => '',
74
-            'comment_parent' => 0,
75
-            'user_id' => 1,
76
-            'comment_author_IP' => '127.0.0.1',
77
-            '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)',
78
-            'comment_date' => $time,
79
-            'comment_approved' => 1,
80
-        );
81
-
82
-        $comment_id = wp_insert_comment($data);
83
-
84
-        $_REQUEST['geodir_overallrating'] = 5.0;
85
-        geodir_save_rating($comment_id);
86
-
87
-        $output = do_shortcode('[gd_recent_reviews count=5]');
88
-        $this->assertContains( 'geodir_sc_recent_reviews', $output );
89
-    }
90
-
91
-    public function testRelatedListingsShortcode()
92
-    {
93
-        $query_args = array(
94
-            'post_status' => 'publish',
95
-            'post_type' => 'gd_place',
96
-            'posts_per_page' => 1,
97
-        );
98
-
99
-        $all_posts = new WP_Query( $query_args );
100
-        $post_id = null;
101
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
102
-            $post_id = get_the_ID();
103
-            global $post;
104
-            $post =  geodir_get_post_info($post_id);
105
-            setup_postdata($post);
106
-            $output = do_shortcode('[gd_related_listings relate_to=category layout=3 add_location_filter=0 list_sort=featured character_count=0]');
107
-            $this->assertContains( 'geodir_location_listing', $output );
108
-        endwhile;
109
-
110
-        $this->assertTrue(is_int($post_id));
111
-
112
-    }
113
-
114
-    public function testListingsShortcode()
115
-    {
116
-        $output = do_shortcode('[gd_listings post_type="gd_place" category="1,3" post_number="10" list_sort="high_review"]');
117
-        $this->assertContains( 'geodir-sc-gd-listings', $output );
118
-    }
119
-
120
-    public function texstBestOfWidgetShortcode()
121
-    {
122
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php';
123
-        include_once($template);
124
-
125
-        $output = do_shortcode('[gd_bestof_widget title="widget title" post_type=gd_hotel post_limit=5 categ_limit=6 character_count=50 use_viewing_post_type=true add_location_filter=true tab_layout=bestof-tabs-as-dropdown]');
126
-        $this->assertContains( 'geodir_bestof_widget', $output );
127
-    }
128
-
129
-    public function testAddListingShortcode()
130
-    {
131
-        $_REQUEST['listing_type'] = 'gd_place';
132
-        $output = do_shortcode('[gd_add_listing listing_type=gd_place login_msg="Please register and login to submit listings" show_login=true]');
133
-        $this->assertContains( 'geodir-add-listing-submit', $output );
134
-    }
135
-
136
-    public function tearDown()
137
-    {
138
-        parent::tearDown();
139
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+		wp_set_current_user(1);
8
+
9
+	}
10
+
11
+	public function testHomeMapShortcode()
12
+	{
13
+		$output = do_shortcode('[gd_homepage_map width=100% height=300 scrollwheel=false]');
14
+		$this->assertContains( 'geodir-map-home-page', $output );
15
+	}
16
+
17
+	public function testListingMapShortcode()
18
+	{
19
+		$output = do_shortcode('[gd_listing_map width=100% height=300 scrollwheel=false sticky=true]');
20
+		$this->assertContains( 'geodir-map-listing-page', $output );
21
+	}
22
+
23
+	public function testListingSliderShortcode()
24
+	{
25
+		$output = do_shortcode('[gd_listing_slider post_number=5 category=3 slideshow=true show_featured_only=true]');
26
+		$this->assertContains( 'geodir_widget_carousel', $output );
27
+	}
28
+
29
+	public function testLoginBoxShortcode()
30
+	{
31
+		$output = do_shortcode('[gd_login_box]');
32
+		$this->assertContains( 'geodir-loginbox-list', $output );
33
+	}
34
+
35
+	public function testPopPostCatShortcode()
36
+	{
37
+		global $geodir_post_type;
38
+		$geodir_post_type = 'gd_place';
39
+		$output = do_shortcode('[gd_popular_post_category category_limit=30]');
40
+		$this->assertContains( 'geodir-popular-cat-list', $output );
41
+	}
42
+
43
+	public function testPopPostViewShortcode()
44
+	{
45
+		$output = do_shortcode('[gd_popular_post_view category=3 layout=5 add_location_filter=true character_count=0 show_featured_only=true]');
46
+		$this->assertContains( 'geodir_category_list_view', $output );
47
+	}
48
+
49
+	public function testRecentReviewsShortcode()
50
+	{
51
+		$query_args = array(
52
+			'post_status' => 'publish',
53
+			'post_type' => 'gd_place',
54
+			'posts_per_page' => 1,
55
+		);
56
+
57
+		$all_posts = new WP_Query( $query_args );
58
+		$post_id = null;
59
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
60
+			$post_id = get_the_ID();
61
+		endwhile;
62
+
63
+		$this->assertTrue(is_int($post_id));
64
+
65
+		$time = current_time('mysql');
66
+
67
+		$data = array(
68
+			'comment_post_ID' => $post_id,
69
+			'comment_author' => 'admin',
70
+			'comment_author_email' => '[email protected]',
71
+			'comment_author_url' => 'http://wpgeodirectory.com',
72
+			'comment_content' => 'content here testtcc',
73
+			'comment_type' => '',
74
+			'comment_parent' => 0,
75
+			'user_id' => 1,
76
+			'comment_author_IP' => '127.0.0.1',
77
+			'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)',
78
+			'comment_date' => $time,
79
+			'comment_approved' => 1,
80
+		);
81
+
82
+		$comment_id = wp_insert_comment($data);
83
+
84
+		$_REQUEST['geodir_overallrating'] = 5.0;
85
+		geodir_save_rating($comment_id);
86
+
87
+		$output = do_shortcode('[gd_recent_reviews count=5]');
88
+		$this->assertContains( 'geodir_sc_recent_reviews', $output );
89
+	}
90
+
91
+	public function testRelatedListingsShortcode()
92
+	{
93
+		$query_args = array(
94
+			'post_status' => 'publish',
95
+			'post_type' => 'gd_place',
96
+			'posts_per_page' => 1,
97
+		);
98
+
99
+		$all_posts = new WP_Query( $query_args );
100
+		$post_id = null;
101
+		while ( $all_posts->have_posts() ) : $all_posts->the_post();
102
+			$post_id = get_the_ID();
103
+			global $post;
104
+			$post =  geodir_get_post_info($post_id);
105
+			setup_postdata($post);
106
+			$output = do_shortcode('[gd_related_listings relate_to=category layout=3 add_location_filter=0 list_sort=featured character_count=0]');
107
+			$this->assertContains( 'geodir_location_listing', $output );
108
+		endwhile;
109
+
110
+		$this->assertTrue(is_int($post_id));
111
+
112
+	}
113
+
114
+	public function testListingsShortcode()
115
+	{
116
+		$output = do_shortcode('[gd_listings post_type="gd_place" category="1,3" post_number="10" list_sort="high_review"]');
117
+		$this->assertContains( 'geodir-sc-gd-listings', $output );
118
+	}
119
+
120
+	public function texstBestOfWidgetShortcode()
121
+	{
122
+		$template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php';
123
+		include_once($template);
124
+
125
+		$output = do_shortcode('[gd_bestof_widget title="widget title" post_type=gd_hotel post_limit=5 categ_limit=6 character_count=50 use_viewing_post_type=true add_location_filter=true tab_layout=bestof-tabs-as-dropdown]');
126
+		$this->assertContains( 'geodir_bestof_widget', $output );
127
+	}
128
+
129
+	public function testAddListingShortcode()
130
+	{
131
+		$_REQUEST['listing_type'] = 'gd_place';
132
+		$output = do_shortcode('[gd_add_listing listing_type=gd_place login_msg="Please register and login to submit listings" show_login=true]');
133
+		$this->assertContains( 'geodir-add-listing-submit', $output );
134
+	}
135
+
136
+	public function tearDown()
137
+	{
138
+		parent::tearDown();
139
+	}
140 140
 }
141 141
 ?>
142 142
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -11,25 +11,25 @@  discard block
 block discarded – undo
11 11
     public function testHomeMapShortcode()
12 12
     {
13 13
         $output = do_shortcode('[gd_homepage_map width=100% height=300 scrollwheel=false]');
14
-        $this->assertContains( 'geodir-map-home-page', $output );
14
+        $this->assertContains('geodir-map-home-page', $output);
15 15
     }
16 16
 
17 17
     public function testListingMapShortcode()
18 18
     {
19 19
         $output = do_shortcode('[gd_listing_map width=100% height=300 scrollwheel=false sticky=true]');
20
-        $this->assertContains( 'geodir-map-listing-page', $output );
20
+        $this->assertContains('geodir-map-listing-page', $output);
21 21
     }
22 22
 
23 23
     public function testListingSliderShortcode()
24 24
     {
25 25
         $output = do_shortcode('[gd_listing_slider post_number=5 category=3 slideshow=true show_featured_only=true]');
26
-        $this->assertContains( 'geodir_widget_carousel', $output );
26
+        $this->assertContains('geodir_widget_carousel', $output);
27 27
     }
28 28
 
29 29
     public function testLoginBoxShortcode()
30 30
     {
31 31
         $output = do_shortcode('[gd_login_box]');
32
-        $this->assertContains( 'geodir-loginbox-list', $output );
32
+        $this->assertContains('geodir-loginbox-list', $output);
33 33
     }
34 34
 
35 35
     public function testPopPostCatShortcode()
@@ -37,13 +37,13 @@  discard block
 block discarded – undo
37 37
         global $geodir_post_type;
38 38
         $geodir_post_type = 'gd_place';
39 39
         $output = do_shortcode('[gd_popular_post_category category_limit=30]');
40
-        $this->assertContains( 'geodir-popular-cat-list', $output );
40
+        $this->assertContains('geodir-popular-cat-list', $output);
41 41
     }
42 42
 
43 43
     public function testPopPostViewShortcode()
44 44
     {
45 45
         $output = do_shortcode('[gd_popular_post_view category=3 layout=5 add_location_filter=true character_count=0 show_featured_only=true]');
46
-        $this->assertContains( 'geodir_category_list_view', $output );
46
+        $this->assertContains('geodir_category_list_view', $output);
47 47
     }
48 48
 
49 49
     public function testRecentReviewsShortcode()
@@ -54,9 +54,9 @@  discard block
 block discarded – undo
54 54
             'posts_per_page' => 1,
55 55
         );
56 56
 
57
-        $all_posts = new WP_Query( $query_args );
57
+        $all_posts = new WP_Query($query_args);
58 58
         $post_id = null;
59
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
59
+        while ($all_posts->have_posts()) : $all_posts->the_post();
60 60
             $post_id = get_the_ID();
61 61
         endwhile;
62 62
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         geodir_save_rating($comment_id);
86 86
 
87 87
         $output = do_shortcode('[gd_recent_reviews count=5]');
88
-        $this->assertContains( 'geodir_sc_recent_reviews', $output );
88
+        $this->assertContains('geodir_sc_recent_reviews', $output);
89 89
     }
90 90
 
91 91
     public function testRelatedListingsShortcode()
@@ -96,15 +96,15 @@  discard block
 block discarded – undo
96 96
             'posts_per_page' => 1,
97 97
         );
98 98
 
99
-        $all_posts = new WP_Query( $query_args );
99
+        $all_posts = new WP_Query($query_args);
100 100
         $post_id = null;
101
-        while ( $all_posts->have_posts() ) : $all_posts->the_post();
101
+        while ($all_posts->have_posts()) : $all_posts->the_post();
102 102
             $post_id = get_the_ID();
103 103
             global $post;
104
-            $post =  geodir_get_post_info($post_id);
104
+            $post = geodir_get_post_info($post_id);
105 105
             setup_postdata($post);
106 106
             $output = do_shortcode('[gd_related_listings relate_to=category layout=3 add_location_filter=0 list_sort=featured character_count=0]');
107
-            $this->assertContains( 'geodir_location_listing', $output );
107
+            $this->assertContains('geodir_location_listing', $output);
108 108
         endwhile;
109 109
 
110 110
         $this->assertTrue(is_int($post_id));
@@ -114,23 +114,23 @@  discard block
 block discarded – undo
114 114
     public function testListingsShortcode()
115 115
     {
116 116
         $output = do_shortcode('[gd_listings post_type="gd_place" category="1,3" post_number="10" list_sort="high_review"]');
117
-        $this->assertContains( 'geodir-sc-gd-listings', $output );
117
+        $this->assertContains('geodir-sc-gd-listings', $output);
118 118
     }
119 119
 
120 120
     public function texstBestOfWidgetShortcode()
121 121
     {
122
-        $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php';
122
+        $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_bestof_widget.php';
123 123
         include_once($template);
124 124
 
125 125
         $output = do_shortcode('[gd_bestof_widget title="widget title" post_type=gd_hotel post_limit=5 categ_limit=6 character_count=50 use_viewing_post_type=true add_location_filter=true tab_layout=bestof-tabs-as-dropdown]');
126
-        $this->assertContains( 'geodir_bestof_widget', $output );
126
+        $this->assertContains('geodir_bestof_widget', $output);
127 127
     }
128 128
 
129 129
     public function testAddListingShortcode()
130 130
     {
131 131
         $_REQUEST['listing_type'] = 'gd_place';
132 132
         $output = do_shortcode('[gd_add_listing listing_type=gd_place login_msg="Please register and login to submit listings" show_login=true]');
133
-        $this->assertContains( 'geodir-add-listing-submit', $output );
133
+        $this->assertContains('geodir-add-listing-submit', $output);
134 134
     }
135 135
 
136 136
     public function tearDown()
Please login to merge, or discard this patch.
tests/test-Author_Page.php 2 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -1,53 +1,53 @@
 block discarded – undo
1 1
 <?php
2 2
 class AuthorPage extends WP_UnitTestCase
3 3
 {
4
-    public function setUp()
5
-    {
6
-        parent::setUp();
7
-    }
4
+	public function setUp()
5
+	{
6
+		parent::setUp();
7
+	}
8 8
 
9
-    public function testAuthorPage()
10
-    {
11
-        global $current_user;
9
+	public function testAuthorPage()
10
+	{
11
+		global $current_user;
12 12
 
13
-        $user_id = $current_user->ID;
13
+		$user_id = $current_user->ID;
14 14
 
15 15
 
16 16
 
17
-        // Add listing
17
+		// Add listing
18 18
 
19
-        $args = array(
20
-            'listing_type' => 'gd_place',
21
-            'post_title' => 'Test Listing Title 2',
22
-            'post_desc' => 'Test Desc',
23
-            'post_tags' => 'test1,test2',
24
-            'post_address' => 'New York City Hall',
25
-            'post_zip' => '10007',
26
-            'post_mapview' => 'ROADMAP',
27
-            'post_mapzoom' => '10',
28
-            'geodir_timing' => '10.00 am to 6 pm every day',
29
-            'geodir_contact' => '1234567890',
30
-            'geodir_email' => '[email protected]',
31
-            'geodir_website' => 'http://test.com',
32
-            'geodir_twitter' => 'http://twitter.com/test',
33
-            'geodir_facebook' => 'http://facebook.com/test',
34
-            'geodir_special_offers' => 'Test offer'
35
-        );
36
-        $post_id = geodir_save_listing($args, true);
19
+		$args = array(
20
+			'listing_type' => 'gd_place',
21
+			'post_title' => 'Test Listing Title 2',
22
+			'post_desc' => 'Test Desc',
23
+			'post_tags' => 'test1,test2',
24
+			'post_address' => 'New York City Hall',
25
+			'post_zip' => '10007',
26
+			'post_mapview' => 'ROADMAP',
27
+			'post_mapzoom' => '10',
28
+			'geodir_timing' => '10.00 am to 6 pm every day',
29
+			'geodir_contact' => '1234567890',
30
+			'geodir_email' => '[email protected]',
31
+			'geodir_website' => 'http://test.com',
32
+			'geodir_twitter' => 'http://twitter.com/test',
33
+			'geodir_facebook' => 'http://facebook.com/test',
34
+			'geodir_special_offers' => 'Test offer'
35
+		);
36
+		$post_id = geodir_save_listing($args, true);
37 37
 
38
-        $this->assertTrue(is_int($post_id));
38
+		$this->assertTrue(is_int($post_id));
39 39
 
40
-        $count = count_user_posts( $user_id, "gd_place"  );
40
+		$count = count_user_posts( $user_id, "gd_place"  );
41 41
 
42
-        $this->assertTrue(is_int((int) $count));
42
+		$this->assertTrue(is_int((int) $count));
43 43
 
44 44
 
45 45
 
46
-    }
46
+	}
47 47
 
48
-    public function tearDown()
49
-    {
50
-        parent::tearDown();
51
-    }
48
+	public function tearDown()
49
+	{
50
+		parent::tearDown();
51
+	}
52 52
 }
53 53
 ?>
54 54
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 
38 38
         $this->assertTrue(is_int($post_id));
39 39
 
40
-        $count = count_user_posts( $user_id, "gd_place"  );
40
+        $count = count_user_posts($user_id, "gd_place");
41 41
 
42 42
         $this->assertTrue(is_int((int) $count));
43 43
 
Please login to merge, or discard this patch.
geodirectory_hooks_actions.php 4 patches
Doc Comments   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2195,7 +2195,7 @@  discard block
 block discarded – undo
2195 2195
  * @global object $wpdb WordPress Database object.
2196 2196
  * @global string $plugin_prefix Geodirectory plugin table prefix.
2197 2197
  * @param int $attachment_id Attachment ID.
2198
- * @return bool|void Returns false on failure.
2198
+ * @return false|null Returns false on failure.
2199 2199
  */
2200 2200
 function geodirectory_before_featured_image_delete($attachment_id)
2201 2201
 {
@@ -2368,6 +2368,7 @@  discard block
 block discarded – undo
2368 2368
  * @global object $wpdb WordPress Database object.
2369 2369
  * @global object $current_user Current user object.
2370 2370
  * @global string $plugin_prefix Geodirectory plugin table prefix.
2371
+ * @param string $user_id
2371 2372
  * @return array User listing count for each post type.
2372 2373
  */
2373 2374
 function geodir_user_post_listing_count($user_id=null)
@@ -3176,7 +3177,7 @@  discard block
 block discarded – undo
3176 3177
  * @since 1.0.0
3177 3178
  * @package GeoDirectory
3178 3179
  * @param array $classes The class array of the HTML element.
3179
- * @return array Modified class array.
3180
+ * @return string[] Modified class array.
3180 3181
  */
3181 3182
 function geodir_body_class_no_rating($classes = array())
3182 3183
 {
Please login to merge, or discard this patch.
Spacing   +148 added lines, -148 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 /* ON TEMPLATE INCLUDE */
137 137
 /////////////////////////
138 138
 
139
-add_filter('template_include', 'geodir_template_loader',9);
139
+add_filter('template_include', 'geodir_template_loader', 9);
140 140
 
141 141
 /////////////////////////
142 142
 /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
 /* WP REVIEW COUNT ACTIONS */
177 177
 ////////////////////////
178 178
 
179
-add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100,1);
179
+add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100, 1);
180 180
 //add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100);
181
-add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3);
181
+add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3);
182 182
 //add_action('created_term', 'geodir_term_review_count_force_update', 100);
183 183
 add_action('edited_term', 'geodir_term_review_count_force_update', 100);
184 184
 add_action('delete_term', 'geodir_term_review_count_force_update', 100);
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
  */
223 223
 function geodir_unset_prev_theme_nav_location($newname)
224 224
 {
225
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
225
+    $geodir_theme_location = get_option('geodir_theme_location_nav_'.$newname);
226 226
     if ($geodir_theme_location) {
227 227
         update_option('geodir_theme_location_nav', $geodir_theme_location);
228 228
     } else {
@@ -320,8 +320,8 @@  discard block
 block discarded – undo
320 320
 
321 321
 /////// GEO DIRECOTORY CUSTOM HOOKS ///
322 322
 
323
-add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content 
324
-add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
323
+add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content 
324
+add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
325 325
 
326 326
 // Detail page sidebar content 
327 327
 add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1);
@@ -421,8 +421,8 @@  discard block
 block discarded – undo
421 421
     do_action('geodir_after_social_sharing_buttons');
422 422
     $content_html = ob_get_clean();
423 423
     if (trim($content_html) != '')
424
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
425
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
424
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">'.$content_html.'</div>';
425
+    if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) {
426 426
         /**
427 427
          * Filter the geodir_social_sharing_buttons() function content.
428 428
          *
@@ -462,12 +462,12 @@  discard block
 block discarded – undo
462 462
             $post_id = $post->ID;
463 463
             
464 464
             if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
465
-                $post_id = (int)$_REQUEST['pid'];
465
+                $post_id = (int) $_REQUEST['pid'];
466 466
             }
467 467
 
468 468
             $postlink = get_permalink(geodir_add_listing_page_id());
469 469
             $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
470
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
470
+            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="'.esc_url($editlink).'">'.__('Edit this Post', 'geodirectory').'</a></p>';
471 471
         }
472 472
     }// end of if, if its a preview or not
473 473
     /**
@@ -478,8 +478,8 @@  discard block
 block discarded – undo
478 478
     do_action('geodir_after_edit_post_link');
479 479
     $content_html = ob_get_clean();
480 480
     if (trim($content_html) != '')
481
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
482
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
481
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">'.$content_html.'</div>';
482
+    if ((int) get_option('geodir_disable_user_links_section') != 1) {
483 483
         /**
484 484
          * Filter the geodir_edit_post_link() function content.
485 485
          *
@@ -500,8 +500,8 @@  discard block
 block discarded – undo
500 500
  */
501 501
 function geodir_detail_page_google_analytics()
502 502
 {
503
-    global $post,$preview;
504
-    if($preview){return '';}
503
+    global $post, $preview;
504
+    if ($preview) {return ''; }
505 505
     $package_info = array();
506 506
     $package_info = geodir_post_package_info($package_info, $post);
507 507
 
@@ -533,14 +533,14 @@  discard block
 block discarded – undo
533 533
     $hide_refresh = get_option('geodir_ga_auto_refresh');
534 534
     
535 535
     $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
536
-    if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
536
+    if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id() == $post->post_author || current_user_can('manage_options'))) {
537 537
         $page_url = urlencode($_SERVER['REQUEST_URI']);
538 538
         ?>
539 539
         <script type="text/javascript">
540 540
             var gd_gaTimeOut;
541
-            var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
542
-            var gd_gaHideRefresh = <?php echo (int)$hide_refresh;?>;
543
-            var gd_gaAutoRefresh = <?php echo $auto_refresh;?>;
541
+            var gd_gaTime = parseInt('<?php echo $refresh_time; ?>');
542
+            var gd_gaHideRefresh = <?php echo (int) $hide_refresh; ?>;
543
+            var gd_gaAutoRefresh = <?php echo $auto_refresh; ?>;
544 544
             ga_data1 = false;
545 545
             ga_data2 = false;
546 546
             ga_data3 = false;
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
             }
682 682
 
683 683
             function gdga_noResults() {
684
-                jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>');
684
+                jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>');
685 685
                 jQuery('#gdga-legend-container').html('');
686 686
             }
687 687
 
@@ -713,18 +713,18 @@  discard block
 block discarded – undo
713 713
                     var data2 = results[1].rows.map(function(row) { return +row[2]; });
714 714
                     //var labelsN = results[0].rows.map(function(row) { return +row[1]; });
715 715
 
716
-                    var labels = ['<?php _e('Jan', 'geodirectory');?>',
717
-                        '<?php _e('Feb', 'geodirectory');?>',
718
-                        '<?php _e('Mar', 'geodirectory');?>',
719
-                        '<?php _e('Apr', 'geodirectory');?>',
720
-                        '<?php _e('May', 'geodirectory');?>',
721
-                        '<?php _e('Jun', 'geodirectory');?>',
722
-                        '<?php _e('Jul', 'geodirectory');?>',
723
-                        '<?php _e('Aug', 'geodirectory');?>',
724
-                        '<?php _e('Sep', 'geodirectory');?>',
725
-                        '<?php _e('Oct', 'geodirectory');?>',
726
-                        '<?php _e('Nov', 'geodirectory');?>',
727
-                        '<?php _e('Dec', 'geodirectory');?>'];
716
+                    var labels = ['<?php _e('Jan', 'geodirectory'); ?>',
717
+                        '<?php _e('Feb', 'geodirectory'); ?>',
718
+                        '<?php _e('Mar', 'geodirectory'); ?>',
719
+                        '<?php _e('Apr', 'geodirectory'); ?>',
720
+                        '<?php _e('May', 'geodirectory'); ?>',
721
+                        '<?php _e('Jun', 'geodirectory'); ?>',
722
+                        '<?php _e('Jul', 'geodirectory'); ?>',
723
+                        '<?php _e('Aug', 'geodirectory'); ?>',
724
+                        '<?php _e('Sep', 'geodirectory'); ?>',
725
+                        '<?php _e('Oct', 'geodirectory'); ?>',
726
+                        '<?php _e('Nov', 'geodirectory'); ?>',
727
+                        '<?php _e('Dec', 'geodirectory'); ?>'];
728 728
 
729 729
                     // Ensure the data arrays are at least as long as the labels array.
730 730
                     // Chart.js bar charts don't (yet) accept sparse datasets.
@@ -737,13 +737,13 @@  discard block
 block discarded – undo
737 737
                         labels : labels,
738 738
                         datasets : [
739 739
                             {
740
-                                label: '<?php _e('Last Year', 'geodirectory');?>',
740
+                                label: '<?php _e('Last Year', 'geodirectory'); ?>',
741 741
                                 fillColor : "rgba(220,220,220,0.5)",
742 742
                                 strokeColor : "rgba(220,220,220,1)",
743 743
                                 data : data2
744 744
                             },
745 745
                             {
746
-                                label: '<?php _e('This Year', 'geodirectory');?>',
746
+                                label: '<?php _e('This Year', 'geodirectory'); ?>',
747 747
                                 fillColor : "rgba(151,187,205,0.5)",
748 748
                                 strokeColor : "rgba(151,187,205,1)",
749 749
                                 data : data1
@@ -788,30 +788,30 @@  discard block
 block discarded – undo
788 788
 
789 789
                     <?php
790 790
                     // Here we list the shorthand days of the week so it can be used in translation.
791
-                    __("Mon",'geodirectory');
792
-                    __("Tue",'geodirectory');
793
-                    __("Wed",'geodirectory');
794
-                    __("Thu",'geodirectory');
795
-                    __("Fri",'geodirectory');
796
-                    __("Sat",'geodirectory');
797
-                    __("Sun",'geodirectory');
791
+                    __("Mon", 'geodirectory');
792
+                    __("Tue", 'geodirectory');
793
+                    __("Wed", 'geodirectory');
794
+                    __("Thu", 'geodirectory');
795
+                    __("Fri", 'geodirectory');
796
+                    __("Sat", 'geodirectory');
797
+                    __("Sun", 'geodirectory');
798 798
                     ?>
799 799
 
800 800
                     labels = [
801
-                        "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
802
-                        "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>",
803
-                        "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>",
804
-                        "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>",
805
-                        "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>",
806
-                        "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>",
807
-                        "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>"
801
+                        "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>",
802
+                        "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>",
803
+                        "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>",
804
+                        "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>",
805
+                        "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>",
806
+                        "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>",
807
+                        "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>"
808 808
                     ];
809 809
 
810 810
                     var data = {
811 811
                         labels : labels,
812 812
                         datasets : [
813 813
                             {
814
-                                label: '<?php _e('Last Week', 'geodirectory');?>',
814
+                                label: '<?php _e('Last Week', 'geodirectory'); ?>',
815 815
                                 fillColor : "rgba(220,220,220,0.5)",
816 816
                                 strokeColor : "rgba(220,220,220,1)",
817 817
                                 pointColor : "rgba(220,220,220,1)",
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
                                 data : data2
820 820
                             },
821 821
                             {
822
-                                label: '<?php _e('This Week', 'geodirectory');?>',
822
+                                label: '<?php _e('This Week', 'geodirectory'); ?>',
823 823
                                 fillColor : "rgba(151,187,205,0.5)",
824 824
                                 strokeColor : "rgba(151,187,205,1)",
825 825
                                 pointColor : "rgba(151,187,205,1)",
@@ -1026,18 +1026,18 @@  discard block
 block discarded – undo
1026 1026
         </style>
1027 1027
         <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
1028 1028
         <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
1029
-        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory');?></button>
1029
+        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory'); ?></button>
1030 1030
         <span id="ga_stats" class="gdga-analytics-box" style="display:none">
1031
-            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div>
1031
+            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div>
1032 1032
             <div id="gd-active-users-container">
1033
-                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory');?>"></i><?php _e("Active Users:", 'geodirectory');?>
1033
+                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory'); ?>"></i><?php _e("Active Users:", 'geodirectory'); ?>
1034 1034
                     <b class="gd-ActiveUsers-value">0</b>
1035 1035
                 </div>
1036 1036
             </div>
1037 1037
             <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;">
1038
-                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option>
1039
-                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option>
1040
-                <option value="country"><?php _e("Top Countries", 'geodirectory');?></option>
1038
+                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option>
1039
+                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option>
1040
+                <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option>
1041 1041
             </select>
1042 1042
             <div class="Chartjs-figure" id="gdga-chart-container"></div>
1043 1043
             <ol class="Chartjs-legend" id="gdga-legend-container"></ol>
@@ -1053,8 +1053,8 @@  discard block
 block discarded – undo
1053 1053
     do_action('geodir_after_google_analytics');
1054 1054
     $content_html = ob_get_clean();
1055 1055
     if (trim($content_html) != '')
1056
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1057
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1056
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">'.$content_html.'</div>';
1057
+    if ((int) get_option('geodir_disable_google_analytics_section') != 1) {
1058 1058
         /**
1059 1059
          * Filter the geodir_edit_post_link() function content.
1060 1060
          *
@@ -1110,10 +1110,10 @@  discard block
 block discarded – undo
1110 1110
        
1111 1111
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1112 1112
 	   
1113
-	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
1113
+	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="'.$post_avgratings.'">'.$post_avgratings.'</span> / <span itemprop="best" content="5">5</span> '.__("based on", 'geodirectory').' </span><span class="count" itemprop="count" content="'.$comment_count.'">'.$comment_count.' '.$reviews_text.'</span><br />';
1114 1114
 
1115 1115
         $html .= '<span class="item">';
1116
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1116
+        $html .= '<span class="fn" itemprop="itemreviewed">'.$post->post_title.'</span>';
1117 1117
 
1118 1118
         if ($post_images) {
1119 1119
             foreach ($post_images as $img) {
@@ -1123,7 +1123,7 @@  discard block
 block discarded – undo
1123 1123
         }
1124 1124
 
1125 1125
         if (isset($post_img) && $post_img) {
1126
-            $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1126
+            $html .= '<br /><img src="'.$post_img.'" class="photo" alt="'.esc_attr($post->post_title).'" itemprop="photo" content="'.$post_img.'" class="photo" />';
1127 1127
         }
1128 1128
 
1129 1129
         $html .= '</span>';
@@ -1150,9 +1150,9 @@  discard block
 block discarded – undo
1150 1150
     do_action('geodir_after_detail_page_review_rating');
1151 1151
     $content_html = ob_get_clean();
1152 1152
     if (trim($content_html) != '') {
1153
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1153
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">'.$content_html.'</div>';
1154 1154
     }
1155
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1155
+    if ((int) get_option('geodir_disable_rating_info_section') != 1) {
1156 1156
         /**
1157 1157
          * Filter the geodir_detail_page_review_rating() function content.
1158 1158
          *
@@ -1191,8 +1191,8 @@  discard block
 block discarded – undo
1191 1191
 
1192 1192
     $content_html = ob_get_clean();
1193 1193
     if (trim($content_html) != '')
1194
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1195
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1194
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">'.$content_html.'</div>';
1195
+    if ((int) get_option('geodir_disable_listing_info_section') != 1) {
1196 1196
         /**
1197 1197
          * Filter the output html for function geodir_detail_page_more_info().
1198 1198
          *
@@ -1291,7 +1291,7 @@  discard block
 block discarded – undo
1291 1291
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
1292 1292
 		'geodir_txt_form_wait' => __('Wait...', 'geodirectory'),
1293 1293
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1294
-		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1294
+		'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1295 1295
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1296 1296
         'multirating' => defined('GEODIRREVIEWRATING_VERSION') && get_option('geodir_reviewrating_enable_rating') ? true : false,
1297 1297
         'geodir_map_name' => geodir_map_name(),
@@ -1313,10 +1313,10 @@  discard block
 block discarded – undo
1313 1313
     foreach ($arr_alert_msg as $key => $value) {
1314 1314
         if (!is_scalar($value))
1315 1315
             continue;
1316
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1316
+        $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
1317 1317
     }
1318 1318
 
1319
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1319
+    $script = "var geodir_all_js_msg = ".json_encode($arr_alert_msg).';';
1320 1320
     echo '<script>';
1321 1321
     echo $script;
1322 1322
     echo '</script>';
@@ -1406,7 +1406,7 @@  discard block
 block discarded – undo
1406 1406
         $geodir_old_sidebars = get_option('geodir_sidebars');
1407 1407
         if (is_array($geodir_old_sidebars)) {
1408 1408
             foreach ($geodir_old_sidebars as $key => $val) {
1409
-                if(0 === strpos($key, 'geodir_'))// if gd widget
1409
+                if (0 === strpos($key, 'geodir_'))// if gd widget
1410 1410
                 {
1411 1411
                     $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1412 1412
                 }
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
         global $post;
1486 1486
         $term_condition = '';
1487 1487
         if (isset($_REQUEST['backandedit'])) {
1488
-            $post = (object)$gd_session->get('listing');
1488
+            $post = (object) $gd_session->get('listing');
1489 1489
             $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1490 1490
         }
1491 1491
 
@@ -1499,7 +1499,7 @@  discard block
 block discarded – undo
1499 1499
                     echo 'checked="checked"';
1500 1500
                 } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1501 1501
                        class="geodir_textfield" value="1"
1502
-                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1502
+                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if ($terms_page) { echo get_permalink($terms_page); }?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1503 1503
 				</span>
1504 1504
             </div>
1505 1505
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
@@ -1539,7 +1539,7 @@  discard block
 block discarded – undo
1539 1539
         /** This action is documented in geodirectory_template_actions.php */
1540 1540
         $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1541 1541
         
1542
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1542
+        if (!($desc_limit === '' || (int) $desc_limit > 0)) {
1543 1543
             $is_display = false;
1544 1544
         }
1545 1545
     }
@@ -1587,16 +1587,16 @@  discard block
 block discarded – undo
1587 1587
     global $wpdb, $plugin_prefix;
1588 1588
 	
1589 1589
 	// Remove unused virtual page
1590
-	$listings_page_id = (int)get_option('geodir_listing_page');
1590
+	$listings_page_id = (int) get_option('geodir_listing_page');
1591 1591
 	if ($listings_page_id) {
1592
-		$wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1592
+		$wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->posts." WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1593 1593
         delete_option('geodir_listing_page');
1594 1594
 	}
1595 1595
 
1596 1596
     if (!get_option('geodir_changes_in_custom_fields_table')) {
1597 1597
         $wpdb->query(
1598 1598
             $wpdb->prepare(
1599
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1599
+                "UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET is_default=%s, is_admin=%s WHERE is_default=%s",
1600 1600
                 array('1', '1', 'admin')
1601 1601
             )
1602 1602
         );
@@ -1604,9 +1604,9 @@  discard block
 block discarded – undo
1604 1604
 
1605 1605
         /* --- terms meta value set --- */
1606 1606
 
1607
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1607
+        update_option('geodir_default_marker_icon', geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png');
1608 1608
 
1609
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1609
+        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."options WHERE option_name LIKE %s", array('%tax_meta_%')));
1610 1610
 
1611 1611
         if (!empty($options_data)) {
1612 1612
 
@@ -1614,7 +1614,7 @@  discard block
 block discarded – undo
1614 1614
 
1615 1615
                 $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1616 1616
 
1617
-                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1617
+                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM ".$wpdb->prefix."term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1618 1618
 
1619 1619
                 if (!empty($taxonomies_data)) {
1620 1620
 
@@ -1623,17 +1623,17 @@  discard block
 block discarded – undo
1623 1623
                         $taxObject = get_taxonomy($taxobj->taxonomy);
1624 1624
                         $post_type = $taxObject->object_type[0];
1625 1625
 
1626
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1626
+                        $opt_value = 'tax_meta_'.$post_type.'_'.$option_val;
1627 1627
 
1628
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1628
+                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM ".$wpdb->prefix."options WHERE option_name=%s", array('tax_meta_'.$option_val)));
1629 1629
 
1630 1630
                         if ($duplicate_data) {
1631 1631
 
1632
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1632
+                            $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1633 1633
 
1634 1634
                         } else {
1635 1635
 
1636
-                            $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1636
+                            $wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1637 1637
 
1638 1638
                         }
1639 1639
 
@@ -1667,14 +1667,14 @@  discard block
 block discarded – undo
1667 1667
 
1668 1668
     global $wpdb, $table_prefix;
1669 1669
 
1670
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1670
+    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($slug)));
1671 1671
 
1672 1672
     if ($slug_exists) {
1673 1673
 
1674 1674
         $suffix = 1;
1675 1675
         do {
1676
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1677
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1676
+            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1677
+            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($alt_location_name)));
1678 1678
             $suffix++;
1679 1679
         } while ($location_slug_check && $suffix < 100);
1680 1680
 
@@ -1728,7 +1728,7 @@  discard block
 block discarded – undo
1728 1728
 
1729 1729
         $suffix = 1;
1730 1730
         do {
1731
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1731
+            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1732 1732
 
1733 1733
             /** This action is documented in geodirectory_hooks_actions.php */
1734 1734
             $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
@@ -1740,7 +1740,7 @@  discard block
 block discarded – undo
1740 1740
 
1741 1741
         //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1742 1742
 
1743
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1743
+        $wpdb->query($wpdb->prepare("UPDATE ".$table_prefix."terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1744 1744
 
1745 1745
     }
1746 1746
 	
@@ -1749,18 +1749,18 @@  discard block
 block discarded – undo
1749 1749
 	$post_type = !empty($taxonomy_obj) ? $taxonomy_obj->object_type[0] : NULL;
1750 1750
 	
1751 1751
 	$post_types = geodir_get_posttypes();
1752
-	if ($post_type && in_array($post_type, $post_types) && $post_type . '_tags' == $taxonomy) {		
1753
-		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM " . $wpdb->term_relationships . " WHERE term_taxonomy_id = %d", array($tt_id)));
1752
+	if ($post_type && in_array($post_type, $post_types) && $post_type.'_tags' == $taxonomy) {		
1753
+		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM ".$wpdb->term_relationships." WHERE term_taxonomy_id = %d", array($tt_id)));
1754 1754
 		
1755 1755
 		if (!empty($posts_obj)) {
1756 1756
 			foreach ($posts_obj as $post_obj) {
1757 1757
 				$post_id = $post_obj->object_id;
1758 1758
 				
1759
-				$raw_tags = wp_get_object_terms($post_id, $post_type . '_tags', array('fields' => 'names'));
1759
+				$raw_tags = wp_get_object_terms($post_id, $post_type.'_tags', array('fields' => 'names'));
1760 1760
 				$post_tags = !empty($raw_tags) ? implode(',', $raw_tags) : '';
1761 1761
 				
1762
-				$listing_table = $plugin_prefix . $post_type . '_detail';
1763
-				$wpdb->query($wpdb->prepare("UPDATE " . $listing_table . " SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1762
+				$listing_table = $plugin_prefix.$post_type.'_detail';
1763
+				$wpdb->query($wpdb->prepare("UPDATE ".$listing_table." SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1764 1764
 			}
1765 1765
 		}
1766 1766
 	}
@@ -1794,7 +1794,7 @@  discard block
 block discarded – undo
1794 1794
     if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1795 1795
         return $slug_exists = true;
1796 1796
 
1797
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1797
+    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1798 1798
         return $slug_exists = true;
1799 1799
 
1800 1800
     return $slug_exists;
@@ -1834,43 +1834,43 @@  discard block
 block discarded – undo
1834 1834
 
1835 1835
 
1836 1836
     $gd_page = '';
1837
-    if(geodir_is_page('home')){
1837
+    if (geodir_is_page('home')) {
1838 1838
         $gd_page = 'home';
1839 1839
         $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1840 1840
     }
1841
-    elseif(geodir_is_page('detail')){
1841
+    elseif (geodir_is_page('detail')) {
1842 1842
         $gd_page = 'detail';
1843 1843
         $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1844 1844
     }
1845
-    elseif(geodir_is_page('pt')){
1845
+    elseif (geodir_is_page('pt')) {
1846 1846
         $gd_page = 'pt';
1847 1847
         $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1848 1848
     }
1849
-    elseif(geodir_is_page('listing')){
1849
+    elseif (geodir_is_page('listing')) {
1850 1850
         $gd_page = 'listing';
1851 1851
         $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1852 1852
     }
1853
-    elseif(geodir_is_page('location')){
1853
+    elseif (geodir_is_page('location')) {
1854 1854
         $gd_page = 'location';
1855 1855
         $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1856 1856
     }
1857
-    elseif(geodir_is_page('search')){
1857
+    elseif (geodir_is_page('search')) {
1858 1858
         $gd_page = 'search';
1859 1859
         $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1860 1860
     }
1861
-    elseif(geodir_is_page('add-listing')){
1861
+    elseif (geodir_is_page('add-listing')) {
1862 1862
         $gd_page = 'add-listing';
1863 1863
         $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1864 1864
     }
1865
-    elseif(geodir_is_page('author')){
1865
+    elseif (geodir_is_page('author')) {
1866 1866
         $gd_page = 'author';
1867 1867
         $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1868 1868
     }
1869
-    elseif(geodir_is_page('login')){
1869
+    elseif (geodir_is_page('login')) {
1870 1870
         $gd_page = 'login';
1871 1871
         $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1872 1872
     }
1873
-    elseif(geodir_is_page('listing-success')){
1873
+    elseif (geodir_is_page('listing-success')) {
1874 1874
         $gd_page = 'listing-success';
1875 1875
         $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1876 1876
     }
@@ -1902,12 +1902,12 @@  discard block
 block discarded – undo
1902 1902
 
1903 1903
     if (!get_option('geodir_set_post_attachments')) {
1904 1904
 
1905
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1906
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1905
+        require_once(ABSPATH.'wp-admin/includes/image.php');
1906
+        require_once(ABSPATH.'wp-admin/includes/file.php');
1907 1907
 
1908 1908
         $all_postypes = geodir_get_posttypes();
1909 1909
 
1910
-        foreach($all_postypes as $post_type){
1910
+        foreach ($all_postypes as $post_type) {
1911 1911
             $args = array(
1912 1912
                 'posts_per_page' => -1,
1913 1913
                 'post_type' => $post_type,
@@ -2001,7 +2001,7 @@  discard block
 block discarded – undo
2001 2001
 {
2002 2002
     $user_id = get_current_user_id();
2003 2003
 
2004
-    if(!$user_id){return $post;}
2004
+    if (!$user_id) {return $post; }
2005 2005
 
2006 2006
     $gd_post_types = geodir_get_posttypes();
2007 2007
 
@@ -2110,7 +2110,7 @@  discard block
 block discarded – undo
2110 2110
 
2111 2111
         if (array_key_exists('post_video', $tabs_arr)) {
2112 2112
 
2113
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2113
+            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2114 2114
 
2115 2115
             if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2116 2116
                 $tabs_arr['post_video']['heading_text'] = $field_title;
@@ -2118,7 +2118,7 @@  discard block
 block discarded – undo
2118 2118
 
2119 2119
         if (array_key_exists('special_offers', $tabs_arr)) {
2120 2120
 
2121
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2121
+            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2122 2122
 
2123 2123
             if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2124 2124
                 $tabs_arr['special_offers']['heading_text'] = $field_title;
@@ -2139,7 +2139,7 @@  discard block
 block discarded – undo
2139 2139
  */
2140 2140
 function geodir_remove_template_redirect_actions()
2141 2141
 {
2142
-    if (geodir_is_page('login')){
2142
+    if (geodir_is_page('login')) {
2143 2143
         remove_all_actions('template_redirect');
2144 2144
         remove_action('init', 'avia_modify_front', 10);
2145 2145
     }
@@ -2186,25 +2186,25 @@  discard block
 block discarded – undo
2186 2186
         $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2187 2187
 
2188 2188
         $wpdb->query(
2189
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2189
+            $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d AND file=%s ",
2190 2190
                 array($post_id, $split_img_file_path)
2191 2191
             )
2192 2192
         );
2193 2193
 
2194 2194
         $attachment_data = $wpdb->get_row(
2195
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2195
+            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=%d",
2196 2196
                 array($post_id)
2197 2197
             )
2198 2198
         );
2199 2199
 
2200 2200
         if (!empty($attachment_data)) {
2201
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2201
+            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2202 2202
         }
2203 2203
 
2204 2204
 
2205
-        $table_name = $plugin_prefix . $post_type . '_detail';
2205
+        $table_name = $plugin_prefix.$post_type.'_detail';
2206 2206
 
2207
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2207
+        $wpdb->query("UPDATE ".$table_name." SET featured_image='' WHERE post_id =".$post_id);
2208 2208
 
2209 2209
         geodir_set_wp_featured_image($post_id);
2210 2210
 
@@ -2232,9 +2232,9 @@  discard block
 block discarded – undo
2232 2232
 
2233 2233
     foreach ($all_postypes as $posttype) {
2234 2234
 
2235
-        $tablename = $plugin_prefix . $posttype . '_detail';
2235
+        $tablename = $plugin_prefix.$posttype.'_detail';
2236 2236
 
2237
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2237
+        $get_post_data = $wpdb->get_results("SELECT post_id FROM ".$tablename);
2238 2238
 
2239 2239
         if (!empty($get_post_data)) {
2240 2240
 
@@ -2242,7 +2242,7 @@  discard block
 block discarded – undo
2242 2242
 
2243 2243
                 $post_id = $data->post_id;
2244 2244
 
2245
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2245
+                $attachment_data = $wpdb->get_results("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =".$post_id." AND file!=''");
2246 2246
 
2247 2247
                 if (!empty($attachment_data)) {
2248 2248
 
@@ -2259,22 +2259,22 @@  discard block
 block discarded – undo
2259 2259
 
2260 2260
                         $file_name = $file_info['basename'];
2261 2261
 
2262
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2262
+                        $img_arr['path'] = $uploads_path.$sub_dir.'/'.$file_name;
2263 2263
 
2264 2264
                         if (!file_exists($img_arr['path'])) {
2265 2265
 
2266
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2266
+                            $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ID=".$attach->ID);
2267 2267
 
2268 2268
                         }
2269 2269
 
2270 2270
                     }
2271 2271
 
2272
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2272
+                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=".$post_id." GROUP BY post_id");
2273 2273
 
2274 2274
                     if (!empty($attachment_data)) {
2275 2275
 
2276 2276
                         if ($attachment_data->ID)
2277
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2277
+                            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2278 2278
 
2279 2279
                     } else {
2280 2280
 
@@ -2288,7 +2288,7 @@  discard block
 block discarded – undo
2288 2288
 
2289 2289
                     }
2290 2290
 
2291
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2291
+                    $wpdb->query("UPDATE ".$tablename." SET featured_image='' WHERE post_id =".$post_id);
2292 2292
 
2293 2293
                     geodir_set_wp_featured_image($post_id);
2294 2294
 
@@ -2317,7 +2317,7 @@  discard block
 block discarded – undo
2317 2317
 {
2318 2318
 
2319 2319
     if (!get_option('geodir_default_rating_star_icon')) {
2320
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2320
+        update_option('geodir_default_rating_star_icon', geodir_plugin_url().'/geodirectory-assets/images/stars.png');
2321 2321
     }
2322 2322
 
2323 2323
 }
@@ -2334,10 +2334,10 @@  discard block
 block discarded – undo
2334 2334
  * @global string $plugin_prefix Geodirectory plugin table prefix.
2335 2335
  * @return array User listing count for each post type.
2336 2336
  */
2337
-function geodir_user_post_listing_count($user_id=null)
2337
+function geodir_user_post_listing_count($user_id = null)
2338 2338
 {
2339 2339
     global $wpdb, $plugin_prefix, $current_user;
2340
-    if(!$user_id){
2340
+    if (!$user_id) {
2341 2341
         $user_id = $current_user->ID;
2342 2342
     }
2343 2343
 
@@ -2348,7 +2348,7 @@  discard block
 block discarded – undo
2348 2348
     $user_listing = array();
2349 2349
     if (is_array($all_posts) && !empty($all_posts)) {
2350 2350
         foreach ($all_posts as $ptype) {
2351
-            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2351
+            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM ".$wpdb->prefix."posts WHERE post_author=".$user_id." AND post_type='".$ptype."' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2352 2352
 
2353 2353
             if ($total_posts > 0) {
2354 2354
                 $user_listing[$ptype] = $total_posts;
@@ -2390,19 +2390,19 @@  discard block
 block discarded – undo
2390 2390
         $custom_fields = geodir_post_custom_fields($post_package_id, 'all', $post_type, $fields_location);
2391 2391
 
2392 2392
         //remove video and special offers if it is already set to show
2393
-        if(isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']){
2393
+        if (isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']) {
2394 2394
             $unset_video = true;
2395 2395
         }
2396 2396
 
2397
-        if(isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']){
2397
+        if (isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']) {
2398 2398
             $unset_special_offers = true;
2399 2399
         }
2400
-        if(isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)){
2401
-            foreach($custom_fields as $key => $custom_field){
2402
-                if($custom_field['name']=='geodir_video' && isset($unset_video)){
2400
+        if (isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)) {
2401
+            foreach ($custom_fields as $key => $custom_field) {
2402
+                if ($custom_field['name'] == 'geodir_video' && isset($unset_video)) {
2403 2403
                     unset($custom_fields[$key]);
2404 2404
                 }
2405
-                if($custom_field['name']=='geodir_special_offers' && isset($unset_special_offers)){
2405
+                if ($custom_field['name'] == 'geodir_special_offers' && isset($unset_special_offers)) {
2406 2406
                     unset($custom_fields[$key]);
2407 2407
                 }
2408 2408
             }
@@ -2421,7 +2421,7 @@  discard block
 block discarded – undo
2421 2421
                     $post->{$field_name} = $_REQUEST[$field_name];
2422 2422
                 }
2423 2423
 
2424
-                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false  && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2424
+                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2425 2425
                     if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2426 2426
                         continue;
2427 2427
                     }
@@ -2470,21 +2470,21 @@  discard block
 block discarded – undo
2470 2470
                         $variables_array['label'] = __($type['site_title'], 'geodirectory');
2471 2471
                         $variables_array['value'] = '';
2472 2472
                         $variables_array['value'] = $post->{$type['htmlvar_name']};
2473
-                    }else{
2473
+                    } else {
2474 2474
                         $i = 0;
2475 2475
                         $fieldset_count++;
2476 2476
                         $field_set_start = 1;
2477
-                        $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2477
+                        $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_'.$fieldset_count;
2478 2478
                         $fieldset_arr[$fieldset_count]['label'] = $label;
2479 2479
                     }
2480 2480
 
2481 2481
 
2482
-                    if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
2482
+                    if (isset($type['extra_fields'])) {$extra_fields = $type['extra_fields']; }
2483 2483
                     $type = stripslashes_deep($type); // strip slashes
2484
-                    if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
2484
+                    if (isset($type['extra_fields'])) {$type['extra_fields'] = $extra_fields; }
2485 2485
                     $html = '';
2486 2486
                     $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : '';
2487
-                    if($html_var=='post'){$html_var='post_address';}
2487
+                    if ($html_var == 'post') {$html_var = 'post_address'; }
2488 2488
                     $field_icon = geodir_field_icon_proccess($type);
2489 2489
                     $filed_type = $type['type'];
2490 2490
 
@@ -2497,7 +2497,7 @@  discard block
 block discarded – undo
2497 2497
                      * @param string $fields_location The location the field is to be show.
2498 2498
                      * @param array $type The array of field values.
2499 2499
                      */
2500
-                    $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
2500
+                    $html = apply_filters("geodir_custom_field_output_{$filed_type}", $html, $fields_location, $type);
2501 2501
 
2502 2502
 
2503 2503
                     /**
@@ -2543,7 +2543,7 @@  discard block
 block discarded – undo
2543 2543
                                  * @param string $htmlvar_name The field HTML var name.
2544 2544
                                  */
2545 2545
                                 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2546
-                                'tab_content' => '<div class="geodir-company_info field-group xxx">' . $fieldset_html . '</div>'
2546
+                                'tab_content' => '<div class="geodir-company_info field-group xxx">'.$fieldset_html.'</div>'
2547 2547
                             );
2548 2548
                         }
2549 2549
                     } else {
@@ -2603,7 +2603,7 @@  discard block
 block discarded – undo
2603 2603
             }
2604 2604
             $status .= ")</strong>";
2605 2605
 
2606
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
2606
+            $html = '<span class="geodir-post-status">'.$status_icon.' <font class="geodir-status-label">'.__('Status: ', 'geodirectory').'</font>'.$status.'</span>';
2607 2607
         }
2608 2608
     }
2609 2609
 
@@ -2687,7 +2687,7 @@  discard block
 block discarded – undo
2687 2687
 function geodir_no_rating_comment_text($content, $comment = '')
2688 2688
 {
2689 2689
     if (!is_admin()) {
2690
-        return '<div class="description">' . $content . '</div>';
2690
+        return '<div class="description">'.$content.'</div>';
2691 2691
     } else {
2692 2692
         return $content;
2693 2693
     }
@@ -2765,7 +2765,7 @@  discard block
 block discarded – undo
2765 2765
         $classes[] = 'gd-no-rating';
2766 2766
     }
2767 2767
     
2768
-    $classes[] = 'gd-map-' . geodir_map_name();
2768
+    $classes[] = 'gd-map-'.geodir_map_name();
2769 2769
 
2770 2770
     return $classes;
2771 2771
 }
@@ -2785,7 +2785,7 @@  discard block
 block discarded – undo
2785 2785
         $class .= ' gd-no-rating';
2786 2786
     }
2787 2787
     
2788
-    $class .= ' gd-map-' . geodir_map_name();
2788
+    $class .= ' gd-map-'.geodir_map_name();
2789 2789
 
2790 2790
     return $class;
2791 2791
 }
@@ -2820,7 +2820,7 @@  discard block
 block discarded – undo
2820 2820
  * @return array Translation texts.
2821 2821
  */
2822 2822
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
2823
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
2823
+    $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array();
2824 2824
 
2825 2825
     $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
2826 2826
 
@@ -2886,14 +2886,14 @@  discard block
 block discarded – undo
2886 2886
  * @param array $args The array of menu arguments.
2887 2887
  * @return array The modified arguments.
2888 2888
  */
2889
-function geodir_add_nav_menu_class( $args )
2889
+function geodir_add_nav_menu_class($args)
2890 2890
 {
2891 2891
 
2892
-        if(isset($args['menu_class'])){
2892
+        if (isset($args['menu_class'])) {
2893 2893
             $args['menu_class'] = $args['menu_class']." gd-menu-z";
2894 2894
         }
2895 2895
     
2896 2896
     return $args;
2897 2897
 }
2898 2898
 
2899
-add_filter( 'wp_nav_menu_args', 'geodir_add_nav_menu_class' );
2900 2899
\ No newline at end of file
2900
+add_filter('wp_nav_menu_args', 'geodir_add_nav_menu_class');
2901 2901
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +88 added lines, -71 removed lines patch added patch discarded remove patch
@@ -86,8 +86,9 @@  discard block
 block discarded – undo
86 86
 add_filter('query_vars', 'geodir_add_location_var');
87 87
 add_filter('query_vars', 'geodir_add_geodir_page_var');
88 88
 add_action('wp', 'geodir_add_page_id_in_query_var'); // problem fix in wordpress 3.8
89
-if (get_option('permalink_structure') != '')
90
-    add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
89
+if (get_option('permalink_structure') != '') {
90
+    add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
91
+}
91 92
 
92 93
 add_filter('parse_query', 'geodir_modified_query');
93 94
 
@@ -420,8 +421,9 @@  discard block
 block discarded – undo
420 421
      */
421 422
     do_action('geodir_after_social_sharing_buttons');
422 423
     $content_html = ob_get_clean();
423
-    if (trim($content_html) != '')
424
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
424
+    if (trim($content_html) != '') {
425
+            $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
426
+    }
425 427
     if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
426 428
         /**
427 429
          * Filter the geodir_social_sharing_buttons() function content.
@@ -477,8 +479,9 @@  discard block
 block discarded – undo
477 479
      */
478 480
     do_action('geodir_after_edit_post_link');
479 481
     $content_html = ob_get_clean();
480
-    if (trim($content_html) != '')
481
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
482
+    if (trim($content_html) != '') {
483
+            $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
484
+    }
482 485
     if ((int)get_option('geodir_disable_user_links_section') != 1) {
483 486
         /**
484 487
          * Filter the geodir_edit_post_link() function content.
@@ -1052,8 +1055,9 @@  discard block
 block discarded – undo
1052 1055
      */
1053 1056
     do_action('geodir_after_google_analytics');
1054 1057
     $content_html = ob_get_clean();
1055
-    if (trim($content_html) != '')
1056
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1058
+    if (trim($content_html) != '') {
1059
+            $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1060
+    }
1057 1061
     if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1058 1062
         /**
1059 1063
          * Filter the geodir_edit_post_link() function content.
@@ -1190,8 +1194,9 @@  discard block
 block discarded – undo
1190 1194
     do_action('geodir_after_detail_page_more_info');
1191 1195
 
1192 1196
     $content_html = ob_get_clean();
1193
-    if (trim($content_html) != '')
1194
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1197
+    if (trim($content_html) != '') {
1198
+            $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1199
+    }
1195 1200
     if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1196 1201
         /**
1197 1202
          * Filter the output html for function geodir_detail_page_more_info().
@@ -1311,8 +1316,9 @@  discard block
 block discarded – undo
1311 1316
     $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1312 1317
 
1313 1318
     foreach ($arr_alert_msg as $key => $value) {
1314
-        if (!is_scalar($value))
1315
-            continue;
1319
+        if (!is_scalar($value)) {
1320
+                    continue;
1321
+        }
1316 1322
         $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1317 1323
     }
1318 1324
 
@@ -1368,17 +1374,19 @@  discard block
 block discarded – undo
1368 1374
     global $geodir_sidebars;
1369 1375
     global $sidebars_widgets;
1370 1376
 
1371
-    if (!is_array($sidebars_widgets))
1372
-        $sidebars_widgets = wp_get_sidebars_widgets();
1377
+    if (!is_array($sidebars_widgets)) {
1378
+            $sidebars_widgets = wp_get_sidebars_widgets();
1379
+    }
1373 1380
     $geodir_old_sidebars = array();
1374 1381
 
1375 1382
     if (is_array($geodir_sidebars)) {
1376 1383
         foreach ($geodir_sidebars as $val) {
1377 1384
             if (is_array($sidebars_widgets)) {
1378
-                if (array_key_exists($val, $sidebars_widgets))
1379
-                    $geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1380
-                else
1381
-                    $geodir_old_sidebars[$val] = array();
1385
+                if (array_key_exists($val, $sidebars_widgets)) {
1386
+                                    $geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1387
+                } else {
1388
+                                    $geodir_old_sidebars[$val] = array();
1389
+                }
1382 1390
             }
1383 1391
         }
1384 1392
     }
@@ -1399,16 +1407,19 @@  discard block
 block discarded – undo
1399 1407
 {
1400 1408
     global $sidebars_widgets;
1401 1409
 
1402
-    if (!is_array($sidebars_widgets))
1403
-        $sidebars_widgets = wp_get_sidebars_widgets();
1410
+    if (!is_array($sidebars_widgets)) {
1411
+            $sidebars_widgets = wp_get_sidebars_widgets();
1412
+    }
1404 1413
 
1405 1414
     if (is_array($sidebars_widgets)) {
1406 1415
         $geodir_old_sidebars = get_option('geodir_sidebars');
1407 1416
         if (is_array($geodir_old_sidebars)) {
1408 1417
             foreach ($geodir_old_sidebars as $key => $val) {
1409
-                if(0 === strpos($key, 'geodir_'))// if gd widget
1418
+                if(0 === strpos($key, 'geodir_')) {
1419
+                	// if gd widget
1410 1420
                 {
1411
-                    $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1421
+                    $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1422
+                }
1412 1423
                 }
1413 1424
 
1414 1425
 
@@ -1544,20 +1555,25 @@  discard block
 block discarded – undo
1544 1555
         }
1545 1556
     }
1546 1557
     
1547
-    if ($tab == 'post_info')
1548
-        $is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1558
+    if ($tab == 'post_info') {
1559
+            $is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1560
+    }
1549 1561
     
1550
-    if ($tab == 'post_images')
1551
-        $is_display = (!empty($post_images)) ? true : false;
1562
+    if ($tab == 'post_images') {
1563
+            $is_display = (!empty($post_images)) ? true : false;
1564
+    }
1552 1565
 
1553
-    if ($tab == 'post_video')
1554
-        $is_display = (!empty($video)) ? true : false;
1566
+    if ($tab == 'post_video') {
1567
+            $is_display = (!empty($video)) ? true : false;
1568
+    }
1555 1569
 
1556
-    if ($tab == 'special_offers')
1557
-        $is_display = (!empty($special_offers)) ? true : false;
1570
+    if ($tab == 'special_offers') {
1571
+            $is_display = (!empty($special_offers)) ? true : false;
1572
+    }
1558 1573
 
1559
-    if ($tab == 'reviews')
1560
-        $is_display = (geodir_is_page('detail')) ? true : false;
1574
+    if ($tab == 'reviews') {
1575
+            $is_display = (geodir_is_page('detail')) ? true : false;
1576
+    }
1561 1577
 
1562 1578
     if ($tab == 'related_listing') {
1563 1579
        $message = __('No listings found which match your selection.', 'geodirectory');
@@ -1791,11 +1807,13 @@  discard block
 block discarded – undo
1791 1807
     $region_slug = $default_location->region_slug;
1792 1808
     $city_slug = $default_location->city_slug;
1793 1809
 
1794
-    if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1795
-        return $slug_exists = true;
1810
+    if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug) {
1811
+            return $slug_exists = true;
1812
+    }
1796 1813
 
1797
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1798
-        return $slug_exists = true;
1814
+    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id)))) {
1815
+            return $slug_exists = true;
1816
+    }
1799 1817
 
1800 1818
     return $slug_exists;
1801 1819
 }
@@ -1837,40 +1855,31 @@  discard block
 block discarded – undo
1837 1855
     if(geodir_is_page('home')){
1838 1856
         $gd_page = 'home';
1839 1857
         $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1840
-    }
1841
-    elseif(geodir_is_page('detail')){
1858
+    } elseif(geodir_is_page('detail')){
1842 1859
         $gd_page = 'detail';
1843 1860
         $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1844
-    }
1845
-    elseif(geodir_is_page('pt')){
1861
+    } elseif(geodir_is_page('pt')){
1846 1862
         $gd_page = 'pt';
1847 1863
         $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1848
-    }
1849
-    elseif(geodir_is_page('listing')){
1864
+    } elseif(geodir_is_page('listing')){
1850 1865
         $gd_page = 'listing';
1851 1866
         $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1852
-    }
1853
-    elseif(geodir_is_page('location')){
1867
+    } elseif(geodir_is_page('location')){
1854 1868
         $gd_page = 'location';
1855 1869
         $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1856
-    }
1857
-    elseif(geodir_is_page('search')){
1870
+    } elseif(geodir_is_page('search')){
1858 1871
         $gd_page = 'search';
1859 1872
         $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1860
-    }
1861
-    elseif(geodir_is_page('add-listing')){
1873
+    } elseif(geodir_is_page('add-listing')){
1862 1874
         $gd_page = 'add-listing';
1863 1875
         $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1864
-    }
1865
-    elseif(geodir_is_page('author')){
1876
+    } elseif(geodir_is_page('author')){
1866 1877
         $gd_page = 'author';
1867 1878
         $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1868
-    }
1869
-    elseif(geodir_is_page('login')){
1879
+    } elseif(geodir_is_page('login')){
1870 1880
         $gd_page = 'login';
1871 1881
         $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1872
-    }
1873
-    elseif(geodir_is_page('listing-success')){
1882
+    } elseif(geodir_is_page('listing-success')){
1874 1883
         $gd_page = 'listing-success';
1875 1884
         $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1876 1885
     }
@@ -1948,11 +1957,13 @@  discard block
 block discarded – undo
1948 1957
 
1949 1958
     if (!get_option('geodir_remove_url_seperator')) {
1950 1959
 
1951
-        if (get_option('geodir_listingurl_separator'))
1952
-            delete_option('geodir_listingurl_separator');
1960
+        if (get_option('geodir_listingurl_separator')) {
1961
+                    delete_option('geodir_listingurl_separator');
1962
+        }
1953 1963
 
1954
-        if (get_option('geodir_detailurl_separator'))
1955
-            delete_option('geodir_detailurl_separator');
1964
+        if (get_option('geodir_detailurl_separator')) {
1965
+                    delete_option('geodir_detailurl_separator');
1966
+        }
1956 1967
 
1957 1968
         flush_rewrite_rules(false);
1958 1969
 
@@ -1976,8 +1987,9 @@  discard block
 block discarded – undo
1976 1987
 {
1977 1988
     foreach ($permalink_arr as $key => $value) {
1978 1989
 
1979
-        if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
1980
-            unset($permalink_arr[$key]);
1990
+        if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator') {
1991
+                    unset($permalink_arr[$key]);
1992
+        }
1981 1993
 
1982 1994
     }
1983 1995
 
@@ -2112,16 +2124,18 @@  discard block
 block discarded – undo
2112 2124
 
2113 2125
             $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2114 2126
 
2115
-            if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2116
-                $tabs_arr['post_video']['heading_text'] = $field_title;
2127
+            if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '') {
2128
+                            $tabs_arr['post_video']['heading_text'] = $field_title;
2129
+            }
2117 2130
         }
2118 2131
 
2119 2132
         if (array_key_exists('special_offers', $tabs_arr)) {
2120 2133
 
2121 2134
             $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2122 2135
 
2123
-            if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2124
-                $tabs_arr['special_offers']['heading_text'] = $field_title;
2136
+            if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '') {
2137
+                            $tabs_arr['special_offers']['heading_text'] = $field_title;
2138
+            }
2125 2139
         }
2126 2140
 
2127 2141
     }
@@ -2176,8 +2190,9 @@  discard block
 block discarded – undo
2176 2190
 
2177 2191
         $all_postypes = geodir_get_posttypes();
2178 2192
 
2179
-        if (!in_array($post_type, $all_postypes) || !is_admin())
2180
-            return false;
2193
+        if (!in_array($post_type, $all_postypes) || !is_admin()) {
2194
+                    return false;
2195
+        }
2181 2196
 
2182 2197
         $uploads = wp_upload_dir();
2183 2198
 
@@ -2251,8 +2266,9 @@  discard block
 block discarded – undo
2251 2266
                         $file_info = pathinfo($attach->file);
2252 2267
 
2253 2268
                         $sub_dir = '';
2254
-                        if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2255
-                            $sub_dir = stripslashes_deep($file_info['dirname']);
2269
+                        if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') {
2270
+                                                    $sub_dir = stripslashes_deep($file_info['dirname']);
2271
+                        }
2256 2272
 
2257 2273
                         $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2258 2274
                         $uploads_path = $uploads['basedir'];
@@ -2273,8 +2289,9 @@  discard block
 block discarded – undo
2273 2289
 
2274 2290
                     if (!empty($attachment_data)) {
2275 2291
 
2276
-                        if ($attachment_data->ID)
2277
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2292
+                        if ($attachment_data->ID) {
2293
+                                                    $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2294
+                        }
2278 2295
 
2279 2296
                     } else {
2280 2297
 
@@ -2470,7 +2487,7 @@  discard block
 block discarded – undo
2470 2487
                         $variables_array['label'] = __($type['site_title'], 'geodirectory');
2471 2488
                         $variables_array['value'] = '';
2472 2489
                         $variables_array['value'] = $post->{$type['htmlvar_name']};
2473
-                    }else{
2490
+                    } else{
2474 2491
                         $i = 0;
2475 2492
                         $fieldset_count++;
2476 2493
                         $field_set_start = 1;
Please login to merge, or discard this patch.
Indentation   +1088 added lines, -1088 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  */
20 20
 function geodir_get_ajax_url()
21 21
 {
22
-    return admin_url('admin-ajax.php?action=geodir_ajax_action');
22
+	return admin_url('admin-ajax.php?action=geodir_ajax_action');
23 23
 }
24 24
 
25 25
 /////////////////////
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 add_filter('query_vars', 'geodir_add_geodir_page_var');
88 88
 add_action('wp', 'geodir_add_page_id_in_query_var'); // problem fix in wordpress 3.8
89 89
 if (get_option('permalink_structure') != '')
90
-    add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
90
+	add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
91 91
 
92 92
 add_filter('parse_query', 'geodir_modified_query');
93 93
 
@@ -154,14 +154,14 @@  discard block
 block discarded – undo
154 154
 /* POST AND LOOP ACTIONS */
155 155
 ////////////////////////
156 156
 if (!is_admin()) {
157
-    add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere
158
-    add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100);
159
-    /** Exclude Virtual Pages From Pages List **/
160
-    add_action('pre_get_posts', 'set_listing_request', 0);
161
-    add_action('pre_get_posts', 'geodir_listing_loop_filter', 1);
162
-    add_filter('excerpt_more', 'geodir_excerpt_more', 1000);
163
-    add_filter('excerpt_length', 'geodir_excerpt_length', 1000);
164
-    add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter
157
+	add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere
158
+	add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100);
159
+	/** Exclude Virtual Pages From Pages List **/
160
+	add_action('pre_get_posts', 'set_listing_request', 0);
161
+	add_action('pre_get_posts', 'geodir_listing_loop_filter', 1);
162
+	add_filter('excerpt_more', 'geodir_excerpt_more', 1000);
163
+	add_filter('excerpt_length', 'geodir_excerpt_length', 1000);
164
+	add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter
165 165
 }
166 166
 
167 167
 
@@ -222,12 +222,12 @@  discard block
 block discarded – undo
222 222
  */
223 223
 function geodir_unset_prev_theme_nav_location($newname)
224 224
 {
225
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
226
-    if ($geodir_theme_location) {
227
-        update_option('geodir_theme_location_nav', $geodir_theme_location);
228
-    } else {
229
-        update_option('geodir_theme_location_nav', '');
230
-    }
225
+	$geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
226
+	if ($geodir_theme_location) {
227
+		update_option('geodir_theme_location_nav', $geodir_theme_location);
228
+	} else {
229
+		update_option('geodir_theme_location_nav', '');
230
+	}
231 231
 }
232 232
 
233 233
 /// add action for theme switch to blank previous theme navigation location setting
@@ -248,32 +248,32 @@  discard block
 block discarded – undo
248 248
  */
249 249
 function geodir_add_post_filters()
250 250
 {
251
-    /**
252
-     * Contains all function for filtering listing.
253
-     *
254
-     * @since 1.0.0
255
-     * @package GeoDirectory
256
-     */
257
-    include_once('geodirectory-functions/listing_filters.php');
251
+	/**
252
+	 * Contains all function for filtering listing.
253
+	 *
254
+	 * @since 1.0.0
255
+	 * @package GeoDirectory
256
+	 */
257
+	include_once('geodirectory-functions/listing_filters.php');
258 258
 }
259 259
 
260 260
 
261 261
 if (!function_exists('geodir_init_defaults')) {
262
-    /**
263
-     * Calls the function to register the GeoDirectory default CPT and taxonomies.
264
-     *
265
-     * @since 1.0.0
266
-     * @package GeoDirectory
267
-     */
268
-    function geodir_init_defaults()
269
-    {
270
-        if (function_exists('geodir_register_defaults')) {
262
+	/**
263
+	 * Calls the function to register the GeoDirectory default CPT and taxonomies.
264
+	 *
265
+	 * @since 1.0.0
266
+	 * @package GeoDirectory
267
+	 */
268
+	function geodir_init_defaults()
269
+	{
270
+		if (function_exists('geodir_register_defaults')) {
271 271
 
272
-            geodir_register_defaults();
272
+			geodir_register_defaults();
273 273
 
274
-        }
274
+		}
275 275
 
276
-    }
276
+	}
277 277
 }
278 278
 
279 279
 
@@ -295,26 +295,26 @@  discard block
 block discarded – undo
295 295
 // CALLED ON 'sidebars_widgets' FILTER
296 296
 
297 297
 if (!function_exists('geodir_restrict_widget')) {
298
-    /**
299
-     * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page.
300
-     *
301
-     * @global bool $is_listing Sets the global value to true if on a GD category page. False if not.
302
-     * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not.
303
-     * @since 1.0.0
304
-     * @package GeoDirectory
305
-     */
306
-    function geodir_restrict_widget()
307
-    {
308
-        global $is_listing, $is_single_place;
298
+	/**
299
+	 * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page.
300
+	 *
301
+	 * @global bool $is_listing Sets the global value to true if on a GD category page. False if not.
302
+	 * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not.
303
+	 * @since 1.0.0
304
+	 * @package GeoDirectory
305
+	 */
306
+	function geodir_restrict_widget()
307
+	{
308
+		global $is_listing, $is_single_place;
309 309
 
310
-        // set is listing	
311
-        (geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
310
+		// set is listing	
311
+		(geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
312 312
 
313
-        // set is single place
314
-        (geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
313
+		// set is single place
314
+		(geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
315 315
 
316 316
 
317
-    }
317
+	}
318 318
 }
319 319
 
320 320
 
@@ -335,31 +335,31 @@  discard block
 block discarded – undo
335 335
  */
336 336
 function geodir_detail_page_sidebar_content_sorting()
337 337
 {
338
-    $arr_detail_page_sidebar_content =
339
-        /**
340
-         * An array of functions to be called to be displayed on the details (post) page sidebar.
341
-         *
342
-         * This filter can be used to remove sections of the details page sidebar,
343
-         * add new sections or rearrange the order of the sections.
344
-         *
345
-         * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called.
346
-         * @since 1.0.0
347
-         */
348
-        apply_filters('geodir_detail_page_sidebar_content',
349
-            array('geodir_social_sharing_buttons',
350
-                'geodir_detail_page_google_analytics',
351
-                'geodir_edit_post_link',
352
-                'geodir_detail_page_review_rating',
353
-                'geodir_detail_page_more_info'
354
-            ) // end of array 
355
-        ); // end of apply filter
356
-    if (!empty($arr_detail_page_sidebar_content)) {
357
-        foreach ($arr_detail_page_sidebar_content as $content_function) {
358
-            if (function_exists($content_function)) {
359
-                add_action('geodir_detail_page_sidebar', $content_function);
360
-            }
361
-        }
362
-    }
338
+	$arr_detail_page_sidebar_content =
339
+		/**
340
+		 * An array of functions to be called to be displayed on the details (post) page sidebar.
341
+		 *
342
+		 * This filter can be used to remove sections of the details page sidebar,
343
+		 * add new sections or rearrange the order of the sections.
344
+		 *
345
+		 * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called.
346
+		 * @since 1.0.0
347
+		 */
348
+		apply_filters('geodir_detail_page_sidebar_content',
349
+			array('geodir_social_sharing_buttons',
350
+				'geodir_detail_page_google_analytics',
351
+				'geodir_edit_post_link',
352
+				'geodir_detail_page_review_rating',
353
+				'geodir_detail_page_more_info'
354
+			) // end of array 
355
+		); // end of apply filter
356
+	if (!empty($arr_detail_page_sidebar_content)) {
357
+		foreach ($arr_detail_page_sidebar_content as $content_function) {
358
+			if (function_exists($content_function)) {
359
+				add_action('geodir_detail_page_sidebar', $content_function);
360
+			}
361
+		}
362
+	}
363 363
 }
364 364
 
365 365
 add_action('geodir_after_edit_post_link', 'geodir_add_to_favourite_link', 1);
@@ -374,14 +374,14 @@  discard block
 block discarded – undo
374 374
  */
375 375
 function geodir_add_to_favourite_link()
376 376
 {
377
-    global $post, $preview;
378
-    if (!$preview && geodir_is_page('detail')) {
379
-        ?>
377
+	global $post, $preview;
378
+	if (!$preview && geodir_is_page('detail')) {
379
+		?>
380 380
         <p class="edit_link">
381 381
             <?php geodir_favourite_html($post->post_author, $post->ID); ?>
382 382
         </p>
383 383
     <?php
384
-    }
384
+	}
385 385
 }
386 386
 
387 387
 /**
@@ -395,41 +395,41 @@  discard block
 block discarded – undo
395 395
  */
396 396
 function geodir_social_sharing_buttons()
397 397
 {
398
-    global $preview;
399
-    ob_start(); // Start  buffering;
400
-    /**
401
-     * This action is called before the social buttons twitter,facebook and google plus are output in a containing div.
402
-     *
403
-     * @since 1.0.0
404
-     */
405
-    do_action('geodir_before_social_sharing_buttons');
406
-    if (!$preview) {
407
-        ?>
398
+	global $preview;
399
+	ob_start(); // Start  buffering;
400
+	/**
401
+	 * This action is called before the social buttons twitter,facebook and google plus are output in a containing div.
402
+	 *
403
+	 * @since 1.0.0
404
+	 */
405
+	do_action('geodir_before_social_sharing_buttons');
406
+	if (!$preview) {
407
+		?>
408 408
         <div class="likethis">
409 409
             <?php geodir_twitter_tweet_button(); ?>
410 410
             <?php geodir_fb_like_button(); ?>
411 411
             <?php geodir_google_plus_button(); ?>
412 412
         </div>
413 413
     <?php
414
-    }// end of if, if its a preview or not
415
-
416
-    /**
417
-     * This action is called after the social buttons twitter,facebook and google plus are output in a containing div.
418
-     *
419
-     * @since 1.0.0
420
-     */
421
-    do_action('geodir_after_social_sharing_buttons');
422
-    $content_html = ob_get_clean();
423
-    if (trim($content_html) != '')
424
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
425
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
426
-        /**
427
-         * Filter the geodir_social_sharing_buttons() function content.
428
-         *
429
-         * @param string $content_html The output html of the geodir_social_sharing_buttons() function.
430
-         */
431
-        echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
432
-    }
414
+	}// end of if, if its a preview or not
415
+
416
+	/**
417
+	 * This action is called after the social buttons twitter,facebook and google plus are output in a containing div.
418
+	 *
419
+	 * @since 1.0.0
420
+	 */
421
+	do_action('geodir_after_social_sharing_buttons');
422
+	$content_html = ob_get_clean();
423
+	if (trim($content_html) != '')
424
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
425
+	if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
426
+		/**
427
+		 * Filter the geodir_social_sharing_buttons() function content.
428
+		 *
429
+		 * @param string $content_html The output html of the geodir_social_sharing_buttons() function.
430
+		 */
431
+		echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
432
+	}
433 433
 
434 434
 
435 435
 }
@@ -447,46 +447,46 @@  discard block
 block discarded – undo
447 447
  */
448 448
 function geodir_edit_post_link()
449 449
 {
450
-    global $post, $preview;
451
-    ob_start(); // Start buffering;
452
-    /**
453
-     * This is called before the edit post link html in the function geodir_edit_post_link()
454
-     *
455
-     * @since 1.0.0
456
-     */
457
-    do_action('geodir_before_edit_post_link');
458
-    if (!$preview) {
459
-        $is_current_user_owner = geodir_listing_belong_to_current_user();
450
+	global $post, $preview;
451
+	ob_start(); // Start buffering;
452
+	/**
453
+	 * This is called before the edit post link html in the function geodir_edit_post_link()
454
+	 *
455
+	 * @since 1.0.0
456
+	 */
457
+	do_action('geodir_before_edit_post_link');
458
+	if (!$preview) {
459
+		$is_current_user_owner = geodir_listing_belong_to_current_user();
460 460
         
461
-        if ($is_current_user_owner) {
462
-            $post_id = $post->ID;
461
+		if ($is_current_user_owner) {
462
+			$post_id = $post->ID;
463 463
             
464
-            if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
465
-                $post_id = (int)$_REQUEST['pid'];
466
-            }
464
+			if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
465
+				$post_id = (int)$_REQUEST['pid'];
466
+			}
467 467
 
468
-            $postlink = get_permalink(geodir_add_listing_page_id());
469
-            $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
470
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
471
-        }
472
-    }// end of if, if its a preview or not
473
-    /**
474
-     * This is called after the edit post link html in the function geodir_edit_post_link()
475
-     *
476
-     * @since 1.0.0
477
-     */
478
-    do_action('geodir_after_edit_post_link');
479
-    $content_html = ob_get_clean();
480
-    if (trim($content_html) != '')
481
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
482
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
483
-        /**
484
-         * Filter the geodir_edit_post_link() function content.
485
-         *
486
-         * @param string $content_html The output html of the geodir_edit_post_link() function.
487
-         */
488
-        echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
489
-    }
468
+			$postlink = get_permalink(geodir_add_listing_page_id());
469
+			$editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
470
+			echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
471
+		}
472
+	}// end of if, if its a preview or not
473
+	/**
474
+	 * This is called after the edit post link html in the function geodir_edit_post_link()
475
+	 *
476
+	 * @since 1.0.0
477
+	 */
478
+	do_action('geodir_after_edit_post_link');
479
+	$content_html = ob_get_clean();
480
+	if (trim($content_html) != '')
481
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
482
+	if ((int)get_option('geodir_disable_user_links_section') != 1) {
483
+		/**
484
+		 * Filter the geodir_edit_post_link() function content.
485
+		 *
486
+		 * @param string $content_html The output html of the geodir_edit_post_link() function.
487
+		 */
488
+		echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
489
+	}
490 490
 }
491 491
 
492 492
 /**
@@ -500,42 +500,42 @@  discard block
 block discarded – undo
500 500
  */
501 501
 function geodir_detail_page_google_analytics()
502 502
 {
503
-    global $post,$preview;
504
-    if($preview){return '';}
505
-    $package_info = array();
506
-    $package_info = geodir_post_package_info($package_info, $post);
503
+	global $post,$preview;
504
+	if($preview){return '';}
505
+	$package_info = array();
506
+	$package_info = geodir_post_package_info($package_info, $post);
507 507
 
508
-    $id = trim(get_option('geodir_ga_account_id'));
508
+	$id = trim(get_option('geodir_ga_account_id'));
509 509
 
510
-    if (!$id) {
511
-        return; //if no Google Analytics ID then bail.
512
-    }
510
+	if (!$id) {
511
+		return; //if no Google Analytics ID then bail.
512
+	}
513 513
 
514
-    ob_start(); // Start buffering;
515
-    /**
516
-     * This is called before the edit post link html in the function geodir_detail_page_google_analytics()
517
-     *
518
-     * @since 1.0.0
519
-     */
520
-    do_action('geodir_before_google_analytics');
514
+	ob_start(); // Start buffering;
515
+	/**
516
+	 * This is called before the edit post link html in the function geodir_detail_page_google_analytics()
517
+	 *
518
+	 * @since 1.0.0
519
+	 */
520
+	do_action('geodir_before_google_analytics');
521 521
     
522
-    $refresh_time = get_option('geodir_ga_refresh_time', 5);
523
-    /**
524
-     * Filter the time interval to check & refresh new users results.
525
-     *
526
-     * @since 1.5.9
527
-     *
528
-     * @param int $refresh_time Time interval to check & refresh new users results.
529
-     */
530
-    $refresh_time = apply_filters('geodir_google_analytics_refresh_time', $refresh_time);
531
-    $refresh_time = absint($refresh_time * 1000);
522
+	$refresh_time = get_option('geodir_ga_refresh_time', 5);
523
+	/**
524
+	 * Filter the time interval to check & refresh new users results.
525
+	 *
526
+	 * @since 1.5.9
527
+	 *
528
+	 * @param int $refresh_time Time interval to check & refresh new users results.
529
+	 */
530
+	$refresh_time = apply_filters('geodir_google_analytics_refresh_time', $refresh_time);
531
+	$refresh_time = absint($refresh_time * 1000);
532 532
     
533
-    $hide_refresh = get_option('geodir_ga_auto_refresh');
533
+	$hide_refresh = get_option('geodir_ga_auto_refresh');
534 534
     
535
-    $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
536
-    if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
537
-        $page_url = urlencode($_SERVER['REQUEST_URI']);
538
-        ?>
535
+	$auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
536
+	if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
537
+		$page_url = urlencode($_SERVER['REQUEST_URI']);
538
+		?>
539 539
         <script type="text/javascript">
540 540
             var gd_gaTimeOut;
541 541
             var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
@@ -787,15 +787,15 @@  discard block
 block discarded – undo
787 787
                     var labels = results[1].rows.map(function(row) { return +row[0]; });
788 788
 
789 789
                     <?php
790
-                    // Here we list the shorthand days of the week so it can be used in translation.
791
-                    __("Mon",'geodirectory');
792
-                    __("Tue",'geodirectory');
793
-                    __("Wed",'geodirectory');
794
-                    __("Thu",'geodirectory');
795
-                    __("Fri",'geodirectory');
796
-                    __("Sat",'geodirectory');
797
-                    __("Sun",'geodirectory');
798
-                    ?>
790
+					// Here we list the shorthand days of the week so it can be used in translation.
791
+					__("Mon",'geodirectory');
792
+					__("Tue",'geodirectory');
793
+					__("Wed",'geodirectory');
794
+					__("Thu",'geodirectory');
795
+					__("Fri",'geodirectory');
796
+					__("Sat",'geodirectory');
797
+					__("Sun",'geodirectory');
798
+					?>
799 799
 
800 800
                     labels = [
801 801
                         "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
@@ -1044,24 +1044,24 @@  discard block
 block discarded – undo
1044 1044
         </span>
1045 1045
 
1046 1046
     <?php
1047
-    }
1048
-    /**
1049
-     * This is called after the edit post link html in the function geodir_detail_page_google_analytics()
1050
-     *
1051
-     * @since 1.0.0
1052
-     */
1053
-    do_action('geodir_after_google_analytics');
1054
-    $content_html = ob_get_clean();
1055
-    if (trim($content_html) != '')
1056
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1057
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1058
-        /**
1059
-         * Filter the geodir_edit_post_link() function content.
1060
-         *
1061
-         * @param string $content_html The output html of the geodir_edit_post_link() function.
1062
-         */
1063
-        echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
1064
-    }
1047
+	}
1048
+	/**
1049
+	 * This is called after the edit post link html in the function geodir_detail_page_google_analytics()
1050
+	 *
1051
+	 * @since 1.0.0
1052
+	 */
1053
+	do_action('geodir_after_google_analytics');
1054
+	$content_html = ob_get_clean();
1055
+	if (trim($content_html) != '')
1056
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1057
+	if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1058
+		/**
1059
+		 * Filter the geodir_edit_post_link() function content.
1060
+		 *
1061
+		 * @param string $content_html The output html of the geodir_edit_post_link() function.
1062
+		 */
1063
+		echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
1064
+	}
1065 1065
 }
1066 1066
 
1067 1067
 /**
@@ -1077,90 +1077,90 @@  discard block
 block discarded – undo
1077 1077
  */
1078 1078
 function geodir_detail_page_review_rating()
1079 1079
 {
1080
-    global $post, $preview, $post_images;
1081
-    ob_start(); // Start  buffering;
1082
-    /**
1083
-     * This is called before the rating html in the function geodir_detail_page_review_rating().
1084
-     *
1085
-     * This is called outside the check for an actual rating and the check for preview page.
1086
-     *
1087
-     * @since 1.0.0
1088
-     */
1089
-    do_action('geodir_before_detail_page_review_rating');
1090
-
1091
-    $comment_count = geodir_get_review_count_total($post->ID);
1092
-    $post_avgratings = geodir_get_post_rating($post->ID);
1093
-
1094
-    if ($post_avgratings != 0 && !$preview) {
1095
-        /**
1096
-         * This is called before the rating html in the function geodir_detail_page_review_rating().
1097
-         *
1098
-         * This is called inside the check for an actual rating and the check for preview page.
1099
-         *
1100
-         * @since 1.0.0
1101
-         * @param float $post_avgratings Average rating for the surrent post.
1102
-         * @param int $post->ID Current post ID.
1103
-         */
1104
-        do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1105
-
1106
-        $html = '<p style=" float:left;">';
1107
-        $html .= geodir_get_rating_stars($post_avgratings, $post->ID);
1108
-        $html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
1109
-        $post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings;
1080
+	global $post, $preview, $post_images;
1081
+	ob_start(); // Start  buffering;
1082
+	/**
1083
+	 * This is called before the rating html in the function geodir_detail_page_review_rating().
1084
+	 *
1085
+	 * This is called outside the check for an actual rating and the check for preview page.
1086
+	 *
1087
+	 * @since 1.0.0
1088
+	 */
1089
+	do_action('geodir_before_detail_page_review_rating');
1090
+
1091
+	$comment_count = geodir_get_review_count_total($post->ID);
1092
+	$post_avgratings = geodir_get_post_rating($post->ID);
1093
+
1094
+	if ($post_avgratings != 0 && !$preview) {
1095
+		/**
1096
+		 * This is called before the rating html in the function geodir_detail_page_review_rating().
1097
+		 *
1098
+		 * This is called inside the check for an actual rating and the check for preview page.
1099
+		 *
1100
+		 * @since 1.0.0
1101
+		 * @param float $post_avgratings Average rating for the surrent post.
1102
+		 * @param int $post->ID Current post ID.
1103
+		 */
1104
+		do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1105
+
1106
+		$html = '<p style=" float:left;">';
1107
+		$html .= geodir_get_rating_stars($post_avgratings, $post->ID);
1108
+		$html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
1109
+		$post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings;
1110 1110
        
1111 1111
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1112 1112
 	   
1113 1113
 	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
1114 1114
 
1115
-        $html .= '<span class="item">';
1116
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1115
+		$html .= '<span class="item">';
1116
+		$html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1117 1117
 
1118
-        if ($post_images) {
1119
-            foreach ($post_images as $img) {
1120
-                $post_img = $img->src;
1121
-                break;
1122
-            }
1123
-        }
1124
-
1125
-        if (isset($post_img) && $post_img) {
1126
-            $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1127
-        }
1128
-
1129
-        $html .= '</span>';
1130
-
1131
-        echo $html .= '</div>';
1132
-        /**
1133
-         * This is called after the rating html in the function geodir_detail_page_review_rating().
1134
-         *
1135
-         * This is called inside the check for an actual rating and the check for preview page.
1136
-         *
1137
-         * @since 1.0.0
1138
-         * @param float $post_avgratings Average rating for the surrent post.
1139
-         * @param int $post->ID Current post ID.
1140
-         */
1141
-        do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1142
-    }
1143
-    /**
1144
-     * This is called before the rating html in the function geodir_detail_page_review_rating().
1145
-     *
1146
-     * This is called outside the check for an actual rating and the check for preview page.
1147
-     *
1148
-     * @since 1.0.0
1149
-     */
1150
-    do_action('geodir_after_detail_page_review_rating');
1151
-    $content_html = ob_get_clean();
1152
-    if (trim($content_html) != '') {
1153
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1154
-    }
1155
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1156
-        /**
1157
-         * Filter the geodir_detail_page_review_rating() function content.
1158
-         *
1159
-         * @since 1.0.0
1160
-         * @param string $content_html The output html of the geodir_detail_page_review_rating() function.
1161
-         */
1162
-        echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
1163
-    }
1118
+		if ($post_images) {
1119
+			foreach ($post_images as $img) {
1120
+				$post_img = $img->src;
1121
+				break;
1122
+			}
1123
+		}
1124
+
1125
+		if (isset($post_img) && $post_img) {
1126
+			$html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1127
+		}
1128
+
1129
+		$html .= '</span>';
1130
+
1131
+		echo $html .= '</div>';
1132
+		/**
1133
+		 * This is called after the rating html in the function geodir_detail_page_review_rating().
1134
+		 *
1135
+		 * This is called inside the check for an actual rating and the check for preview page.
1136
+		 *
1137
+		 * @since 1.0.0
1138
+		 * @param float $post_avgratings Average rating for the surrent post.
1139
+		 * @param int $post->ID Current post ID.
1140
+		 */
1141
+		do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1142
+	}
1143
+	/**
1144
+	 * This is called before the rating html in the function geodir_detail_page_review_rating().
1145
+	 *
1146
+	 * This is called outside the check for an actual rating and the check for preview page.
1147
+	 *
1148
+	 * @since 1.0.0
1149
+	 */
1150
+	do_action('geodir_after_detail_page_review_rating');
1151
+	$content_html = ob_get_clean();
1152
+	if (trim($content_html) != '') {
1153
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1154
+	}
1155
+	if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1156
+		/**
1157
+		 * Filter the geodir_detail_page_review_rating() function content.
1158
+		 *
1159
+		 * @since 1.0.0
1160
+		 * @param string $content_html The output html of the geodir_detail_page_review_rating() function.
1161
+		 */
1162
+		echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
1163
+	}
1164 1164
 }
1165 1165
 
1166 1166
 /**
@@ -1172,35 +1172,35 @@  discard block
 block discarded – undo
1172 1172
  */
1173 1173
 function geodir_detail_page_more_info()
1174 1174
 {
1175
-    ob_start(); // Start  buffering;
1176
-    /**
1177
-     * This is called before the info section html.
1178
-     *
1179
-     * @since 1.0.0
1180
-     */
1181
-    do_action('geodir_before_detail_page_more_info');
1182
-    if ($geodir_post_detail_fields = geodir_show_listing_info('detail')) {
1183
-        echo $geodir_post_detail_fields;
1184
-    }
1185
-    /**
1186
-     * This is called after the info section html.
1187
-     *
1188
-     * @since 1.0.0
1189
-     */
1190
-    do_action('geodir_after_detail_page_more_info');
1191
-
1192
-    $content_html = ob_get_clean();
1193
-    if (trim($content_html) != '')
1194
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1195
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1196
-        /**
1197
-         * Filter the output html for function geodir_detail_page_more_info().
1198
-         *
1199
-         * @since 1.0.0
1200
-         * @param string $content_html The output html of the geodir_detail_page_more_info() function.
1201
-         */
1202
-        echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
1203
-    }
1175
+	ob_start(); // Start  buffering;
1176
+	/**
1177
+	 * This is called before the info section html.
1178
+	 *
1179
+	 * @since 1.0.0
1180
+	 */
1181
+	do_action('geodir_before_detail_page_more_info');
1182
+	if ($geodir_post_detail_fields = geodir_show_listing_info('detail')) {
1183
+		echo $geodir_post_detail_fields;
1184
+	}
1185
+	/**
1186
+	 * This is called after the info section html.
1187
+	 *
1188
+	 * @since 1.0.0
1189
+	 */
1190
+	do_action('geodir_after_detail_page_more_info');
1191
+
1192
+	$content_html = ob_get_clean();
1193
+	if (trim($content_html) != '')
1194
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1195
+	if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1196
+		/**
1197
+		 * Filter the output html for function geodir_detail_page_more_info().
1198
+		 *
1199
+		 * @since 1.0.0
1200
+		 * @param string $content_html The output html of the geodir_detail_page_more_info() function.
1201
+		 */
1202
+		echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
1203
+	}
1204 1204
 }
1205 1205
 
1206 1206
 
@@ -1214,15 +1214,15 @@  discard block
 block discarded – undo
1214 1214
  */
1215 1215
 function geodir_localize_all_js_msg()
1216 1216
 {// check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
1217
-    if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1218
-        $ajax_url = admin_url('admin-ajax.php');
1219
-    } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1220
-        $ajax_url = admin_url('admin-ajax.php');
1221
-    } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1222
-        $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
1223
-    } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1224
-        $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
1225
-    }
1217
+	if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1218
+		$ajax_url = admin_url('admin-ajax.php');
1219
+	} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1220
+		$ajax_url = admin_url('admin-ajax.php');
1221
+	} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1222
+		$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
1223
+	} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1224
+		$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
1225
+	}
1226 1226
 	
1227 1227
 	/**
1228 1228
 	 * Filter the allowed image type extensions for post images.
@@ -1232,60 +1232,60 @@  discard block
 block discarded – undo
1232 1232
 	 */
1233 1233
 	$allowed_img_types = apply_filters('geodir_allowed_post_image_exts', array('jpg', 'jpeg', 'jpe', 'gif', 'png'));
1234 1234
 	
1235
-    $default_marker_icon = get_option('geodir_default_marker_icon');
1236
-    $default_marker_size = geodir_get_marker_size($default_marker_icon, array('w' => 20, 'h' => 34));
1237
-    $default_marker_width = $default_marker_size['w'];
1238
-    $default_marker_height = $default_marker_size['h'];
1235
+	$default_marker_icon = get_option('geodir_default_marker_icon');
1236
+	$default_marker_size = geodir_get_marker_size($default_marker_icon, array('w' => 20, 'h' => 34));
1237
+	$default_marker_width = $default_marker_size['w'];
1238
+	$default_marker_height = $default_marker_size['h'];
1239 1239
     
1240
-    $arr_alert_msg = array(
1241
-        'geodir_plugin_url' => geodir_plugin_url(),
1242
-        'geodir_admin_ajax_url' => $ajax_url,
1243
-        'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
1244
-        'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
1245
-        'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
1246
-        'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
1247
-        //start not show alert msg
1248
-        'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
1249
-        'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
1250
-        'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
1251
-        'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
1252
-        'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
1253
-        // end not show alert msg
1254
-        'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
1255
-        'my_main_listing_del' => __('Deleting the main listing of a franchise will turn all franchises in regular listings. Are you sure wish to delete this main listing?', 'geodirectory'),
1256
-        //start not show alert msg
1257
-        'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1258
-        'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1259
-        'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1260
-        'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1261
-        'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1262
-        'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1263
-        'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1264
-        'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1265
-        'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1266
-        'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1267
-        'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1268
-        'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1269
-        'geodir_default_marker_icon' => $default_marker_icon,
1270
-        'geodir_default_marker_w' => $default_marker_width,
1271
-        'geodir_default_marker_h' => $default_marker_height,
1272
-        'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1273
-        'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1274
-        'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1275
-        'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1276
-        'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1277
-        'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1278
-        'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1279
-        'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1280
-        /* on/off dragging for phone devices */
1281
-        'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1282
-        'geodir_is_mobile' => wp_is_mobile() ? true : false,
1283
-        'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1284
-        'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1285
-        'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1286
-        'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1287
-        'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1288
-        'geodir_action_remove' => __('Remove', 'geodirectory'),
1240
+	$arr_alert_msg = array(
1241
+		'geodir_plugin_url' => geodir_plugin_url(),
1242
+		'geodir_admin_ajax_url' => $ajax_url,
1243
+		'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
1244
+		'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
1245
+		'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
1246
+		'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
1247
+		//start not show alert msg
1248
+		'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
1249
+		'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
1250
+		'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
1251
+		'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
1252
+		'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
1253
+		// end not show alert msg
1254
+		'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
1255
+		'my_main_listing_del' => __('Deleting the main listing of a franchise will turn all franchises in regular listings. Are you sure wish to delete this main listing?', 'geodirectory'),
1256
+		//start not show alert msg
1257
+		'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1258
+		'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1259
+		'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1260
+		'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1261
+		'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1262
+		'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1263
+		'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1264
+		'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1265
+		'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1266
+		'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1267
+		'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1268
+		'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1269
+		'geodir_default_marker_icon' => $default_marker_icon,
1270
+		'geodir_default_marker_w' => $default_marker_width,
1271
+		'geodir_default_marker_h' => $default_marker_height,
1272
+		'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1273
+		'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1274
+		'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1275
+		'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1276
+		'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1277
+		'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1278
+		'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1279
+		'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1280
+		/* on/off dragging for phone devices */
1281
+		'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1282
+		'geodir_is_mobile' => wp_is_mobile() ? true : false,
1283
+		'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1284
+		'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1285
+		'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1286
+		'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1287
+		'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1288
+		'geodir_action_remove' => __('Remove', 'geodirectory'),
1289 1289
 		'geodir_txt_all_files' => __('Allowed files', 'geodirectory'),
1290 1290
 		'geodir_err_file_type' => __('File type error. Allowed file types: %s', 'geodirectory'),
1291 1291
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
@@ -1293,35 +1293,35 @@  discard block
 block discarded – undo
1293 1293
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1294 1294
 		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1295 1295
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1296
-        'multirating' => defined('GEODIRREVIEWRATING_VERSION') && get_option('geodir_reviewrating_enable_rating') ? true : false,
1297
-        'geodir_map_name' => geodir_map_name(),
1298
-        'osmStart' => __('Start', 'geodirectory'),
1299
-        'osmVia' => __('Via {viaNumber}', 'geodirectory'),
1300
-        'osmEnd' => __('Enter Your Location', 'geodirectory'),
1301
-        'ga_delete_check' => __('Are you wish to Deauthorize and break Analytics?', 'geodirectory'),
1302
-
1303
-    );
1304
-
1305
-    /**
1306
-     * Filters the translated JS strings from function geodir_localize_all_js_msg().
1307
-     *
1308
-     * With this filter you can add, remove or change translated JS strings.
1309
-     * You should add your own translations to this if you are building an addon rather than adding another script block.
1310
-     *
1311
-     * @since 1.0.0
1312
-     */
1313
-    $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1314
-
1315
-    foreach ($arr_alert_msg as $key => $value) {
1316
-        if (!is_scalar($value))
1317
-            continue;
1318
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1319
-    }
1296
+		'multirating' => defined('GEODIRREVIEWRATING_VERSION') && get_option('geodir_reviewrating_enable_rating') ? true : false,
1297
+		'geodir_map_name' => geodir_map_name(),
1298
+		'osmStart' => __('Start', 'geodirectory'),
1299
+		'osmVia' => __('Via {viaNumber}', 'geodirectory'),
1300
+		'osmEnd' => __('Enter Your Location', 'geodirectory'),
1301
+		'ga_delete_check' => __('Are you wish to Deauthorize and break Analytics?', 'geodirectory'),
1302
+
1303
+	);
1320 1304
 
1321
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1322
-    echo '<script>';
1323
-    echo $script;
1324
-    echo '</script>';
1305
+	/**
1306
+	 * Filters the translated JS strings from function geodir_localize_all_js_msg().
1307
+	 *
1308
+	 * With this filter you can add, remove or change translated JS strings.
1309
+	 * You should add your own translations to this if you are building an addon rather than adding another script block.
1310
+	 *
1311
+	 * @since 1.0.0
1312
+	 */
1313
+	$arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1314
+
1315
+	foreach ($arr_alert_msg as $key => $value) {
1316
+		if (!is_scalar($value))
1317
+			continue;
1318
+		$arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1319
+	}
1320
+
1321
+	$script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1322
+	echo '<script>';
1323
+	echo $script;
1324
+	echo '</script>';
1325 1325
 }
1326 1326
 
1327 1327
 add_action('admin_bar_menu', 'geodir_admin_bar_site_menu', 31);
@@ -1337,11 +1337,11 @@  discard block
 block discarded – undo
1337 1337
  */
1338 1338
 function geodir_admin_bar_site_menu($wp_admin_bar)
1339 1339
 {
1340
-    if (get_option("geodir_installed")) {
1341
-        if (current_user_can('manage_options')) {
1342
-            $wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1343
-        }
1344
-    }
1340
+	if (get_option("geodir_installed")) {
1341
+		if (current_user_can('manage_options')) {
1342
+			$wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1343
+		}
1344
+	}
1345 1345
 }
1346 1346
 
1347 1347
 add_action('geodir_before_listing', 'geodir_display_sort_options'); /*function in custom_functions.php*/
@@ -1367,25 +1367,25 @@  discard block
 block discarded – undo
1367 1367
  */
1368 1368
 function geodir_store_sidebars()
1369 1369
 {
1370
-    global $geodir_sidebars;
1371
-    global $sidebars_widgets;
1372
-
1373
-    if (!is_array($sidebars_widgets))
1374
-        $sidebars_widgets = wp_get_sidebars_widgets();
1375
-    $geodir_old_sidebars = array();
1376
-
1377
-    if (is_array($geodir_sidebars)) {
1378
-        foreach ($geodir_sidebars as $val) {
1379
-            if (is_array($sidebars_widgets)) {
1380
-                if (array_key_exists($val, $sidebars_widgets))
1381
-                    $geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1382
-                else
1383
-                    $geodir_old_sidebars[$val] = array();
1384
-            }
1385
-        }
1386
-    }
1387
-    update_option('geodir_sidebars', $geodir_old_sidebars);
1388
-    geodir_option_version_backup('geodir_sidebars');
1370
+	global $geodir_sidebars;
1371
+	global $sidebars_widgets;
1372
+
1373
+	if (!is_array($sidebars_widgets))
1374
+		$sidebars_widgets = wp_get_sidebars_widgets();
1375
+	$geodir_old_sidebars = array();
1376
+
1377
+	if (is_array($geodir_sidebars)) {
1378
+		foreach ($geodir_sidebars as $val) {
1379
+			if (is_array($sidebars_widgets)) {
1380
+				if (array_key_exists($val, $sidebars_widgets))
1381
+					$geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1382
+				else
1383
+					$geodir_old_sidebars[$val] = array();
1384
+			}
1385
+		}
1386
+	}
1387
+	update_option('geodir_sidebars', $geodir_old_sidebars);
1388
+	geodir_option_version_backup('geodir_sidebars');
1389 1389
 
1390 1390
 }
1391 1391
 
@@ -1399,28 +1399,28 @@  discard block
 block discarded – undo
1399 1399
  */
1400 1400
 function geodir_restore_sidebars()
1401 1401
 {
1402
-    global $sidebars_widgets;
1403
-
1404
-    if (!is_array($sidebars_widgets))
1405
-        $sidebars_widgets = wp_get_sidebars_widgets();
1406
-
1407
-    if (is_array($sidebars_widgets)) {
1408
-        $geodir_old_sidebars = get_option('geodir_sidebars');
1409
-        if (is_array($geodir_old_sidebars)) {
1410
-            foreach ($geodir_old_sidebars as $key => $val) {
1411
-                if(0 === strpos($key, 'geodir_'))// if gd widget
1412
-                {
1413
-                    $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1414
-                }
1402
+	global $sidebars_widgets;
1415 1403
 
1404
+	if (!is_array($sidebars_widgets))
1405
+		$sidebars_widgets = wp_get_sidebars_widgets();
1416 1406
 
1417
-            }
1418
-        }
1407
+	if (is_array($sidebars_widgets)) {
1408
+		$geodir_old_sidebars = get_option('geodir_sidebars');
1409
+		if (is_array($geodir_old_sidebars)) {
1410
+			foreach ($geodir_old_sidebars as $key => $val) {
1411
+				if(0 === strpos($key, 'geodir_'))// if gd widget
1412
+				{
1413
+					$sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1414
+				}
1419 1415
 
1420
-    }
1421 1416
 
1422
-    update_option('sidebars_widgets', $sidebars_widgets);
1423
-    update_option('geodir_sidebars', '');
1417
+			}
1418
+		}
1419
+
1420
+	}
1421
+
1422
+	update_option('sidebars_widgets', $sidebars_widgets);
1423
+	update_option('geodir_sidebars', '');
1424 1424
 }
1425 1425
 
1426 1426
 add_action('geodir_after_listing_post_gridview', 'geodir_after_listing_post_gridview');
@@ -1433,9 +1433,9 @@  discard block
 block discarded – undo
1433 1433
  */
1434 1434
 function geodir_after_listing_post_gridview()
1435 1435
 {
1436
-    global $gridview_columns;
1436
+	global $gridview_columns;
1437 1437
 
1438
-    $gridview_columns = '';
1438
+	$gridview_columns = '';
1439 1439
 
1440 1440
 }
1441 1441
 
@@ -1463,11 +1463,11 @@  discard block
 block discarded – undo
1463 1463
  */
1464 1464
 function so_handle_038($url, $original_url, $_context)
1465 1465
 {
1466
-    if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1467
-        $url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1468
-    }
1466
+	if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1467
+		$url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1468
+	}
1469 1469
 
1470
-    return $url;
1470
+	return $url;
1471 1471
 }
1472 1472
 
1473 1473
 
@@ -1483,34 +1483,34 @@  discard block
 block discarded – undo
1483 1483
 function geodir_after_main_form_fields() {
1484 1484
 	global $gd_session;
1485 1485
 	
1486
-    if (get_option('geodir_accept_term_condition')) {
1487
-        global $post;
1488
-        $term_condition = '';
1489
-        if (isset($_REQUEST['backandedit'])) {
1490
-            $post = (object)$gd_session->get('listing');
1491
-            $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1492
-        }
1493
-
1494
-        ?>
1486
+	if (get_option('geodir_accept_term_condition')) {
1487
+		global $post;
1488
+		$term_condition = '';
1489
+		if (isset($_REQUEST['backandedit'])) {
1490
+			$post = (object)$gd_session->get('listing');
1491
+			$term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1492
+		}
1493
+
1494
+		?>
1495 1495
         <div id="geodir_accept_term_condition_row" class="required_field geodir_form_row clearfix">
1496 1496
             <label>&nbsp;</label>
1497 1497
 
1498 1498
             <div class="geodir_taxonomy_field" style="float:left; width:70%;">
1499 1499
 				<span style="display:block"> 
1500 1500
 				<input class="main_list_selecter" type="checkbox" <?php if ($term_condition == '1') {
1501
-                    echo 'checked="checked"';
1502
-                } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1501
+					echo 'checked="checked"';
1502
+				} ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1503 1503
                        class="geodir_textfield" value="1"
1504 1504
                        style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1505 1505
 				</span>
1506 1506
             </div>
1507 1507
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
1508
-                    _e($required_msg, 'geodirectory');
1509
-                } ?></span>
1508
+					_e($required_msg, 'geodirectory');
1509
+				} ?></span>
1510 1510
         </div>
1511 1511
     <?php
1512 1512
 
1513
-    }
1513
+	}
1514 1514
 }
1515 1515
 
1516 1516
 
@@ -1535,42 +1535,42 @@  discard block
 block discarded – undo
1535 1535
  */
1536 1536
 function geodir_detail_page_tab_is_display($is_display, $tab)
1537 1537
 {
1538
-    global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1538
+	global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1539 1539
 
1540
-    if ($tab == 'post_profile') {
1541
-        /** This action is documented in geodirectory_template_actions.php */
1542
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1540
+	if ($tab == 'post_profile') {
1541
+		/** This action is documented in geodirectory_template_actions.php */
1542
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1543 1543
         
1544
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1545
-            $is_display = false;
1546
-        }
1547
-    }
1544
+		if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1545
+			$is_display = false;
1546
+		}
1547
+	}
1548 1548
     
1549
-    if ($tab == 'post_info')
1550
-        $is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1549
+	if ($tab == 'post_info')
1550
+		$is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1551 1551
     
1552
-    if ($tab == 'post_images')
1553
-        $is_display = (!empty($post_images)) ? true : false;
1552
+	if ($tab == 'post_images')
1553
+		$is_display = (!empty($post_images)) ? true : false;
1554 1554
 
1555
-    if ($tab == 'post_video')
1556
-        $is_display = (!empty($video)) ? true : false;
1555
+	if ($tab == 'post_video')
1556
+		$is_display = (!empty($video)) ? true : false;
1557 1557
 
1558
-    if ($tab == 'special_offers')
1559
-        $is_display = (!empty($special_offers)) ? true : false;
1558
+	if ($tab == 'special_offers')
1559
+		$is_display = (!empty($special_offers)) ? true : false;
1560 1560
 
1561
-    if ($tab == 'reviews')
1562
-        $is_display = (geodir_is_page('detail')) ? true : false;
1561
+	if ($tab == 'reviews')
1562
+		$is_display = (geodir_is_page('detail')) ? true : false;
1563 1563
 
1564
-    if ($tab == 'related_listing') {
1565
-       $message = __('No listings found which match your selection.', 'geodirectory');
1564
+	if ($tab == 'related_listing') {
1565
+	   $message = __('No listings found which match your selection.', 'geodirectory');
1566 1566
        
1567
-       /** This action is documented in geodirectory-functions/template_functions.php */
1568
-       $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1567
+	   /** This action is documented in geodirectory-functions/template_functions.php */
1568
+	   $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1569 1569
        
1570
-       $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1571
-    }
1570
+	   $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1571
+	}
1572 1572
 
1573
-    return $is_display;
1573
+	return $is_display;
1574 1574
 }
1575 1575
 
1576 1576
 
@@ -1586,69 +1586,69 @@  discard block
 block discarded – undo
1586 1586
  * @global string $plugin_prefix Geodirectory plugin table prefix.
1587 1587
  */
1588 1588
 function geodir_changes_in_custom_fields_table() {
1589
-    global $wpdb, $plugin_prefix;
1589
+	global $wpdb, $plugin_prefix;
1590 1590
 	
1591 1591
 	// Remove unused virtual page
1592 1592
 	$listings_page_id = (int)get_option('geodir_listing_page');
1593 1593
 	if ($listings_page_id) {
1594 1594
 		$wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1595
-        delete_option('geodir_listing_page');
1595
+		delete_option('geodir_listing_page');
1596 1596
 	}
1597 1597
 
1598
-    if (!get_option('geodir_changes_in_custom_fields_table')) {
1599
-        $wpdb->query(
1600
-            $wpdb->prepare(
1601
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1602
-                array('1', '1', 'admin')
1603
-            )
1604
-        );
1598
+	if (!get_option('geodir_changes_in_custom_fields_table')) {
1599
+		$wpdb->query(
1600
+			$wpdb->prepare(
1601
+				"UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1602
+				array('1', '1', 'admin')
1603
+			)
1604
+		);
1605 1605
 
1606 1606
 
1607
-        /* --- terms meta value set --- */
1607
+		/* --- terms meta value set --- */
1608 1608
 
1609
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1609
+		update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1610 1610
 
1611
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1611
+		$options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1612 1612
 
1613
-        if (!empty($options_data)) {
1613
+		if (!empty($options_data)) {
1614 1614
 
1615
-            foreach ($options_data as $optobj) {
1615
+			foreach ($options_data as $optobj) {
1616 1616
 
1617
-                $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1617
+				$option_val = str_replace('tax_meta_', '', $optobj->option_name);
1618 1618
 
1619
-                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1619
+				$taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1620 1620
 
1621
-                if (!empty($taxonomies_data)) {
1621
+				if (!empty($taxonomies_data)) {
1622 1622
 
1623
-                    foreach ($taxonomies_data as $taxobj) {
1623
+					foreach ($taxonomies_data as $taxobj) {
1624 1624
 
1625
-                        $taxObject = get_taxonomy($taxobj->taxonomy);
1626
-                        $post_type = $taxObject->object_type[0];
1625
+						$taxObject = get_taxonomy($taxobj->taxonomy);
1626
+						$post_type = $taxObject->object_type[0];
1627 1627
 
1628
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1628
+						$opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1629 1629
 
1630
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1630
+						$duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1631 1631
 
1632
-                        if ($duplicate_data) {
1632
+						if ($duplicate_data) {
1633 1633
 
1634
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1634
+							$wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1635 1635
 
1636
-                        } else {
1636
+						} else {
1637 1637
 
1638
-                            $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1638
+							$wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1639 1639
 
1640
-                        }
1640
+						}
1641 1641
 
1642
-                    }
1642
+					}
1643 1643
 
1644
-                }
1644
+				}
1645 1645
 
1646
-            }
1647
-        }
1646
+			}
1647
+		}
1648 1648
 
1649
-        update_option('geodir_changes_in_custom_fields_table', '1');
1649
+		update_option('geodir_changes_in_custom_fields_table', '1');
1650 1650
 
1651
-    }
1651
+	}
1652 1652
 
1653 1653
 }
1654 1654
 
@@ -1667,24 +1667,24 @@  discard block
 block discarded – undo
1667 1667
 function geodir_location_slug_check($slug)
1668 1668
 {
1669 1669
 
1670
-    global $wpdb, $table_prefix;
1670
+	global $wpdb, $table_prefix;
1671 1671
 
1672
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1672
+	$slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1673 1673
 
1674
-    if ($slug_exists) {
1674
+	if ($slug_exists) {
1675 1675
 
1676
-        $suffix = 1;
1677
-        do {
1678
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1679
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1680
-            $suffix++;
1681
-        } while ($location_slug_check && $suffix < 100);
1676
+		$suffix = 1;
1677
+		do {
1678
+			$alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1679
+			$location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1680
+			$suffix++;
1681
+		} while ($location_slug_check && $suffix < 100);
1682 1682
 
1683
-        $slug = $alt_location_name;
1683
+		$slug = $alt_location_name;
1684 1684
 
1685
-    }
1685
+	}
1686 1686
 
1687
-    return $slug;
1687
+	return $slug;
1688 1688
 
1689 1689
 }
1690 1690
 
@@ -1709,42 +1709,42 @@  discard block
 block discarded – undo
1709 1709
 function geodir_update_term_slug($term_id, $tt_id, $taxonomy)
1710 1710
 {
1711 1711
 
1712
-    global $wpdb, $plugin_prefix, $table_prefix;
1712
+	global $wpdb, $plugin_prefix, $table_prefix;
1713 1713
 
1714
-    $tern_data = get_term_by('id', $term_id, $taxonomy);
1714
+	$tern_data = get_term_by('id', $term_id, $taxonomy);
1715 1715
 
1716
-    $slug = $tern_data->slug;
1716
+	$slug = $tern_data->slug;
1717 1717
 
1718
-    /**
1719
-     * Filter if a term slug exists.
1720
-     *
1721
-     * @since 1.0.0
1722
-     * @package GeoDirectory
1723
-     * @param bool $bool Default: false.
1724
-     * @param string $slug The term slug.
1725
-     * @param int $term_id The term ID.
1726
-     */
1727
-    $slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1718
+	/**
1719
+	 * Filter if a term slug exists.
1720
+	 *
1721
+	 * @since 1.0.0
1722
+	 * @package GeoDirectory
1723
+	 * @param bool $bool Default: false.
1724
+	 * @param string $slug The term slug.
1725
+	 * @param int $term_id The term ID.
1726
+	 */
1727
+	$slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1728 1728
 
1729
-    if ($slug_exists) {
1729
+	if ($slug_exists) {
1730 1730
 
1731
-        $suffix = 1;
1732
-        do {
1733
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1731
+		$suffix = 1;
1732
+		do {
1733
+			$new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1734 1734
 
1735
-            /** This action is documented in geodirectory_hooks_actions.php */
1736
-            $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1735
+			/** This action is documented in geodirectory_hooks_actions.php */
1736
+			$term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1737 1737
 
1738
-            $suffix++;
1739
-        } while ($term_slug_check && $suffix < 100);
1738
+			$suffix++;
1739
+		} while ($term_slug_check && $suffix < 100);
1740 1740
 
1741
-        $slug = $new_slug;
1741
+		$slug = $new_slug;
1742 1742
 
1743
-        //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1743
+		//wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1744 1744
 
1745
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1745
+		$wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1746 1746
 
1747
-    }
1747
+	}
1748 1748
 	
1749 1749
 	// Update tag in detail table.
1750 1750
 	$taxonomy_obj = get_taxonomy($taxonomy);
@@ -1785,21 +1785,21 @@  discard block
 block discarded – undo
1785 1785
 function geodir_term_slug_is_exists($slug_exists, $slug, $term_id)
1786 1786
 {
1787 1787
 
1788
-    global $wpdb, $table_prefix;
1788
+	global $wpdb, $table_prefix;
1789 1789
 
1790
-    $default_location = geodir_get_default_location();
1790
+	$default_location = geodir_get_default_location();
1791 1791
 
1792
-    $country_slug = $default_location->country_slug;
1793
-    $region_slug = $default_location->region_slug;
1794
-    $city_slug = $default_location->city_slug;
1792
+	$country_slug = $default_location->country_slug;
1793
+	$region_slug = $default_location->region_slug;
1794
+	$city_slug = $default_location->city_slug;
1795 1795
 
1796
-    if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1797
-        return $slug_exists = true;
1796
+	if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1797
+		return $slug_exists = true;
1798 1798
 
1799
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1800
-        return $slug_exists = true;
1799
+	if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1800
+		return $slug_exists = true;
1801 1801
 
1802
-    return $slug_exists;
1802
+	return $slug_exists;
1803 1803
 }
1804 1804
 
1805 1805
 
@@ -1818,75 +1818,75 @@  discard block
 block discarded – undo
1818 1818
  */
1819 1819
 function geodir_custom_page_title($title = '', $sep = '')
1820 1820
 {
1821
-    global $wp;
1822
-    if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1823
-        return $title;
1824
-    }
1821
+	global $wp;
1822
+	if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1823
+		return $title;
1824
+	}
1825 1825
 
1826
-    if ($sep == '') {
1827
-        /**
1828
-         * Filter the page title separator.
1829
-         *
1830
-         * @since 1.0.0
1831
-         * @package GeoDirectory
1832
-         * @param string $sep The separator, default: `|`.
1833
-         */
1834
-        $sep = apply_filters('geodir_page_title_separator', '|');
1835
-    }
1826
+	if ($sep == '') {
1827
+		/**
1828
+		 * Filter the page title separator.
1829
+		 *
1830
+		 * @since 1.0.0
1831
+		 * @package GeoDirectory
1832
+		 * @param string $sep The separator, default: `|`.
1833
+		 */
1834
+		$sep = apply_filters('geodir_page_title_separator', '|');
1835
+	}
1836 1836
 
1837 1837
 
1838
-    $gd_page = '';
1839
-    if(geodir_is_page('home')){
1840
-        $gd_page = 'home';
1841
-        $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1842
-    }
1843
-    elseif(geodir_is_page('detail')){
1844
-        $gd_page = 'detail';
1845
-        $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1846
-    }
1847
-    elseif(geodir_is_page('pt')){
1848
-        $gd_page = 'pt';
1849
-        $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1850
-    }
1851
-    elseif(geodir_is_page('listing')){
1852
-        $gd_page = 'listing';
1853
-        $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1854
-    }
1855
-    elseif(geodir_is_page('location')){
1856
-        $gd_page = 'location';
1857
-        $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1858
-    }
1859
-    elseif(geodir_is_page('search')){
1860
-        $gd_page = 'search';
1861
-        $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1862
-    }
1863
-    elseif(geodir_is_page('add-listing')){
1864
-        $gd_page = 'add-listing';
1865
-        $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1866
-    }
1867
-    elseif(geodir_is_page('author')){
1868
-        $gd_page = 'author';
1869
-        $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1870
-    }
1871
-    elseif(geodir_is_page('login')){
1872
-        $gd_page = 'login';
1873
-        $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1874
-    }
1875
-    elseif(geodir_is_page('listing-success')){
1876
-        $gd_page = 'listing-success';
1877
-        $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1878
-    }
1838
+	$gd_page = '';
1839
+	if(geodir_is_page('home')){
1840
+		$gd_page = 'home';
1841
+		$title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1842
+	}
1843
+	elseif(geodir_is_page('detail')){
1844
+		$gd_page = 'detail';
1845
+		$title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1846
+	}
1847
+	elseif(geodir_is_page('pt')){
1848
+		$gd_page = 'pt';
1849
+		$title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1850
+	}
1851
+	elseif(geodir_is_page('listing')){
1852
+		$gd_page = 'listing';
1853
+		$title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1854
+	}
1855
+	elseif(geodir_is_page('location')){
1856
+		$gd_page = 'location';
1857
+		$title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1858
+	}
1859
+	elseif(geodir_is_page('search')){
1860
+		$gd_page = 'search';
1861
+		$title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1862
+	}
1863
+	elseif(geodir_is_page('add-listing')){
1864
+		$gd_page = 'add-listing';
1865
+		$title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1866
+	}
1867
+	elseif(geodir_is_page('author')){
1868
+		$gd_page = 'author';
1869
+		$title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1870
+	}
1871
+	elseif(geodir_is_page('login')){
1872
+		$gd_page = 'login';
1873
+		$title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1874
+	}
1875
+	elseif(geodir_is_page('listing-success')){
1876
+		$gd_page = 'listing-success';
1877
+		$title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1878
+	}
1879 1879
 
1880 1880
 
1881
-    /**
1882
-     * Filter page meta title to replace variables.
1883
-     *
1884
-     * @since 1.5.4
1885
-     * @param string $title The page title including variables.
1886
-     * @param string $gd_page The GeoDirectory page type if any.
1887
-     * @param string $sep The title separator symbol.
1888
-     */
1889
-    return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1881
+	/**
1882
+	 * Filter page meta title to replace variables.
1883
+	 *
1884
+	 * @since 1.5.4
1885
+	 * @param string $title The page title including variables.
1886
+	 * @param string $gd_page The GeoDirectory page type if any.
1887
+	 * @param string $sep The title separator symbol.
1888
+	 */
1889
+	return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1890 1890
 
1891 1891
 }
1892 1892
 
@@ -1902,36 +1902,36 @@  discard block
 block discarded – undo
1902 1902
 function geodir_set_post_attachment()
1903 1903
 {
1904 1904
 
1905
-    if (!get_option('geodir_set_post_attachments')) {
1905
+	if (!get_option('geodir_set_post_attachments')) {
1906 1906
 
1907
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1908
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1907
+		require_once(ABSPATH . 'wp-admin/includes/image.php');
1908
+		require_once(ABSPATH . 'wp-admin/includes/file.php');
1909 1909
 
1910
-        $all_postypes = geodir_get_posttypes();
1910
+		$all_postypes = geodir_get_posttypes();
1911 1911
 
1912
-        foreach($all_postypes as $post_type){
1913
-            $args = array(
1914
-                'posts_per_page' => -1,
1915
-                'post_type' => $post_type,
1916
-                'post_status' => 'publish');
1912
+		foreach($all_postypes as $post_type){
1913
+			$args = array(
1914
+				'posts_per_page' => -1,
1915
+				'post_type' => $post_type,
1916
+				'post_status' => 'publish');
1917 1917
 
1918
-            $posts_array = get_posts($args);
1918
+			$posts_array = get_posts($args);
1919 1919
 
1920
-            if (!empty($posts_array)) {
1920
+			if (!empty($posts_array)) {
1921 1921
 
1922
-                foreach ($posts_array as $post) {
1922
+				foreach ($posts_array as $post) {
1923 1923
 
1924
-                    geodir_set_wp_featured_image($post->ID);
1924
+					geodir_set_wp_featured_image($post->ID);
1925 1925
 
1926
-                }
1926
+				}
1927 1927
 
1928
-            }
1929
-        }
1928
+			}
1929
+		}
1930 1930
 
1931 1931
 
1932
-        update_option('geodir_set_post_attachments', '1');
1932
+		update_option('geodir_set_post_attachments', '1');
1933 1933
 
1934
-    }
1934
+	}
1935 1935
 
1936 1936
 }
1937 1937
 
@@ -1948,19 +1948,19 @@  discard block
 block discarded – undo
1948 1948
 function geodir_remove_url_seperator()
1949 1949
 {
1950 1950
 
1951
-    if (!get_option('geodir_remove_url_seperator')) {
1951
+	if (!get_option('geodir_remove_url_seperator')) {
1952 1952
 
1953
-        if (get_option('geodir_listingurl_separator'))
1954
-            delete_option('geodir_listingurl_separator');
1953
+		if (get_option('geodir_listingurl_separator'))
1954
+			delete_option('geodir_listingurl_separator');
1955 1955
 
1956
-        if (get_option('geodir_detailurl_separator'))
1957
-            delete_option('geodir_detailurl_separator');
1956
+		if (get_option('geodir_detailurl_separator'))
1957
+			delete_option('geodir_detailurl_separator');
1958 1958
 
1959
-        flush_rewrite_rules(false);
1959
+		flush_rewrite_rules(false);
1960 1960
 
1961
-        update_option('geodir_remove_url_seperator', '1');
1961
+		update_option('geodir_remove_url_seperator', '1');
1962 1962
 
1963
-    }
1963
+	}
1964 1964
 
1965 1965
 }
1966 1966
 
@@ -1976,19 +1976,19 @@  discard block
 block discarded – undo
1976 1976
  */
1977 1977
 function geodir_remove_url_seperator_form_permalink_settings($permalink_arr)
1978 1978
 {
1979
-    foreach ($permalink_arr as $key => $value) {
1979
+	foreach ($permalink_arr as $key => $value) {
1980 1980
 
1981
-        if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
1982
-            unset($permalink_arr[$key]);
1981
+		if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
1982
+			unset($permalink_arr[$key]);
1983 1983
 
1984
-    }
1984
+	}
1985 1985
 
1986
-    return $permalink_arr;
1986
+	return $permalink_arr;
1987 1987
 
1988 1988
 }
1989 1989
 
1990 1990
 if (!is_admin()) {
1991
-    add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
1991
+	add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
1992 1992
 }
1993 1993
 /**
1994 1994
  * Set status from draft to publish.
@@ -2001,16 +2001,16 @@  discard block
 block discarded – undo
2001 2001
  */
2002 2002
 function geodir_set_status_draft_to_publish_for_own_post($post)
2003 2003
 {
2004
-    $user_id = get_current_user_id();
2004
+	$user_id = get_current_user_id();
2005 2005
 
2006
-    if(!$user_id){return $post;}
2006
+	if(!$user_id){return $post;}
2007 2007
 
2008
-    $gd_post_types = geodir_get_posttypes();
2008
+	$gd_post_types = geodir_get_posttypes();
2009 2009
 
2010
-    if (!empty($post) && $post[0]->post_author == $user_id && in_array($post[0]->post_type, $gd_post_types) && !isset($_REQUEST['fl_builder'])) {
2011
-        $post[0]->post_status = 'publish';
2012
-    }
2013
-    return $post;
2010
+	if (!empty($post) && $post[0]->post_author == $user_id && in_array($post[0]->post_type, $gd_post_types) && !isset($_REQUEST['fl_builder'])) {
2011
+		$post[0]->post_status = 'publish';
2012
+	}
2013
+	return $post;
2014 2014
 }
2015 2015
 
2016 2016
 
@@ -2102,33 +2102,33 @@  discard block
 block discarded – undo
2102 2102
  */
2103 2103
 function geodir_detail_page_tab_headings_change($tabs_arr)
2104 2104
 {
2105
-    global $wpdb;
2105
+	global $wpdb;
2106 2106
 
2107
-    $post_type = geodir_get_current_posttype();
2107
+	$post_type = geodir_get_current_posttype();
2108 2108
 
2109
-    $all_postypes = geodir_get_posttypes();
2109
+	$all_postypes = geodir_get_posttypes();
2110 2110
 
2111
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2111
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2112 2112
 
2113
-        if (array_key_exists('post_video', $tabs_arr)) {
2113
+		if (array_key_exists('post_video', $tabs_arr)) {
2114 2114
 
2115
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2115
+			$field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2116 2116
 
2117
-            if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2118
-                $tabs_arr['post_video']['heading_text'] = $field_title;
2119
-        }
2117
+			if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2118
+				$tabs_arr['post_video']['heading_text'] = $field_title;
2119
+		}
2120 2120
 
2121
-        if (array_key_exists('special_offers', $tabs_arr)) {
2121
+		if (array_key_exists('special_offers', $tabs_arr)) {
2122 2122
 
2123
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2123
+			$field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2124 2124
 
2125
-            if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2126
-                $tabs_arr['special_offers']['heading_text'] = $field_title;
2127
-        }
2125
+			if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2126
+				$tabs_arr['special_offers']['heading_text'] = $field_title;
2127
+		}
2128 2128
 
2129
-    }
2129
+	}
2130 2130
 
2131
-    return $tabs_arr;
2131
+	return $tabs_arr;
2132 2132
 
2133 2133
 }
2134 2134
 
@@ -2141,10 +2141,10 @@  discard block
 block discarded – undo
2141 2141
  */
2142 2142
 function geodir_remove_template_redirect_actions()
2143 2143
 {
2144
-    if (geodir_is_page('login')){
2145
-        remove_all_actions('template_redirect');
2146
-        remove_action('init', 'avia_modify_front', 10);
2147
-    }
2144
+	if (geodir_is_page('login')){
2145
+		remove_all_actions('template_redirect');
2146
+		remove_action('init', 'avia_modify_front', 10);
2147
+	}
2148 2148
 }
2149 2149
 
2150 2150
 
@@ -2166,51 +2166,51 @@  discard block
 block discarded – undo
2166 2166
 function geodirectory_before_featured_image_delete($attachment_id)
2167 2167
 {
2168 2168
 
2169
-    global $wpdb, $plugin_prefix;
2169
+	global $wpdb, $plugin_prefix;
2170 2170
 
2171
-    $post_id = get_post_field('post_parent', $attachment_id);
2171
+	$post_id = get_post_field('post_parent', $attachment_id);
2172 2172
 
2173
-    $attachment_url = wp_get_attachment_url($attachment_id);
2173
+	$attachment_url = wp_get_attachment_url($attachment_id);
2174 2174
 
2175
-    if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2175
+	if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2176 2176
 
2177
-        $post_type = get_post_type($post_id);
2177
+		$post_type = get_post_type($post_id);
2178 2178
 
2179
-        $all_postypes = geodir_get_posttypes();
2179
+		$all_postypes = geodir_get_posttypes();
2180 2180
 
2181
-        if (!in_array($post_type, $all_postypes) || !is_admin())
2182
-            return false;
2181
+		if (!in_array($post_type, $all_postypes) || !is_admin())
2182
+			return false;
2183 2183
 
2184
-        $uploads = wp_upload_dir();
2184
+		$uploads = wp_upload_dir();
2185 2185
 
2186
-        $split_img_path = explode($uploads['baseurl'], $attachment_url);
2186
+		$split_img_path = explode($uploads['baseurl'], $attachment_url);
2187 2187
 
2188
-        $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2188
+		$split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2189 2189
 
2190
-        $wpdb->query(
2191
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2192
-                array($post_id, $split_img_file_path)
2193
-            )
2194
-        );
2190
+		$wpdb->query(
2191
+			$wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2192
+				array($post_id, $split_img_file_path)
2193
+			)
2194
+		);
2195 2195
 
2196
-        $attachment_data = $wpdb->get_row(
2197
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2198
-                array($post_id)
2199
-            )
2200
-        );
2196
+		$attachment_data = $wpdb->get_row(
2197
+			$wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2198
+				array($post_id)
2199
+			)
2200
+		);
2201 2201
 
2202
-        if (!empty($attachment_data)) {
2203
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2204
-        }
2202
+		if (!empty($attachment_data)) {
2203
+			$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2204
+		}
2205 2205
 
2206 2206
 
2207
-        $table_name = $plugin_prefix . $post_type . '_detail';
2207
+		$table_name = $plugin_prefix . $post_type . '_detail';
2208 2208
 
2209
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2209
+		$wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2210 2210
 
2211
-        geodir_set_wp_featured_image($post_id);
2211
+		geodir_set_wp_featured_image($post_id);
2212 2212
 
2213
-    }
2213
+	}
2214 2214
 
2215 2215
 }
2216 2216
 
@@ -2228,79 +2228,79 @@  discard block
 block discarded – undo
2228 2228
 function geodir_temp_set_post_attachment()
2229 2229
 {
2230 2230
 
2231
-    global $wpdb, $plugin_prefix;
2231
+	global $wpdb, $plugin_prefix;
2232 2232
 
2233
-    $all_postypes = geodir_get_posttypes();
2233
+	$all_postypes = geodir_get_posttypes();
2234 2234
 
2235
-    foreach ($all_postypes as $posttype) {
2235
+	foreach ($all_postypes as $posttype) {
2236 2236
 
2237
-        $tablename = $plugin_prefix . $posttype . '_detail';
2237
+		$tablename = $plugin_prefix . $posttype . '_detail';
2238 2238
 
2239
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2239
+		$get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2240 2240
 
2241
-        if (!empty($get_post_data)) {
2241
+		if (!empty($get_post_data)) {
2242 2242
 
2243
-            foreach ($get_post_data as $data) {
2243
+			foreach ($get_post_data as $data) {
2244 2244
 
2245
-                $post_id = $data->post_id;
2245
+				$post_id = $data->post_id;
2246 2246
 
2247
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2247
+				$attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2248 2248
 
2249
-                if (!empty($attachment_data)) {
2249
+				if (!empty($attachment_data)) {
2250 2250
 
2251
-                    foreach ($attachment_data as $attach) {
2251
+					foreach ($attachment_data as $attach) {
2252 2252
 
2253
-                        $file_info = pathinfo($attach->file);
2253
+						$file_info = pathinfo($attach->file);
2254 2254
 
2255
-                        $sub_dir = '';
2256
-                        if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2257
-                            $sub_dir = stripslashes_deep($file_info['dirname']);
2255
+						$sub_dir = '';
2256
+						if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2257
+							$sub_dir = stripslashes_deep($file_info['dirname']);
2258 2258
 
2259
-                        $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2260
-                        $uploads_path = $uploads['basedir'];
2259
+						$uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2260
+						$uploads_path = $uploads['basedir'];
2261 2261
 
2262
-                        $file_name = $file_info['basename'];
2262
+						$file_name = $file_info['basename'];
2263 2263
 
2264
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2264
+						$img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2265 2265
 
2266
-                        if (!file_exists($img_arr['path'])) {
2266
+						if (!file_exists($img_arr['path'])) {
2267 2267
 
2268
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2268
+							$wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2269 2269
 
2270
-                        }
2270
+						}
2271 2271
 
2272
-                    }
2272
+					}
2273 2273
 
2274
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2274
+					$attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2275 2275
 
2276
-                    if (!empty($attachment_data)) {
2276
+					if (!empty($attachment_data)) {
2277 2277
 
2278
-                        if ($attachment_data->ID)
2279
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2278
+						if ($attachment_data->ID)
2279
+							$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2280 2280
 
2281
-                    } else {
2281
+					} else {
2282 2282
 
2283
-                        if (has_post_thumbnail($post_id)) {
2283
+						if (has_post_thumbnail($post_id)) {
2284 2284
 
2285
-                            $post_thumbnail_id = get_post_thumbnail_id($post_id);
2285
+							$post_thumbnail_id = get_post_thumbnail_id($post_id);
2286 2286
 
2287
-                            wp_delete_attachment($post_thumbnail_id);
2287
+							wp_delete_attachment($post_thumbnail_id);
2288 2288
 
2289
-                        }
2289
+						}
2290 2290
 
2291
-                    }
2291
+					}
2292 2292
 
2293
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2293
+					$wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2294 2294
 
2295
-                    geodir_set_wp_featured_image($post_id);
2295
+					geodir_set_wp_featured_image($post_id);
2296 2296
 
2297
-                }
2297
+				}
2298 2298
 
2299
-            }
2299
+			}
2300 2300
 
2301
-        }
2301
+		}
2302 2302
 
2303
-    }
2303
+	}
2304 2304
 
2305 2305
 }
2306 2306
 
@@ -2318,9 +2318,9 @@  discard block
 block discarded – undo
2318 2318
 function geodir_default_rating_star_icon()
2319 2319
 {
2320 2320
 
2321
-    if (!get_option('geodir_default_rating_star_icon')) {
2322
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2323
-    }
2321
+	if (!get_option('geodir_default_rating_star_icon')) {
2322
+		update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2323
+	}
2324 2324
 
2325 2325
 }
2326 2326
 
@@ -2338,27 +2338,27 @@  discard block
 block discarded – undo
2338 2338
  */
2339 2339
 function geodir_user_post_listing_count($user_id=null)
2340 2340
 {
2341
-    global $wpdb, $plugin_prefix, $current_user;
2342
-    if(!$user_id){
2343
-        $user_id = $current_user->ID;
2344
-    }
2341
+	global $wpdb, $plugin_prefix, $current_user;
2342
+	if(!$user_id){
2343
+		$user_id = $current_user->ID;
2344
+	}
2345 2345
 
2346
-    $user_id = $current_user->ID;
2347
-    $all_postypes = geodir_get_posttypes();
2348
-    $all_posts = get_option('geodir_listing_link_user_dashboard');
2346
+	$user_id = $current_user->ID;
2347
+	$all_postypes = geodir_get_posttypes();
2348
+	$all_posts = get_option('geodir_listing_link_user_dashboard');
2349 2349
 
2350
-    $user_listing = array();
2351
-    if (is_array($all_posts) && !empty($all_posts)) {
2352
-        foreach ($all_posts as $ptype) {
2353
-            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2350
+	$user_listing = array();
2351
+	if (is_array($all_posts) && !empty($all_posts)) {
2352
+		foreach ($all_posts as $ptype) {
2353
+			$total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2354 2354
 
2355
-            if ($total_posts > 0) {
2356
-                $user_listing[$ptype] = $total_posts;
2357
-            }
2358
-        }
2359
-    }
2355
+			if ($total_posts > 0) {
2356
+				$user_listing[$ptype] = $total_posts;
2357
+			}
2358
+		}
2359
+	}
2360 2360
 
2361
-    return $user_listing;
2361
+	return $user_listing;
2362 2362
 }
2363 2363
 
2364 2364
 
@@ -2378,192 +2378,192 @@  discard block
 block discarded – undo
2378 2378
  */
2379 2379
 function geodir_detail_page_custom_field_tab($tabs_arr)
2380 2380
 {
2381
-    global $post;
2382
-
2383
-    $post_type = geodir_get_current_posttype();
2384
-    $all_postypes = geodir_get_posttypes();
2385
-
2386
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2387
-        $package_info = array();
2388
-        $package_info = geodir_post_package_info($package_info, $post);
2389
-        $post_package_id = !empty($package_info->pid) ? $package_info->pid : '';
2390
-        $fields_location = 'owntab';
2391
-
2392
-        $custom_fields = geodir_post_custom_fields($post_package_id, 'all', $post_type, $fields_location);
2393
-
2394
-        //remove video and special offers if it is already set to show
2395
-        if(isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']){
2396
-            $unset_video = true;
2397
-        }
2398
-
2399
-        if(isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']){
2400
-            $unset_special_offers = true;
2401
-        }
2402
-        if(isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)){
2403
-            foreach($custom_fields as $key => $custom_field){
2404
-                if($custom_field['name']=='geodir_video' && isset($unset_video)){
2405
-                    unset($custom_fields[$key]);
2406
-                }
2407
-                if($custom_field['name']=='geodir_special_offers' && isset($unset_special_offers)){
2408
-                    unset($custom_fields[$key]);
2409
-                }
2410
-            }
2411
-        }
2412
-
2413
-
2381
+	global $post;
2414 2382
 
2415
-        if (!empty($custom_fields)) {
2416
-            $parse_custom_fields = array();
2417
-            foreach ($custom_fields as $field) {
2418
-                $field = stripslashes_deep($field); // strip slashes
2419
-                
2420
-                $type = $field;
2421
-                $field_name = $field['htmlvar_name'];
2422
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2423
-                    $post->{$field_name} = $_REQUEST[$field_name];
2424
-                }
2383
+	$post_type = geodir_get_current_posttype();
2384
+	$all_postypes = geodir_get_posttypes();
2425 2385
 
2426
-                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false  && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2427
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2428
-                        continue;
2429
-                    }
2430
-
2431
-                    $parse_custom_fields[] = $field;
2432
-                }
2433
-            }
2434
-            $custom_fields = $parse_custom_fields;
2435
-        }
2436
-        //print_r($custom_fields);
2437
-        if (!empty($custom_fields)) {
2386
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2387
+		$package_info = array();
2388
+		$package_info = geodir_post_package_info($package_info, $post);
2389
+		$post_package_id = !empty($package_info->pid) ? $package_info->pid : '';
2390
+		$fields_location = 'owntab';
2438 2391
 
2439
-            global $field_set_start;
2392
+		$custom_fields = geodir_post_custom_fields($post_package_id, 'all', $post_type, $fields_location);
2440 2393
 
2441
-            $post = stripslashes_deep($post); // strip slashes
2442
-            
2443
-            $field_set_start = 0;
2444
-            $fieldset_count = 0;
2445
-            $fieldset = '';
2446
-            $total_fields = count($custom_fields);
2447
-            $count_field = 0;
2448
-            $fieldset_arr = array();
2449
-            $i = 0;
2450
-            $geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2451
-
2452
-            foreach ($custom_fields as $field) {
2453
-                $count_field++;
2454
-                $field_name = $field['htmlvar_name'];
2455
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2456
-                    $post->{$field_name} = $_REQUEST[$field_name];
2457
-                }
2394
+		//remove video and special offers if it is already set to show
2395
+		if(isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']){
2396
+			$unset_video = true;
2397
+		}
2458 2398
 
2459
-                if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2460
-                    $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2461
-                    $site_title = trim($field['site_title']);
2462
-                    $type = $field;
2463
-                    $variables_array = array();
2399
+		if(isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']){
2400
+			$unset_special_offers = true;
2401
+		}
2402
+		if(isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)){
2403
+			foreach($custom_fields as $key => $custom_field){
2404
+				if($custom_field['name']=='geodir_video' && isset($unset_video)){
2405
+					unset($custom_fields[$key]);
2406
+				}
2407
+				if($custom_field['name']=='geodir_special_offers' && isset($unset_special_offers)){
2408
+					unset($custom_fields[$key]);
2409
+				}
2410
+			}
2411
+		}
2464 2412
 
2465
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2466
-                        continue;
2467
-                    }
2468 2413
 
2469
-                    if ($type['type'] != 'fieldset') {
2470
-                        $i++;
2471
-                        $variables_array['post_id'] = $post->ID;
2472
-                        $variables_array['label'] = __($type['site_title'], 'geodirectory');
2473
-                        $variables_array['value'] = '';
2474
-                        $variables_array['value'] = $post->{$type['htmlvar_name']};
2475
-                    }else{
2476
-                        $i = 0;
2477
-                        $fieldset_count++;
2478
-                        $field_set_start = 1;
2479
-                        $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2480
-                        $fieldset_arr[$fieldset_count]['label'] = $label;
2481
-                    }
2482 2414
 
2415
+		if (!empty($custom_fields)) {
2416
+			$parse_custom_fields = array();
2417
+			foreach ($custom_fields as $field) {
2418
+				$field = stripslashes_deep($field); // strip slashes
2419
+                
2420
+				$type = $field;
2421
+				$field_name = $field['htmlvar_name'];
2422
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2423
+					$post->{$field_name} = $_REQUEST[$field_name];
2424
+				}
2425
+
2426
+				if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false  && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2427
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2428
+						continue;
2429
+					}
2430
+
2431
+					$parse_custom_fields[] = $field;
2432
+				}
2433
+			}
2434
+			$custom_fields = $parse_custom_fields;
2435
+		}
2436
+		//print_r($custom_fields);
2437
+		if (!empty($custom_fields)) {
2483 2438
 
2484
-                    if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
2485
-                    $type = stripslashes_deep($type); // strip slashes
2486
-                    if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
2487
-                    $html = '';
2488
-                    $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : '';
2489
-                    if($html_var=='post'){$html_var='post_address';}
2490
-                    $field_icon = geodir_field_icon_proccess($type);
2491
-                    $filed_type = $type['type'];
2492
-
2493
-                    /**
2494
-                     * Filter the output for custom fields.
2495
-                     *
2496
-                     * Here we can remove or add new functions depending on the field type.
2497
-                     *
2498
-                     * @param string $html The html to be filtered (blank).
2499
-                     * @param string $fields_location The location the field is to be show.
2500
-                     * @param array $type The array of field values.
2501
-                     */
2502
-                    $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
2503
-
2504
-
2505
-                    /**
2506
-                     * Filter custom field output in tab.
2507
-                     *
2508
-                     * @since 1.5.6
2509
-                     *
2510
-                     * @param string $html_var The HTML variable name for the field.
2511
-                     * @param string $html Custom field unfiltered HTML.
2512
-                     * @param array $variables_array Custom field variables array.
2513
-                     */
2514
-                    $html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2515
-
2516
-                    $fieldset_html = '';
2517
-                    if ($field_set_start == 1) {
2518
-                        $add_html = false;
2519
-                        if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2520
-                            if ($fieldset != '') {
2521
-                                $add_html = true;
2522
-                                $label = $fieldset_arr[$fieldset_count - 1]['label'];
2523
-                                $htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2524
-                            }
2525
-                            $fieldset_html = $fieldset;
2526
-                            $fieldset = '';
2527
-                        } else {
2528
-                            $fieldset .= $html;
2529
-                            if ($total_fields == $count_field && $fieldset != '') {
2530
-                                $add_html = true;
2531
-                                $label = $fieldset_arr[$fieldset_count]['label'];
2532
-                                $htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2533
-                                $fieldset_html = $fieldset;
2534
-                            }
2535
-                        }
2439
+			global $field_set_start;
2536 2440
 
2537
-                        if ($add_html) {
2538
-                            $tabs_arr[$htmlvar_name] = array(
2539
-                                'heading_text' => __($label, 'geodirectory'),
2540
-                                'is_active_tab' => false,
2541
-                                /**
2542
-                                 * Filter if a custom field should be displayed on the details page tab.
2543
-                                 *
2544
-                                 * @since 1.0.0
2545
-                                 * @param string $htmlvar_name The field HTML var name.
2546
-                                 */
2547
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2548
-                                'tab_content' => '<div class="geodir-company_info field-group xxx">' . $fieldset_html . '</div>'
2549
-                            );
2550
-                        }
2551
-                    } else {
2552
-                        if ($html != '') {
2553
-                            $tabs_arr[$field['htmlvar_name']] = array(
2554
-                                'heading_text' => __($label, 'geodirectory'),
2555
-                                'is_active_tab' => false,
2556
-                                /** This action is documented in geodirectory_hooks_actions.php */
2557
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2558
-                                'tab_content' => $html
2559
-                            );
2560
-                        }
2561
-                    }
2562
-                }
2563
-            }
2564
-        }
2565
-    }
2566
-    return $tabs_arr;
2441
+			$post = stripslashes_deep($post); // strip slashes
2442
+            
2443
+			$field_set_start = 0;
2444
+			$fieldset_count = 0;
2445
+			$fieldset = '';
2446
+			$total_fields = count($custom_fields);
2447
+			$count_field = 0;
2448
+			$fieldset_arr = array();
2449
+			$i = 0;
2450
+			$geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2451
+
2452
+			foreach ($custom_fields as $field) {
2453
+				$count_field++;
2454
+				$field_name = $field['htmlvar_name'];
2455
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2456
+					$post->{$field_name} = $_REQUEST[$field_name];
2457
+				}
2458
+
2459
+				if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2460
+					$label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2461
+					$site_title = trim($field['site_title']);
2462
+					$type = $field;
2463
+					$variables_array = array();
2464
+
2465
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2466
+						continue;
2467
+					}
2468
+
2469
+					if ($type['type'] != 'fieldset') {
2470
+						$i++;
2471
+						$variables_array['post_id'] = $post->ID;
2472
+						$variables_array['label'] = __($type['site_title'], 'geodirectory');
2473
+						$variables_array['value'] = '';
2474
+						$variables_array['value'] = $post->{$type['htmlvar_name']};
2475
+					}else{
2476
+						$i = 0;
2477
+						$fieldset_count++;
2478
+						$field_set_start = 1;
2479
+						$fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2480
+						$fieldset_arr[$fieldset_count]['label'] = $label;
2481
+					}
2482
+
2483
+
2484
+					if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
2485
+					$type = stripslashes_deep($type); // strip slashes
2486
+					if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
2487
+					$html = '';
2488
+					$html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : '';
2489
+					if($html_var=='post'){$html_var='post_address';}
2490
+					$field_icon = geodir_field_icon_proccess($type);
2491
+					$filed_type = $type['type'];
2492
+
2493
+					/**
2494
+					 * Filter the output for custom fields.
2495
+					 *
2496
+					 * Here we can remove or add new functions depending on the field type.
2497
+					 *
2498
+					 * @param string $html The html to be filtered (blank).
2499
+					 * @param string $fields_location The location the field is to be show.
2500
+					 * @param array $type The array of field values.
2501
+					 */
2502
+					$html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
2503
+
2504
+
2505
+					/**
2506
+					 * Filter custom field output in tab.
2507
+					 *
2508
+					 * @since 1.5.6
2509
+					 *
2510
+					 * @param string $html_var The HTML variable name for the field.
2511
+					 * @param string $html Custom field unfiltered HTML.
2512
+					 * @param array $variables_array Custom field variables array.
2513
+					 */
2514
+					$html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2515
+
2516
+					$fieldset_html = '';
2517
+					if ($field_set_start == 1) {
2518
+						$add_html = false;
2519
+						if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2520
+							if ($fieldset != '') {
2521
+								$add_html = true;
2522
+								$label = $fieldset_arr[$fieldset_count - 1]['label'];
2523
+								$htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2524
+							}
2525
+							$fieldset_html = $fieldset;
2526
+							$fieldset = '';
2527
+						} else {
2528
+							$fieldset .= $html;
2529
+							if ($total_fields == $count_field && $fieldset != '') {
2530
+								$add_html = true;
2531
+								$label = $fieldset_arr[$fieldset_count]['label'];
2532
+								$htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2533
+								$fieldset_html = $fieldset;
2534
+							}
2535
+						}
2536
+
2537
+						if ($add_html) {
2538
+							$tabs_arr[$htmlvar_name] = array(
2539
+								'heading_text' => __($label, 'geodirectory'),
2540
+								'is_active_tab' => false,
2541
+								/**
2542
+								 * Filter if a custom field should be displayed on the details page tab.
2543
+								 *
2544
+								 * @since 1.0.0
2545
+								 * @param string $htmlvar_name The field HTML var name.
2546
+								 */
2547
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2548
+								'tab_content' => '<div class="geodir-company_info field-group xxx">' . $fieldset_html . '</div>'
2549
+							);
2550
+						}
2551
+					} else {
2552
+						if ($html != '') {
2553
+							$tabs_arr[$field['htmlvar_name']] = array(
2554
+								'heading_text' => __($label, 'geodirectory'),
2555
+								'is_active_tab' => false,
2556
+								/** This action is documented in geodirectory_hooks_actions.php */
2557
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2558
+								'tab_content' => $html
2559
+							);
2560
+						}
2561
+					}
2562
+				}
2563
+			}
2564
+		}
2565
+	}
2566
+	return $tabs_arr;
2567 2567
 }
2568 2568
 
2569 2569
 /* display add listing page for wpml */
@@ -2587,39 +2587,39 @@  discard block
 block discarded – undo
2587 2587
  */
2588 2588
 function geodir_add_post_status_author_page()
2589 2589
 {
2590
-    global $wpdb, $post;
2591
-
2592
-    $html = '';
2593
-    if (get_current_user_id()) {
2594
-
2595
-        $is_author_page = apply_filters('geodir_post_status_is_author_page', geodir_is_page('author'));
2596
-        if ($is_author_page && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
2597
-
2598
-            // we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them.
2599
-            $real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
2600
-            $status = "<strong>(";
2601
-            $status_icon = '<i class="fa fa-play"></i>';
2602
-            if ($real_status == 'publish') {
2603
-                $status .= __('Published', 'geodirectory');
2604
-            } else {
2605
-                $status .= __('Not published', 'geodirectory');
2606
-                $status_icon = '<i class="fa fa-pause"></i>';
2607
-            }
2608
-            $status .= ")</strong>";
2590
+	global $wpdb, $post;
2591
+
2592
+	$html = '';
2593
+	if (get_current_user_id()) {
2594
+
2595
+		$is_author_page = apply_filters('geodir_post_status_is_author_page', geodir_is_page('author'));
2596
+		if ($is_author_page && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
2597
+
2598
+			// we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them.
2599
+			$real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
2600
+			$status = "<strong>(";
2601
+			$status_icon = '<i class="fa fa-play"></i>';
2602
+			if ($real_status == 'publish') {
2603
+				$status .= __('Published', 'geodirectory');
2604
+			} else {
2605
+				$status .= __('Not published', 'geodirectory');
2606
+				$status_icon = '<i class="fa fa-pause"></i>';
2607
+			}
2608
+			$status .= ")</strong>";
2609 2609
 
2610
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
2611
-        }
2612
-    }
2610
+			$html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
2611
+		}
2612
+	}
2613 2613
 
2614
-    if ($html != '') {
2615
-        /**
2616
-         * Filter the post status text on the author page.
2617
-         *
2618
-         * @since 1.0.0
2619
-         * @param string $html The HTML of the status.
2620
-         */
2621
-        echo apply_filters('geodir_filter_status_text_on_author_page', $html);
2622
-    }
2614
+	if ($html != '') {
2615
+		/**
2616
+		 * Filter the post status text on the author page.
2617
+		 *
2618
+		 * @since 1.0.0
2619
+		 * @param string $html The HTML of the status.
2620
+		 */
2621
+		echo apply_filters('geodir_filter_status_text_on_author_page', $html);
2622
+	}
2623 2623
 
2624 2624
 
2625 2625
 }
@@ -2633,21 +2633,21 @@  discard block
 block discarded – undo
2633 2633
  */
2634 2634
 function geodir_init_no_rating()
2635 2635
 {
2636
-    if (get_option('geodir_disable_rating')) {
2637
-        remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
2638
-        remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
2639
-        remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
2640
-        remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
2641
-        remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
2642
-        remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
2643
-        remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
2644
-
2645
-        add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
2646
-        add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
2647
-        add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
2648
-        add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
2649
-        add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
2650
-    }
2636
+	if (get_option('geodir_disable_rating')) {
2637
+		remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
2638
+		remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
2639
+		remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
2640
+		remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
2641
+		remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
2642
+		remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
2643
+		remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
2644
+
2645
+		add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
2646
+		add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
2647
+		add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
2648
+		add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
2649
+		add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
2650
+	}
2651 2651
 }
2652 2652
 
2653 2653
 /**
@@ -2659,24 +2659,24 @@  discard block
 block discarded – undo
2659 2659
  */
2660 2660
 function geodir_no_rating_rating_fields()
2661 2661
 {
2662
-    global $post;
2662
+	global $post;
2663 2663
 
2664
-    $post_types = geodir_get_posttypes();
2664
+	$post_types = geodir_get_posttypes();
2665 2665
 
2666
-    if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
2667
-        if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
2668
-            if (get_option('geodir_reviewrating_enable_rating')) {
2669
-                echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
2670
-            } else {
2671
-                echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
2672
-            }
2673
-            if (get_option('geodir_reviewrating_enable_images')) {
2674
-                geodir_reviewrating_rating_img_html();
2675
-            }
2676
-        } else {
2677
-            echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
2678
-        }
2679
-    }
2666
+	if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
2667
+		if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
2668
+			if (get_option('geodir_reviewrating_enable_rating')) {
2669
+				echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
2670
+			} else {
2671
+				echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
2672
+			}
2673
+			if (get_option('geodir_reviewrating_enable_images')) {
2674
+				geodir_reviewrating_rating_img_html();
2675
+			}
2676
+		} else {
2677
+			echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
2678
+		}
2679
+	}
2680 2680
 }
2681 2681
 
2682 2682
 /**
@@ -2690,11 +2690,11 @@  discard block
 block discarded – undo
2690 2690
  */
2691 2691
 function geodir_no_rating_comment_text($content, $comment = '')
2692 2692
 {
2693
-    if (!is_admin()) {
2694
-        return '<div class="description">' . $content . '</div>';
2695
-    } else {
2696
-        return $content;
2697
-    }
2693
+	if (!is_admin()) {
2694
+		return '<div class="description">' . $content . '</div>';
2695
+	} else {
2696
+		return $content;
2697
+	}
2698 2698
 }
2699 2699
 
2700 2700
 /**
@@ -2707,7 +2707,7 @@  discard block
 block discarded – undo
2707 2707
  */
2708 2708
 function geodir_no_rating_review_rating_html($content = '')
2709 2709
 {
2710
-    return NULL;
2710
+	return NULL;
2711 2711
 }
2712 2712
 
2713 2713
 /**
@@ -2721,19 +2721,19 @@  discard block
 block discarded – undo
2721 2721
  */
2722 2722
 function geodir_no_rating_get_sort_options($options, $post_type = '')
2723 2723
 {
2724
-    $new_options = array();
2725
-    if (!empty($options)) {
2726
-        foreach ($options as $option) {
2727
-            if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
2728
-                continue;
2729
-            }
2730
-            $new_options[] = $option;
2731
-        }
2724
+	$new_options = array();
2725
+	if (!empty($options)) {
2726
+		foreach ($options as $option) {
2727
+			if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
2728
+				continue;
2729
+			}
2730
+			$new_options[] = $option;
2731
+		}
2732 2732
 
2733
-        $options = $new_options;
2734
-    }
2733
+		$options = $new_options;
2734
+	}
2735 2735
 
2736
-    return $options;
2736
+	return $options;
2737 2737
 }
2738 2738
 
2739 2739
 add_filter('geodir_all_js_msg', 'geodir_all_js_msg_no_rating', 100);
@@ -2747,11 +2747,11 @@  discard block
 block discarded – undo
2747 2747
  */
2748 2748
 function geodir_all_js_msg_no_rating($msg = array())
2749 2749
 {
2750
-    if (get_option('geodir_disable_rating')) {
2751
-        $msg['gd_cmt_no_rating'] = true;
2752
-    }
2750
+	if (get_option('geodir_disable_rating')) {
2751
+		$msg['gd_cmt_no_rating'] = true;
2752
+	}
2753 2753
 
2754
-    return $msg;
2754
+	return $msg;
2755 2755
 }
2756 2756
 
2757 2757
 add_filter('body_class', 'geodir_body_class_no_rating', 100);
@@ -2765,13 +2765,13 @@  discard block
 block discarded – undo
2765 2765
  */
2766 2766
 function geodir_body_class_no_rating($classes = array())
2767 2767
 {
2768
-    if (get_option('geodir_disable_rating')) {
2769
-        $classes[] = 'gd-no-rating';
2770
-    }
2768
+	if (get_option('geodir_disable_rating')) {
2769
+		$classes[] = 'gd-no-rating';
2770
+	}
2771 2771
     
2772
-    $classes[] = 'gd-map-' . geodir_map_name();
2772
+	$classes[] = 'gd-map-' . geodir_map_name();
2773 2773
 
2774
-    return $classes;
2774
+	return $classes;
2775 2775
 }
2776 2776
 
2777 2777
 add_filter('admin_body_class', 'geodir_admin_body_class_no_rating', 100);
@@ -2785,13 +2785,13 @@  discard block
 block discarded – undo
2785 2785
  */
2786 2786
 function geodir_admin_body_class_no_rating($class = '')
2787 2787
 {
2788
-    if (get_option('geodir_disable_rating')) {
2789
-        $class .= ' gd-no-rating';
2790
-    }
2788
+	if (get_option('geodir_disable_rating')) {
2789
+		$class .= ' gd-no-rating';
2790
+	}
2791 2791
     
2792
-    $class .= ' gd-map-' . geodir_map_name();
2792
+	$class .= ' gd-map-' . geodir_map_name();
2793 2793
 
2794
-    return $class;
2794
+	return $class;
2795 2795
 }
2796 2796
 
2797 2797
 add_action('wp_head', 'geodir_wp_head_no_rating');
@@ -2804,10 +2804,10 @@  discard block
 block discarded – undo
2804 2804
  */
2805 2805
 function geodir_wp_head_no_rating()
2806 2806
 {
2807
-    if (get_option('geodir_disable_rating')) {
2808
-        echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
2809
-        echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
2810
-    }
2807
+	if (get_option('geodir_disable_rating')) {
2808
+		echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
2809
+		echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
2810
+	}
2811 2811
 }
2812 2812
 
2813 2813
 add_filter('geodir_load_db_language', 'geodir_load_custom_field_translation');
@@ -2824,36 +2824,36 @@  discard block
 block discarded – undo
2824 2824
  * @return array Translation texts.
2825 2825
  */
2826 2826
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
2827
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
2828
-
2829
-    $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
2830
-
2831
-    /**
2832
-     * Filters the geodirectory option names that requires to add for translation.
2833
-     *
2834
-     * @since 1.5.7
2835
-     * @package GeoDirectory
2836
-     *
2837
-     * @param  array $gd_options Array of option names.
2838
-     */
2839
-    $gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
2840
-    $gd_options = array_unique($gd_options);
2841
-
2842
-    if (!empty($gd_options)) {
2843
-        foreach ($gd_options as $gd_option) {
2844
-            if ($gd_option != '' && $option_value = get_option($gd_option)) {
2845
-                $option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
2827
+	$translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
2828
+
2829
+	$gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
2830
+
2831
+	/**
2832
+	 * Filters the geodirectory option names that requires to add for translation.
2833
+	 *
2834
+	 * @since 1.5.7
2835
+	 * @package GeoDirectory
2836
+	 *
2837
+	 * @param  array $gd_options Array of option names.
2838
+	 */
2839
+	$gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
2840
+	$gd_options = array_unique($gd_options);
2841
+
2842
+	if (!empty($gd_options)) {
2843
+		foreach ($gd_options as $gd_option) {
2844
+			if ($gd_option != '' && $option_value = get_option($gd_option)) {
2845
+				$option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
2846 2846
                 
2847
-                if ($option_value != '' && !in_array($option_value, $translation_texts)) {
2848
-                    $translation_texts[] = stripslashes_deep($option_value);
2849
-                }
2850
-            }
2851
-        }
2852
-    }
2847
+				if ($option_value != '' && !in_array($option_value, $translation_texts)) {
2848
+					$translation_texts[] = stripslashes_deep($option_value);
2849
+				}
2850
+			}
2851
+		}
2852
+	}
2853 2853
 
2854
-    $translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
2854
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
2855 2855
 
2856
-    return $translation_texts;
2856
+	return $translation_texts;
2857 2857
 }
2858 2858
 
2859 2859
 add_filter('geodir_load_db_language', 'geodir_load_gd_options_text_translation');
@@ -2867,15 +2867,15 @@  discard block
 block discarded – undo
2867 2867
 
2868 2868
 add_filter('get_comments_link', 'gd_get_comments_link', 10, 2);
2869 2869
 function gd_get_comments_link($comments_link, $post_id) {
2870
-    $post_type = get_post_type($post_id);
2870
+	$post_type = get_post_type($post_id);
2871 2871
 
2872
-    $all_postypes = geodir_get_posttypes();
2873
-    if (in_array($post_type, $all_postypes)) {
2874
-        $comments_link = str_replace('#comments', '#reviews', $comments_link);
2875
-        $comments_link = str_replace('#respond', '#reviews', $comments_link);
2876
-    }
2872
+	$all_postypes = geodir_get_posttypes();
2873
+	if (in_array($post_type, $all_postypes)) {
2874
+		$comments_link = str_replace('#comments', '#reviews', $comments_link);
2875
+		$comments_link = str_replace('#respond', '#reviews', $comments_link);
2876
+	}
2877 2877
 
2878
-    return $comments_link;
2878
+	return $comments_link;
2879 2879
 }
2880 2880
 
2881 2881
 
@@ -2893,11 +2893,11 @@  discard block
 block discarded – undo
2893 2893
 function geodir_add_nav_menu_class( $args )
2894 2894
 {
2895 2895
 
2896
-        if(isset($args['menu_class'])){
2897
-            $args['menu_class'] = $args['menu_class']." gd-menu-z";
2898
-        }
2896
+		if(isset($args['menu_class'])){
2897
+			$args['menu_class'] = $args['menu_class']." gd-menu-z";
2898
+		}
2899 2899
     
2900
-    return $args;
2900
+	return $args;
2901 2901
 }
2902 2902
 
2903 2903
 add_filter( 'wp_nav_menu_args', 'geodir_add_nav_menu_class' );
2904 2904
\ No newline at end of file
Please login to merge, or discard this patch.
language.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 define('LISTING_DETAILS_TEXT', __('Enter Listing Details', 'geodirectory'));
42 42
 
43 43
 define('PLACE_TITLE_TEXT', __('Listing Title', 'geodirectory')); // depreciated @since 1.6.3
44
-define('PLACE_DESC_TEXT', __('Listing Description', 'geodirectory'));// depreciated @since 1.6.3
44
+define('PLACE_DESC_TEXT', __('Listing Description', 'geodirectory')); // depreciated @since 1.6.3
45 45
 
46 46
 define('LISTING_ADDRESS_TEXT', __('Listing Address:', 'geodirectory'));
47 47
 define('PLACE_ADDRESS', __('Address:', 'geodirectory'));
Please login to merge, or discard this patch.
geodirectory_shortcodes.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -202,14 +202,14 @@  discard block
 block discarded – undo
202 202
 	// Add marker cluster
203 203
 	if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
204 204
         $map_args['enable_marker_cluster'] = true;
205
-        if(get_option('geodir_marker_cluster_type')) {
205
+        if (get_option('geodir_marker_cluster_type')) {
206 206
             if ($map_args['autozoom']) {
207 207
                 $map_args['enable_marker_cluster_no_reposition'] = false;
208 208
             } else {
209 209
                 $map_args['enable_marker_cluster_no_reposition'] = true;
210 210
             }
211 211
 
212
-            $map_args['enable_marker_cluster_server'] = true ;
212
+            $map_args['enable_marker_cluster_server'] = true;
213 213
 
214 214
         }
215 215
 	} else {
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	}
218 218
 
219 219
     // if lat and long set in shortcode, hack it so the map is not repositioned
220
-    if(!empty($params['latitude']) && !empty($params['longitude']) ){
220
+    if (!empty($params['latitude']) && !empty($params['longitude'])) {
221 221
         $map_args['enable_marker_cluster_no_reposition'] = true;
222 222
     }
223 223
 
@@ -890,20 +890,20 @@  discard block
 block discarded – undo
890 890
 	
891 891
 	$show_adv_search = isset($params['show_adv_search']) && in_array($params['show_adv_search'], array('default', 'always', 'searched')) ? $params['show_adv_search'] : '';
892 892
 	
893
-	if ($show_adv_search != '' ) {
894
-		$show_adv_class = 'geodir-advance-search-' . $show_adv_search . ' ';
893
+	if ($show_adv_search != '') {
894
+		$show_adv_class = 'geodir-advance-search-'.$show_adv_search.' ';
895 895
 		if ($show_adv_search == 'searched' && geodir_is_page('search')) {
896 896
 			$show_adv_search = 'search';
897 897
 		}
898
-		$show_adv_attrs = 'data-show-adv="' . $show_adv_search . '"';
898
+		$show_adv_attrs = 'data-show-adv="'.$show_adv_search.'"';
899 899
 		
900
-		$params['before_widget'] = str_replace('class="', $show_adv_attrs . ' class="' . $show_adv_class, $params['before_widget']);
900
+		$params['before_widget'] = str_replace('class="', $show_adv_attrs.' class="'.$show_adv_class, $params['before_widget']);
901 901
 	}
902 902
 	
903 903
 	ob_start();
904 904
 	
905 905
 	//geodir_get_template_part('listing', 'filter-form');
906
-	the_widget('geodir_advance_search_widget', $params, $params );
906
+	the_widget('geodir_advance_search_widget', $params, $params);
907 907
 	
908 908
 	$output = ob_get_contents();
909 909
     ob_end_clean();
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 
1104 1104
     // Validate character_count
1105 1105
     //todo: is this necessary?
1106
-    $params['character_count']  = $params['character_count'];
1106
+    $params['character_count'] = $params['character_count'];
1107 1107
 
1108 1108
     // Validate our layout choice
1109 1109
     // Outside of the norm, I added some more simple terms to match the existing
@@ -1115,7 +1115,7 @@  discard block
 block discarded – undo
1115 1115
 
1116 1116
     // Validate Listing width, used in the template widget-listing-listview.php
1117 1117
     // The context is in width=$listing_width% - So we need a positive number between 0 & 100
1118
-    $params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1118
+    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
1119 1119
 
1120 1120
     // Validate the checkboxes used on the widget
1121 1121
     $params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
@@ -1131,7 +1131,7 @@  discard block
 block discarded – undo
1131 1131
     if (!empty($params['tags'])) {
1132 1132
         if (!is_array($params['tags'])) {
1133 1133
             $comma = _x(',', 'tag delimiter');
1134
-            if ( ',' !== $comma ) {
1134
+            if (',' !== $comma) {
1135 1135
                 $params['tags'] = str_replace($comma, ',', $params['tags']);
1136 1136
             }
1137 1137
             $params['tags'] = explode(',', trim($params['tags'], " \n\t\r\0\x0B,"));
@@ -1153,13 +1153,13 @@  discard block
 block discarded – undo
1153 1153
         unset($atts['pageno']);
1154 1154
     }
1155 1155
 
1156
-    if ( !empty($atts['shortcode_content']) ) {
1156
+    if (!empty($atts['shortcode_content'])) {
1157 1157
         $content = $atts['shortcode_content'];
1158 1158
     }
1159 1159
     $params['shortcode_content'] = trim($content);
1160 1160
     $atts['shortcode_content'] = trim($content);
1161 1161
     
1162
-    $params['shortcode_atts']       = $atts;
1162
+    $params['shortcode_atts'] = $atts;
1163 1163
 
1164 1164
     $output = geodir_sc_gd_listings_output($params);
1165 1165
 
@@ -1226,8 +1226,8 @@  discard block
 block discarded – undo
1226 1226
 	// Validate the checkboxes used on the widget
1227 1227
     $params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1228 1228
     $params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1229
-    $params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1230
-    $params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1229
+    $params['hide_icon'] = gdsc_to_bool_val($params['hide_icon']);
1230
+    $params['cpt_left'] = gdsc_to_bool_val($params['cpt_left']);
1231 1231
 	
1232 1232
 	if ($params['max_count'] != 'all') {
1233 1233
 		$params['max_count'] = absint($params['max_count']);
Please login to merge, or discard this patch.
Indentation   +711 added lines, -711 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 // If this file is called directly, abort.
9 9
 if (!defined('WPINC')) {
10
-    die;
10
+	die;
11 11
 }
12 12
 require_once('geodirectory-functions/shortcode_functions.php');
13 13
 
@@ -32,43 +32,43 @@  discard block
 block discarded – undo
32 32
  */
33 33
 function geodir_sc_add_listing($atts)
34 34
 {
35
-    ob_start();
36
-    $defaults = array(
37
-        'pid' => '',
38
-        'listing_type' => 'gd_place',
39
-        'login_msg' => __('You must login to post.', 'geodirectory'),
40
-        'show_login' => false,
41
-    );
42
-    $params = shortcode_atts($defaults, $atts);
43
-
44
-    foreach ($params as $key => $value) {
45
-        $_REQUEST[$key] = $value;
46
-    }
47
-
48
-    $user_id = get_current_user_id();
49
-    if (!$user_id) {
50
-        echo $params['login_msg'];
51
-        if ($params['show_login']) {
52
-            echo "<br />";
53
-            $defaults = array(
54
-                'before_widget' => '',
55
-                'after_widget' => '',
56
-                'before_title' => '',
57
-                'after_title' => '',
58
-            );
59
-
60
-            geodir_loginwidget_output($defaults, $defaults);
61
-        }
62
-
63
-
64
-    } else {
65
-       // Add listing page will be used if shortcode is detected in page content, no need to call it here
66
-    }
67
-    $output = ob_get_contents();
68
-
69
-    ob_end_clean();
70
-
71
-    return $output;
35
+	ob_start();
36
+	$defaults = array(
37
+		'pid' => '',
38
+		'listing_type' => 'gd_place',
39
+		'login_msg' => __('You must login to post.', 'geodirectory'),
40
+		'show_login' => false,
41
+	);
42
+	$params = shortcode_atts($defaults, $atts);
43
+
44
+	foreach ($params as $key => $value) {
45
+		$_REQUEST[$key] = $value;
46
+	}
47
+
48
+	$user_id = get_current_user_id();
49
+	if (!$user_id) {
50
+		echo $params['login_msg'];
51
+		if ($params['show_login']) {
52
+			echo "<br />";
53
+			$defaults = array(
54
+				'before_widget' => '',
55
+				'after_widget' => '',
56
+				'before_title' => '',
57
+				'after_title' => '',
58
+			);
59
+
60
+			geodir_loginwidget_output($defaults, $defaults);
61
+		}
62
+
63
+
64
+	} else {
65
+	   // Add listing page will be used if shortcode is detected in page content, no need to call it here
66
+	}
67
+	$output = ob_get_contents();
68
+
69
+	ob_end_clean();
70
+
71
+	return $output;
72 72
 }
73 73
 
74 74
 /**
@@ -96,136 +96,136 @@  discard block
 block discarded – undo
96 96
  */
97 97
 function geodir_sc_home_map($atts)
98 98
 {
99
-    ob_start();
100
-    $defaults = array(
101
-        'width' => '960',
102
-        'height' => '425',
103
-        'maptype' => 'ROADMAP',
104
-        'zoom' => '13',
105
-        'autozoom' => '',
106
-        'child_collapse' => '0',
107
-        'scrollwheel' => '0',
99
+	ob_start();
100
+	$defaults = array(
101
+		'width' => '960',
102
+		'height' => '425',
103
+		'maptype' => 'ROADMAP',
104
+		'zoom' => '13',
105
+		'autozoom' => '',
106
+		'child_collapse' => '0',
107
+		'scrollwheel' => '0',
108 108
 		'marker_cluster' => false,
109
-        'latitude' => '',
110
-        'longitude' => ''
111
-    );
112
-
113
-    $params = shortcode_atts($defaults, $atts);
114
-
115
-    $params = gdsc_validate_map_args($params);
116
-
117
-    $map_args = array(
118
-        'map_canvas_name' => 'gd_home_map',
119
-        'latitude' => $params['latitude'],
120
-        'longitude' => $params['longitude'],
121
-
122
-        /**
123
-         * Filter the widget width of the map on home/listings page.
124
-         *
125
-         * @since 1.0.0
126
-         * @param mixed(string|int|float) $params['width'] The map width.
127
-         */
128
-        'width' => apply_filters('widget_width', $params['width']),
129
-        /**
130
-         * Filter the widget height of the map on home/listings page.
131
-         *
132
-         * @since 1.0.0
133
-         * @param mixed(string|int|float) $params['height'] The map height.
134
-         */
135
-        'height' => apply_filters('widget_heigh', $params['height']),
136
-        /**
137
-         * Filter the widget maptype of the map on home/listings page.
138
-         *
139
-         * @since 1.0.0
109
+		'latitude' => '',
110
+		'longitude' => ''
111
+	);
112
+
113
+	$params = shortcode_atts($defaults, $atts);
114
+
115
+	$params = gdsc_validate_map_args($params);
116
+
117
+	$map_args = array(
118
+		'map_canvas_name' => 'gd_home_map',
119
+		'latitude' => $params['latitude'],
120
+		'longitude' => $params['longitude'],
121
+
122
+		/**
123
+		 * Filter the widget width of the map on home/listings page.
124
+		 *
125
+		 * @since 1.0.0
126
+		 * @param mixed(string|int|float) $params['width'] The map width.
127
+		 */
128
+		'width' => apply_filters('widget_width', $params['width']),
129
+		/**
130
+		 * Filter the widget height of the map on home/listings page.
131
+		 *
132
+		 * @since 1.0.0
133
+		 * @param mixed(string|int|float) $params['height'] The map height.
134
+		 */
135
+		'height' => apply_filters('widget_heigh', $params['height']),
136
+		/**
137
+		 * Filter the widget maptype of the map on home/listings page.
138
+		 *
139
+		 * @since 1.0.0
140 140
 		 * @since 1.5.2 Added TERRAIN map type.
141
-         * @param string $params['maptype'] The map type. Can be ROADMAP | SATELLITE | HYBRID | TERRAIN.
142
-         */
143
-        'maptype' => apply_filters('widget_maptype', $params['maptype']),
144
-        /**
145
-         * Filter the widget scrollwheel value of the map on home/listings page.
146
-         *
147
-         * Should the scrollwheel zoom the map or not.
148
-         *
149
-         * @since 1.0.0
150
-         * @param bool $params['scrollwheel'] True to allow scroll wheel to scroll map or false if not.
151
-         */
152
-        'scrollwheel' => apply_filters('widget_scrollwheel', $params['scrollwheel']),
153
-        /**
154
-         * Filter the widget zoom level of the map on home/listings page.
155
-         *
156
-         * @since 1.0.0
157
-         * @param int $params['zoom'] The zoom level of the map. Between 1-19.
158
-         */
159
-        'zoom' => apply_filters('widget_zoom', $params['zoom']),
160
-        /**
161
-         * Filter the widget auto zoom value of the map on home/listings page.
162
-         *
163
-         * If the map should autozoom to fit the markers shown.
164
-         *
165
-         * @since 1.0.0
166
-         * @param bool $params['autozoom'] True if the map should autozoom, false if not.
167
-         */
168
-        'autozoom' => apply_filters('widget_autozoom', $params['autozoom']),
169
-        /**
170
-         * Filter the widget child_collapse value of the map on home/listings page.
171
-         *
172
-         * If the map should auto collapse the child categories if the category bar is present.
173
-         *
174
-         * @since 1.0.0
175
-         * @param bool $params['child_collapse'] True if the map should collapse the categories, false if not.
176
-         */
177
-        'child_collapse' => apply_filters('widget_child_collapse', $params['child_collapse']),
178
-        'enable_cat_filters' => true,
179
-        'enable_text_search' => true,
180
-        'enable_post_type_filters' => true,
181
-        /**
182
-         * Filter the widget enable_location_filters value of the map on home/listings page.
183
-         *
184
-         * This is used when the location addon is used.
185
-         *
186
-         * @since 1.0.0
187
-         * @param bool $val True if location filters should be used, false if not.
188
-         */
189
-        'enable_location_filters' => apply_filters('geodir_home_map_enable_location_filters', false),
190
-        'enable_jason_on_load' => false,
191
-        'enable_marker_cluster' => false,
192
-        'enable_map_resize_button' => true,
193
-        'map_class_name' => 'geodir-map-home-page',
194
-        'is_geodir_home_map_widget' => true,
195
-    );
141
+		 * @param string $params['maptype'] The map type. Can be ROADMAP | SATELLITE | HYBRID | TERRAIN.
142
+		 */
143
+		'maptype' => apply_filters('widget_maptype', $params['maptype']),
144
+		/**
145
+		 * Filter the widget scrollwheel value of the map on home/listings page.
146
+		 *
147
+		 * Should the scrollwheel zoom the map or not.
148
+		 *
149
+		 * @since 1.0.0
150
+		 * @param bool $params['scrollwheel'] True to allow scroll wheel to scroll map or false if not.
151
+		 */
152
+		'scrollwheel' => apply_filters('widget_scrollwheel', $params['scrollwheel']),
153
+		/**
154
+		 * Filter the widget zoom level of the map on home/listings page.
155
+		 *
156
+		 * @since 1.0.0
157
+		 * @param int $params['zoom'] The zoom level of the map. Between 1-19.
158
+		 */
159
+		'zoom' => apply_filters('widget_zoom', $params['zoom']),
160
+		/**
161
+		 * Filter the widget auto zoom value of the map on home/listings page.
162
+		 *
163
+		 * If the map should autozoom to fit the markers shown.
164
+		 *
165
+		 * @since 1.0.0
166
+		 * @param bool $params['autozoom'] True if the map should autozoom, false if not.
167
+		 */
168
+		'autozoom' => apply_filters('widget_autozoom', $params['autozoom']),
169
+		/**
170
+		 * Filter the widget child_collapse value of the map on home/listings page.
171
+		 *
172
+		 * If the map should auto collapse the child categories if the category bar is present.
173
+		 *
174
+		 * @since 1.0.0
175
+		 * @param bool $params['child_collapse'] True if the map should collapse the categories, false if not.
176
+		 */
177
+		'child_collapse' => apply_filters('widget_child_collapse', $params['child_collapse']),
178
+		'enable_cat_filters' => true,
179
+		'enable_text_search' => true,
180
+		'enable_post_type_filters' => true,
181
+		/**
182
+		 * Filter the widget enable_location_filters value of the map on home/listings page.
183
+		 *
184
+		 * This is used when the location addon is used.
185
+		 *
186
+		 * @since 1.0.0
187
+		 * @param bool $val True if location filters should be used, false if not.
188
+		 */
189
+		'enable_location_filters' => apply_filters('geodir_home_map_enable_location_filters', false),
190
+		'enable_jason_on_load' => false,
191
+		'enable_marker_cluster' => false,
192
+		'enable_map_resize_button' => true,
193
+		'map_class_name' => 'geodir-map-home-page',
194
+		'is_geodir_home_map_widget' => true,
195
+	);
196 196
 
197 197
 	// Add marker cluster
198 198
 	if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
199
-        $map_args['enable_marker_cluster'] = true;
200
-        if(get_option('geodir_marker_cluster_type')) {
201
-            if ($map_args['autozoom']) {
202
-                $map_args['enable_marker_cluster_no_reposition'] = false;
203
-            } else {
204
-                $map_args['enable_marker_cluster_no_reposition'] = true;
205
-            }
199
+		$map_args['enable_marker_cluster'] = true;
200
+		if(get_option('geodir_marker_cluster_type')) {
201
+			if ($map_args['autozoom']) {
202
+				$map_args['enable_marker_cluster_no_reposition'] = false;
203
+			} else {
204
+				$map_args['enable_marker_cluster_no_reposition'] = true;
205
+			}
206 206
 
207
-            $map_args['enable_marker_cluster_server'] = true ;
207
+			$map_args['enable_marker_cluster_server'] = true ;
208 208
 
209
-        }
209
+		}
210 210
 	} else {
211 211
 		$map_args['enable_marker_cluster'] = false;
212 212
 	}
213 213
 
214
-    // if lat and long set in shortcode, hack it so the map is not repositioned
215
-    if(!empty($params['latitude']) && !empty($params['longitude']) ){
216
-        $map_args['enable_marker_cluster_no_reposition'] = true;
217
-    }
214
+	// if lat and long set in shortcode, hack it so the map is not repositioned
215
+	if(!empty($params['latitude']) && !empty($params['longitude']) ){
216
+		$map_args['enable_marker_cluster_no_reposition'] = true;
217
+	}
218 218
 
219 219
 
220
-    geodir_draw_map($map_args);
220
+	geodir_draw_map($map_args);
221 221
 
222
-    add_action('wp_footer', 'geodir_home_map_add_script', 100);
222
+	add_action('wp_footer', 'geodir_home_map_add_script', 100);
223 223
 
224
-    $output = ob_get_contents();
224
+	$output = ob_get_contents();
225 225
 
226
-    ob_end_clean();
226
+	ob_end_clean();
227 227
 
228
-    return $output;
228
+	return $output;
229 229
 }
230 230
 add_shortcode('gd_homepage_map', 'geodir_sc_home_map');
231 231
 
@@ -259,77 +259,77 @@  discard block
 block discarded – undo
259 259
  */
260 260
 function geodir_sc_listing_map($atts)
261 261
 {
262
-    ob_start();
263
-    add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
264
-
265
-    add_action('the_post', 'create_list_jsondata'); // Add marker in json array
266
-
267
-    add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
268
-
269
-    $defaults = array(
270
-        'width' => '294',
271
-        'height' => '370',
272
-        'zoom' => '13',
273
-        'autozoom' => '',
274
-        'sticky' => '',
275
-        'showall' => '0',
276
-        'scrollwheel' => '0',
277
-        'maptype' => 'ROADMAP',
278
-        'child_collapse' => 0,
262
+	ob_start();
263
+	add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
264
+
265
+	add_action('the_post', 'create_list_jsondata'); // Add marker in json array
266
+
267
+	add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
268
+
269
+	$defaults = array(
270
+		'width' => '294',
271
+		'height' => '370',
272
+		'zoom' => '13',
273
+		'autozoom' => '',
274
+		'sticky' => '',
275
+		'showall' => '0',
276
+		'scrollwheel' => '0',
277
+		'maptype' => 'ROADMAP',
278
+		'child_collapse' => 0,
279 279
 		'marker_cluster' => false
280
-    );
281
-
282
-    $params = shortcode_atts($defaults, $atts);
283
-
284
-    $params = gdsc_validate_map_args($params);
285
-
286
-    $map_args = array(
287
-        'map_canvas_name' => 'gd_listing_map',
288
-        'width' => $params['width'],
289
-        'height' => $params['height'],
290
-        'zoom' => $params['zoom'],
291
-        'autozoom' => $params['autozoom'],
292
-        'sticky' => $params['sticky'],
293
-        'showall' => $params['showall'],
294
-        'scrollwheel' => $params['scrollwheel'],
295
-        'child_collapse' => 0,
296
-        'enable_cat_filters' => false,
297
-        'enable_text_search' => false,
298
-        'enable_post_type_filters' => false,
299
-        'enable_location_filters' => false,
300
-        'enable_jason_on_load' => true,
301
-    );
302
-
303
-    if (is_single()) {
304
-
305
-        global $post;
306
-        $map_default_lat = $address_latitude = $post->post_latitude;
307
-        $map_default_lng = $address_longitude = $post->post_longitude;
308
-        $mapview = $post->post_mapview;
309
-        $map_args['zoom'] = $post->post_mapzoom;
310
-        $map_args['map_class_name'] = 'geodir-map-listing-page-single';
311
-
312
-    } else {
313
-        $default_location = geodir_get_default_location();
314
-
315
-        $map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
316
-        $map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
317
-        $map_args['map_class_name'] = 'geodir-map-listing-page';
318
-    }
319
-
320
-    if (empty($mapview)) {
321
-        $mapview = 'ROADMAP';
322
-    }
323
-
324
-    // Set default map options
325
-    $map_args['ajax_url'] = geodir_get_ajax_url();
326
-    $map_args['latitude'] = $map_default_lat;
327
-    $map_args['longitude'] = $map_default_lng;
328
-    $map_args['streetViewControl'] = true;
329
-    $map_args['maptype'] = $mapview;
330
-    $map_args['showPreview'] = '0';
331
-    $map_args['maxZoom'] = 21;
332
-    $map_args['bubble_size'] = 'small';
280
+	);
281
+
282
+	$params = shortcode_atts($defaults, $atts);
283
+
284
+	$params = gdsc_validate_map_args($params);
285
+
286
+	$map_args = array(
287
+		'map_canvas_name' => 'gd_listing_map',
288
+		'width' => $params['width'],
289
+		'height' => $params['height'],
290
+		'zoom' => $params['zoom'],
291
+		'autozoom' => $params['autozoom'],
292
+		'sticky' => $params['sticky'],
293
+		'showall' => $params['showall'],
294
+		'scrollwheel' => $params['scrollwheel'],
295
+		'child_collapse' => 0,
296
+		'enable_cat_filters' => false,
297
+		'enable_text_search' => false,
298
+		'enable_post_type_filters' => false,
299
+		'enable_location_filters' => false,
300
+		'enable_jason_on_load' => true,
301
+	);
302
+
303
+	if (is_single()) {
304
+
305
+		global $post;
306
+		$map_default_lat = $address_latitude = $post->post_latitude;
307
+		$map_default_lng = $address_longitude = $post->post_longitude;
308
+		$mapview = $post->post_mapview;
309
+		$map_args['zoom'] = $post->post_mapzoom;
310
+		$map_args['map_class_name'] = 'geodir-map-listing-page-single';
311
+
312
+	} else {
313
+		$default_location = geodir_get_default_location();
314
+
315
+		$map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
316
+		$map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
317
+		$map_args['map_class_name'] = 'geodir-map-listing-page';
318
+	}
319
+
320
+	if (empty($mapview)) {
321
+		$mapview = 'ROADMAP';
322
+	}
323
+
324
+	// Set default map options
325
+	$map_args['ajax_url'] = geodir_get_ajax_url();
326
+	$map_args['latitude'] = $map_default_lat;
327
+	$map_args['longitude'] = $map_default_lng;
328
+	$map_args['streetViewControl'] = true;
329
+	$map_args['maptype'] = $mapview;
330
+	$map_args['showPreview'] = '0';
331
+	$map_args['maxZoom'] = 21;
332
+	$map_args['bubble_size'] = 'small';
333 333
 	
334 334
 	// Add marker cluster
335 335
 	if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
@@ -338,13 +338,13 @@  discard block
 block discarded – undo
338 338
 		$map_args['enable_marker_cluster'] = false;
339 339
 	}
340 340
 
341
-    geodir_draw_map($map_args);
341
+	geodir_draw_map($map_args);
342 342
 
343
-    $output = ob_get_contents();
343
+	$output = ob_get_contents();
344 344
 
345
-    ob_end_clean();
345
+	ob_end_clean();
346 346
 
347
-    return $output;
347
+	return $output;
348 348
 }
349 349
 
350 350
 add_shortcode('gd_listing_slider', 'geodir_sc_listing_slider');
@@ -377,120 +377,120 @@  discard block
 block discarded – undo
377 377
  */
378 378
 function geodir_sc_listing_slider($atts)
379 379
 {
380
-    ob_start();
381
-    $defaults = array(
382
-        'post_type' => 'gd_place',
383
-        'category' => '0',
384
-        'post_number' => '5',
385
-        'slideshow' => '0',
386
-        'animation_loop' => 0,
387
-        'direction_nav' => 0,
388
-        'slideshow_speed' => 5000,
389
-        'animation_speed' => 600,
390
-        'animation' => 'slide',
391
-        'order_by' => 'latest',
392
-        'show_title' => '',
393
-        'show_featured_only' => '',
394
-        'title' => '',
395
-    );
396
-
397
-    $params = shortcode_atts($defaults, $atts);
398
-
399
-
400
-    /*
380
+	ob_start();
381
+	$defaults = array(
382
+		'post_type' => 'gd_place',
383
+		'category' => '0',
384
+		'post_number' => '5',
385
+		'slideshow' => '0',
386
+		'animation_loop' => 0,
387
+		'direction_nav' => 0,
388
+		'slideshow_speed' => 5000,
389
+		'animation_speed' => 600,
390
+		'animation' => 'slide',
391
+		'order_by' => 'latest',
392
+		'show_title' => '',
393
+		'show_featured_only' => '',
394
+		'title' => '',
395
+	);
396
+
397
+	$params = shortcode_atts($defaults, $atts);
398
+
399
+
400
+	/*
401 401
      *
402 402
      * Now we begin the validation of the attributes.
403 403
      */
404
-    // Check we have a valid post_type
405
-    if (!(gdsc_is_post_type_valid($params['post_type']))) {
406
-        $params['post_type'] = 'gd_place';
407
-    }
408
-
409
-    // Check we have a valid sort_order
410
-    $params['order_by'] = gdsc_validate_sort_choice($params['order_by']);
411
-
412
-    // Match the chosen animation to our options
413
-    $animation_list = array('slide', 'fade');
414
-    if (!(in_array($params['animation'], $animation_list))) {
415
-        $params['animation'] = 'slide';
416
-    }
417
-
418
-    // Post_number needs to be a positive integer
419
-    $params['post_number'] = absint($params['post_number']);
420
-    if (0 == $params['post_number']) {
421
-        $params['post_number'] = 1;
422
-    }
423
-
424
-    // Manage the entered categories
425
-    if (0 != $params['category'] || '' != $params['category']) {
426
-        $params['category'] = gdsc_manage_category_choice($params['post_type'], $params['category']);
427
-    }
428
-    // Convert show_title to a bool
429
-    $params['show_title'] = intval(gdsc_to_bool_val($params['show_title']));
430
-
431
-    // Convert show_featured_only to a bool
432
-    $params['show_featured_only'] = intval(gdsc_to_bool_val($params['show_featured_only']));
433
-
434
-    /*
404
+	// Check we have a valid post_type
405
+	if (!(gdsc_is_post_type_valid($params['post_type']))) {
406
+		$params['post_type'] = 'gd_place';
407
+	}
408
+
409
+	// Check we have a valid sort_order
410
+	$params['order_by'] = gdsc_validate_sort_choice($params['order_by']);
411
+
412
+	// Match the chosen animation to our options
413
+	$animation_list = array('slide', 'fade');
414
+	if (!(in_array($params['animation'], $animation_list))) {
415
+		$params['animation'] = 'slide';
416
+	}
417
+
418
+	// Post_number needs to be a positive integer
419
+	$params['post_number'] = absint($params['post_number']);
420
+	if (0 == $params['post_number']) {
421
+		$params['post_number'] = 1;
422
+	}
423
+
424
+	// Manage the entered categories
425
+	if (0 != $params['category'] || '' != $params['category']) {
426
+		$params['category'] = gdsc_manage_category_choice($params['post_type'], $params['category']);
427
+	}
428
+	// Convert show_title to a bool
429
+	$params['show_title'] = intval(gdsc_to_bool_val($params['show_title']));
430
+
431
+	// Convert show_featured_only to a bool
432
+	$params['show_featured_only'] = intval(gdsc_to_bool_val($params['show_featured_only']));
433
+
434
+	/*
435 435
      * Hopefully all attributes are now valid, and safe to pass forward
436 436
      */
437 437
 
438
-    // redeclare vars after validation
439
-
440
-    if (isset($params['direction_nav'])) {
441
-        $params['directionNav'] = $params['direction_nav'];
442
-    }
443
-    if (isset($params['animation_loop'])) {
444
-        $params['animationLoop'] = $params['animation_loop'];
445
-    }
446
-    if (isset($params['slideshow_speed'])) {
447
-        $params['slideshowSpeed'] = $params['slideshow_speed'];
448
-    }
449
-    if (isset($params['animation_speed'])) {
450
-        $params['animationSpeed'] = $params['animation_speed'];
451
-    }
452
-    if (isset($params['order_by'])) {
453
-        $params['list_sort'] = $params['order_by'];
454
-    }
455
-
456
-    $query_args = array(
457
-        'post_number' => $params['post_number'],
458
-        'is_geodir_loop' => true,
459
-        'post_type' => $params['post_type'],
460
-        'order_by' => $params['order_by']
461
-    );
462
-
463
-    if (1 == $params['show_featured_only']) {
464
-        $query_args['show_featured_only'] = 1;
465
-    }
466
-
467
-    if (0 != $params['category'] && '' != $params['category']) {
468
-        $category_taxonomy = geodir_get_taxonomies($params['post_type']);
469
-        $tax_query = array(
470
-            'taxonomy' => $category_taxonomy[0],
471
-            'field' => 'id',
472
-            'terms' => $params['category'],
473
-        );
474
-
475
-        $query_args['tax_query'] = array($tax_query);
476
-    }
477
-
478
-    $defaults = array(
479
-        'before_widget' => '',
480
-        'after_widget' => '',
481
-        'before_title' => '',
482
-        'after_title' => '',
483
-    );
484
-
485
-    $query_args = array_merge($query_args, $params);
486
-
487
-    geodir_listing_slider_widget_output($defaults, $query_args);
488
-
489
-    $output = ob_get_contents();
490
-
491
-    ob_end_clean();
492
-
493
-    return $output;
438
+	// redeclare vars after validation
439
+
440
+	if (isset($params['direction_nav'])) {
441
+		$params['directionNav'] = $params['direction_nav'];
442
+	}
443
+	if (isset($params['animation_loop'])) {
444
+		$params['animationLoop'] = $params['animation_loop'];
445
+	}
446
+	if (isset($params['slideshow_speed'])) {
447
+		$params['slideshowSpeed'] = $params['slideshow_speed'];
448
+	}
449
+	if (isset($params['animation_speed'])) {
450
+		$params['animationSpeed'] = $params['animation_speed'];
451
+	}
452
+	if (isset($params['order_by'])) {
453
+		$params['list_sort'] = $params['order_by'];
454
+	}
455
+
456
+	$query_args = array(
457
+		'post_number' => $params['post_number'],
458
+		'is_geodir_loop' => true,
459
+		'post_type' => $params['post_type'],
460
+		'order_by' => $params['order_by']
461
+	);
462
+
463
+	if (1 == $params['show_featured_only']) {
464
+		$query_args['show_featured_only'] = 1;
465
+	}
466
+
467
+	if (0 != $params['category'] && '' != $params['category']) {
468
+		$category_taxonomy = geodir_get_taxonomies($params['post_type']);
469
+		$tax_query = array(
470
+			'taxonomy' => $category_taxonomy[0],
471
+			'field' => 'id',
472
+			'terms' => $params['category'],
473
+		);
474
+
475
+		$query_args['tax_query'] = array($tax_query);
476
+	}
477
+
478
+	$defaults = array(
479
+		'before_widget' => '',
480
+		'after_widget' => '',
481
+		'before_title' => '',
482
+		'after_title' => '',
483
+	);
484
+
485
+	$query_args = array_merge($query_args, $params);
486
+
487
+	geodir_listing_slider_widget_output($defaults, $query_args);
488
+
489
+	$output = ob_get_contents();
490
+
491
+	ob_end_clean();
492
+
493
+	return $output;
494 494
 }
495 495
 
496 496
 add_shortcode('gd_login_box', 'geodir_sc_login_box');
@@ -514,22 +514,22 @@  discard block
 block discarded – undo
514 514
  */
515 515
 function geodir_sc_login_box($atts)
516 516
 {
517
-    ob_start();
517
+	ob_start();
518 518
 
519
-    $defaults = array(
520
-        'before_widget' => '',
521
-        'after_widget' => '',
522
-        'before_title' => '',
523
-        'after_title' => '',
524
-    );
519
+	$defaults = array(
520
+		'before_widget' => '',
521
+		'after_widget' => '',
522
+		'before_title' => '',
523
+		'after_title' => '',
524
+	);
525 525
 
526
-    geodir_loginwidget_output($defaults, $defaults);
526
+	geodir_loginwidget_output($defaults, $defaults);
527 527
 
528
-    $output = ob_get_contents();
528
+	$output = ob_get_contents();
529 529
 
530
-    ob_end_clean();
530
+	ob_end_clean();
531 531
 
532
-    return $output;
532
+	return $output;
533 533
 }
534 534
 
535 535
 add_shortcode('gd_popular_post_category', 'geodir_sc_popular_post_category');
@@ -560,30 +560,30 @@  discard block
 block discarded – undo
560 560
  */
561 561
 function geodir_sc_popular_post_category($atts)
562 562
 {
563
-    ob_start();
564
-    global $geodir_post_category_str;
565
-    $defaults = array(
566
-        'category_limit' => 15,
567
-        'before_widget' => '',
568
-        'after_widget' => '',
569
-        'before_title' => '',
570
-        'after_title' => '',
571
-        'title' => '',
572
-        'default_post_type' => '',
573
-        'parent_only' => false,
574
-    );
575
-
576
-    $params = shortcode_atts($defaults, $atts, 'popular_post_category');
577
-    $params['category_limit'] = absint($params['category_limit']);
578
-    $params['default_post_type'] = gdsc_is_post_type_valid($params['default_post_type']) ? $params['default_post_type'] : '';
579
-    $params['parent_only'] = gdsc_to_bool_val($params['parent_only']);
580
-    geodir_popular_post_category_output($params, $params);
581
-
582
-    $output = ob_get_contents();
583
-
584
-    ob_end_clean();
585
-
586
-    return $output;
563
+	ob_start();
564
+	global $geodir_post_category_str;
565
+	$defaults = array(
566
+		'category_limit' => 15,
567
+		'before_widget' => '',
568
+		'after_widget' => '',
569
+		'before_title' => '',
570
+		'after_title' => '',
571
+		'title' => '',
572
+		'default_post_type' => '',
573
+		'parent_only' => false,
574
+	);
575
+
576
+	$params = shortcode_atts($defaults, $atts, 'popular_post_category');
577
+	$params['category_limit'] = absint($params['category_limit']);
578
+	$params['default_post_type'] = gdsc_is_post_type_valid($params['default_post_type']) ? $params['default_post_type'] : '';
579
+	$params['parent_only'] = gdsc_to_bool_val($params['parent_only']);
580
+	geodir_popular_post_category_output($params, $params);
581
+
582
+	$output = ob_get_contents();
583
+
584
+	ob_end_clean();
585
+
586
+	return $output;
587 587
 }
588 588
 
589 589
 add_shortcode('gd_popular_post_view', 'geodir_sc_popular_post_view');
@@ -623,97 +623,97 @@  discard block
 block discarded – undo
623 623
  */
624 624
 function geodir_sc_popular_post_view($atts)
625 625
 {
626
-    ob_start();
627
-    $defaults = array(
628
-        'post_type' => 'gd_place',
629
-        'category' => '0',
630
-        'post_number' => '5',
631
-        'layout' => 'gridview_onehalf',
632
-        'add_location_filter' => '0',
633
-        'list_sort' => 'latest',
634
-        'use_viewing_post_type' => '1',
635
-        'character_count' => '20',
636
-        'listing_width' => '',
637
-        'show_featured_only' => '0',
638
-        'show_special_only' => '0',
639
-        'with_pics_only' => '0',
640
-        'with_videos_only' => '0',
641
-        'before_widget' => '',
642
-        'after_widget' => '',
643
-        'before_title' => '<h3 class="widget-title">',
644
-        'after_title' => '</h3>',
645
-        'title' => '',
646
-        'category_title' => '',
647
-    );
648
-
649
-    $params = shortcode_atts($defaults, $atts);
650
-
651
-    /**
652
-     * Validate our incoming params
653
-     */
626
+	ob_start();
627
+	$defaults = array(
628
+		'post_type' => 'gd_place',
629
+		'category' => '0',
630
+		'post_number' => '5',
631
+		'layout' => 'gridview_onehalf',
632
+		'add_location_filter' => '0',
633
+		'list_sort' => 'latest',
634
+		'use_viewing_post_type' => '1',
635
+		'character_count' => '20',
636
+		'listing_width' => '',
637
+		'show_featured_only' => '0',
638
+		'show_special_only' => '0',
639
+		'with_pics_only' => '0',
640
+		'with_videos_only' => '0',
641
+		'before_widget' => '',
642
+		'after_widget' => '',
643
+		'before_title' => '<h3 class="widget-title">',
644
+		'after_title' => '</h3>',
645
+		'title' => '',
646
+		'category_title' => '',
647
+	);
654 648
 
655
-    // Validate the selected post type, default to gd_place on fail
656
-    if (!(gdsc_is_post_type_valid($params['post_type']))) {
657
-        $params['post_type'] = 'gd_place';
658
-    }
659
-
660
-    // Validate the selected category/ies - Grab the current list based on post_type
661
-    $category_taxonomy = geodir_get_taxonomies($params['post_type']);
662
-    $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
663
-
664
-    // Make sure we have an array
665
-    if (!(is_array($params['category']))) {
666
-        $params['category'] = explode(',', $params['category']);
667
-    }
668
-
669
-    // Array_intersect returns only the items in $params['category'] that are also in our category list
670
-    // Otherwise it becomes empty and later on that will mean "All"
671
-    $params['category'] = array_intersect($params['category'], $categories);
672
-
673
-    // Post_number needs to be a positive integer
674
-    $params['post_number'] = absint($params['post_number']);
675
-    if (0 == $params['post_number']) {
676
-        $params['post_number'] = 1;
677
-    }
678
-
679
-    // Validate our layout choice
680
-    // Outside of the norm, I added some more simple terms to match the existing
681
-    // So now I just run the switch to set it properly.
682
-    $params['layout'] = gdsc_validate_layout_choice($params['layout']);
683
-
684
-    // Validate our sorting choice
685
-    $params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
686
-
687
-    // Validate character_count
688
-    $params['character_count'] = absint($params['character_count']);
689
-    if (20 > $params['character_count']) {
690
-        $params['character_count'] = 20;
691
-    }
692
-
693
-    // Validate Listing width, used in the template widget-listing-listview.php
694
-    // The context is in width=$listing_width% - So we need a positive number between 0 & 100
695
-    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
696
-
697
-    // Validate the checkboxes used on the widget
698
-    $params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
699
-    $params['show_featured_only'] = gdsc_to_bool_val($params['show_featured_only']);
700
-    $params['show_special_only'] = gdsc_to_bool_val($params['show_special_only']);
701
-    $params['with_pics_only'] = gdsc_to_bool_val($params['with_pics_only']);
702
-    $params['with_videos_only'] = gdsc_to_bool_val($params['with_videos_only']);
703
-    $params['use_viewing_post_type'] = gdsc_to_bool_val($params['use_viewing_post_type']);
704
-
705
-    /**
706
-     * End of validation
707
-     */
649
+	$params = shortcode_atts($defaults, $atts);
650
+
651
+	/**
652
+	 * Validate our incoming params
653
+	 */
654
+
655
+	// Validate the selected post type, default to gd_place on fail
656
+	if (!(gdsc_is_post_type_valid($params['post_type']))) {
657
+		$params['post_type'] = 'gd_place';
658
+	}
659
+
660
+	// Validate the selected category/ies - Grab the current list based on post_type
661
+	$category_taxonomy = geodir_get_taxonomies($params['post_type']);
662
+	$categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
708 663
 
709
-    geodir_popular_postview_output($params, $params);
664
+	// Make sure we have an array
665
+	if (!(is_array($params['category']))) {
666
+		$params['category'] = explode(',', $params['category']);
667
+	}
668
+
669
+	// Array_intersect returns only the items in $params['category'] that are also in our category list
670
+	// Otherwise it becomes empty and later on that will mean "All"
671
+	$params['category'] = array_intersect($params['category'], $categories);
672
+
673
+	// Post_number needs to be a positive integer
674
+	$params['post_number'] = absint($params['post_number']);
675
+	if (0 == $params['post_number']) {
676
+		$params['post_number'] = 1;
677
+	}
710 678
 
679
+	// Validate our layout choice
680
+	// Outside of the norm, I added some more simple terms to match the existing
681
+	// So now I just run the switch to set it properly.
682
+	$params['layout'] = gdsc_validate_layout_choice($params['layout']);
711 683
 
712
-    $output = ob_get_contents();
684
+	// Validate our sorting choice
685
+	$params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
713 686
 
714
-    ob_end_clean();
687
+	// Validate character_count
688
+	$params['character_count'] = absint($params['character_count']);
689
+	if (20 > $params['character_count']) {
690
+		$params['character_count'] = 20;
691
+	}
715 692
 
716
-    return $output;
693
+	// Validate Listing width, used in the template widget-listing-listview.php
694
+	// The context is in width=$listing_width% - So we need a positive number between 0 & 100
695
+	$params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
696
+
697
+	// Validate the checkboxes used on the widget
698
+	$params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
699
+	$params['show_featured_only'] = gdsc_to_bool_val($params['show_featured_only']);
700
+	$params['show_special_only'] = gdsc_to_bool_val($params['show_special_only']);
701
+	$params['with_pics_only'] = gdsc_to_bool_val($params['with_pics_only']);
702
+	$params['with_videos_only'] = gdsc_to_bool_val($params['with_videos_only']);
703
+	$params['use_viewing_post_type'] = gdsc_to_bool_val($params['use_viewing_post_type']);
704
+
705
+	/**
706
+	 * End of validation
707
+	 */
708
+
709
+	geodir_popular_postview_output($params, $params);
710
+
711
+
712
+	$output = ob_get_contents();
713
+
714
+	ob_end_clean();
715
+
716
+	return $output;
717 717
 }
718 718
 
719 719
 add_shortcode('gd_recent_reviews', 'geodir_sc_recent_reviews');
@@ -735,37 +735,37 @@  discard block
 block discarded – undo
735 735
  * @return string Recent reviews HTML.
736 736
  */
737 737
 function geodir_sc_recent_reviews($atts) {
738
-    ob_start();
739
-    $defaults = array(
738
+	ob_start();
739
+	$defaults = array(
740 740
 		'title' => '',
741 741
 		'count' => 5,
742
-    );
742
+	);
743 743
 
744
-    $params = shortcode_atts($defaults, $atts);
744
+	$params = shortcode_atts($defaults, $atts);
745 745
 
746
-    $count = absint($params['count']);
747
-    if (0 == $count) {
748
-        $count = 1;
749
-    }
746
+	$count = absint($params['count']);
747
+	if (0 == $count) {
748
+		$count = 1;
749
+	}
750 750
 	
751 751
 	$title = !empty($params['title']) ? __($params['title'], 'geodirectory') : '';
752 752
 
753
-    $comments_li = geodir_get_recent_reviews(30, $count, 100, false);
753
+	$comments_li = geodir_get_recent_reviews(30, $count, 100, false);
754 754
 
755
-    if ($comments_li) {
756
-        if ($title != '') { ?>
755
+	if ($comments_li) {
756
+		if ($title != '') { ?>
757 757
 		<h3 class="geodir-sc-recent-reviews-title widget-title"><?php echo $title; ?></h3>
758 758
 		<?php } ?>
759 759
         <div class="geodir_sc_recent_reviews_section">
760 760
             <ul class="geodir_sc_recent_reviews"><?php echo $comments_li; ?></ul>
761 761
         </div>
762 762
     <?php
763
-    }
764
-    $output = ob_get_contents();
763
+	}
764
+	$output = ob_get_contents();
765 765
 
766
-    ob_end_clean();
766
+	ob_end_clean();
767 767
 
768
-    return $output;
768
+	return $output;
769 769
 }
770 770
 
771 771
 add_shortcode('gd_related_listings', 'geodir_sc_related_listings');
@@ -795,64 +795,64 @@  discard block
 block discarded – undo
795 795
  */
796 796
 function geodir_sc_related_listings($atts)
797 797
 {
798
-    ob_start();
799
-    $defaults = array(
800
-        'post_number' => 5,
801
-        'relate_to' => 'category',
802
-        'layout' => 'gridview_onehalf',
803
-        'add_location_filter' => 0,
804
-        'listing_width' => '',
805
-        'list_sort' => 'latest',
806
-        'character_count' => 20,
807
-        'is_widget' => 1,
808
-        'before_title' => '<style type="text/css">.geodir_category_list_view li{margin:0px!important}</style>',
809
-    );
810
-    // The "before_title" code is an ugly & terrible hack. But it works for now. I should enqueue a new stylesheet.
811
-
812
-    $params = shortcode_atts($defaults, $atts);
813
-
814
-    /**
815
-     * Begin validating parameters
816
-     */
798
+	ob_start();
799
+	$defaults = array(
800
+		'post_number' => 5,
801
+		'relate_to' => 'category',
802
+		'layout' => 'gridview_onehalf',
803
+		'add_location_filter' => 0,
804
+		'listing_width' => '',
805
+		'list_sort' => 'latest',
806
+		'character_count' => 20,
807
+		'is_widget' => 1,
808
+		'before_title' => '<style type="text/css">.geodir_category_list_view li{margin:0px!important}</style>',
809
+	);
810
+	// The "before_title" code is an ugly & terrible hack. But it works for now. I should enqueue a new stylesheet.
811
+
812
+	$params = shortcode_atts($defaults, $atts);
813
+
814
+	/**
815
+	 * Begin validating parameters
816
+	 */
817 817
 
818
-    // Validate that post_number is a number and is 1 or higher
819
-    $params['post_number'] = absint($params['post_number']);
820
-    if (0 === $params['post_number']) {
821
-        $params['post_number'] = 1;
822
-    }
818
+	// Validate that post_number is a number and is 1 or higher
819
+	$params['post_number'] = absint($params['post_number']);
820
+	if (0 === $params['post_number']) {
821
+		$params['post_number'] = 1;
822
+	}
823 823
 
824
-    // Validate relate_to - only category or tags
825
-    $params['relate_to'] = geodir_strtolower($params['relate_to']);
826
-    if ('category' != $params['relate_to'] && 'tags' != $params['relate_to']) {
827
-        $params['relate_to'] = 'category';
828
-    }
824
+	// Validate relate_to - only category or tags
825
+	$params['relate_to'] = geodir_strtolower($params['relate_to']);
826
+	if ('category' != $params['relate_to'] && 'tags' != $params['relate_to']) {
827
+		$params['relate_to'] = 'category';
828
+	}
829 829
 
830
-    // Validate layout selection
831
-    $params['layout'] = gdsc_validate_layout_choice($params['layout']);
830
+	// Validate layout selection
831
+	$params['layout'] = gdsc_validate_layout_choice($params['layout']);
832 832
 
833
-    // Validate sorting option
834
-    $params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
833
+	// Validate sorting option
834
+	$params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
835 835
 
836
-    // Validate add_location_filter
837
-    $params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
836
+	// Validate add_location_filter
837
+	$params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
838 838
 
839
-    // Validate listing_width
840
-    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
839
+	// Validate listing_width
840
+	$params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
841 841
 
842
-    // Validate character_count
843
-    $params['character_count'] = absint($params['character_count']);
844
-    if (20 > $params['character_count']) {
845
-        $params['character_count'] = 20;
846
-    }
842
+	// Validate character_count
843
+	$params['character_count'] = absint($params['character_count']);
844
+	if (20 > $params['character_count']) {
845
+		$params['character_count'] = 20;
846
+	}
847 847
 
848
-    if ($related_display = geodir_related_posts_display($params)) {
849
-        echo $related_display;
850
-    }
851
-    $output = ob_get_contents();
848
+	if ($related_display = geodir_related_posts_display($params)) {
849
+		echo $related_display;
850
+	}
851
+	$output = ob_get_contents();
852 852
 
853
-    ob_end_clean();
853
+	ob_end_clean();
854 854
 
855
-    return $output;
855
+	return $output;
856 856
 }
857 857
 
858 858
 /**
@@ -876,13 +876,13 @@  discard block
 block discarded – undo
876 876
  * @return string Advanced search widget HTML.
877 877
  */
878 878
 function geodir_sc_advanced_search($atts) {
879
-    $defaults = array(
879
+	$defaults = array(
880 880
 		'title' => '',
881 881
 		'before_widget' => '<section id="geodir_advanced_search-1" class="widget geodir-widget geodir_advance_search_widget">',
882
-        'after_widget' => '</section>',
883
-        'before_title' => '<h3 class="widget-title">',
884
-        'after_title' => '</h3>',
885
-        'show_adv_search' => 'default',
882
+		'after_widget' => '</section>',
883
+		'before_title' => '<h3 class="widget-title">',
884
+		'after_title' => '</h3>',
885
+		'show_adv_search' => 'default',
886 886
 		'post_type' => ''
887 887
 	);
888 888
 	
@@ -906,9 +906,9 @@  discard block
 block discarded – undo
906 906
 	the_widget('geodir_advance_search_widget', $params, $params );
907 907
 	
908 908
 	$output = ob_get_contents();
909
-    ob_end_clean();
909
+	ob_end_clean();
910 910
 
911
-    return $output;
911
+	return $output;
912 912
 }
913 913
 add_shortcode('gd_advanced_search', 'geodir_sc_advanced_search');
914 914
 
@@ -954,48 +954,48 @@  discard block
 block discarded – undo
954 954
 		'add_location_filter' => '1',
955 955
 		'tab_layout' => 'bestof-tabs-on-top',
956 956
 		'before_widget' => '<section id="bestof_widget-1" class="widget geodir-widget geodir_bestof_widget geodir_sc_bestof_widget">',
957
-        'after_widget' => '</section>',
958
-        'before_title' => '<h3 class="widget-title">',
959
-        'after_title' => '</h3>',
957
+		'after_widget' => '</section>',
958
+		'before_title' => '<h3 class="widget-title">',
959
+		'after_title' => '</h3>',
960 960
 	);
961 961
 	$params = shortcode_atts($defaults, $atts);
962 962
 
963
-    /**
964
-     * Validate our incoming params
965
-     */
963
+	/**
964
+	 * Validate our incoming params
965
+	 */
966 966
 
967
-    // Validate the selected post type, default to gd_place on fail
968
-    if (!(gdsc_is_post_type_valid($params['post_type']))) {
969
-        $params['post_type'] = 'gd_place';
970
-    }
967
+	// Validate the selected post type, default to gd_place on fail
968
+	if (!(gdsc_is_post_type_valid($params['post_type']))) {
969
+		$params['post_type'] = 'gd_place';
970
+	}
971 971
 	
972 972
 	// Post limit needs to be a positive integer
973
-    $params['post_limit'] = absint($params['post_limit']);
974
-    if (0 == $params['post_limit']) {
975
-        $params['post_limit'] = 5;
976
-    }
973
+	$params['post_limit'] = absint($params['post_limit']);
974
+	if (0 == $params['post_limit']) {
975
+		$params['post_limit'] = 5;
976
+	}
977 977
 	
978 978
 	// Category limit needs to be a positive integer
979
-    $params['categ_limit'] = absint($params['categ_limit']);
980
-    if (0 == $params['categ_limit']) {
981
-        $params['categ_limit'] = 3;
982
-    }
979
+	$params['categ_limit'] = absint($params['categ_limit']);
980
+	if (0 == $params['categ_limit']) {
981
+		$params['categ_limit'] = 3;
982
+	}
983 983
 	
984 984
 	// Tab layout validation
985
-    $params['tab_layout'] = $params['tab_layout'];
986
-    if (!in_array($params['tab_layout'], array('bestof-tabs-on-top', 'bestof-tabs-on-left', 'bestof-tabs-as-dropdown'))) {
987
-        $params['tab_layout'] = 'bestof-tabs-on-top';
988
-    }
985
+	$params['tab_layout'] = $params['tab_layout'];
986
+	if (!in_array($params['tab_layout'], array('bestof-tabs-on-top', 'bestof-tabs-on-left', 'bestof-tabs-as-dropdown'))) {
987
+		$params['tab_layout'] = 'bestof-tabs-on-top';
988
+	}
989 989
 	
990 990
 	// Validate character_count
991
-    $params['character_count'] = $params['character_count'];
991
+	$params['character_count'] = $params['character_count'];
992 992
 
993 993
 	ob_start();
994 994
 	the_widget('geodir_bestof_widget', $params, $params);
995
-    $output = ob_get_contents();
996
-    ob_end_clean();
995
+	$output = ob_get_contents();
996
+	ob_end_clean();
997 997
 
998
-    return $output;
998
+	return $output;
999 999
 }
1000 1000
 add_shortcode('gd_bestof_widget', 'geodir_sc_bestof_widget');
1001 1001
 
@@ -1043,127 +1043,127 @@  discard block
 block discarded – undo
1043 1043
  * @return string HTML content to display geodirectory listings.
1044 1044
  */
1045 1045
 function geodir_sc_gd_listings($atts, $content = '') {
1046
-    global $post;
1047
-    $defaults = array(
1048
-        'title'                 => '',
1049
-        'post_type'             => 'gd_place',
1050
-        'category'              => 0,
1051
-        'list_sort'             => 'latest',
1052
-        'event_type'            => '',
1053
-        'post_number'           => 10,
1054
-        'post_author'           => '',
1055
-        'layout'                => 'gridview_onehalf',
1056
-        'listing_width'         => '',
1057
-        'character_count'       => 20,
1058
-        'add_location_filter'   => 1,
1059
-        'show_featured_only'    => '',
1060
-        'show_special_only'     => '',
1061
-        'with_pics_only'        => '',
1062
-        'with_videos_only'      => '',
1063
-        'with_pagination'       => '1',
1064
-        'top_pagination'        => '0',
1065
-        'bottom_pagination'     => '1',
1066
-        'without_no_results'    => 0,
1067
-        'tags'                  => ''
1068
-    );
1069
-    $params = shortcode_atts($defaults, $atts);
1070
-
1071
-    $params['title']        = wp_strip_all_tags($params['title']);
1072
-    $params['post_type']    = gdsc_is_post_type_valid($params['post_type']) ? $params['post_type'] : 'gd_place';
1073
-
1074
-    // Validate the selected category/ies - Grab the current list based on post_type
1075
-    $category_taxonomy      = geodir_get_taxonomies($params['post_type']);
1076
-    $categories             = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
1077
-
1078
-    // Make sure we have an array
1079
-    if (!(is_array($params['category']))) {
1080
-        $params['category'] = explode(',', $params['category']);
1081
-    }
1082
-
1083
-    // Array_intersect returns only the items in $params['category'] that are also in our category list
1084
-    // Otherwise it becomes empty and later on that will mean "All"
1085
-    $params['category']     = array_intersect($params['category'], $categories);
1086
-
1087
-    // Post_number needs to be a positive integer
1088
-    $params['post_number']  = absint($params['post_number']);
1089
-    $params['post_number']  = $params['post_number'] > 0 ? $params['post_number'] : 10;
1046
+	global $post;
1047
+	$defaults = array(
1048
+		'title'                 => '',
1049
+		'post_type'             => 'gd_place',
1050
+		'category'              => 0,
1051
+		'list_sort'             => 'latest',
1052
+		'event_type'            => '',
1053
+		'post_number'           => 10,
1054
+		'post_author'           => '',
1055
+		'layout'                => 'gridview_onehalf',
1056
+		'listing_width'         => '',
1057
+		'character_count'       => 20,
1058
+		'add_location_filter'   => 1,
1059
+		'show_featured_only'    => '',
1060
+		'show_special_only'     => '',
1061
+		'with_pics_only'        => '',
1062
+		'with_videos_only'      => '',
1063
+		'with_pagination'       => '1',
1064
+		'top_pagination'        => '0',
1065
+		'bottom_pagination'     => '1',
1066
+		'without_no_results'    => 0,
1067
+		'tags'                  => ''
1068
+	);
1069
+	$params = shortcode_atts($defaults, $atts);
1070
+
1071
+	$params['title']        = wp_strip_all_tags($params['title']);
1072
+	$params['post_type']    = gdsc_is_post_type_valid($params['post_type']) ? $params['post_type'] : 'gd_place';
1073
+
1074
+	// Validate the selected category/ies - Grab the current list based on post_type
1075
+	$category_taxonomy      = geodir_get_taxonomies($params['post_type']);
1076
+	$categories             = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
1077
+
1078
+	// Make sure we have an array
1079
+	if (!(is_array($params['category']))) {
1080
+		$params['category'] = explode(',', $params['category']);
1081
+	}
1082
+
1083
+	// Array_intersect returns only the items in $params['category'] that are also in our category list
1084
+	// Otherwise it becomes empty and later on that will mean "All"
1085
+	$params['category']     = array_intersect($params['category'], $categories);
1086
+
1087
+	// Post_number needs to be a positive integer
1088
+	$params['post_number']  = absint($params['post_number']);
1089
+	$params['post_number']  = $params['post_number'] > 0 ? $params['post_number'] : 10;
1090 1090
     
1091
-    // Post_number needs to be a positive integer
1092
-    if (!empty($atts['post_author'])) {
1093
-        if ($atts['post_author'] == 'current' && !empty($post) && isset($post->post_author) && $post->post_type != 'page') {
1094
-            $params['post_author'] = $post->post_author;
1095
-        } else if ($atts['post_author'] != 'current' && absint($atts['post_author']) > 0) {
1096
-            $params['post_author'] = absint($atts['post_author']);
1097
-        } else {
1098
-            unset($params['post_author']);
1099
-        }
1100
-    } else {
1101
-        unset($params['post_author']);
1102
-    }
1103
-
1104
-    // Validate character_count
1105
-    //todo: is this necessary?
1106
-    $params['character_count']  = $params['character_count'];
1107
-
1108
-    // Validate our layout choice
1109
-    // Outside of the norm, I added some more simple terms to match the existing
1110
-    // So now I just run the switch to set it properly.
1111
-    $params['layout']           = gdsc_validate_layout_choice($params['layout']);
1112
-
1113
-    // Validate our sorting choice
1114
-    $params['list_sort']        = gdsc_validate_sort_choice($params['list_sort']);
1115
-
1116
-    // Validate Listing width, used in the template widget-listing-listview.php
1117
-    // The context is in width=$listing_width% - So we need a positive number between 0 & 100
1118
-    $params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1119
-
1120
-    // Validate the checkboxes used on the widget
1121
-    $params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
1122
-    $params['show_featured_only']   = gdsc_to_bool_val($params['show_featured_only']);
1123
-    $params['show_special_only']    = gdsc_to_bool_val($params['show_special_only']);
1124
-    $params['with_pics_only']       = gdsc_to_bool_val($params['with_pics_only']);
1125
-    $params['with_videos_only']     = gdsc_to_bool_val($params['with_videos_only']);
1126
-    $params['with_pagination']      = gdsc_to_bool_val($params['with_pagination']);
1127
-    $params['top_pagination']       = gdsc_to_bool_val($params['top_pagination']);
1128
-    $params['bottom_pagination']    = gdsc_to_bool_val($params['bottom_pagination']);
1129
-
1130
-    // Clean tags
1131
-    if (!empty($params['tags'])) {
1132
-        if (!is_array($params['tags'])) {
1133
-            $comma = _x(',', 'tag delimiter');
1134
-            if ( ',' !== $comma ) {
1135
-                $params['tags'] = str_replace($comma, ',', $params['tags']);
1136
-            }
1137
-            $params['tags'] = explode(',', trim($params['tags'], " \n\t\r\0\x0B,"));
1138
-            $params['tags'] = array_map('trim', $params['tags']);
1139
-        }
1140
-    } else {
1141
-        $params['tags'] = array();
1142
-    }
1143
-
1144
-    /**
1145
-     * End of validation
1146
-     */
1147
-    if (isset($atts['geodir_ajax'])) {
1148
-        $params['geodir_ajax'] = $atts['geodir_ajax'];
1149
-        unset($atts['geodir_ajax']);
1150
-    }
1151
-    if (isset($atts['pageno'])) {
1152
-        $params['pageno'] = $atts['pageno'];
1153
-        unset($atts['pageno']);
1154
-    }
1155
-
1156
-    if ( !empty($atts['shortcode_content']) ) {
1157
-        $content = $atts['shortcode_content'];
1158
-    }
1159
-    $params['shortcode_content'] = trim($content);
1160
-    $atts['shortcode_content'] = trim($content);
1091
+	// Post_number needs to be a positive integer
1092
+	if (!empty($atts['post_author'])) {
1093
+		if ($atts['post_author'] == 'current' && !empty($post) && isset($post->post_author) && $post->post_type != 'page') {
1094
+			$params['post_author'] = $post->post_author;
1095
+		} else if ($atts['post_author'] != 'current' && absint($atts['post_author']) > 0) {
1096
+			$params['post_author'] = absint($atts['post_author']);
1097
+		} else {
1098
+			unset($params['post_author']);
1099
+		}
1100
+	} else {
1101
+		unset($params['post_author']);
1102
+	}
1103
+
1104
+	// Validate character_count
1105
+	//todo: is this necessary?
1106
+	$params['character_count']  = $params['character_count'];
1107
+
1108
+	// Validate our layout choice
1109
+	// Outside of the norm, I added some more simple terms to match the existing
1110
+	// So now I just run the switch to set it properly.
1111
+	$params['layout']           = gdsc_validate_layout_choice($params['layout']);
1112
+
1113
+	// Validate our sorting choice
1114
+	$params['list_sort']        = gdsc_validate_sort_choice($params['list_sort']);
1115
+
1116
+	// Validate Listing width, used in the template widget-listing-listview.php
1117
+	// The context is in width=$listing_width% - So we need a positive number between 0 & 100
1118
+	$params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1119
+
1120
+	// Validate the checkboxes used on the widget
1121
+	$params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
1122
+	$params['show_featured_only']   = gdsc_to_bool_val($params['show_featured_only']);
1123
+	$params['show_special_only']    = gdsc_to_bool_val($params['show_special_only']);
1124
+	$params['with_pics_only']       = gdsc_to_bool_val($params['with_pics_only']);
1125
+	$params['with_videos_only']     = gdsc_to_bool_val($params['with_videos_only']);
1126
+	$params['with_pagination']      = gdsc_to_bool_val($params['with_pagination']);
1127
+	$params['top_pagination']       = gdsc_to_bool_val($params['top_pagination']);
1128
+	$params['bottom_pagination']    = gdsc_to_bool_val($params['bottom_pagination']);
1129
+
1130
+	// Clean tags
1131
+	if (!empty($params['tags'])) {
1132
+		if (!is_array($params['tags'])) {
1133
+			$comma = _x(',', 'tag delimiter');
1134
+			if ( ',' !== $comma ) {
1135
+				$params['tags'] = str_replace($comma, ',', $params['tags']);
1136
+			}
1137
+			$params['tags'] = explode(',', trim($params['tags'], " \n\t\r\0\x0B,"));
1138
+			$params['tags'] = array_map('trim', $params['tags']);
1139
+		}
1140
+	} else {
1141
+		$params['tags'] = array();
1142
+	}
1143
+
1144
+	/**
1145
+	 * End of validation
1146
+	 */
1147
+	if (isset($atts['geodir_ajax'])) {
1148
+		$params['geodir_ajax'] = $atts['geodir_ajax'];
1149
+		unset($atts['geodir_ajax']);
1150
+	}
1151
+	if (isset($atts['pageno'])) {
1152
+		$params['pageno'] = $atts['pageno'];
1153
+		unset($atts['pageno']);
1154
+	}
1155
+
1156
+	if ( !empty($atts['shortcode_content']) ) {
1157
+		$content = $atts['shortcode_content'];
1158
+	}
1159
+	$params['shortcode_content'] = trim($content);
1160
+	$atts['shortcode_content'] = trim($content);
1161 1161
     
1162
-    $params['shortcode_atts']       = $atts;
1162
+	$params['shortcode_atts']       = $atts;
1163 1163
 
1164
-    $output = geodir_sc_gd_listings_output($params);
1164
+	$output = geodir_sc_gd_listings_output($params);
1165 1165
 
1166
-    return $output;
1166
+	return $output;
1167 1167
 }
1168 1168
 add_shortcode('gd_listings', 'geodir_sc_gd_listings');
1169 1169
 
@@ -1203,56 +1203,56 @@  discard block
 block discarded – undo
1203 1203
  * @return string HTML content to display CPT categories.
1204 1204
  */
1205 1205
 function geodir_sc_cpt_categories_widget($atts, $content = '') {
1206
-    $defaults = array(
1207
-        'title' => '',
1208
-        'post_type' => '', // NULL for all
1209
-        'hide_empty' => '',
1210
-        'show_count' => '',
1211
-        'hide_icon' => '',
1212
-        'cpt_left' => '',
1213
-        'sort_by' => 'count',
1214
-        'max_count' => 'all',
1215
-        'max_level' => '1',
1216
-        'no_cpt_filter' => '',
1217
-        'no_cat_filter' => '',
1218
-        'before_widget' => '<section id="geodir_cpt_categories_widget-1" class="widget geodir-widget geodir_cpt_categories_widget geodir_sc_cpt_categories_widget">',
1219
-        'after_widget' => '</section>',
1220
-        'before_title' => '<h3 class="widget-title">',
1221
-        'after_title' => '</h3>',
1222
-    );
1223
-    $params = shortcode_atts($defaults, $atts);
1224
-
1225
-    /**
1226
-     * Validate our incoming params
1227
-     */
1228
-    // Make sure we have an array
1229
-    $params['post_type'] = !is_array($params['post_type']) && trim($params['post_type']) != '' ? explode(',', trim($params['post_type'])) : array();
1230
-     
1231
-    // Validate the checkboxes used on the widget
1232
-    $params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1233
-    $params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1234
-    $params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1235
-    $params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1206
+	$defaults = array(
1207
+		'title' => '',
1208
+		'post_type' => '', // NULL for all
1209
+		'hide_empty' => '',
1210
+		'show_count' => '',
1211
+		'hide_icon' => '',
1212
+		'cpt_left' => '',
1213
+		'sort_by' => 'count',
1214
+		'max_count' => 'all',
1215
+		'max_level' => '1',
1216
+		'no_cpt_filter' => '',
1217
+		'no_cat_filter' => '',
1218
+		'before_widget' => '<section id="geodir_cpt_categories_widget-1" class="widget geodir-widget geodir_cpt_categories_widget geodir_sc_cpt_categories_widget">',
1219
+		'after_widget' => '</section>',
1220
+		'before_title' => '<h3 class="widget-title">',
1221
+		'after_title' => '</h3>',
1222
+	);
1223
+	$params = shortcode_atts($defaults, $atts);
1236 1224
 
1237
-    if ($params['max_count'] != 'all') {
1238
-        $params['max_count'] = absint($params['max_count']);
1239
-    }
1225
+	/**
1226
+	 * Validate our incoming params
1227
+	 */
1228
+	// Make sure we have an array
1229
+	$params['post_type'] = !is_array($params['post_type']) && trim($params['post_type']) != '' ? explode(',', trim($params['post_type'])) : array();
1230
+     
1231
+	// Validate the checkboxes used on the widget
1232
+	$params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1233
+	$params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1234
+	$params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1235
+	$params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1236
+
1237
+	if ($params['max_count'] != 'all') {
1238
+		$params['max_count'] = absint($params['max_count']);
1239
+	}
1240 1240
 
1241
-    if ($params['max_level'] != 'all') {
1242
-        $params['max_level'] = absint($params['max_level']);
1243
-    }
1241
+	if ($params['max_level'] != 'all') {
1242
+		$params['max_level'] = absint($params['max_level']);
1243
+	}
1244 1244
 
1245
-    $params['no_cpt_filter'] = gdsc_to_bool_val($params['no_cpt_filter']);
1246
-    $params['no_cat_filter'] = gdsc_to_bool_val($params['no_cat_filter']);
1245
+	$params['no_cpt_filter'] = gdsc_to_bool_val($params['no_cpt_filter']);
1246
+	$params['no_cat_filter'] = gdsc_to_bool_val($params['no_cat_filter']);
1247 1247
 
1248
-    $params['sort_by'] = $params['sort_by'] == 'az' ? 'az' : 'count';
1248
+	$params['sort_by'] = $params['sort_by'] == 'az' ? 'az' : 'count';
1249 1249
 
1250
-    ob_start();
1251
-    the_widget('geodir_cpt_categories_widget', $params, $params);
1252
-    $output = ob_get_contents();
1253
-    ob_end_clean();
1250
+	ob_start();
1251
+	the_widget('geodir_cpt_categories_widget', $params, $params);
1252
+	$output = ob_get_contents();
1253
+	ob_end_clean();
1254 1254
 
1255
-    return $output;
1255
+	return $output;
1256 1256
 }
1257 1257
 add_shortcode('gd_cpt_categories', 'geodir_sc_cpt_categories_widget');
1258 1258
 
@@ -1267,7 +1267,7 @@  discard block
 block discarded – undo
1267 1267
  * @return string HTML code.
1268 1268
  */
1269 1269
 function geodir_sc_responsive_videos($atts, $content) {
1270
-    return '<div class="geodir-video-wrapper">'.$content.'</div>';
1270
+	return '<div class="geodir-video-wrapper">'.$content.'</div>';
1271 1271
 }
1272 1272
 add_shortcode('gd_video', 'geodir_sc_responsive_videos');
1273 1273
 ?>
1274 1274
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-templates/listing-detail.php 2 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 // We are submitting iframes etc so we turn this off to allow them to show on preview.
13 13
 if(geodir_is_page('preview')){
14
-    header("X-XSS-Protection: 0");
14
+	header("X-XSS-Protection: 0");
15 15
 }
16 16
 
17 17
 
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 
39 39
 ###### SIDEBAR ON LEFT ######
40 40
 if (get_option('geodir_detail_sidebar_left_section')) {
41
-    /**
42
-     * Adds the details page sidebar to the details template page.
43
-     *
44
-     * @since 1.1.0
45
-     */
46
-    do_action('geodir_detail_sidebar');
41
+	/**
42
+	 * Adds the details page sidebar to the details template page.
43
+	 *
44
+	 * @since 1.1.0
45
+	 */
46
+	do_action('geodir_detail_sidebar');
47 47
 }
48 48
 
49 49
 ###### MAIN CONTENT WRAPPERS OPEN ######
@@ -72,29 +72,29 @@  discard block
 block discarded – undo
72 72
 // this call the main page content
73 73
 global $preview;
74 74
 if (have_posts() && !$preview) {
75
-    the_post();
76
-    global $post, $post_images;
77
-    /**
78
-     * Calls the details page main content on the details template page.
79
-     *
80
-     * @since 1.1.0
81
-     * @param object $post The current post object.
82
-     */
83
-    do_action('geodir_details_main_content', $post);
75
+	the_post();
76
+	global $post, $post_images;
77
+	/**
78
+	 * Calls the details page main content on the details template page.
79
+	 *
80
+	 * @since 1.1.0
81
+	 * @param object $post The current post object.
82
+	 */
83
+	do_action('geodir_details_main_content', $post);
84 84
 } elseif ($preview) {
85
-    /**
86
-     * Called on the details page if the page is being previewed.
87
-     *
88
-     * This sets the value of `$post` to the preview values before the main content is called.
89
-     *
90
-     * @since 1.1.0
91
-     */
92
-    do_action('geodir_action_geodir_set_preview_post'); // set the $post to the preview values
93
-    if (defined( 'GD_TESTING_MODE' )) {
94
-        global $post;
95
-    }
96
-    /** This action is documented in geodirectory-templates/listing-detail.php */
97
-    do_action('geodir_details_main_content', $post);
85
+	/**
86
+	 * Called on the details page if the page is being previewed.
87
+	 *
88
+	 * This sets the value of `$post` to the preview values before the main content is called.
89
+	 *
90
+	 * @since 1.1.0
91
+	 */
92
+	do_action('geodir_action_geodir_set_preview_post'); // set the $post to the preview values
93
+	if (defined( 'GD_TESTING_MODE' )) {
94
+		global $post;
95
+	}
96
+	/** This action is documented in geodirectory-templates/listing-detail.php */
97
+	do_action('geodir_details_main_content', $post);
98 98
 }
99 99
 
100 100
 /** This action is documented in geodirectory-templates/geodir-home.php */
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 
119 119
 ###### SIDEBAR ON RIGHT ######
120 120
 if (!get_option('geodir_detail_sidebar_left_section')) {
121
-    /** This action is documented in geodirectory-templates/listing-detail.php */
122
-    do_action('geodir_detail_sidebar');
121
+	/** This action is documented in geodirectory-templates/listing-detail.php */
122
+	do_action('geodir_detail_sidebar');
123 123
 }
124 124
 
125 125
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // We are submitting iframes etc so we turn this off to allow them to show on preview.
13
-if(geodir_is_page('preview')){
13
+if (geodir_is_page('preview')) {
14 14
     header("X-XSS-Protection: 0");
15 15
 }
16 16
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
  * @param string $itemtype The itemtype value of the HTML element.
64 64
  * @see 'geodir_article_close'
65 65
  */
66
-do_action('geodir_article_open', 'details-page', 'post-' . get_the_ID(), get_post_class(), '');
66
+do_action('geodir_article_open', 'details-page', 'post-'.get_the_ID(), get_post_class(), '');
67 67
 
68 68
 ###### MAIN CONTENT ######
69 69
 /** This action is documented in geodirectory-templates/geodir-home.php */
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      * @since 1.1.0
91 91
      */
92 92
     do_action('geodir_action_geodir_set_preview_post'); // set the $post to the preview values
93
-    if (defined( 'GD_TESTING_MODE' )) {
93
+    if (defined('GD_TESTING_MODE')) {
94 94
         global $post;
95 95
     }
96 96
     /** This action is documented in geodirectory-templates/listing-detail.php */
Please login to merge, or discard this patch.
geodirectory-functions/general_functions.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2301,7 +2301,7 @@  discard block
 block discarded – undo
2301 2301
  * @global string $table_prefix  WordPress Database Table prefix.
2302 2302
  *
2303 2303
  * @param array $query_args      The query array.
2304
- * @param  int|bool $count_only  If true returns listings count only, otherwise returns array
2304
+ * @param  boolean $count_only  If true returns listings count only, otherwise returns array
2305 2305
  *
2306 2306
  * @return mixed Result object.
2307 2307
  */
@@ -3958,7 +3958,7 @@  discard block
 block discarded – undo
3958 3958
  * @since   1.0.0
3959 3959
  * @since   1.6.1 Fixed add listing page load time.
3960 3960
  * @package GeoDirectory
3961
- * @return bool
3961
+ * @return null|boolean
3962 3962
  */
3963 3963
 function geodir_term_review_count_force_update( $new_status, $old_status = '', $post = '' ) {
3964 3964
 	if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'geodir_import_export' ) {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 			break;
302 302
 		case 'preview':
303 303
 			if ( ( is_page() && get_query_var( 'page_id' ) == geodir_preview_page_id() ) && isset( $_REQUEST['listing_type'] )
304
-			     && in_array( $_REQUEST['listing_type'], geodir_get_posttypes() )
304
+				 && in_array( $_REQUEST['listing_type'], geodir_get_posttypes() )
305 305
 			) {
306 306
 				return true;
307 307
 			}
@@ -505,9 +505,9 @@  discard block
 block discarded – undo
505 505
 
506 506
 //check if homepage
507 507
 		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] )
508
-		     && ! isset( $wp->query_vars['page_id'] )
509
-		     && ! isset( $wp->query_vars['pagename'] )
510
-		     && is_page_geodir_home()
508
+			 && ! isset( $wp->query_vars['page_id'] )
509
+			 && ! isset( $wp->query_vars['pagename'] )
510
+			 && is_page_geodir_home()
511 511
 		) {
512 512
 			$wp->query_vars['gd_is_geodir_page'] = true;
513 513
 		}
@@ -692,8 +692,8 @@  discard block
 block discarded – undo
692 692
 		$deltaLatitude  = deg2rad( (float) $point2['latitude'] - (float) $point1['latitude'] );
693 693
 		$deltaLongitude = deg2rad( (float) $point2['longitude'] - (float) $point1['longitude'] );
694 694
 		$a              = sin( $deltaLatitude / 2 ) * sin( $deltaLatitude / 2 ) +
695
-		                  cos( deg2rad( (float) $point1['latitude'] ) ) * cos( deg2rad( (float) $point2['latitude'] ) ) *
696
-		                  sin( $deltaLongitude / 2 ) * sin( $deltaLongitude / 2 );
695
+						  cos( deg2rad( (float) $point1['latitude'] ) ) * cos( deg2rad( (float) $point2['latitude'] ) ) *
696
+						  sin( $deltaLongitude / 2 ) * sin( $deltaLongitude / 2 );
697 697
 		$c              = 2 * atan2( sqrt( $a ), sqrt( 1 - $a ) );
698 698
 		$distance       = $earthMeanRadius * $c;
699 699
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,8 +29,10 @@  discard block
 block discarded – undo
29 29
 
30 30
 	if ( is_ssl() ) :
31 31
 		return str_replace( 'http://', 'https://', WP_PLUGIN_URL ) . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
32
-	else :
33
-		return WP_PLUGIN_URL . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
32
+	else {
33
+		:
34
+		return WP_PLUGIN_URL . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
35
+	}
34 36
 	endif;
35 37
 }
36 38
 
@@ -764,7 +766,7 @@  discard block
 block discarded – undo
764 766
 			$post_author = get_post_field( 'post_author', $post_id );
765 767
 			if(is_super_admin( $post_author  )){// if admin probably not the post author so change name
766 768
 				$toEmailName = __('Business Owner','geodirectory');
767
-			}elseif(defined('GEODIRCLAIM_VERSION') && geodir_get_post_meta($post_id,'claimed')!='1'){// if claim manager installed but listing not claimed
769
+			} elseif(defined('GEODIRCLAIM_VERSION') && geodir_get_post_meta($post_id,'claimed')!='1'){// if claim manager installed but listing not claimed
768 770
 				$toEmailName = __('Business Owner','geodirectory');
769 771
 			}
770 772
 
@@ -1569,12 +1571,14 @@  discard block
 block discarded – undo
1569 1571
 	 */
1570 1572
 	function geodir_allow_wpadmin() {
1571 1573
 		global $wpdb;
1572
-		if ( get_option( 'geodir_allow_wpadmin' ) == '0' && is_user_logged_in() && ( ! defined( 'DOING_AJAX' ) ) ) // checking action in request to allow ajax request go through
1574
+		if ( get_option( 'geodir_allow_wpadmin' ) == '0' && is_user_logged_in() && ( ! defined( 'DOING_AJAX' ) ) ) {
1575
+			// checking action in request to allow ajax request go through
1573 1576
 		{
1574 1577
 			if ( current_user_can( 'administrator' ) ) {
1575 1578
 			} else {
1576 1579
 
1577
-				wp_redirect( home_url() );
1580
+				wp_redirect( home_url() );
1581
+		}
1578 1582
 				exit;
1579 1583
 			}
1580 1584
 
Please login to merge, or discard this patch.
Spacing   +1346 added lines, -1346 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 /**
11 11
  * Get All Plugin functions from WordPress
12 12
  */
13
-include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
13
+include_once(ABSPATH.'wp-admin/includes/plugin.php');
14 14
 
15 15
 /*-----------------------------------------------------------------------------------*/
16 16
 /* Helper functions */
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
  */
28 28
 function geodir_plugin_url() {
29 29
 
30
-	if ( is_ssl() ) :
31
-		return str_replace( 'http://', 'https://', WP_PLUGIN_URL ) . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
30
+	if (is_ssl()) :
31
+		return str_replace('http://', 'https://', WP_PLUGIN_URL)."/".plugin_basename(dirname(dirname(__FILE__)));
32 32
 	else :
33
-		return WP_PLUGIN_URL . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
33
+		return WP_PLUGIN_URL."/".plugin_basename(dirname(dirname(__FILE__)));
34 34
 	endif;
35 35
 }
36 36
 
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
  * @return string example url eg: /home/geo/public_html/wp-content/plugins/geodirectory
46 46
  */
47 47
 function geodir_plugin_path() {
48
-	if ( defined( 'GD_TESTING_MODE' ) && GD_TESTING_MODE ) {
49
-		return dirname( dirname( __FILE__ ) );
48
+	if (defined('GD_TESTING_MODE') && GD_TESTING_MODE) {
49
+		return dirname(dirname(__FILE__));
50 50
 	} else {
51
-		return WP_PLUGIN_DIR . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
51
+		return WP_PLUGIN_DIR."/".plugin_basename(dirname(dirname(__FILE__)));
52 52
 	}
53 53
 }
54 54
 
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
  * @return bool true or false.
64 64
  * @todo    check if this is faster than normal WP check and remove if not.
65 65
  */
66
-function geodir_is_plugin_active( $plugin ) {
67
-	$active_plugins = get_option( 'active_plugins' );
68
-	foreach ( $active_plugins as $key => $active_plugin ) {
69
-		if ( strstr( $active_plugin, $plugin ) ) {
66
+function geodir_is_plugin_active($plugin) {
67
+	$active_plugins = get_option('active_plugins');
68
+	foreach ($active_plugins as $key => $active_plugin) {
69
+		if (strstr($active_plugin, $plugin)) {
70 70
 			return true;
71 71
 		}
72 72
 	}
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
  *
89 89
  * @return bool|int|string the formatted date.
90 90
  */
91
-function geodir_get_formated_date( $date ) {
92
-	return mysql2date( get_option( 'date_format' ), $date );
91
+function geodir_get_formated_date($date) {
92
+	return mysql2date(get_option('date_format'), $date);
93 93
 }
94 94
 
95 95
 /**
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
  *
106 106
  * @return bool|int|string the formatted time.
107 107
  */
108
-function geodir_get_formated_time( $time ) {
109
-	return mysql2date( get_option( 'time_format' ), $time, $translate = true );
108
+function geodir_get_formated_time($time) {
109
+	return mysql2date(get_option('time_format'), $time, $translate = true);
110 110
 }
111 111
 
112 112
 
@@ -124,35 +124,35 @@  discard block
 block discarded – undo
124 124
  *
125 125
  * @return string Formatted link.
126 126
  */
127
-function geodir_getlink( $url, $params = array(), $use_existing_arguments = false ) {
128
-	if ( $use_existing_arguments ) {
127
+function geodir_getlink($url, $params = array(), $use_existing_arguments = false) {
128
+	if ($use_existing_arguments) {
129 129
 		$params = $params + $_GET;
130 130
 	}
131
-	if ( ! $params ) {
131
+	if (!$params) {
132 132
 		return $url;
133 133
 	}
134 134
 	$link = $url;
135
-	if ( strpos( $link, '?' ) === false ) {
135
+	if (strpos($link, '?') === false) {
136 136
 		$link .= '?';
137 137
 	} //If there is no '?' add one at the end
138
-	elseif ( strpos( $link, '//maps.google.com/maps/api/js?language=' ) ) {
138
+	elseif (strpos($link, '//maps.google.com/maps/api/js?language=')) {
139 139
 		$link .= '&amp;';
140 140
 	} //If there is no '&' at the END, add one.
141
-	elseif ( ! preg_match( '/(\?|\&(amp;)?)$/', $link ) ) {
141
+	elseif (!preg_match('/(\?|\&(amp;)?)$/', $link)) {
142 142
 		$link .= '&';
143 143
 	} //If there is no '&' at the END, add one.
144 144
 
145 145
 	$params_arr = array();
146
-	foreach ( $params as $key => $value ) {
147
-		if ( gettype( $value ) == 'array' ) { //Handle array data properly
148
-			foreach ( $value as $val ) {
149
-				$params_arr[] = $key . '[]=' . urlencode( $val );
146
+	foreach ($params as $key => $value) {
147
+		if (gettype($value) == 'array') { //Handle array data properly
148
+			foreach ($value as $val) {
149
+				$params_arr[] = $key.'[]='.urlencode($val);
150 150
 			}
151 151
 		} else {
152
-			$params_arr[] = $key . '=' . urlencode( $value );
152
+			$params_arr[] = $key.'='.urlencode($value);
153 153
 		}
154 154
 	}
155
-	$link .= implode( '&', $params_arr );
155
+	$link .= implode('&', $params_arr);
156 156
 
157 157
 	return $link;
158 158
 }
@@ -169,18 +169,18 @@  discard block
 block discarded – undo
169 169
  *
170 170
  * @return string Listing page url if valid. Otherwise home url will be returned.
171 171
  */
172
-function geodir_get_addlisting_link( $post_type = '' ) {
172
+function geodir_get_addlisting_link($post_type = '') {
173 173
 	global $wpdb;
174 174
 
175 175
 	//$check_pkg  = $wpdb->get_var("SELECT pid FROM ".GEODIR_PRICE_TABLE." WHERE post_type='".$post_type."' and status != '0'");
176 176
 	$check_pkg = 1;
177
-	if ( post_type_exists( $post_type ) && $check_pkg ) {
177
+	if (post_type_exists($post_type) && $check_pkg) {
178 178
 
179
-		$add_listing_link = get_page_link( geodir_add_listing_page_id() );
179
+		$add_listing_link = get_page_link(geodir_add_listing_page_id());
180 180
 
181
-		return esc_url( add_query_arg( array( 'listing_type' => $post_type ), $add_listing_link ) );
181
+		return esc_url(add_query_arg(array('listing_type' => $post_type), $add_listing_link));
182 182
 	} else {
183
-		return get_bloginfo( 'url' );
183
+		return get_bloginfo('url');
184 184
 	}
185 185
 }
186 186
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	if (!empty($_SERVER['PHP_SELF']) && !empty($_SERVER['REQUEST_URI'])) {
209 209
 		// To build the entire URI we need to prepend the protocol, and the http host
210 210
 		// to the URI string.
211
-		$pageURL .= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
211
+		$pageURL .= $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
212 212
 	} else {
213 213
 		/*
214 214
 		 * Since we do not have REQUEST_URI to work with, we will assume we are
@@ -217,11 +217,11 @@  discard block
 block discarded – undo
217 217
 		 *
218 218
 		 * IIS uses the SCRIPT_NAME variable instead of a REQUEST_URI variable... thanks, MS
219 219
 		 */
220
-		$pageURL .= $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
220
+		$pageURL .= $_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
221 221
 		
222 222
 		// If the query string exists append it to the URI string
223 223
 		if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
224
-			$pageURL .= '?' . $_SERVER['QUERY_STRING'];
224
+			$pageURL .= '?'.$_SERVER['QUERY_STRING'];
225 225
 		}
226 226
 	}
227 227
 	
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 	 *
233 233
 	 * @param string $pageURL The URL of the current page.
234 234
 	 */
235
-	return apply_filters( 'geodir_curPageURL', $pageURL );
235
+	return apply_filters('geodir_curPageURL', $pageURL);
236 236
 }
237 237
 
238 238
 /**
@@ -247,12 +247,12 @@  discard block
 block discarded – undo
247 247
  *
248 248
  * @return string Cleaned variable.
249 249
  */
250
-function geodir_clean( $string ) {
250
+function geodir_clean($string) {
251 251
 
252
-	$string = trim( strip_tags( stripslashes( $string ) ) );
253
-	$string = str_replace( " ", "-", $string ); // Replaces all spaces with hyphens.
254
-	$string = preg_replace( '/[^A-Za-z0-9\-\_]/', '', $string ); // Removes special chars.
255
-	$string = preg_replace( '/-+/', '-', $string ); // Replaces multiple hyphens with single one.
252
+	$string = trim(strip_tags(stripslashes($string)));
253
+	$string = str_replace(" ", "-", $string); // Replaces all spaces with hyphens.
254
+	$string = preg_replace('/[^A-Za-z0-9\-\_]/', '', $string); // Removes special chars.
255
+	$string = preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one.
256 256
 
257 257
 	return $string;
258 258
 }
@@ -266,13 +266,13 @@  discard block
 block discarded – undo
266 266
  */
267 267
 function geodir_get_weekday() {
268 268
 	return array(
269
-		__( 'Sunday', 'geodirectory' ),
270
-		__( 'Monday', 'geodirectory' ),
271
-		__( 'Tuesday', 'geodirectory' ),
272
-		__( 'Wednesday', 'geodirectory' ),
273
-		__( 'Thursday', 'geodirectory' ),
274
-		__( 'Friday', 'geodirectory' ),
275
-		__( 'Saturday', 'geodirectory' )
269
+		__('Sunday', 'geodirectory'),
270
+		__('Monday', 'geodirectory'),
271
+		__('Tuesday', 'geodirectory'),
272
+		__('Wednesday', 'geodirectory'),
273
+		__('Thursday', 'geodirectory'),
274
+		__('Friday', 'geodirectory'),
275
+		__('Saturday', 'geodirectory')
276 276
 	);
277 277
 }
278 278
 
@@ -285,11 +285,11 @@  discard block
 block discarded – undo
285 285
  */
286 286
 function geodir_get_weeks() {
287 287
 	return array(
288
-		__( 'First', 'geodirectory' ),
289
-		__( 'Second', 'geodirectory' ),
290
-		__( 'Third', 'geodirectory' ),
291
-		__( 'Fourth', 'geodirectory' ),
292
-		__( 'Last', 'geodirectory' )
288
+		__('First', 'geodirectory'),
289
+		__('Second', 'geodirectory'),
290
+		__('Third', 'geodirectory'),
291
+		__('Fourth', 'geodirectory'),
292
+		__('Last', 'geodirectory')
293 293
 	);
294 294
 }
295 295
 
@@ -308,112 +308,112 @@  discard block
 block discarded – undo
308 308
  *
309 309
  * @return bool If valid returns true. Otherwise false.
310 310
  */
311
-function geodir_is_page( $gdpage = '' ) {
311
+function geodir_is_page($gdpage = '') {
312 312
 
313 313
 	global $wp_query, $post, $wp;
314 314
 	//if(!is_admin()):
315 315
 
316
-	switch ( $gdpage ):
316
+	switch ($gdpage):
317 317
 		case 'add-listing':
318 318
 
319
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_add_listing_page_id() ) {
319
+			if (is_page() && get_query_var('page_id') == geodir_add_listing_page_id()) {
320 320
 				return true;
321
-			} elseif ( is_page() && isset( $post->post_content ) && has_shortcode( $post->post_content, 'gd_add_listing' ) ) {
321
+			} elseif (is_page() && isset($post->post_content) && has_shortcode($post->post_content, 'gd_add_listing')) {
322 322
 				return true;
323 323
 			}
324 324
 
325 325
 			break;
326 326
 		case 'preview':
327
-			if ( ( is_page() && get_query_var( 'page_id' ) == geodir_preview_page_id() ) && isset( $_REQUEST['listing_type'] )
328
-			     && in_array( $_REQUEST['listing_type'], geodir_get_posttypes() )
327
+			if ((is_page() && get_query_var('page_id') == geodir_preview_page_id()) && isset($_REQUEST['listing_type'])
328
+			     && in_array($_REQUEST['listing_type'], geodir_get_posttypes())
329 329
 			) {
330 330
 				return true;
331 331
 			}
332 332
 			break;
333 333
 		case 'listing-success':
334
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_success_page_id() ) {
334
+			if (is_page() && get_query_var('page_id') == geodir_success_page_id()) {
335 335
 				return true;
336 336
 			}
337 337
 			break;
338 338
 		case 'detail':
339
-			$post_type = get_query_var( 'post_type' );
340
-			if ( is_array( $post_type ) ) {
341
-				$post_type = reset( $post_type );
339
+			$post_type = get_query_var('post_type');
340
+			if (is_array($post_type)) {
341
+				$post_type = reset($post_type);
342 342
 			}
343
-			if ( is_single() && in_array( $post_type, geodir_get_posttypes() ) ) {
343
+			if (is_single() && in_array($post_type, geodir_get_posttypes())) {
344 344
 				return true;
345 345
 			}
346 346
 			break;
347 347
 		case 'pt':
348
-			$post_type = get_query_var( 'post_type' );
349
-			if ( is_array( $post_type ) ) {
350
-				$post_type = reset( $post_type );
348
+			$post_type = get_query_var('post_type');
349
+			if (is_array($post_type)) {
350
+				$post_type = reset($post_type);
351 351
 			}
352
-			if ( is_post_type_archive() && in_array( $post_type, geodir_get_posttypes() ) && ! is_tax() ) {
352
+			if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes()) && !is_tax()) {
353 353
 				return true;
354 354
 			}
355 355
 
356 356
 			break;
357 357
 		case 'listing':
358
-			if ( is_tax() && geodir_get_taxonomy_posttype() ) {
358
+			if (is_tax() && geodir_get_taxonomy_posttype()) {
359 359
 				global $current_term, $taxonomy, $term;
360 360
 
361 361
 				return true;
362 362
 			}
363
-			$post_type = get_query_var( 'post_type' );
364
-			if ( is_array( $post_type ) ) {
365
-				$post_type = reset( $post_type );
363
+			$post_type = get_query_var('post_type');
364
+			if (is_array($post_type)) {
365
+				$post_type = reset($post_type);
366 366
 			}
367
-			if ( is_post_type_archive() && in_array( $post_type, geodir_get_posttypes() ) ) {
367
+			if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes())) {
368 368
 				return true;
369 369
 			}
370 370
 
371 371
 			break;
372 372
 		case 'home':
373 373
 
374
-			if ( ( is_page() && get_query_var( 'page_id' ) == geodir_home_page_id() ) || is_page_geodir_home() ) {
374
+			if ((is_page() && get_query_var('page_id') == geodir_home_page_id()) || is_page_geodir_home()) {
375 375
 				return true;
376 376
 			}
377 377
 
378 378
 			break;
379 379
 		case 'location':
380
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_location_page_id() ) {
380
+			if (is_page() && get_query_var('page_id') == geodir_location_page_id()) {
381 381
 				return true;
382 382
 			}
383 383
 			break;
384 384
 		case 'author':
385
-			if ( is_author() && isset( $_REQUEST['geodir_dashbord'] ) ) {
385
+			if (is_author() && isset($_REQUEST['geodir_dashbord'])) {
386 386
 				return true;
387 387
 			}
388 388
 
389
-			if ( function_exists( 'bp_loggedin_user_id' ) && function_exists( 'bp_displayed_user_id' ) && $my_id = (int) bp_loggedin_user_id() ) {
390
-				if ( ( (bool) bp_is_current_component( 'listings' ) || (bool) bp_is_current_component( 'favorites' ) ) && $my_id > 0 && $my_id == (int) bp_displayed_user_id() ) {
389
+			if (function_exists('bp_loggedin_user_id') && function_exists('bp_displayed_user_id') && $my_id = (int) bp_loggedin_user_id()) {
390
+				if (((bool) bp_is_current_component('listings') || (bool) bp_is_current_component('favorites')) && $my_id > 0 && $my_id == (int) bp_displayed_user_id()) {
391 391
 					return true;
392 392
 				}
393 393
 			}
394 394
 			break;
395 395
 		case 'search':
396
-			if ( is_search() && isset( $_REQUEST['geodir_search'] ) ) {
396
+			if (is_search() && isset($_REQUEST['geodir_search'])) {
397 397
 				return true;
398 398
 			}
399 399
 			break;
400 400
 		case 'info':
401
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_info_page_id() ) {
401
+			if (is_page() && get_query_var('page_id') == geodir_info_page_id()) {
402 402
 				return true;
403 403
 			}
404 404
 			break;
405 405
 		case 'login':
406
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_login_page_id() ) {
406
+			if (is_page() && get_query_var('page_id') == geodir_login_page_id()) {
407 407
 				return true;
408 408
 			}
409 409
 			break;
410 410
 		case 'checkout':
411
-			if ( is_page() && function_exists( 'geodir_payment_checkout_page_id' ) && get_query_var( 'page_id' ) == geodir_payment_checkout_page_id() ) {
411
+			if (is_page() && function_exists('geodir_payment_checkout_page_id') && get_query_var('page_id') == geodir_payment_checkout_page_id()) {
412 412
 				return true;
413 413
 			}
414 414
 			break;
415 415
 		case 'invoices':
416
-			if ( is_page() && function_exists( 'geodir_payment_invoices_page_id' ) && get_query_var( 'page_id' ) == geodir_payment_invoices_page_id() ) {
416
+			if (is_page() && function_exists('geodir_payment_invoices_page_id') && get_query_var('page_id') == geodir_payment_invoices_page_id()) {
417 417
 				return true;
418 418
 			}
419 419
 			break;
@@ -438,25 +438,25 @@  discard block
 block discarded – undo
438 438
  *
439 439
  * @param object $wp WordPress object.
440 440
  */
441
-function geodir_set_is_geodir_page( $wp ) {
442
-	if ( ! is_admin() ) {
441
+function geodir_set_is_geodir_page($wp) {
442
+	if (!is_admin()) {
443 443
 		//$wp->query_vars['gd_is_geodir_page'] = false;
444 444
 		//print_r()
445
-		if ( empty( $wp->query_vars ) || ! array_diff( array_keys( $wp->query_vars ), array(
445
+		if (empty($wp->query_vars) || !array_diff(array_keys($wp->query_vars), array(
446 446
 				'preview',
447 447
 				'page',
448 448
 				'paged',
449 449
 				'cpage'
450
-			) )
450
+			))
451 451
 		) {
452
-			if ( geodir_is_page( 'home' ) ) {
452
+			if (geodir_is_page('home')) {
453 453
 				$wp->query_vars['gd_is_geodir_page'] = true;
454 454
 			}
455 455
 
456 456
 
457 457
 		}
458 458
 
459
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['page_id'] ) ) {
459
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['page_id'])) {
460 460
 			if (
461 461
 				$wp->query_vars['page_id'] == geodir_add_listing_page_id()
462 462
 				|| $wp->query_vars['page_id'] == geodir_preview_page_id()
@@ -465,26 +465,26 @@  discard block
 block discarded – undo
465 465
 				|| $wp->query_vars['page_id'] == geodir_home_page_id()
466 466
 				|| $wp->query_vars['page_id'] == geodir_info_page_id()
467 467
 				|| $wp->query_vars['page_id'] == geodir_login_page_id()
468
-				|| ( function_exists( 'geodir_payment_checkout_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id() )
469
-				|| ( function_exists( 'geodir_payment_invoices_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id() )
468
+				|| (function_exists('geodir_payment_checkout_page_id') && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id())
469
+				|| (function_exists('geodir_payment_invoices_page_id') && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id())
470 470
 			) {
471 471
 				$wp->query_vars['gd_is_geodir_page'] = true;
472 472
 			}
473 473
 		}
474 474
 
475
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['pagename'] ) ) {
476
-			$page = get_page_by_path( $wp->query_vars['pagename'] );
475
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['pagename'])) {
476
+			$page = get_page_by_path($wp->query_vars['pagename']);
477 477
 
478
-			if ( ! empty( $page ) && (
478
+			if (!empty($page) && (
479 479
 					$page->ID == geodir_add_listing_page_id()
480 480
 					|| $page->ID == geodir_preview_page_id()
481 481
 					|| $page->ID == geodir_success_page_id()
482 482
 					|| $page->ID == geodir_location_page_id()
483
-					|| ( isset( $wp->query_vars['page_id'] ) && $wp->query_vars['page_id'] == geodir_home_page_id() )
484
-					|| ( isset( $wp->query_vars['page_id'] ) && $wp->query_vars['page_id'] == geodir_info_page_id() )
485
-					|| ( isset( $wp->query_vars['page_id'] ) && $wp->query_vars['page_id'] == geodir_login_page_id() )
486
-					|| ( isset( $wp->query_vars['page_id'] ) && function_exists( 'geodir_payment_checkout_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id() )
487
-					|| ( isset( $wp->query_vars['page_id'] ) && function_exists( 'geodir_payment_invoices_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id() )
483
+					|| (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_home_page_id())
484
+					|| (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_info_page_id())
485
+					|| (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_login_page_id())
486
+					|| (isset($wp->query_vars['page_id']) && function_exists('geodir_payment_checkout_page_id') && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id())
487
+					|| (isset($wp->query_vars['page_id']) && function_exists('geodir_payment_invoices_page_id') && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id())
488 488
 				)
489 489
 			) {
490 490
 				$wp->query_vars['gd_is_geodir_page'] = true;
@@ -492,20 +492,20 @@  discard block
 block discarded – undo
492 492
 		}
493 493
 
494 494
 
495
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['post_type'] ) && $wp->query_vars['post_type'] != '' ) {
495
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['post_type']) && $wp->query_vars['post_type'] != '') {
496 496
 			$requested_post_type = $wp->query_vars['post_type'];
497 497
 			// check if this post type is geodirectory post types
498 498
 			$post_type_array = geodir_get_posttypes();
499
-			if ( in_array( $requested_post_type, $post_type_array ) ) {
499
+			if (in_array($requested_post_type, $post_type_array)) {
500 500
 				$wp->query_vars['gd_is_geodir_page'] = true;
501 501
 			}
502 502
 		}
503 503
 
504
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) ) {
505
-			$geodir_taxonomis = geodir_get_taxonomies( '', true );
506
-			if ( ! empty( $geodir_taxonomis ) ) {
507
-				foreach ( $geodir_taxonomis as $taxonomy ) {
508
-					if ( array_key_exists( $taxonomy, $wp->query_vars ) ) {
504
+		if (!isset($wp->query_vars['gd_is_geodir_page'])) {
505
+			$geodir_taxonomis = geodir_get_taxonomies('', true);
506
+			if (!empty($geodir_taxonomis)) {
507
+				foreach ($geodir_taxonomis as $taxonomy) {
508
+					if (array_key_exists($taxonomy, $wp->query_vars)) {
509 509
 						$wp->query_vars['gd_is_geodir_page'] = true;
510 510
 						break;
511 511
 					}
@@ -514,20 +514,20 @@  discard block
 block discarded – undo
514 514
 
515 515
 		}
516 516
 
517
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['author_name'] ) && isset( $_REQUEST['geodir_dashbord'] ) ) {
517
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['author_name']) && isset($_REQUEST['geodir_dashbord'])) {
518 518
 			$wp->query_vars['gd_is_geodir_page'] = true;
519 519
 		}
520 520
 
521 521
 
522
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $_REQUEST['geodir_search'] ) ) {
522
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($_REQUEST['geodir_search'])) {
523 523
 			$wp->query_vars['gd_is_geodir_page'] = true;
524 524
 		}
525 525
 
526 526
 
527 527
 //check if homepage
528
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] )
529
-		     && ! isset( $wp->query_vars['page_id'] )
530
-		     && ! isset( $wp->query_vars['pagename'] )
528
+		if (!isset($wp->query_vars['gd_is_geodir_page'])
529
+		     && !isset($wp->query_vars['page_id'])
530
+		     && !isset($wp->query_vars['pagename'])
531 531
 		     && is_page_geodir_home()
532 532
 		) {
533 533
 			$wp->query_vars['gd_is_geodir_page'] = true;
@@ -551,14 +551,14 @@  discard block
 block discarded – undo
551 551
  */
552 552
 function geodir_is_geodir_page() {
553 553
 	global $wp;
554
-	if ( isset( $wp->query_vars['gd_is_geodir_page'] ) && $wp->query_vars['gd_is_geodir_page'] ) {
554
+	if (isset($wp->query_vars['gd_is_geodir_page']) && $wp->query_vars['gd_is_geodir_page']) {
555 555
 		return true;
556 556
 	} else {
557 557
 		return false;
558 558
 	}
559 559
 }
560 560
 
561
-if ( ! function_exists( 'geodir_get_imagesize' ) ) {
561
+if (!function_exists('geodir_get_imagesize')) {
562 562
 	/**
563 563
 	 * Get image size using the size key .
564 564
 	 *
@@ -569,13 +569,13 @@  discard block
 block discarded – undo
569 569
 	 *
570 570
 	 * @return array|mixed|void|WP_Error If valid returns image size. Else returns error.
571 571
 	 */
572
-	function geodir_get_imagesize( $size = '' ) {
572
+	function geodir_get_imagesize($size = '') {
573 573
 
574 574
 		$imagesizes = array(
575
-			'list-thumb'   => array( 'w' => 283, 'h' => 188 ),
576
-			'thumbnail'    => array( 'w' => 125, 'h' => 125 ),
577
-			'widget-thumb' => array( 'w' => 50, 'h' => 50 ),
578
-			'slider-thumb' => array( 'w' => 100, 'h' => 100 )
575
+			'list-thumb'   => array('w' => 283, 'h' => 188),
576
+			'thumbnail'    => array('w' => 125, 'h' => 125),
577
+			'widget-thumb' => array('w' => 50, 'h' => 50),
578
+			'slider-thumb' => array('w' => 100, 'h' => 100)
579 579
 		);
580 580
 
581 581
 		/**
@@ -585,9 +585,9 @@  discard block
 block discarded – undo
585 585
 		 *
586 586
 		 * @param array $imagesizes Image size array.
587 587
 		 */
588
-		$imagesizes = apply_filters( 'geodir_imagesizes', $imagesizes );
588
+		$imagesizes = apply_filters('geodir_imagesizes', $imagesizes);
589 589
 
590
-		if ( ! empty( $size ) && array_key_exists( $size, $imagesizes ) ) {
590
+		if (!empty($size) && array_key_exists($size, $imagesizes)) {
591 591
 			/**
592 592
 			 * Filters image size of the passed key.
593 593
 			 *
@@ -595,11 +595,11 @@  discard block
 block discarded – undo
595 595
 			 *
596 596
 			 * @param array $imagesizes [$size] Image size array of the passed key.
597 597
 			 */
598
-			return apply_filters( 'geodir_get_imagesize_' . $size, $imagesizes[ $size ] );
598
+			return apply_filters('geodir_get_imagesize_'.$size, $imagesizes[$size]);
599 599
 
600
-		} elseif ( ! empty( $size ) ) {
600
+		} elseif (!empty($size)) {
601 601
 
602
-			return new WP_Error( 'geodir_no_imagesize', __( "Given image size is not valid", 'geodirectory' ) );
602
+			return new WP_Error('geodir_no_imagesize', __("Given image size is not valid", 'geodirectory'));
603 603
 
604 604
 		}
605 605
 
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 */
624 624
 
625 625
 
626
-if ( ! function_exists( 'createRandomString' ) ) {
626
+if (!function_exists('createRandomString')) {
627 627
 	/**
628 628
 	 * Creates random string.
629 629
 	 *
@@ -633,21 +633,21 @@  discard block
 block discarded – undo
633 633
 	 */
634 634
 	function createRandomString() {
635 635
 		$chars = "abcdefghijkmlnopqrstuvwxyz1023456789";
636
-		srand( (double) microtime() * 1000000 );
636
+		srand((double) microtime() * 1000000);
637 637
 		$i       = 0;
638 638
 		$rstring = '';
639
-		while ( $i <= 25 ) {
639
+		while ($i <= 25) {
640 640
 			$num     = rand() % 33;
641
-			$tmp     = substr( $chars, $num, 1 );
642
-			$rstring = $rstring . $tmp;
643
-			$i ++;
641
+			$tmp     = substr($chars, $num, 1);
642
+			$rstring = $rstring.$tmp;
643
+			$i++;
644 644
 		}
645 645
 
646 646
 		return $rstring;
647 647
 	}
648 648
 }
649 649
 
650
-if ( ! function_exists( 'geodir_getDistanceRadius' ) ) {
650
+if (!function_exists('geodir_getDistanceRadius')) {
651 651
 	/**
652 652
 	 * Calculates the distance radius.
653 653
 	 *
@@ -658,9 +658,9 @@  discard block
 block discarded – undo
658 658
 	 *
659 659
 	 * @return float The mean radius.
660 660
 	 */
661
-	function geodir_getDistanceRadius( $uom = 'km' ) {
661
+	function geodir_getDistanceRadius($uom = 'km') {
662 662
 //	Use Haversine formula to calculate the great circle distance between two points identified by longitude and latitude
663
-		switch ( geodir_strtolower( $uom ) ):
663
+		switch (geodir_strtolower($uom)):
664 664
 			case 'km'    :
665 665
 				$earthMeanRadius = 6371.009; // km
666 666
 				break;
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
 }
693 693
 
694 694
 
695
-if ( ! function_exists( 'geodir_calculateDistanceFromLatLong' ) ) {
695
+if (!function_exists('geodir_calculateDistanceFromLatLong')) {
696 696
 	/**
697 697
 	 * Calculate the great circle distance between two points identified by longitude and latitude.
698 698
 	 *
@@ -705,17 +705,17 @@  discard block
 block discarded – undo
705 705
 	 *
706 706
 	 * @return float The distance.
707 707
 	 */
708
-	function geodir_calculateDistanceFromLatLong( $point1, $point2, $uom = 'km' ) {
708
+	function geodir_calculateDistanceFromLatLong($point1, $point2, $uom = 'km') {
709 709
 //	Use Haversine formula to calculate the great circle distance between two points identified by longitude and latitude
710 710
 
711
-		$earthMeanRadius = geodir_getDistanceRadius( $uom );
711
+		$earthMeanRadius = geodir_getDistanceRadius($uom);
712 712
 
713
-		$deltaLatitude  = deg2rad( (float) $point2['latitude'] - (float) $point1['latitude'] );
714
-		$deltaLongitude = deg2rad( (float) $point2['longitude'] - (float) $point1['longitude'] );
715
-		$a              = sin( $deltaLatitude / 2 ) * sin( $deltaLatitude / 2 ) +
716
-		                  cos( deg2rad( (float) $point1['latitude'] ) ) * cos( deg2rad( (float) $point2['latitude'] ) ) *
717
-		                  sin( $deltaLongitude / 2 ) * sin( $deltaLongitude / 2 );
718
-		$c              = 2 * atan2( sqrt( $a ), sqrt( 1 - $a ) );
713
+		$deltaLatitude  = deg2rad((float) $point2['latitude'] - (float) $point1['latitude']);
714
+		$deltaLongitude = deg2rad((float) $point2['longitude'] - (float) $point1['longitude']);
715
+		$a              = sin($deltaLatitude / 2) * sin($deltaLatitude / 2) +
716
+		                  cos(deg2rad((float) $point1['latitude'])) * cos(deg2rad((float) $point2['latitude'])) *
717
+		                  sin($deltaLongitude / 2) * sin($deltaLongitude / 2);
718
+		$c              = 2 * atan2(sqrt($a), sqrt(1 - $a));
719 719
 		$distance       = $earthMeanRadius * $c;
720 720
 
721 721
 		return $distance;
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 }
725 725
 
726 726
 
727
-if ( ! function_exists( 'geodir_sendEmail' ) ) {
727
+if (!function_exists('geodir_sendEmail')) {
728 728
 	/**
729 729
 	 * The main function that send transactional emails using the args provided.
730 730
 	 *
@@ -743,93 +743,93 @@  discard block
 block discarded – undo
743 743
 	 * @param string $post_id       The post ID.
744 744
 	 * @param string $user_id       The user ID.
745 745
 	 */
746
-	function geodir_sendEmail( $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra = '', $message_type, $post_id = '', $user_id = '' ) {
746
+	function geodir_sendEmail($fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra = '', $message_type, $post_id = '', $user_id = '') {
747 747
 		$login_details = '';
748 748
 
749 749
 		// strip slashes from subject & message text
750
-		$to_subject = stripslashes_deep( $to_subject );
751
-		$to_message = stripslashes_deep( $to_message );
750
+		$to_subject = stripslashes_deep($to_subject);
751
+		$to_message = stripslashes_deep($to_message);
752 752
 
753
-		if ( $message_type == 'send_friend' ) {
754
-			$subject = get_option( 'geodir_email_friend_subject' );
755
-			$message = get_option( 'geodir_email_friend_content' );
756
-		} elseif ( $message_type == 'send_enquiry' ) {
757
-			$subject = get_option( 'geodir_email_enquiry_subject' );
758
-			$message = get_option( 'geodir_email_enquiry_content' );
753
+		if ($message_type == 'send_friend') {
754
+			$subject = get_option('geodir_email_friend_subject');
755
+			$message = get_option('geodir_email_friend_content');
756
+		} elseif ($message_type == 'send_enquiry') {
757
+			$subject = get_option('geodir_email_enquiry_subject');
758
+			$message = get_option('geodir_email_enquiry_content');
759 759
 
760 760
 			// change to name in some cases
761
-			$post_author = get_post_field( 'post_author', $post_id );
762
-			if(is_super_admin( $post_author  )){// if admin probably not the post author so change name
763
-				$toEmailName = __('Business Owner','geodirectory');
764
-			}elseif(defined('GEODIRCLAIM_VERSION') && geodir_get_post_meta($post_id,'claimed')!='1'){// if claim manager installed but listing not claimed
765
-				$toEmailName = __('Business Owner','geodirectory');
761
+			$post_author = get_post_field('post_author', $post_id);
762
+			if (is_super_admin($post_author)) {// if admin probably not the post author so change name
763
+				$toEmailName = __('Business Owner', 'geodirectory');
764
+			}elseif (defined('GEODIRCLAIM_VERSION') && geodir_get_post_meta($post_id, 'claimed') != '1') {// if claim manager installed but listing not claimed
765
+				$toEmailName = __('Business Owner', 'geodirectory');
766 766
 			}
767 767
 
768 768
 
769
-		} elseif ( $message_type == 'forgot_password' ) {
770
-			$subject       = get_option( 'geodir_forgot_password_subject' );
771
-			$message       = get_option( 'geodir_forgot_password_content' );
769
+		} elseif ($message_type == 'forgot_password') {
770
+			$subject       = get_option('geodir_forgot_password_subject');
771
+			$message       = get_option('geodir_forgot_password_content');
772 772
 			$login_details = $to_message;
773
-		} elseif ( $message_type == 'registration' ) {
774
-			$subject       = get_option( 'geodir_registration_success_email_subject' );
775
-			$message       = get_option( 'geodir_registration_success_email_content' );
773
+		} elseif ($message_type == 'registration') {
774
+			$subject       = get_option('geodir_registration_success_email_subject');
775
+			$message       = get_option('geodir_registration_success_email_content');
776 776
 			$login_details = $to_message;
777
-		} elseif ( $message_type == 'post_submit' ) {
778
-			$subject = get_option( 'geodir_post_submited_success_email_subject' );
779
-			$message = get_option( 'geodir_post_submited_success_email_content' );
780
-		} elseif ( $message_type == 'listing_published' ) {
781
-			$subject = get_option( 'geodir_post_published_email_subject' );
782
-			$message = get_option( 'geodir_post_published_email_content' );
783
-		} elseif ( $message_type == 'listing_edited' ) {
784
-			$subject = get_option( 'geodir_post_edited_email_subject_admin' );
785
-			$message = get_option( 'geodir_post_edited_email_content_admin' );
777
+		} elseif ($message_type == 'post_submit') {
778
+			$subject = get_option('geodir_post_submited_success_email_subject');
779
+			$message = get_option('geodir_post_submited_success_email_content');
780
+		} elseif ($message_type == 'listing_published') {
781
+			$subject = get_option('geodir_post_published_email_subject');
782
+			$message = get_option('geodir_post_published_email_content');
783
+		} elseif ($message_type == 'listing_edited') {
784
+			$subject = get_option('geodir_post_edited_email_subject_admin');
785
+			$message = get_option('geodir_post_edited_email_content_admin');
786 786
 		}
787 787
 
788
-		if ( ! empty( $subject ) ) {
789
-			$subject = __( stripslashes_deep( $subject ), 'geodirectory' );
788
+		if (!empty($subject)) {
789
+			$subject = __(stripslashes_deep($subject), 'geodirectory');
790 790
 		}
791 791
 
792
-		if ( ! empty( $message ) ) {
793
-			$message = __( stripslashes_deep( $message ), 'geodirectory' );
792
+		if (!empty($message)) {
793
+			$message = __(stripslashes_deep($message), 'geodirectory');
794 794
 		}
795 795
 
796
-		$to_message        = nl2br( $to_message );
797
-		$sitefromEmail     = get_option( 'site_email' );
796
+		$to_message        = nl2br($to_message);
797
+		$sitefromEmail     = get_option('site_email');
798 798
 		$sitefromEmailName = get_site_emailName();
799
-		$productlink       = get_permalink( $post_id );
799
+		$productlink       = get_permalink($post_id);
800 800
 
801 801
 		$user_login = '';
802
-		if ( $user_id > 0 && $user_info = get_userdata( $user_id ) ) {
802
+		if ($user_id > 0 && $user_info = get_userdata($user_id)) {
803 803
 			$user_login = $user_info->user_login;
804 804
 		}
805 805
 
806 806
 		$posted_date = '';
807 807
 		$listingLink = '';
808 808
 
809
-		$post_info = get_post( $post_id );
809
+		$post_info = get_post($post_id);
810 810
 
811
-		if ( $post_info ) {
811
+		if ($post_info) {
812 812
 			$posted_date = $post_info->post_date;
813
-			$listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
813
+			$listingLink = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>';
814 814
 		}
815 815
 		$siteurl       = home_url();
816
-		$siteurl_link  = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
816
+		$siteurl_link  = '<a href="'.$siteurl.'">'.$siteurl.'</a>';
817 817
 		$loginurl      = geodir_login_url();
818
-		$loginurl_link = '<a href="' . $loginurl . '">login</a>';
818
+		$loginurl_link = '<a href="'.$loginurl.'">login</a>';
819 819
 
820
-		$post_author_id   = ! empty( $post_info ) ? $post_info->post_author : 0;
821
-		$post_author_name = geodir_get_client_name( $post_author_id );
822
-		$current_date     = date_i18n( 'Y-m-d H:i:s', current_time( 'timestamp' ) );
820
+		$post_author_id   = !empty($post_info) ? $post_info->post_author : 0;
821
+		$post_author_name = geodir_get_client_name($post_author_id);
822
+		$current_date     = date_i18n('Y-m-d H:i:s', current_time('timestamp'));
823 823
 
824
-		if ( $fromEmail == '' ) {
825
-			$fromEmail = get_option( 'site_email' );
824
+		if ($fromEmail == '') {
825
+			$fromEmail = get_option('site_email');
826 826
 		}
827 827
 
828
-		if ( $fromEmailName == '' ) {
829
-			$fromEmailName = get_option( 'site_email_name' );
828
+		if ($fromEmailName == '') {
829
+			$fromEmailName = get_option('site_email_name');
830 830
 		}
831 831
 
832
-		$search_array  = array(
832
+		$search_array = array(
833 833
 			'[#listing_link#]',
834 834
 			'[#site_name_url#]',
835 835
 			'[#post_id#]',
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
 			$post_author_name,
870 870
 			$current_date
871 871
 		);
872
-		$message       = str_replace( $search_array, $replace_array, $message );
872
+		$message       = str_replace($search_array, $replace_array, $message);
873 873
 
874 874
 		$search_array  = array(
875 875
 			'[#listing_link#]',
@@ -905,12 +905,12 @@  discard block
 block discarded – undo
905 905
 			$post_author_name,
906 906
 			$current_date
907 907
 		);
908
-		$subject       = str_replace( $search_array, $replace_array, $subject );
908
+		$subject = str_replace($search_array, $replace_array, $subject);
909 909
 
910
-		$headers =  array();
910
+		$headers = array();
911 911
 		$headers[] = 'Content-type: text/html; charset=UTF-8';
912
-		$headers[] = "Reply-To: " . $fromEmail;
913
-		$headers[] = 'From: ' . $sitefromEmailName . ' <' . $sitefromEmail . '>';
912
+		$headers[] = "Reply-To: ".$fromEmail;
913
+		$headers[] = 'From: '.$sitefromEmailName.' <'.$sitefromEmail.'>';
914 914
 
915 915
 		$to = $toEmail;
916 916
 
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
 		 * @param string $post_id       The post ID.
933 933
 		 * @param string $user_id       The user ID.
934 934
 		 */
935
-		$to = apply_filters( 'geodir_sendEmail_to', $to, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
935
+		$to = apply_filters('geodir_sendEmail_to', $to, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
936 936
 		/**
937 937
 		 * Filter the client email subject.
938 938
 		 *
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 		 * @param string $post_id       The post ID.
952 952
 		 * @param string $user_id       The user ID.
953 953
 		 */
954
-		$subject = apply_filters( 'geodir_sendEmail_subject', $subject, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
954
+		$subject = apply_filters('geodir_sendEmail_subject', $subject, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
955 955
 		/**
956 956
 		 * Filter the client email message.
957 957
 		 *
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
 		 * @param string $post_id       The post ID.
971 971
 		 * @param string $user_id       The user ID.
972 972
 		 */
973
-		$message = apply_filters( 'geodir_sendEmail_message', $message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
973
+		$message = apply_filters('geodir_sendEmail_message', $message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
974 974
 		/**
975 975
 		 * Filter the client email headers.
976 976
 		 *
@@ -989,39 +989,39 @@  discard block
 block discarded – undo
989 989
 		 * @param string $post_id       The post ID.
990 990
 		 * @param string $user_id       The user ID.
991 991
 		 */
992
-		$headers = apply_filters( 'geodir_sendEmail_headers', $headers, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
992
+		$headers = apply_filters('geodir_sendEmail_headers', $headers, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
993 993
 
994
-		$sent = wp_mail( $to, $subject, $message, $headers );
994
+		$sent = wp_mail($to, $subject, $message, $headers);
995 995
 
996
-		if ( ! $sent ) {
997
-			if ( is_array( $to ) ) {
998
-				$to = implode( ',', $to );
996
+		if (!$sent) {
997
+			if (is_array($to)) {
998
+				$to = implode(',', $to);
999 999
 			}
1000 1000
 			$log_message = sprintf(
1001
-				__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1001
+				__("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1002 1002
 				$message_type,
1003
-				date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1003
+				date_i18n('F j Y H:i:s', current_time('timestamp')),
1004 1004
 				$to,
1005 1005
 				$subject
1006 1006
 			);
1007
-			geodir_error_log( $log_message );
1007
+			geodir_error_log($log_message);
1008 1008
 		}
1009 1009
 
1010 1010
 		///////// ADMIN BCC EMIALS
1011
-		$adminEmail = get_bloginfo( 'admin_email' );
1011
+		$adminEmail = get_bloginfo('admin_email');
1012 1012
 		$to         = $adminEmail;
1013 1013
 
1014 1014
 		$admin_bcc = false;
1015
-		if ( $message_type == 'registration' ) {
1016
-			$message_raw  = explode( __( "Password:", 'geodirectory' ), $message );
1017
-			$message_raw2 = explode( "</p>", $message_raw[1], 2 );
1018
-			$message      = $message_raw[0] . __( 'Password:', 'geodirectory' ) . ' **********</p>' . $message_raw2[1];
1015
+		if ($message_type == 'registration') {
1016
+			$message_raw  = explode(__("Password:", 'geodirectory'), $message);
1017
+			$message_raw2 = explode("</p>", $message_raw[1], 2);
1018
+			$message      = $message_raw[0].__('Password:', 'geodirectory').' **********</p>'.$message_raw2[1];
1019 1019
 		}
1020
-		if ( $message_type == 'post_submit' ) {
1021
-			$subject = __( stripslashes_deep( get_option( 'geodir_post_submited_success_email_subject_admin' ) ), 'geodirectory' );
1022
-			$message = __( stripslashes_deep( get_option( 'geodir_post_submited_success_email_content_admin' ) ), 'geodirectory' );
1020
+		if ($message_type == 'post_submit') {
1021
+			$subject = __(stripslashes_deep(get_option('geodir_post_submited_success_email_subject_admin')), 'geodirectory');
1022
+			$message = __(stripslashes_deep(get_option('geodir_post_submited_success_email_content_admin')), 'geodirectory');
1023 1023
 
1024
-			$search_array  = array(
1024
+			$search_array = array(
1025 1025
 				'[#listing_link#]',
1026 1026
 				'[#site_name_url#]',
1027 1027
 				'[#post_id#]',
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
 				$user_login,
1054 1054
 				$user_login
1055 1055
 			);
1056
-			$message       = str_replace( $search_array, $replace_array, $message );
1056
+			$message       = str_replace($search_array, $replace_array, $message);
1057 1057
 
1058 1058
 			$search_array  = array(
1059 1059
 				'[#listing_link#]',
@@ -1081,26 +1081,26 @@  discard block
 block discarded – undo
1081 1081
 				$user_login,
1082 1082
 				$user_login
1083 1083
 			);
1084
-			$subject       = str_replace( $search_array, $replace_array, $subject );
1084
+			$subject = str_replace($search_array, $replace_array, $subject);
1085 1085
 
1086 1086
 			$subject .= ' - ADMIN BCC COPY';
1087 1087
 			$admin_bcc = true;
1088 1088
 
1089
-		} elseif ( $message_type == 'registration' && get_option( 'geodir_bcc_new_user' ) ) {
1089
+		} elseif ($message_type == 'registration' && get_option('geodir_bcc_new_user')) {
1090 1090
 			$subject .= ' - ADMIN BCC COPY';
1091 1091
 			$admin_bcc = true;
1092
-		} elseif ( $message_type == 'send_friend' && get_option( 'geodir_bcc_friend' ) ) {
1092
+		} elseif ($message_type == 'send_friend' && get_option('geodir_bcc_friend')) {
1093 1093
 			$subject .= ' - ADMIN BCC COPY';
1094 1094
 			$admin_bcc = true;
1095
-		} elseif ( $message_type == 'send_enquiry' && get_option( 'geodir_bcc_enquiry' ) ) {
1095
+		} elseif ($message_type == 'send_enquiry' && get_option('geodir_bcc_enquiry')) {
1096 1096
 			$subject .= ' - ADMIN BCC COPY';
1097 1097
 			$admin_bcc = true;
1098
-		} elseif ( $message_type == 'listing_published' && get_option( 'geodir_bcc_listing_published' ) ) {
1098
+		} elseif ($message_type == 'listing_published' && get_option('geodir_bcc_listing_published')) {
1099 1099
 			$subject .= ' - ADMIN BCC COPY';
1100 1100
 			$admin_bcc = true;
1101 1101
 		}
1102 1102
 
1103
-		if ( $admin_bcc === true ) {
1103
+		if ($admin_bcc === true) {
1104 1104
 
1105 1105
 			/**
1106 1106
 			 * Filter the client email subject.
@@ -1120,7 +1120,7 @@  discard block
 block discarded – undo
1120 1120
 			 * @param string $post_id       The post ID.
1121 1121
 			 * @param string $user_id       The user ID.
1122 1122
 			 */
1123
-			$subject = apply_filters( 'geodir_sendEmail_subject_admin_bcc', $subject, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
1123
+			$subject = apply_filters('geodir_sendEmail_subject_admin_bcc', $subject, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
1124 1124
 			/**
1125 1125
 			 * Filter the client email message.
1126 1126
 			 *
@@ -1139,23 +1139,23 @@  discard block
 block discarded – undo
1139 1139
 			 * @param string $post_id       The post ID.
1140 1140
 			 * @param string $user_id       The user ID.
1141 1141
 			 */
1142
-			$message = apply_filters( 'geodir_sendEmail_message_admin_bcc', $message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
1142
+			$message = apply_filters('geodir_sendEmail_message_admin_bcc', $message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
1143 1143
 
1144 1144
 
1145
-			$sent = wp_mail( $to, $subject, $message, $headers );
1145
+			$sent = wp_mail($to, $subject, $message, $headers);
1146 1146
 
1147
-			if ( ! $sent ) {
1148
-				if ( is_array( $to ) ) {
1149
-					$to = implode( ',', $to );
1147
+			if (!$sent) {
1148
+				if (is_array($to)) {
1149
+					$to = implode(',', $to);
1150 1150
 				}
1151 1151
 				$log_message = sprintf(
1152
-					__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1152
+					__("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1153 1153
 					$message_type,
1154
-					date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1154
+					date_i18n('F j Y H:i:s', current_time('timestamp')),
1155 1155
 					$to,
1156 1156
 					$subject
1157 1157
 				);
1158
-				geodir_error_log( $log_message );
1158
+				geodir_error_log($log_message);
1159 1159
 			}
1160 1160
 		}
1161 1161
 
@@ -1171,52 +1171,52 @@  discard block
 block discarded – undo
1171 1171
  */
1172 1172
 function geodir_taxonomy_breadcrumb() {
1173 1173
 
1174
-	$term   = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
1174
+	$term   = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
1175 1175
 	$parent = $term->parent;
1176 1176
 
1177
-	while ( $parent ):
1177
+	while ($parent):
1178 1178
 		$parents[]  = $parent;
1179
-		$new_parent = get_term_by( 'id', $parent, get_query_var( 'taxonomy' ) );
1179
+		$new_parent = get_term_by('id', $parent, get_query_var('taxonomy'));
1180 1180
 		$parent     = $new_parent->parent;
1181 1181
 	endwhile;
1182 1182
 
1183
-	if ( ! empty( $parents ) ):
1184
-		$parents = array_reverse( $parents );
1183
+	if (!empty($parents)):
1184
+		$parents = array_reverse($parents);
1185 1185
 
1186
-		foreach ( $parents as $parent ):
1187
-			$item = get_term_by( 'id', $parent, get_query_var( 'taxonomy' ) );
1188
-			$url  = get_term_link( $item, get_query_var( 'taxonomy' ) );
1189
-			echo '<li> > <a href="' . $url . '">' . $item->name . '</a></li>';
1186
+		foreach ($parents as $parent):
1187
+			$item = get_term_by('id', $parent, get_query_var('taxonomy'));
1188
+			$url  = get_term_link($item, get_query_var('taxonomy'));
1189
+			echo '<li> > <a href="'.$url.'">'.$item->name.'</a></li>';
1190 1190
 		endforeach;
1191 1191
 
1192 1192
 	endif;
1193 1193
 
1194
-	echo '<li> > ' . $term->name . '</li>';
1194
+	echo '<li> > '.$term->name.'</li>';
1195 1195
 }
1196 1196
 
1197
-function geodir_wpml_post_type_archive_link($link, $post_type){
1197
+function geodir_wpml_post_type_archive_link($link, $post_type) {
1198 1198
 
1199
-	if(function_exists('icl_object_id')) {
1200
-		$post_types   = get_option( 'geodir_post_types' );
1201
-		$slug         = $post_types[ $post_type ]['rewrite']['slug'];
1199
+	if (function_exists('icl_object_id')) {
1200
+		$post_types   = get_option('geodir_post_types');
1201
+		$slug         = $post_types[$post_type]['rewrite']['slug'];
1202 1202
 
1203 1203
 		//echo $link.'###'.gd_wpml_get_lang_from_url( $link) ;
1204 1204
 
1205 1205
 		// Alter the CPT slug if WPML is set to do so
1206
-		if ( function_exists( 'icl_object_id' ) ) {
1207
-			if ( gd_wpml_slug_translation_turned_on( $post_type ) && $language_code = gd_wpml_get_lang_from_url( $link) ) {
1206
+		if (function_exists('icl_object_id')) {
1207
+			if (gd_wpml_slug_translation_turned_on($post_type) && $language_code = gd_wpml_get_lang_from_url($link)) {
1208 1208
 
1209 1209
 				$org_slug = $slug;
1210
-				$slug     = apply_filters( 'wpml_translate_single_string',
1210
+				$slug     = apply_filters('wpml_translate_single_string',
1211 1211
 					$slug,
1212 1212
 					'WordPress',
1213
-					'URL slug: ' . $slug,
1214
-					$language_code );
1213
+					'URL slug: '.$slug,
1214
+					$language_code);
1215 1215
 
1216
-				if ( ! $slug ) {
1216
+				if (!$slug) {
1217 1217
 					$slug = $org_slug;
1218 1218
 				} else {
1219
-					$link = str_replace( $org_slug, $slug, $link );
1219
+					$link = str_replace($org_slug, $slug, $link);
1220 1220
 				}
1221 1221
 
1222 1222
 			}
@@ -1247,9 +1247,9 @@  discard block
 block discarded – undo
1247 1247
 	 *
1248 1248
 	 * @since 1.0.0
1249 1249
 	 */
1250
-	$separator = apply_filters( 'geodir_breadcrumb_separator', ' > ' );
1250
+	$separator = apply_filters('geodir_breadcrumb_separator', ' > ');
1251 1251
 
1252
-	if ( ! geodir_is_page( 'home' ) ) {
1252
+	if (!geodir_is_page('home')) {
1253 1253
 		$breadcrumb    = '';
1254 1254
 		$url_categoris = '';
1255 1255
 		$breadcrumb .= '<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">';
@@ -1258,162 +1258,162 @@  discard block
 block discarded – undo
1258 1258
 		 *
1259 1259
 		 * @since 1.0.0
1260 1260
 		 */
1261
-		$breadcrumb .= '<li>' . apply_filters( 'geodir_breadcrumb_first_link', '<a href="' . home_url() . '">' . __( 'Home', 'geodirectory' ) . '</a>' ) . '</li>';
1261
+		$breadcrumb .= '<li>'.apply_filters('geodir_breadcrumb_first_link', '<a href="'.home_url().'">'.__('Home', 'geodirectory').'</a>').'</li>';
1262 1262
 
1263 1263
 		$gd_post_type   = geodir_get_current_posttype();
1264
-		$post_type_info = get_post_type_object( $gd_post_type );
1264
+		$post_type_info = get_post_type_object($gd_post_type);
1265 1265
 
1266
-		remove_filter( 'post_type_archive_link', 'geodir_get_posttype_link' );
1266
+		remove_filter('post_type_archive_link', 'geodir_get_posttype_link');
1267 1267
 
1268
-		$listing_link = get_post_type_archive_link( $gd_post_type );
1268
+		$listing_link = get_post_type_archive_link($gd_post_type);
1269 1269
 
1270
-		add_filter( 'post_type_archive_link', 'geodir_get_posttype_link', 10, 2 );
1271
-		$listing_link = rtrim( $listing_link, '/' );
1270
+		add_filter('post_type_archive_link', 'geodir_get_posttype_link', 10, 2);
1271
+		$listing_link = rtrim($listing_link, '/');
1272 1272
 		$listing_link .= '/';
1273 1273
 
1274 1274
 		$post_type_for_location_link = $listing_link;
1275
-		$location_terms              = geodir_get_current_location_terms( 'query_vars', $gd_post_type );
1275
+		$location_terms              = geodir_get_current_location_terms('query_vars', $gd_post_type);
1276 1276
 
1277 1277
 		global $wp, $gd_session;
1278 1278
 		$location_link = $post_type_for_location_link;
1279 1279
 
1280
-		if ( geodir_is_page( 'detail' ) || geodir_is_page( 'listing' ) ) {
1280
+		if (geodir_is_page('detail') || geodir_is_page('listing')) {
1281 1281
 			global $post;
1282
-			$location_manager     = defined( 'POST_LOCATION_TABLE' ) ? true : false;
1283
-			$neighbourhood_active = $location_manager && get_option( 'location_neighbourhoods' ) ? true : false;
1282
+			$location_manager     = defined('POST_LOCATION_TABLE') ? true : false;
1283
+			$neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false;
1284 1284
 
1285
-			if ( geodir_is_page( 'detail' ) && isset( $post->country_slug ) ) {
1285
+			if (geodir_is_page('detail') && isset($post->country_slug)) {
1286 1286
 				$location_terms = array(
1287 1287
 					'gd_country' => $post->country_slug,
1288 1288
 					'gd_region'  => $post->region_slug,
1289 1289
 					'gd_city'    => $post->city_slug
1290 1290
 				);
1291 1291
 
1292
-				if ( $neighbourhood_active && ! empty( $location_terms['gd_city'] ) && $gd_ses_neighbourhood = $gd_session->get( 'gd_neighbourhood' ) ) {
1292
+				if ($neighbourhood_active && !empty($location_terms['gd_city']) && $gd_ses_neighbourhood = $gd_session->get('gd_neighbourhood')) {
1293 1293
 					$location_terms['gd_neighbourhood'] = $gd_ses_neighbourhood;
1294 1294
 				}
1295 1295
 			}
1296 1296
 
1297
-			$geodir_show_location_url = get_option( 'geodir_show_location_url' );
1297
+			$geodir_show_location_url = get_option('geodir_show_location_url');
1298 1298
 
1299 1299
 			$hide_url_part = array();
1300
-			if ( $location_manager ) {
1301
-				$hide_country_part = get_option( 'geodir_location_hide_country_part' );
1302
-				$hide_region_part  = get_option( 'geodir_location_hide_region_part' );
1303
-
1304
-				if ( $hide_region_part && $hide_country_part ) {
1305
-					$hide_url_part = array( 'gd_country', 'gd_region' );
1306
-				} else if ( $hide_region_part && ! $hide_country_part ) {
1307
-					$hide_url_part = array( 'gd_region' );
1308
-				} else if ( ! $hide_region_part && $hide_country_part ) {
1309
-					$hide_url_part = array( 'gd_country' );
1300
+			if ($location_manager) {
1301
+				$hide_country_part = get_option('geodir_location_hide_country_part');
1302
+				$hide_region_part  = get_option('geodir_location_hide_region_part');
1303
+
1304
+				if ($hide_region_part && $hide_country_part) {
1305
+					$hide_url_part = array('gd_country', 'gd_region');
1306
+				} else if ($hide_region_part && !$hide_country_part) {
1307
+					$hide_url_part = array('gd_region');
1308
+				} else if (!$hide_region_part && $hide_country_part) {
1309
+					$hide_url_part = array('gd_country');
1310 1310
 				}
1311 1311
 			}
1312 1312
 
1313 1313
 			$hide_text_part = array();
1314
-			if ( $geodir_show_location_url == 'country_city' ) {
1315
-				$hide_text_part = array( 'gd_region' );
1314
+			if ($geodir_show_location_url == 'country_city') {
1315
+				$hide_text_part = array('gd_region');
1316 1316
 
1317
-				if ( isset( $location_terms['gd_region'] ) && ! $location_manager ) {
1318
-					unset( $location_terms['gd_region'] );
1317
+				if (isset($location_terms['gd_region']) && !$location_manager) {
1318
+					unset($location_terms['gd_region']);
1319 1319
 				}
1320
-			} else if ( $geodir_show_location_url == 'region_city' ) {
1321
-				$hide_text_part = array( 'gd_country' );
1320
+			} else if ($geodir_show_location_url == 'region_city') {
1321
+				$hide_text_part = array('gd_country');
1322 1322
 
1323
-				if ( isset( $location_terms['gd_country'] ) && ! $location_manager ) {
1324
-					unset( $location_terms['gd_country'] );
1323
+				if (isset($location_terms['gd_country']) && !$location_manager) {
1324
+					unset($location_terms['gd_country']);
1325 1325
 				}
1326
-			} else if ( $geodir_show_location_url == 'city' ) {
1327
-				$hide_text_part = array( 'gd_country', 'gd_region' );
1326
+			} else if ($geodir_show_location_url == 'city') {
1327
+				$hide_text_part = array('gd_country', 'gd_region');
1328 1328
 
1329
-				if ( isset( $location_terms['gd_country'] ) && ! $location_manager ) {
1330
-					unset( $location_terms['gd_country'] );
1329
+				if (isset($location_terms['gd_country']) && !$location_manager) {
1330
+					unset($location_terms['gd_country']);
1331 1331
 				}
1332
-				if ( isset( $location_terms['gd_region'] ) && ! $location_manager ) {
1333
-					unset( $location_terms['gd_region'] );
1332
+				if (isset($location_terms['gd_region']) && !$location_manager) {
1333
+					unset($location_terms['gd_region']);
1334 1334
 				}
1335 1335
 			}
1336 1336
 
1337 1337
 			$is_location_last = '';
1338 1338
 			$is_taxonomy_last = '';
1339 1339
 			$breadcrumb .= '<li>';
1340
-			if ( get_query_var( $gd_post_type . 'category' ) ) {
1341
-				$gd_taxonomy = $gd_post_type . 'category';
1342
-			} elseif ( get_query_var( $gd_post_type . '_tags' ) ) {
1343
-				$gd_taxonomy = $gd_post_type . '_tags';
1340
+			if (get_query_var($gd_post_type.'category')) {
1341
+				$gd_taxonomy = $gd_post_type.'category';
1342
+			} elseif (get_query_var($gd_post_type.'_tags')) {
1343
+				$gd_taxonomy = $gd_post_type.'_tags';
1344 1344
 			}
1345 1345
 
1346
-			$breadcrumb .= $separator . '<a href="' . $listing_link . '">' . __( ucfirst( $post_type_info->label ), 'geodirectory' ) . '</a>';
1347
-			if ( ! empty( $gd_taxonomy ) || geodir_is_page( 'detail' ) ) {
1346
+			$breadcrumb .= $separator.'<a href="'.$listing_link.'">'.__(ucfirst($post_type_info->label), 'geodirectory').'</a>';
1347
+			if (!empty($gd_taxonomy) || geodir_is_page('detail')) {
1348 1348
 				$is_location_last = false;
1349 1349
 			} else {
1350 1350
 				$is_location_last = true;
1351 1351
 			}
1352 1352
 
1353
-			if ( ! empty( $gd_taxonomy ) && geodir_is_page( 'listing' ) ) {
1353
+			if (!empty($gd_taxonomy) && geodir_is_page('listing')) {
1354 1354
 				$is_taxonomy_last = true;
1355 1355
 			} else {
1356 1356
 				$is_taxonomy_last = false;
1357 1357
 			}
1358 1358
 
1359
-			if ( ! empty( $location_terms ) ) {
1360
-				$geodir_get_locations = function_exists( 'get_actual_location_name' ) ? true : false;
1359
+			if (!empty($location_terms)) {
1360
+				$geodir_get_locations = function_exists('get_actual_location_name') ? true : false;
1361 1361
 
1362
-				foreach ( $location_terms as $key => $location_term ) {
1363
-					if ( $location_term != '' ) {
1364
-						if ( ! empty( $hide_url_part ) && in_array( $key, $hide_url_part ) ) { // Hide location part from url & breadcrumb.
1362
+				foreach ($location_terms as $key => $location_term) {
1363
+					if ($location_term != '') {
1364
+						if (!empty($hide_url_part) && in_array($key, $hide_url_part)) { // Hide location part from url & breadcrumb.
1365 1365
 							continue;
1366 1366
 						}
1367 1367
 
1368
-						$gd_location_link_text = preg_replace( '/-(\d+)$/', '', $location_term );
1369
-						$gd_location_link_text = preg_replace( '/[_-]/', ' ', $gd_location_link_text );
1370
-						$gd_location_link_text = ucfirst( $gd_location_link_text );
1368
+						$gd_location_link_text = preg_replace('/-(\d+)$/', '', $location_term);
1369
+						$gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
1370
+						$gd_location_link_text = ucfirst($gd_location_link_text);
1371 1371
 
1372 1372
 						$location_term_actual_country = '';
1373 1373
 						$location_term_actual_region  = '';
1374 1374
 						$location_term_actual_city    = '';
1375
-						if ( $geodir_get_locations ) {
1376
-							if ( $key == 'gd_country' ) {
1377
-								$location_term_actual_country = get_actual_location_name( 'country', $location_term, true );
1378
-							} else if ( $key == 'gd_region' ) {
1379
-								$location_term_actual_region = get_actual_location_name( 'region', $location_term, true );
1380
-							} else if ( $key == 'gd_city' ) {
1381
-								$location_term_actual_city = get_actual_location_name( 'city', $location_term, true );
1375
+						if ($geodir_get_locations) {
1376
+							if ($key == 'gd_country') {
1377
+								$location_term_actual_country = get_actual_location_name('country', $location_term, true);
1378
+							} else if ($key == 'gd_region') {
1379
+								$location_term_actual_region = get_actual_location_name('region', $location_term, true);
1380
+							} else if ($key == 'gd_city') {
1381
+								$location_term_actual_city = get_actual_location_name('city', $location_term, true);
1382 1382
 							}
1383 1383
 						} else {
1384 1384
 							$location_info = geodir_get_location();
1385 1385
 
1386
-							if ( ! empty( $location_info ) && isset( $location_info->location_id ) ) {
1387
-								if ( $key == 'gd_country' ) {
1388
-									$location_term_actual_country = __( $location_info->country, 'geodirectory' );
1389
-								} else if ( $key == 'gd_region' ) {
1390
-									$location_term_actual_region = __( $location_info->region, 'geodirectory' );
1391
-								} else if ( $key == 'gd_city' ) {
1392
-									$location_term_actual_city = __( $location_info->city, 'geodirectory' );
1386
+							if (!empty($location_info) && isset($location_info->location_id)) {
1387
+								if ($key == 'gd_country') {
1388
+									$location_term_actual_country = __($location_info->country, 'geodirectory');
1389
+								} else if ($key == 'gd_region') {
1390
+									$location_term_actual_region = __($location_info->region, 'geodirectory');
1391
+								} else if ($key == 'gd_city') {
1392
+									$location_term_actual_city = __($location_info->city, 'geodirectory');
1393 1393
 								}
1394 1394
 							}
1395 1395
 						}
1396 1396
 
1397
-						if ( $is_location_last && $key == 'gd_country' && ! ( isset( $location_terms['gd_region'] ) && $location_terms['gd_region'] != '' ) && ! ( isset( $location_terms['gd_city'] ) && $location_terms['gd_city'] != '' ) ) {
1398
-							$breadcrumb .= $location_term_actual_country != '' ? $separator . $location_term_actual_country : $separator . $gd_location_link_text;
1399
-						} else if ( $is_location_last && $key == 'gd_region' && ! ( isset( $location_terms['gd_city'] ) && $location_terms['gd_city'] != '' ) ) {
1400
-							$breadcrumb .= $location_term_actual_region != '' ? $separator . $location_term_actual_region : $separator . $gd_location_link_text;
1401
-						} else if ( $is_location_last && $key == 'gd_city' && empty( $location_terms['gd_neighbourhood'] ) ) {
1402
-							$breadcrumb .= $location_term_actual_city != '' ? $separator . $location_term_actual_city : $separator . $gd_location_link_text;
1403
-						} else if ( $is_location_last && $key == 'gd_neighbourhood' ) {
1404
-							$breadcrumb .= $separator . $gd_location_link_text;
1397
+						if ($is_location_last && $key == 'gd_country' && !(isset($location_terms['gd_region']) && $location_terms['gd_region'] != '') && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) {
1398
+							$breadcrumb .= $location_term_actual_country != '' ? $separator.$location_term_actual_country : $separator.$gd_location_link_text;
1399
+						} else if ($is_location_last && $key == 'gd_region' && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) {
1400
+							$breadcrumb .= $location_term_actual_region != '' ? $separator.$location_term_actual_region : $separator.$gd_location_link_text;
1401
+						} else if ($is_location_last && $key == 'gd_city' && empty($location_terms['gd_neighbourhood'])) {
1402
+							$breadcrumb .= $location_term_actual_city != '' ? $separator.$location_term_actual_city : $separator.$gd_location_link_text;
1403
+						} else if ($is_location_last && $key == 'gd_neighbourhood') {
1404
+							$breadcrumb .= $separator.$gd_location_link_text;
1405 1405
 						} else {
1406
-							if ( get_option( 'permalink_structure' ) != '' ) {
1407
-								$location_link .= $location_term . '/';
1406
+							if (get_option('permalink_structure') != '') {
1407
+								$location_link .= $location_term.'/';
1408 1408
 							} else {
1409
-								$location_link .= "&$key=" . $location_term;
1409
+								$location_link .= "&$key=".$location_term;
1410 1410
 							}
1411 1411
 
1412
-							if ( $key == 'gd_country' && $location_term_actual_country != '' ) {
1412
+							if ($key == 'gd_country' && $location_term_actual_country != '') {
1413 1413
 								$gd_location_link_text = $location_term_actual_country;
1414
-							} else if ( $key == 'gd_region' && $location_term_actual_region != '' ) {
1414
+							} else if ($key == 'gd_region' && $location_term_actual_region != '') {
1415 1415
 								$gd_location_link_text = $location_term_actual_region;
1416
-							} else if ( $key == 'gd_city' && $location_term_actual_city != '' ) {
1416
+							} else if ($key == 'gd_city' && $location_term_actual_city != '') {
1417 1417
 								$gd_location_link_text = $location_term_actual_city;
1418 1418
 							}
1419 1419
 
@@ -1423,76 +1423,76 @@  discard block
 block discarded – undo
1423 1423
                             }
1424 1424
                             */
1425 1425
 
1426
-							$breadcrumb .= $separator . '<a href="' . $location_link . '">' . $gd_location_link_text . '</a>';
1426
+							$breadcrumb .= $separator.'<a href="'.$location_link.'">'.$gd_location_link_text.'</a>';
1427 1427
 						}
1428 1428
 					}
1429 1429
 				}
1430 1430
 			}
1431 1431
 
1432
-			if ( ! empty( $gd_taxonomy ) ) {
1432
+			if (!empty($gd_taxonomy)) {
1433 1433
 				$term_index = 1;
1434 1434
 
1435 1435
 				//if(get_option('geodir_add_categories_url'))
1436 1436
 				{
1437
-					if ( get_query_var( $gd_post_type . '_tags' ) ) {
1438
-						$cat_link = $listing_link . 'tags/';
1437
+					if (get_query_var($gd_post_type.'_tags')) {
1438
+						$cat_link = $listing_link.'tags/';
1439 1439
 					} else {
1440 1440
 						$cat_link = $listing_link;
1441 1441
 					}
1442 1442
 
1443
-					foreach ( $location_terms as $key => $location_term ) {
1444
-						if ( $location_manager && in_array( $key, $hide_url_part ) ) {
1443
+					foreach ($location_terms as $key => $location_term) {
1444
+						if ($location_manager && in_array($key, $hide_url_part)) {
1445 1445
 							continue;
1446 1446
 						}
1447 1447
 
1448
-						if ( $location_term != '' ) {
1449
-							if ( get_option( 'permalink_structure' ) != '' ) {
1450
-								$cat_link .= $location_term . '/';
1448
+						if ($location_term != '') {
1449
+							if (get_option('permalink_structure') != '') {
1450
+								$cat_link .= $location_term.'/';
1451 1451
 							}
1452 1452
 						}
1453 1453
 					}
1454 1454
 
1455
-					$term_array = explode( "/", trim( $wp_query->query[ $gd_taxonomy ], "/" ) );
1456
-					foreach ( $term_array as $term ) {
1457
-						$term_link_text = preg_replace( '/-(\d+)$/', '', $term );
1458
-						$term_link_text = preg_replace( '/[_-]/', ' ', $term_link_text );
1455
+					$term_array = explode("/", trim($wp_query->query[$gd_taxonomy], "/"));
1456
+					foreach ($term_array as $term) {
1457
+						$term_link_text = preg_replace('/-(\d+)$/', '', $term);
1458
+						$term_link_text = preg_replace('/[_-]/', ' ', $term_link_text);
1459 1459
 
1460 1460
 						// get term actual name
1461
-						$term_info = get_term_by( 'slug', $term, $gd_taxonomy, 'ARRAY_A' );
1462
-						if ( ! empty( $term_info ) && isset( $term_info['name'] ) && $term_info['name'] != '' ) {
1463
-							$term_link_text = urldecode( $term_info['name'] );
1461
+						$term_info = get_term_by('slug', $term, $gd_taxonomy, 'ARRAY_A');
1462
+						if (!empty($term_info) && isset($term_info['name']) && $term_info['name'] != '') {
1463
+							$term_link_text = urldecode($term_info['name']);
1464 1464
 						} else {
1465 1465
 							continue;
1466 1466
 							//$term_link_text = wp_strip_all_tags(geodir_ucwords(urldecode($term_link_text)));
1467 1467
 						}
1468 1468
 
1469
-						if ( $term_index == count( $term_array ) && $is_taxonomy_last ) {
1470
-							$breadcrumb .= $separator . $term_link_text;
1469
+						if ($term_index == count($term_array) && $is_taxonomy_last) {
1470
+							$breadcrumb .= $separator.$term_link_text;
1471 1471
 						} else {
1472
-							$cat_link .= $term . '/';
1473
-							$breadcrumb .= $separator . '<a href="' . $cat_link . '">' . $term_link_text . '</a>';
1472
+							$cat_link .= $term.'/';
1473
+							$breadcrumb .= $separator.'<a href="'.$cat_link.'">'.$term_link_text.'</a>';
1474 1474
 						}
1475
-						$term_index ++;
1475
+						$term_index++;
1476 1476
 					}
1477 1477
 				}
1478 1478
 
1479 1479
 
1480 1480
 			}
1481 1481
 
1482
-			if ( geodir_is_page( 'detail' ) ) {
1483
-				$breadcrumb .= $separator . get_the_title();
1482
+			if (geodir_is_page('detail')) {
1483
+				$breadcrumb .= $separator.get_the_title();
1484 1484
 			}
1485 1485
 
1486 1486
 			$breadcrumb .= '</li>';
1487 1487
 
1488 1488
 
1489
-		} elseif ( geodir_is_page( 'author' ) ) {
1489
+		} elseif (geodir_is_page('author')) {
1490 1490
 			$user_id             = get_current_user_id();
1491
-			$author_link         = get_author_posts_url( $user_id );
1492
-			$default_author_link = geodir_getlink( $author_link, array(
1491
+			$author_link         = get_author_posts_url($user_id);
1492
+			$default_author_link = geodir_getlink($author_link, array(
1493 1493
 				'geodir_dashbord' => 'true',
1494 1494
 				'stype'           => 'gd_place'
1495
-			), false );
1495
+			), false);
1496 1496
 
1497 1497
 			/**
1498 1498
 			 * Filter author page link.
@@ -1502,16 +1502,16 @@  discard block
 block discarded – undo
1502 1502
 			 * @param string $default_author_link Default author link.
1503 1503
 			 * @param int $user_id                Author ID.
1504 1504
 			 */
1505
-			$default_author_link = apply_filters( 'geodir_dashboard_author_link', $default_author_link, $user_id );
1505
+			$default_author_link = apply_filters('geodir_dashboard_author_link', $default_author_link, $user_id);
1506 1506
 
1507 1507
 			$breadcrumb .= '<li>';
1508
-			$breadcrumb .= $separator . '<a href="' . $default_author_link . '">' . __( 'My Dashboard', 'geodirectory' ) . '</a>';
1508
+			$breadcrumb .= $separator.'<a href="'.$default_author_link.'">'.__('My Dashboard', 'geodirectory').'</a>';
1509 1509
 
1510
-			if ( isset( $_REQUEST['list'] ) ) {
1511
-				$author_link = geodir_getlink( $author_link, array(
1510
+			if (isset($_REQUEST['list'])) {
1511
+				$author_link = geodir_getlink($author_link, array(
1512 1512
 					'geodir_dashbord' => 'true',
1513 1513
 					'stype'           => $_REQUEST['stype']
1514
-				), false );
1514
+				), false);
1515 1515
 
1516 1516
 				/**
1517 1517
 				 * Filter author page link.
@@ -1522,61 +1522,61 @@  discard block
 block discarded – undo
1522 1522
 				 * @param int $user_id        Author ID.
1523 1523
 				 * @param string $_REQUEST    ['stype'] Post type.
1524 1524
 				 */
1525
-				$author_link = apply_filters( 'geodir_dashboard_author_link', $author_link, $user_id, $_REQUEST['stype'] );
1525
+				$author_link = apply_filters('geodir_dashboard_author_link', $author_link, $user_id, $_REQUEST['stype']);
1526 1526
 
1527
-				$breadcrumb .= $separator . '<a href="' . $author_link . '">' . __( ucfirst( $post_type_info->label ), 'geodirectory' ) . '</a>';
1528
-				$breadcrumb .= $separator . ucfirst( __( 'My', 'geodirectory' ) . ' ' . $_REQUEST['list'] );
1527
+				$breadcrumb .= $separator.'<a href="'.$author_link.'">'.__(ucfirst($post_type_info->label), 'geodirectory').'</a>';
1528
+				$breadcrumb .= $separator.ucfirst(__('My', 'geodirectory').' '.$_REQUEST['list']);
1529 1529
 			} else {
1530
-				$breadcrumb .= $separator . __( ucfirst( $post_type_info->label ), 'geodirectory' );
1530
+				$breadcrumb .= $separator.__(ucfirst($post_type_info->label), 'geodirectory');
1531 1531
 			}
1532 1532
 
1533 1533
 			$breadcrumb .= '</li>';
1534
-		} elseif ( is_category() || is_single() ) {
1534
+		} elseif (is_category() || is_single()) {
1535 1535
 			$category = get_the_category();
1536
-			if ( is_category() ) {
1537
-				$breadcrumb .= '<li>' . $separator . $category[0]->cat_name . '</li>';
1536
+			if (is_category()) {
1537
+				$breadcrumb .= '<li>'.$separator.$category[0]->cat_name.'</li>';
1538 1538
 			}
1539
-			if ( is_single() ) {
1540
-				$breadcrumb .= '<li>' . $separator . '<a href="' . get_category_link( $category[0]->term_id ) . '">' . $category[0]->cat_name . '</a></li>';
1541
-				$breadcrumb .= '<li>' . $separator . get_the_title() . '</li>';
1539
+			if (is_single()) {
1540
+				$breadcrumb .= '<li>'.$separator.'<a href="'.get_category_link($category[0]->term_id).'">'.$category[0]->cat_name.'</a></li>';
1541
+				$breadcrumb .= '<li>'.$separator.get_the_title().'</li>';
1542 1542
 			}
1543 1543
 			/* End of my version ##################################################### */
1544
-		} else if ( is_page() ) {
1544
+		} else if (is_page()) {
1545 1545
 			$page_title = get_the_title();
1546 1546
 
1547
-			if ( geodir_is_page( 'location' ) ) {
1547
+			if (geodir_is_page('location')) {
1548 1548
 				$location_page_id = geodir_location_page_id();
1549
-				$loc_post         = get_post( $location_page_id );
1549
+				$loc_post         = get_post($location_page_id);
1550 1550
 				$post_name        = $loc_post->post_name;
1551
-				$slug             = ucwords( str_replace( '-', ' ', $post_name ) );
1552
-				$page_title       = ! empty( $slug ) ? $slug : __( 'Location', 'geodirectory' );
1551
+				$slug             = ucwords(str_replace('-', ' ', $post_name));
1552
+				$page_title       = !empty($slug) ? $slug : __('Location', 'geodirectory');
1553 1553
 			}
1554 1554
 
1555
-			$breadcrumb .= '<li>' . $separator;
1556
-			$breadcrumb .= stripslashes_deep( $page_title );
1555
+			$breadcrumb .= '<li>'.$separator;
1556
+			$breadcrumb .= stripslashes_deep($page_title);
1557 1557
 			$breadcrumb .= '</li>';
1558
-		} else if ( is_tag() ) {
1559
-			$breadcrumb .= "<li> " . $separator . single_tag_title( '', false ) . '</li>';
1560
-		} else if ( is_day() ) {
1561
-			$breadcrumb .= "<li> " . $separator . __( " Archive for", 'geodirectory' ) . " ";
1562
-			the_time( 'F jS, Y' );
1558
+		} else if (is_tag()) {
1559
+			$breadcrumb .= "<li> ".$separator.single_tag_title('', false).'</li>';
1560
+		} else if (is_day()) {
1561
+			$breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." ";
1562
+			the_time('F jS, Y');
1563 1563
 			$breadcrumb .= '</li>';
1564
-		} else if ( is_month() ) {
1565
-			$breadcrumb .= "<li> " . $separator . __( " Archive for", 'geodirectory' ) . " ";
1566
-			the_time( 'F, Y' );
1564
+		} else if (is_month()) {
1565
+			$breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." ";
1566
+			the_time('F, Y');
1567 1567
 			$breadcrumb .= '</li>';
1568
-		} else if ( is_year() ) {
1569
-			$breadcrumb .= "<li> " . $separator . __( " Archive for", 'geodirectory' ) . " ";
1570
-			the_time( 'Y' );
1568
+		} else if (is_year()) {
1569
+			$breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." ";
1570
+			the_time('Y');
1571 1571
 			$breadcrumb .= '</li>';
1572
-		} else if ( is_author() ) {
1573
-			$breadcrumb .= "<li> " . $separator . __( " Author Archive", 'geodirectory' );
1572
+		} else if (is_author()) {
1573
+			$breadcrumb .= "<li> ".$separator.__(" Author Archive", 'geodirectory');
1574 1574
 			$breadcrumb .= '</li>';
1575
-		} else if ( isset( $_GET['paged'] ) && ! empty( $_GET['paged'] ) ) {
1576
-			$breadcrumb .= "<li>" . $separator . __( "Blog Archives", 'geodirectory' );
1575
+		} else if (isset($_GET['paged']) && !empty($_GET['paged'])) {
1576
+			$breadcrumb .= "<li>".$separator.__("Blog Archives", 'geodirectory');
1577 1577
 			$breadcrumb .= '</li>';
1578
-		} else if ( is_search() ) {
1579
-			$breadcrumb .= "<li> " . $separator . __( " Search Results", 'geodirectory' );
1578
+		} else if (is_search()) {
1579
+			$breadcrumb .= "<li> ".$separator.__(" Search Results", 'geodirectory');
1580 1580
 			$breadcrumb .= '</li>';
1581 1581
 		}
1582 1582
 		$breadcrumb .= '</ul></div>';
@@ -1589,13 +1589,13 @@  discard block
 block discarded – undo
1589 1589
 		 * @param string $breadcrumb Breadcrumb HTML.
1590 1590
 		 * @param string $separator  Breadcrumb separator.
1591 1591
 		 */
1592
-		echo $breadcrumb = apply_filters( 'geodir_breadcrumb', $breadcrumb, $separator );
1592
+		echo $breadcrumb = apply_filters('geodir_breadcrumb', $breadcrumb, $separator);
1593 1593
 	}
1594 1594
 }
1595 1595
 
1596 1596
 
1597
-add_action( "admin_init", "geodir_allow_wpadmin" ); // check user is admin
1598
-if ( ! function_exists( 'geodir_allow_wpadmin' ) ) {
1597
+add_action("admin_init", "geodir_allow_wpadmin"); // check user is admin
1598
+if (!function_exists('geodir_allow_wpadmin')) {
1599 1599
 	/**
1600 1600
 	 * Allow only admins to access wp-admin.
1601 1601
 	 *
@@ -1607,12 +1607,12 @@  discard block
 block discarded – undo
1607 1607
 	 */
1608 1608
 	function geodir_allow_wpadmin() {
1609 1609
 		global $wpdb;
1610
-		if ( get_option( 'geodir_allow_wpadmin' ) == '0' && is_user_logged_in() && ( ! defined( 'DOING_AJAX' ) ) ) // checking action in request to allow ajax request go through
1610
+		if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && (!defined('DOING_AJAX'))) // checking action in request to allow ajax request go through
1611 1611
 		{
1612
-			if ( current_user_can( 'administrator' ) ) {
1612
+			if (current_user_can('administrator')) {
1613 1613
 			} else {
1614 1614
 
1615
-				wp_redirect( home_url() );
1615
+				wp_redirect(home_url());
1616 1616
 				exit;
1617 1617
 			}
1618 1618
 
@@ -1631,23 +1631,23 @@  discard block
 block discarded – undo
1631 1631
  *
1632 1632
  * @return array|WP_Error The uploaded data as array. When failure returns error.
1633 1633
  */
1634
-function fetch_remote_file( $url ) {
1634
+function fetch_remote_file($url) {
1635 1635
 	// extract the file name and extension from the url
1636
-	require_once( ABSPATH . 'wp-includes/pluggable.php' );
1637
-	$file_name = basename( $url );
1638
-	if ( strpos( $file_name, '?' ) !== false ) {
1639
-		list( $file_name ) = explode( '?', $file_name );
1636
+	require_once(ABSPATH.'wp-includes/pluggable.php');
1637
+	$file_name = basename($url);
1638
+	if (strpos($file_name, '?') !== false) {
1639
+		list($file_name) = explode('?', $file_name);
1640 1640
 	}
1641 1641
 	$dummy        = false;
1642 1642
 	$add_to_cache = false;
1643 1643
 	$key          = null;
1644
-	if ( strpos( $url, '/dummy/' ) !== false ) {
1644
+	if (strpos($url, '/dummy/') !== false) {
1645 1645
 		$dummy = true;
1646
-		$key   = "dummy_" . str_replace( '.', '_', $file_name );
1647
-		$value = get_transient( 'cached_dummy_images' );
1648
-		if ( $value ) {
1649
-			if ( isset( $value[ $key ] ) ) {
1650
-				return $value[ $key ];
1646
+		$key   = "dummy_".str_replace('.', '_', $file_name);
1647
+		$value = get_transient('cached_dummy_images');
1648
+		if ($value) {
1649
+			if (isset($value[$key])) {
1650
+				return $value[$key];
1651 1651
 			} else {
1652 1652
 				$add_to_cache = true;
1653 1653
 			}
@@ -1658,58 +1658,58 @@  discard block
 block discarded – undo
1658 1658
 
1659 1659
 	// get placeholder file in the upload dir with a unique, sanitized filename
1660 1660
 
1661
-	$post_upload_date = isset( $post['upload_date'] ) ? $post['upload_date'] : '';
1661
+	$post_upload_date = isset($post['upload_date']) ? $post['upload_date'] : '';
1662 1662
 
1663
-	$upload = wp_upload_bits( $file_name, 0, '', $post_upload_date );
1664
-	if ( $upload['error'] ) {
1665
-		return new WP_Error( 'upload_dir_error', $upload['error'] );
1663
+	$upload = wp_upload_bits($file_name, 0, '', $post_upload_date);
1664
+	if ($upload['error']) {
1665
+		return new WP_Error('upload_dir_error', $upload['error']);
1666 1666
 	}
1667 1667
 
1668 1668
 
1669
-	sleep( 0.3 );// if multiple remote file this can cause the remote server to timeout so we add a slight delay
1669
+	sleep(0.3); // if multiple remote file this can cause the remote server to timeout so we add a slight delay
1670 1670
 
1671 1671
 	// fetch the remote url and write it to the placeholder file
1672
-	$headers = wp_remote_get( $url, array( 'stream' => true, 'filename' => $upload['file'] ) );
1672
+	$headers = wp_remote_get($url, array('stream' => true, 'filename' => $upload['file']));
1673 1673
 
1674 1674
 	$log_message = '';
1675
-	if ( is_wp_error( $headers ) ) {
1676
-		echo 'file: ' . $url;
1675
+	if (is_wp_error($headers)) {
1676
+		echo 'file: '.$url;
1677 1677
 
1678
-		return new WP_Error( 'import_file_error', $headers->get_error_message() );
1678
+		return new WP_Error('import_file_error', $headers->get_error_message());
1679 1679
 	}
1680 1680
 
1681
-	$filesize = filesize( $upload['file'] );
1681
+	$filesize = filesize($upload['file']);
1682 1682
 	// request failed
1683
-	if ( ! $headers ) {
1684
-		$log_message = __( 'Remote server did not respond', 'geodirectory' );
1683
+	if (!$headers) {
1684
+		$log_message = __('Remote server did not respond', 'geodirectory');
1685 1685
 	} // make sure the fetch was successful
1686
-	elseif ( $headers['response']['code'] != '200' ) {
1687
-		$log_message = sprintf( __( 'Remote server returned error response %1$d %2$s', 'geodirectory' ), esc_html( $headers['response'] ), get_status_header_desc( $headers['response'] ) );
1688
-	} elseif ( isset( $headers['headers']['content-length'] ) && $filesize != $headers['headers']['content-length'] ) {
1689
-		$log_message = __( 'Remote file is incorrect size', 'geodirectory' );
1690
-	} elseif ( 0 == $filesize ) {
1691
-		$log_message = __( 'Zero size file downloaded', 'geodirectory' );
1692
-	}
1693
-
1694
-	if ( $log_message ) {
1695
-		$del = unlink( $upload['file'] );
1696
-		if ( ! $del ) {
1697
-			geodir_error_log( __( 'GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory' ) );
1686
+	elseif ($headers['response']['code'] != '200') {
1687
+		$log_message = sprintf(__('Remote server returned error response %1$d %2$s', 'geodirectory'), esc_html($headers['response']), get_status_header_desc($headers['response']));
1688
+	} elseif (isset($headers['headers']['content-length']) && $filesize != $headers['headers']['content-length']) {
1689
+		$log_message = __('Remote file is incorrect size', 'geodirectory');
1690
+	} elseif (0 == $filesize) {
1691
+		$log_message = __('Zero size file downloaded', 'geodirectory');
1692
+	}
1693
+
1694
+	if ($log_message) {
1695
+		$del = unlink($upload['file']);
1696
+		if (!$del) {
1697
+			geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory'));
1698 1698
 		}
1699 1699
 
1700
-		return new WP_Error( 'import_file_error', $log_message );
1700
+		return new WP_Error('import_file_error', $log_message);
1701 1701
 	}
1702 1702
 
1703
-	if ( $dummy && $add_to_cache && is_array( $upload ) ) {
1704
-		$images = get_transient( 'cached_dummy_images' );
1705
-		if ( is_array( $images ) ) {
1706
-			$images[ $key ] = $upload;
1703
+	if ($dummy && $add_to_cache && is_array($upload)) {
1704
+		$images = get_transient('cached_dummy_images');
1705
+		if (is_array($images)) {
1706
+			$images[$key] = $upload;
1707 1707
 		} else {
1708
-			$images = array( $key => $upload );
1708
+			$images = array($key => $upload);
1709 1709
 		}
1710 1710
 
1711 1711
 		//setting the cache using the WP Transient API
1712
-		set_transient( 'cached_dummy_images', $images, 60 * 10 ); //10 minutes cache
1712
+		set_transient('cached_dummy_images', $images, 60 * 10); //10 minutes cache
1713 1713
 	}
1714 1714
 
1715 1715
 	return $upload;
@@ -1723,12 +1723,12 @@  discard block
 block discarded – undo
1723 1723
  * @return string|void Max upload size.
1724 1724
  */
1725 1725
 function geodir_max_upload_size() {
1726
-	$max_filesize = (float) get_option( 'geodir_upload_max_filesize', 2 );
1726
+	$max_filesize = (float) get_option('geodir_upload_max_filesize', 2);
1727 1727
 
1728
-	if ( $max_filesize > 0 && $max_filesize < 1 ) {
1729
-		$max_filesize = (int) ( $max_filesize * 1024 ) . 'kb';
1728
+	if ($max_filesize > 0 && $max_filesize < 1) {
1729
+		$max_filesize = (int) ($max_filesize * 1024).'kb';
1730 1730
 	} else {
1731
-		$max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1731
+		$max_filesize = $max_filesize > 0 ? $max_filesize.'mb' : '2mb';
1732 1732
 	}
1733 1733
 
1734 1734
 	/**
@@ -1738,7 +1738,7 @@  discard block
 block discarded – undo
1738 1738
 	 *
1739 1739
 	 * @param string $max_filesize Max file upload size. Ex. 10mb, 512kb.
1740 1740
 	 */
1741
-	return apply_filters( 'geodir_default_image_upload_size_limit', $max_filesize );
1741
+	return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
1742 1742
 }
1743 1743
 
1744 1744
 /**
@@ -1751,8 +1751,8 @@  discard block
 block discarded – undo
1751 1751
  * @return bool If dummy folder exists returns true, else false.
1752 1752
  */
1753 1753
 function geodir_dummy_folder_exists() {
1754
-	$path = geodir_plugin_path() . '/geodirectory-admin/dummy/';
1755
-	if ( ! is_dir( $path ) ) {
1754
+	$path = geodir_plugin_path().'/geodirectory-admin/dummy/';
1755
+	if (!is_dir($path)) {
1756 1756
 		return false;
1757 1757
 	} else {
1758 1758
 		return true;
@@ -1771,17 +1771,17 @@  discard block
 block discarded – undo
1771 1771
  *
1772 1772
  * @return object Author info.
1773 1773
  */
1774
-function geodir_get_author_info( $aid ) {
1774
+function geodir_get_author_info($aid) {
1775 1775
 	global $wpdb;
1776 1776
 	/*$infosql = "select * from $wpdb->users where ID=$aid";*/
1777
-	$infosql = $wpdb->prepare( "select * from $wpdb->users where ID=%d", array( $aid ) );
1778
-	$info    = $wpdb->get_results( $infosql );
1779
-	if ( $info ) {
1777
+	$infosql = $wpdb->prepare("select * from $wpdb->users where ID=%d", array($aid));
1778
+	$info    = $wpdb->get_results($infosql);
1779
+	if ($info) {
1780 1780
 		return $info[0];
1781 1781
 	}
1782 1782
 }
1783 1783
 
1784
-if ( ! function_exists( 'adminEmail' ) ) {
1784
+if (!function_exists('adminEmail')) {
1785 1785
 	/**
1786 1786
 	 * Send emails to client on post submission, renew etc.
1787 1787
 	 *
@@ -1794,67 +1794,67 @@  discard block
 block discarded – undo
1794 1794
 	 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1795 1795
 	 * @param string $custom_1     Custom data to be sent.
1796 1796
 	 */
1797
-	function adminEmail( $page_id, $user_id, $message_type, $custom_1 = '' ) {
1797
+	function adminEmail($page_id, $user_id, $message_type, $custom_1 = '') {
1798 1798
 		global $wpdb;
1799
-		if ( $message_type == 'expiration' ) {
1800
-			$subject        = stripslashes( __( get_option( 'renew_email_subject' ), 'geodirectory' ) );
1801
-			$client_message = stripslashes( __( get_option( 'renew_email_content' ), 'geodirectory' ) );
1802
-		} elseif ( $message_type == 'post_submited' ) {
1803
-			$subject        = __( get_option( 'post_submited_success_email_subject_admin' ), 'geodirectory' );
1804
-			$client_message = __( get_option( 'post_submited_success_email_content_admin' ), 'geodirectory' );
1805
-		} elseif ( $message_type == 'renew' ) {
1806
-			$subject        = __( get_option( 'post_renew_success_email_subject_admin' ), 'geodirectory' );
1807
-			$client_message = __( get_option( 'post_renew_success_email_content_admin' ), 'geodirectory' );
1808
-		} elseif ( $message_type == 'upgrade' ) {
1809
-			$subject        = __( get_option( 'post_upgrade_success_email_subject_admin' ), 'geodirectory' );
1810
-			$client_message = __( get_option( 'post_upgrade_success_email_content_admin' ), 'geodirectory' );
1811
-		} elseif ( $message_type == 'claim_approved' ) {
1812
-			$subject        = __( get_option( 'claim_approved_email_subject' ), 'geodirectory' );
1813
-			$client_message = __( get_option( 'claim_approved_email_content' ), 'geodirectory' );
1814
-		} elseif ( $message_type == 'claim_rejected' ) {
1815
-			$subject        = __( get_option( 'claim_rejected_email_subject' ), 'geodirectory' );
1816
-			$client_message = __( get_option( 'claim_rejected_email_content' ), 'geodirectory' );
1817
-		} elseif ( $message_type == 'claim_requested' ) {
1818
-			$subject        = __( get_option( 'claim_email_subject_admin' ), 'geodirectory' );
1819
-			$client_message = __( get_option( 'claim_email_content_admin' ), 'geodirectory' );
1820
-		} elseif ( $message_type == 'auto_claim' ) {
1821
-			$subject        = __( get_option( 'auto_claim_email_subject' ), 'geodirectory' );
1822
-			$client_message = __( get_option( 'auto_claim_email_content' ), 'geodirectory' );
1823
-		} elseif ( $message_type == 'payment_success' ) {
1824
-			$subject        = __( get_option( 'post_payment_success_admin_email_subject' ), 'geodirectory' );
1825
-			$client_message = __( get_option( 'post_payment_success_admin_email_content' ), 'geodirectory' );
1826
-		} elseif ( $message_type == 'payment_fail' ) {
1827
-			$subject        = __( get_option( 'post_payment_fail_admin_email_subject' ), 'geodirectory' );
1828
-			$client_message = __( get_option( 'post_payment_fail_admin_email_content' ), 'geodirectory' );
1799
+		if ($message_type == 'expiration') {
1800
+			$subject        = stripslashes(__(get_option('renew_email_subject'), 'geodirectory'));
1801
+			$client_message = stripslashes(__(get_option('renew_email_content'), 'geodirectory'));
1802
+		} elseif ($message_type == 'post_submited') {
1803
+			$subject        = __(get_option('post_submited_success_email_subject_admin'), 'geodirectory');
1804
+			$client_message = __(get_option('post_submited_success_email_content_admin'), 'geodirectory');
1805
+		} elseif ($message_type == 'renew') {
1806
+			$subject        = __(get_option('post_renew_success_email_subject_admin'), 'geodirectory');
1807
+			$client_message = __(get_option('post_renew_success_email_content_admin'), 'geodirectory');
1808
+		} elseif ($message_type == 'upgrade') {
1809
+			$subject        = __(get_option('post_upgrade_success_email_subject_admin'), 'geodirectory');
1810
+			$client_message = __(get_option('post_upgrade_success_email_content_admin'), 'geodirectory');
1811
+		} elseif ($message_type == 'claim_approved') {
1812
+			$subject        = __(get_option('claim_approved_email_subject'), 'geodirectory');
1813
+			$client_message = __(get_option('claim_approved_email_content'), 'geodirectory');
1814
+		} elseif ($message_type == 'claim_rejected') {
1815
+			$subject        = __(get_option('claim_rejected_email_subject'), 'geodirectory');
1816
+			$client_message = __(get_option('claim_rejected_email_content'), 'geodirectory');
1817
+		} elseif ($message_type == 'claim_requested') {
1818
+			$subject        = __(get_option('claim_email_subject_admin'), 'geodirectory');
1819
+			$client_message = __(get_option('claim_email_content_admin'), 'geodirectory');
1820
+		} elseif ($message_type == 'auto_claim') {
1821
+			$subject        = __(get_option('auto_claim_email_subject'), 'geodirectory');
1822
+			$client_message = __(get_option('auto_claim_email_content'), 'geodirectory');
1823
+		} elseif ($message_type == 'payment_success') {
1824
+			$subject        = __(get_option('post_payment_success_admin_email_subject'), 'geodirectory');
1825
+			$client_message = __(get_option('post_payment_success_admin_email_content'), 'geodirectory');
1826
+		} elseif ($message_type == 'payment_fail') {
1827
+			$subject        = __(get_option('post_payment_fail_admin_email_subject'), 'geodirectory');
1828
+			$client_message = __(get_option('post_payment_fail_admin_email_content'), 'geodirectory');
1829 1829
 		}
1830 1830
 		$transaction_details = $custom_1;
1831
-		$fromEmail           = get_option( 'site_email' );
1831
+		$fromEmail           = get_option('site_email');
1832 1832
 		$fromEmailName       = get_site_emailName();
1833 1833
 //$alivedays = get_post_meta($page_id,'alive_days',true);
1834
-		$pkg_limit            = get_property_price_info_listing( $page_id );
1834
+		$pkg_limit            = get_property_price_info_listing($page_id);
1835 1835
 		$alivedays            = $pkg_limit['days'];
1836
-		$productlink          = get_permalink( $page_id );
1837
-		$post_info            = get_post( $page_id );
1838
-		$post_date            = date( 'dS F,Y', strtotime( $post_info->post_date ) );
1839
-		$listingLink          = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
1836
+		$productlink          = get_permalink($page_id);
1837
+		$post_info            = get_post($page_id);
1838
+		$post_date            = date('dS F,Y', strtotime($post_info->post_date));
1839
+		$listingLink          = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>';
1840 1840
 		$loginurl             = geodir_login_url();
1841
-		$loginurl_link        = '<a href="' . $loginurl . '">login</a>';
1841
+		$loginurl_link        = '<a href="'.$loginurl.'">login</a>';
1842 1842
 		$siteurl              = home_url();
1843
-		$siteurl_link         = '<a href="' . $siteurl . '">' . $fromEmailName . '</a>';
1844
-		$user_info            = get_userdata( $user_id );
1843
+		$siteurl_link         = '<a href="'.$siteurl.'">'.$fromEmailName.'</a>';
1844
+		$user_info            = get_userdata($user_id);
1845 1845
 		$user_email           = $user_info->user_email;
1846
-		$display_name         = geodir_get_client_name( $user_id );
1846
+		$display_name         = geodir_get_client_name($user_id);
1847 1847
 		$user_login           = $user_info->user_login;
1848
-		$number_of_grace_days = get_option( 'ptthemes_listing_preexpiry_notice_days' );
1849
-		if ( $number_of_grace_days == '' ) {
1848
+		$number_of_grace_days = get_option('ptthemes_listing_preexpiry_notice_days');
1849
+		if ($number_of_grace_days == '') {
1850 1850
 			$number_of_grace_days = 1;
1851 1851
 		}
1852
-		if ( $post_info->post_type == 'event' ) {
1852
+		if ($post_info->post_type == 'event') {
1853 1853
 			$post_type = 'event';
1854 1854
 		} else {
1855 1855
 			$post_type = 'listing';
1856 1856
 		}
1857
-		$renew_link     = '<a href="' . $siteurl . '?ptype=post_' . $post_type . '&renew=1&pid=' . $page_id . '">' . RENEW_LINK . '</a>';
1857
+		$renew_link     = '<a href="'.$siteurl.'?ptype=post_'.$post_type.'&renew=1&pid='.$page_id.'">'.RENEW_LINK.'</a>';
1858 1858
 		$search_array   = array(
1859 1859
 			'[#client_name#]',
1860 1860
 			'[#listing_link#]',
@@ -1870,7 +1870,7 @@  discard block
 block discarded – undo
1870 1870
 			'[#site_name#]',
1871 1871
 			'[#transaction_details#]'
1872 1872
 		);
1873
-		$replace_array  = array(
1873
+		$replace_array = array(
1874 1874
 			$display_name,
1875 1875
 			$listingLink,
1876 1876
 			$post_date,
@@ -1885,13 +1885,13 @@  discard block
 block discarded – undo
1885 1885
 			$fromEmailName,
1886 1886
 			$transaction_details
1887 1887
 		);
1888
-		$client_message = str_replace( $search_array, $replace_array, $client_message );
1889
-		$subject        = str_replace( $search_array, $replace_array, $subject );
1888
+		$client_message = str_replace($search_array, $replace_array, $client_message);
1889
+		$subject        = str_replace($search_array, $replace_array, $subject);
1890 1890
 		
1891 1891
 		
1892
-		$headers  = array();
1892
+		$headers = array();
1893 1893
 		$headers[] = 'Content-type: text/html; charset=UTF-8';
1894
-		$headers[] = 'From: ' . $fromEmailName . ' <' . $fromEmail . '>';
1894
+		$headers[] = 'From: '.$fromEmailName.' <'.$fromEmail.'>';
1895 1895
 
1896 1896
 		$to      = $fromEmail;
1897 1897
 		$message = $client_message;
@@ -1909,7 +1909,7 @@  discard block
 block discarded – undo
1909 1909
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1910 1910
 		 * @param string $custom_1     Custom data to be sent.
1911 1911
 		 */
1912
-		$to = apply_filters( 'geodir_adminEmail_to', $to, $page_id, $user_id, $message_type, $custom_1 );
1912
+		$to = apply_filters('geodir_adminEmail_to', $to, $page_id, $user_id, $message_type, $custom_1);
1913 1913
 		/**
1914 1914
 		 * Filter the admin email subject.
1915 1915
 		 *
@@ -1922,7 +1922,7 @@  discard block
 block discarded – undo
1922 1922
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1923 1923
 		 * @param string $custom_1     Custom data to be sent.
1924 1924
 		 */
1925
-		$subject = apply_filters( 'geodir_adminEmail_subject', $subject, $page_id, $user_id, $message_type, $custom_1 );
1925
+		$subject = apply_filters('geodir_adminEmail_subject', $subject, $page_id, $user_id, $message_type, $custom_1);
1926 1926
 		/**
1927 1927
 		 * Filter the admin email message.
1928 1928
 		 *
@@ -1935,7 +1935,7 @@  discard block
 block discarded – undo
1935 1935
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1936 1936
 		 * @param string $custom_1     Custom data to be sent.
1937 1937
 		 */
1938
-		$message = apply_filters( 'geodir_adminEmail_message', $message, $page_id, $user_id, $message_type, $custom_1 );
1938
+		$message = apply_filters('geodir_adminEmail_message', $message, $page_id, $user_id, $message_type, $custom_1);
1939 1939
 		/**
1940 1940
 		 * Filter the admin email headers.
1941 1941
 		 *
@@ -1948,22 +1948,22 @@  discard block
 block discarded – undo
1948 1948
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1949 1949
 		 * @param string $custom_1     Custom data to be sent.
1950 1950
 		 */
1951
-		$headers = apply_filters( 'geodir_adminEmail_headers', $headers, $page_id, $user_id, $message_type, $custom_1 );
1951
+		$headers = apply_filters('geodir_adminEmail_headers', $headers, $page_id, $user_id, $message_type, $custom_1);
1952 1952
 
1953 1953
 
1954
-		$sent = wp_mail( $to, $subject, $message, $headers );
1955
-		if ( ! $sent ) {
1956
-			if ( is_array( $to ) ) {
1957
-				$to = implode( ',', $to );
1954
+		$sent = wp_mail($to, $subject, $message, $headers);
1955
+		if (!$sent) {
1956
+			if (is_array($to)) {
1957
+				$to = implode(',', $to);
1958 1958
 			}
1959 1959
 			$log_message = sprintf(
1960
-				__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1960
+				__("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1961 1961
 				$message_type,
1962
-				date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1962
+				date_i18n('F j Y H:i:s', current_time('timestamp')),
1963 1963
 				$to,
1964 1964
 				$subject
1965 1965
 			);
1966
-			geodir_error_log( $log_message );
1966
+			geodir_error_log($log_message);
1967 1967
 		}
1968 1968
 	}
1969 1969
 }
@@ -1983,12 +1983,12 @@  discard block
 block discarded – undo
1983 1983
  *
1984 1984
  * @return array Category IDs.
1985 1985
  */
1986
-function gd_lang_object_ids( $ids_array, $type ) {
1987
-	if ( function_exists( 'icl_object_id' ) ) {
1986
+function gd_lang_object_ids($ids_array, $type) {
1987
+	if (function_exists('icl_object_id')) {
1988 1988
 		$res = array();
1989
-		foreach ( $ids_array as $id ) {
1990
-			$xlat = icl_object_id( $id, $type, false );
1991
-			if ( ! is_null( $xlat ) ) {
1989
+		foreach ($ids_array as $id) {
1990
+			$xlat = icl_object_id($id, $type, false);
1991
+			if (!is_null($xlat)) {
1992 1992
 				$res[] = $xlat;
1993 1993
 			}
1994 1994
 		}
@@ -2012,20 +2012,20 @@  discard block
 block discarded – undo
2012 2012
  *
2013 2013
  * @return array Modified Body CSS classes.
2014 2014
  */
2015
-function geodir_custom_posts_body_class( $classes ) {
2015
+function geodir_custom_posts_body_class($classes) {
2016 2016
 	global $wpdb, $wp;
2017
-	$post_types = geodir_get_posttypes( 'object' );
2018
-	if ( ! empty( $post_types ) && count( (array) $post_types ) > 1 ) {
2017
+	$post_types = geodir_get_posttypes('object');
2018
+	if (!empty($post_types) && count((array) $post_types) > 1) {
2019 2019
 		$classes[] = 'geodir_custom_posts';
2020 2020
 	}
2021 2021
 
2022 2022
 	// fix body class for signup page
2023
-	if ( geodir_is_page( 'login' ) ) {
2023
+	if (geodir_is_page('login')) {
2024 2024
 		$new_classes   = array();
2025 2025
 		$new_classes[] = 'signup page-geodir-signup';
2026
-		if ( ! empty( $classes ) ) {
2027
-			foreach ( $classes as $class ) {
2028
-				if ( $class && $class != 'home' && $class != 'blog' ) {
2026
+		if (!empty($classes)) {
2027
+			foreach ($classes as $class) {
2028
+				if ($class && $class != 'home' && $class != 'blog') {
2029 2029
 					$new_classes[] = $class;
2030 2030
 				}
2031 2031
 			}
@@ -2033,14 +2033,14 @@  discard block
 block discarded – undo
2033 2033
 		$classes = $new_classes;
2034 2034
 	}
2035 2035
 
2036
-	if ( geodir_is_geodir_page() ) {
2036
+	if (geodir_is_geodir_page()) {
2037 2037
 		$classes[] = 'geodir-page';
2038 2038
 	}
2039 2039
 
2040 2040
 	return $classes;
2041 2041
 }
2042 2042
 
2043
-add_filter( 'body_class', 'geodir_custom_posts_body_class' ); // let's add a class to the body so we can style the new addition to the search
2043
+add_filter('body_class', 'geodir_custom_posts_body_class'); // let's add a class to the body so we can style the new addition to the search
2044 2044
 
2045 2045
 
2046 2046
 /**
@@ -2056,7 +2056,7 @@  discard block
 block discarded – undo
2056 2056
 	 *
2057 2057
 	 * @since 1.0.0
2058 2058
 	 */
2059
-	return apply_filters( 'geodir_map_zoom_level', array(
2059
+	return apply_filters('geodir_map_zoom_level', array(
2060 2060
 		1,
2061 2061
 		2,
2062 2062
 		3,
@@ -2076,7 +2076,7 @@  discard block
 block discarded – undo
2076 2076
 		17,
2077 2077
 		18,
2078 2078
 		19
2079
-	) );
2079
+	));
2080 2080
 
2081 2081
 }
2082 2082
 
@@ -2089,12 +2089,12 @@  discard block
 block discarded – undo
2089 2089
  *
2090 2090
  * @param string $geodir_option_name Option key.
2091 2091
  */
2092
-function geodir_option_version_backup( $geodir_option_name ) {
2092
+function geodir_option_version_backup($geodir_option_name) {
2093 2093
 	$version_date  = time();
2094
-	$geodir_option = get_option( $geodir_option_name );
2094
+	$geodir_option = get_option($geodir_option_name);
2095 2095
 
2096
-	if ( ! empty( $geodir_option ) ) {
2097
-		add_option( $geodir_option_name . '_' . $version_date, $geodir_option );
2096
+	if (!empty($geodir_option)) {
2097
+		add_option($geodir_option_name.'_'.$version_date, $geodir_option);
2098 2098
 	}
2099 2099
 }
2100 2100
 
@@ -2108,10 +2108,10 @@  discard block
 block discarded – undo
2108 2108
  *
2109 2109
  * @return int Page ID.
2110 2110
  */
2111
-function get_page_id_geodir_add_listing_page( $page_id ) {
2112
-	if ( geodir_wpml_multilingual_status() ) {
2111
+function get_page_id_geodir_add_listing_page($page_id) {
2112
+	if (geodir_wpml_multilingual_status()) {
2113 2113
 		$post_type = 'post_page';
2114
-		$page_id   = geodir_get_wpml_element_id( $page_id, $post_type );
2114
+		$page_id   = geodir_get_wpml_element_id($page_id, $post_type);
2115 2115
 	}
2116 2116
 
2117 2117
 	return $page_id;
@@ -2125,7 +2125,7 @@  discard block
 block discarded – undo
2125 2125
  * @return bool Returns true when sitepress multilingual CMS active. else returns false.
2126 2126
  */
2127 2127
 function geodir_wpml_multilingual_status() {
2128
-	if ( function_exists( 'icl_object_id' ) ) {
2128
+	if (function_exists('icl_object_id')) {
2129 2129
 		return true;
2130 2130
 	}
2131 2131
 
@@ -2143,19 +2143,19 @@  discard block
 block discarded – undo
2143 2143
  *
2144 2144
  * @return int Element ID when exists. Else the page id.
2145 2145
  */
2146
-function geodir_get_wpml_element_id( $page_id, $post_type ) {
2146
+function geodir_get_wpml_element_id($page_id, $post_type) {
2147 2147
 	global $sitepress;
2148
-	if ( geodir_wpml_multilingual_status() && ! empty( $sitepress ) && isset( $sitepress->queries ) ) {
2149
-		$trid = $sitepress->get_element_trid( $page_id, $post_type );
2148
+	if (geodir_wpml_multilingual_status() && !empty($sitepress) && isset($sitepress->queries)) {
2149
+		$trid = $sitepress->get_element_trid($page_id, $post_type);
2150 2150
 
2151
-		if ( $trid > 0 ) {
2152
-			$translations = $sitepress->get_element_translations( $trid, $post_type );
2151
+		if ($trid > 0) {
2152
+			$translations = $sitepress->get_element_translations($trid, $post_type);
2153 2153
 
2154 2154
 			$lang = $sitepress->get_current_language();
2155 2155
 			$lang = $lang ? $lang : $sitepress->get_default_language();
2156 2156
 
2157
-			if ( ! empty( $translations ) && ! empty( $lang ) && isset( $translations[ $lang ] ) && isset( $translations[ $lang ]->element_id ) && ! empty( $translations[ $lang ]->element_id ) ) {
2158
-				$page_id = $translations[ $lang ]->element_id;
2157
+			if (!empty($translations) && !empty($lang) && isset($translations[$lang]) && isset($translations[$lang]->element_id) && !empty($translations[$lang]->element_id)) {
2158
+				$page_id = $translations[$lang]->element_id;
2159 2159
 			}
2160 2160
 		}
2161 2161
 	}
@@ -2172,15 +2172,15 @@  discard block
 block discarded – undo
2172 2172
  */
2173 2173
 function geodir_wpml_check_element_id() {
2174 2174
 	global $sitepress;
2175
-	if ( geodir_wpml_multilingual_status() && ! empty( $sitepress ) && isset( $sitepress->queries ) ) {
2175
+	if (geodir_wpml_multilingual_status() && !empty($sitepress) && isset($sitepress->queries)) {
2176 2176
 		$el_type      = 'post_page';
2177
-		$el_id        = get_option( 'geodir_add_listing_page' );
2177
+		$el_id        = get_option('geodir_add_listing_page');
2178 2178
 		$default_lang = $sitepress->get_default_language();
2179
-		$el_details   = $sitepress->get_element_language_details( $el_id, $el_type );
2179
+		$el_details   = $sitepress->get_element_language_details($el_id, $el_type);
2180 2180
 
2181
-		if ( ! ( $el_id > 0 && $default_lang && ! empty( $el_details ) && isset( $el_details->language_code ) && $el_details->language_code == $default_lang ) ) {
2182
-			if ( ! $el_details->source_language_code ) {
2183
-				$sitepress->set_element_language_details( $el_id, $el_type, '', $default_lang );
2181
+		if (!($el_id > 0 && $default_lang && !empty($el_details) && isset($el_details->language_code) && $el_details->language_code == $default_lang)) {
2182
+			if (!$el_details->source_language_code) {
2183
+				$sitepress->set_element_language_details($el_id, $el_type, '', $default_lang);
2184 2184
 				$sitepress->icl_translations_cache->clear();
2185 2185
 			}
2186 2186
 		}
@@ -2199,41 +2199,41 @@  discard block
 block discarded – undo
2199 2199
  *
2200 2200
  * @return string Orderby SQL.
2201 2201
  */
2202
-function geodir_widget_listings_get_order( $query_args ) {
2202
+function geodir_widget_listings_get_order($query_args) {
2203 2203
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2204 2204
 
2205 2205
 	$query_args = $gd_query_args_widgets;
2206
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2207
-		return $wpdb->posts . ".post_date DESC, ";
2206
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2207
+		return $wpdb->posts.".post_date DESC, ";
2208 2208
 	}
2209 2209
 
2210
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2211
-	$table     = $plugin_prefix . $post_type . '_detail';
2210
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2211
+	$table     = $plugin_prefix.$post_type.'_detail';
2212 2212
 
2213
-	$sort_by = ! empty( $query_args['order_by'] ) ? $query_args['order_by'] : '';
2213
+	$sort_by = !empty($query_args['order_by']) ? $query_args['order_by'] : '';
2214 2214
 
2215
-	switch ( $sort_by ) {
2215
+	switch ($sort_by) {
2216 2216
 		case 'latest':
2217 2217
 		case 'newest':
2218
-			$orderby = $wpdb->posts . ".post_date DESC, ";
2218
+			$orderby = $wpdb->posts.".post_date DESC, ";
2219 2219
 			break;
2220 2220
 		case 'featured':
2221
-			$orderby = $table . ".is_featured ASC, ";
2221
+			$orderby = $table.".is_featured ASC, ";
2222 2222
 			break;
2223 2223
 		case 'az':
2224
-			$orderby = $wpdb->posts . ".post_title ASC, ";
2224
+			$orderby = $wpdb->posts.".post_title ASC, ";
2225 2225
 			break;
2226 2226
 		case 'high_review':
2227
-			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
2227
+			$orderby = $table.".rating_count DESC, ".$table.".overall_rating DESC, ";
2228 2228
 			break;
2229 2229
 		case 'high_rating':
2230
-			$orderby = "( " . $table . ".overall_rating  ) DESC, ";
2230
+			$orderby = "( ".$table.".overall_rating  ) DESC, ";
2231 2231
 			break;
2232 2232
 		case 'random':
2233 2233
 			$orderby = "RAND(), ";
2234 2234
 			break;
2235 2235
 		default:
2236
-			$orderby = $wpdb->posts . ".post_title ASC, ";
2236
+			$orderby = $wpdb->posts.".post_title ASC, ";
2237 2237
 			break;
2238 2238
 	}
2239 2239
 
@@ -2256,15 +2256,15 @@  discard block
 block discarded – undo
2256 2256
  *
2257 2257
  * @return mixed Result object.
2258 2258
  */
2259
-function geodir_get_widget_listings( $query_args = array(), $count_only = false ) {
2259
+function geodir_get_widget_listings($query_args = array(), $count_only = false) {
2260 2260
 	global $wpdb, $plugin_prefix, $table_prefix;
2261 2261
 	$GLOBALS['gd_query_args_widgets'] = $query_args;
2262 2262
 	$gd_query_args_widgets            = $query_args;
2263 2263
 
2264
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2265
-	$table     = $plugin_prefix . $post_type . '_detail';
2264
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2265
+	$table     = $plugin_prefix.$post_type.'_detail';
2266 2266
 
2267
-	$fields = $wpdb->posts . ".*, " . $table . ".*";
2267
+	$fields = $wpdb->posts.".*, ".$table.".*";
2268 2268
 	/**
2269 2269
 	 * Filter widget listing fields string part that is being used for query.
2270 2270
 	 *
@@ -2274,17 +2274,17 @@  discard block
 block discarded – undo
2274 2274
 	 * @param string $table     Table name.
2275 2275
 	 * @param string $post_type Post type.
2276 2276
 	 */
2277
-	$fields = apply_filters( 'geodir_filter_widget_listings_fields', $fields, $table, $post_type );
2277
+	$fields = apply_filters('geodir_filter_widget_listings_fields', $fields, $table, $post_type);
2278 2278
 
2279
-	$join = "INNER JOIN " . $table . " ON (" . $table . ".post_id = " . $wpdb->posts . ".ID)";
2279
+	$join = "INNER JOIN ".$table." ON (".$table.".post_id = ".$wpdb->posts.".ID)";
2280 2280
 
2281 2281
 	########### WPML ###########
2282 2282
 
2283
-	if ( function_exists( 'icl_object_id' ) ) {
2283
+	if (function_exists('icl_object_id')) {
2284 2284
 		global $sitepress;
2285 2285
 		$lang_code = ICL_LANGUAGE_CODE;
2286
-		if ( $lang_code ) {
2287
-			$join .= " JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
2286
+		if ($lang_code) {
2287
+			$join .= " JOIN ".$table_prefix."icl_translations icl_t ON icl_t.element_id = ".$table_prefix."posts.ID";
2288 2288
 		}
2289 2289
 	}
2290 2290
 
@@ -2298,15 +2298,15 @@  discard block
 block discarded – undo
2298 2298
 	 * @param string $join      Join clause string.
2299 2299
 	 * @param string $post_type Post type.
2300 2300
 	 */
2301
-	$join = apply_filters( 'geodir_filter_widget_listings_join', $join, $post_type );
2301
+	$join = apply_filters('geodir_filter_widget_listings_join', $join, $post_type);
2302 2302
 
2303
-	$post_status = is_super_admin() ? " OR " . $wpdb->posts . ".post_status = 'private'" : '';
2303
+	$post_status = is_super_admin() ? " OR ".$wpdb->posts.".post_status = 'private'" : '';
2304 2304
 
2305
-	$where = " AND ( " . $wpdb->posts . ".post_status = 'publish' " . $post_status . " ) AND " . $wpdb->posts . ".post_type = '" . $post_type . "'";
2305
+	$where = " AND ( ".$wpdb->posts.".post_status = 'publish' ".$post_status." ) AND ".$wpdb->posts.".post_type = '".$post_type."'";
2306 2306
 
2307 2307
 	########### WPML ###########
2308
-	if ( function_exists( 'icl_object_id' ) ) {
2309
-		if ( $lang_code ) {
2308
+	if (function_exists('icl_object_id')) {
2309
+		if ($lang_code) {
2310 2310
 			$where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type = 'post_$post_type' ";
2311 2311
 		}
2312 2312
 	}
@@ -2319,8 +2319,8 @@  discard block
 block discarded – undo
2319 2319
 	 * @param string $where     Where clause string.
2320 2320
 	 * @param string $post_type Post type.
2321 2321
 	 */
2322
-	$where = apply_filters( 'geodir_filter_widget_listings_where', $where, $post_type );
2323
-	$where = $where != '' ? " WHERE 1=1 " . $where : '';
2322
+	$where = apply_filters('geodir_filter_widget_listings_where', $where, $post_type);
2323
+	$where = $where != '' ? " WHERE 1=1 ".$where : '';
2324 2324
 
2325 2325
 	$groupby = " GROUP BY $wpdb->posts.ID ";
2326 2326
 	/**
@@ -2331,15 +2331,15 @@  discard block
 block discarded – undo
2331 2331
 	 * @param string $groupby   Group by clause string.
2332 2332
 	 * @param string $post_type Post type.
2333 2333
 	 */
2334
-	$groupby = apply_filters( 'geodir_filter_widget_listings_groupby', $groupby, $post_type );
2334
+	$groupby = apply_filters('geodir_filter_widget_listings_groupby', $groupby, $post_type);
2335 2335
 
2336
-	if ( $count_only ) {
2337
-		$sql  = "SELECT COUNT(DISTINCT " . $wpdb->posts . ".ID) AS total FROM " . $wpdb->posts . "
2338
-			" . $join . "
2336
+	if ($count_only) {
2337
+		$sql  = "SELECT COUNT(DISTINCT ".$wpdb->posts.".ID) AS total FROM ".$wpdb->posts."
2338
+			" . $join."
2339 2339
 			" . $where;
2340
-		$rows = (int) $wpdb->get_var( $sql );
2340
+		$rows = (int) $wpdb->get_var($sql);
2341 2341
 	} else {
2342
-		$orderby = geodir_widget_listings_get_order( $query_args );
2342
+		$orderby = geodir_widget_listings_get_order($query_args);
2343 2343
 		/**
2344 2344
 		 * Filter widget listing orderby clause string part that is being used for query.
2345 2345
 		 *
@@ -2349,11 +2349,11 @@  discard block
 block discarded – undo
2349 2349
 		 * @param string $table     Table name.
2350 2350
 		 * @param string $post_type Post type.
2351 2351
 		 */
2352
-		$orderby = apply_filters( 'geodir_filter_widget_listings_orderby', $orderby, $table, $post_type );
2353
-		$orderby .= $wpdb->posts . ".post_title ASC";
2354
-		$orderby = $orderby != '' ? " ORDER BY " . $orderby : '';
2352
+		$orderby = apply_filters('geodir_filter_widget_listings_orderby', $orderby, $table, $post_type);
2353
+		$orderby .= $wpdb->posts.".post_title ASC";
2354
+		$orderby = $orderby != '' ? " ORDER BY ".$orderby : '';
2355 2355
 
2356
-		$limit = ! empty( $query_args['posts_per_page'] ) ? $query_args['posts_per_page'] : 5;
2356
+		$limit = !empty($query_args['posts_per_page']) ? $query_args['posts_per_page'] : 5;
2357 2357
 		/**
2358 2358
 		 * Filter widget listing limit that is being used for query.
2359 2359
 		 *
@@ -2362,26 +2362,26 @@  discard block
 block discarded – undo
2362 2362
 		 * @param int $limit        Query results limit.
2363 2363
 		 * @param string $post_type Post type.
2364 2364
 		 */
2365
-		$limit = apply_filters( 'geodir_filter_widget_listings_limit', $limit, $post_type );
2365
+		$limit = apply_filters('geodir_filter_widget_listings_limit', $limit, $post_type);
2366 2366
 
2367
-		$page = ! empty( $query_args['pageno'] ) ? absint( $query_args['pageno'] ) : 1;
2368
-		if ( ! $page ) {
2367
+		$page = !empty($query_args['pageno']) ? absint($query_args['pageno']) : 1;
2368
+		if (!$page) {
2369 2369
 			$page = 1;
2370 2370
 		}
2371 2371
 
2372
-		$limit = (int) $limit > 0 ? " LIMIT " . absint( ( $page - 1 ) * (int) $limit ) . ", " . (int) $limit : "";
2372
+		$limit = (int) $limit > 0 ? " LIMIT ".absint(($page - 1) * (int) $limit).", ".(int) $limit : "";
2373 2373
 
2374
-		$sql  = "SELECT SQL_CALC_FOUND_ROWS " . $fields . " FROM " . $wpdb->posts . "
2375
-			" . $join . "
2376
-			" . $where . "
2377
-			" . $groupby . "
2378
-			" . $orderby . "
2374
+		$sql = "SELECT SQL_CALC_FOUND_ROWS ".$fields." FROM ".$wpdb->posts."
2375
+			" . $join."
2376
+			" . $where."
2377
+			" . $groupby."
2378
+			" . $orderby."
2379 2379
 			" . $limit;
2380
-		$rows = $wpdb->get_results( $sql );
2380
+		$rows = $wpdb->get_results($sql);
2381 2381
 	}
2382 2382
 
2383
-	unset( $GLOBALS['gd_query_args_widgets'] );
2384
-	unset( $gd_query_args_widgets );
2383
+	unset($GLOBALS['gd_query_args_widgets']);
2384
+	unset($gd_query_args_widgets);
2385 2385
 
2386 2386
 	return $rows;
2387 2387
 }
@@ -2398,11 +2398,11 @@  discard block
 block discarded – undo
2398 2398
  *
2399 2399
  * @return string Modified fields SQL.
2400 2400
  */
2401
-function geodir_function_widget_listings_fields( $fields ) {
2401
+function geodir_function_widget_listings_fields($fields) {
2402 2402
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2403 2403
 
2404 2404
 	$query_args = $gd_query_args_widgets;
2405
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2405
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2406 2406
 		return $fields;
2407 2407
 	}
2408 2408
 
@@ -2421,24 +2421,24 @@  discard block
 block discarded – undo
2421 2421
  *
2422 2422
  * @return string Modified join clause SQL.
2423 2423
  */
2424
-function geodir_function_widget_listings_join( $join ) {
2424
+function geodir_function_widget_listings_join($join) {
2425 2425
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2426 2426
 
2427 2427
 	$query_args = $gd_query_args_widgets;
2428
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2428
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2429 2429
 		return $join;
2430 2430
 	}
2431 2431
 
2432
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2433
-	$table     = $plugin_prefix . $post_type . '_detail';
2432
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2433
+	$table     = $plugin_prefix.$post_type.'_detail';
2434 2434
 
2435
-	if ( ! empty( $query_args['with_pics_only'] ) ) {
2436
-		$join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
2435
+	if (!empty($query_args['with_pics_only'])) {
2436
+		$join .= " LEFT JOIN ".GEODIR_ATTACHMENT_TABLE." ON ( ".GEODIR_ATTACHMENT_TABLE.".post_id=".$table.".post_id AND ".GEODIR_ATTACHMENT_TABLE.".mime_type LIKE '%image%' )";
2437 2437
 	}
2438 2438
 
2439
-	if ( ! empty( $query_args['tax_query'] ) ) {
2440
-		$tax_queries = get_tax_sql( $query_args['tax_query'], $wpdb->posts, 'ID' );
2441
-		if ( ! empty( $tax_queries['join'] ) && ! empty( $tax_queries['where'] ) ) {
2439
+	if (!empty($query_args['tax_query'])) {
2440
+		$tax_queries = get_tax_sql($query_args['tax_query'], $wpdb->posts, 'ID');
2441
+		if (!empty($tax_queries['join']) && !empty($tax_queries['where'])) {
2442 2442
 			$join .= $tax_queries['join'];
2443 2443
 		}
2444 2444
 	}
@@ -2458,49 +2458,49 @@  discard block
 block discarded – undo
2458 2458
  *
2459 2459
  * @return string Modified where clause SQL.
2460 2460
  */
2461
-function geodir_function_widget_listings_where( $where ) {
2461
+function geodir_function_widget_listings_where($where) {
2462 2462
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2463 2463
 
2464 2464
 	$query_args = $gd_query_args_widgets;
2465
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2465
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2466 2466
 		return $where;
2467 2467
 	}
2468
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2469
-	$table     = $plugin_prefix . $post_type . '_detail';
2468
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2469
+	$table     = $plugin_prefix.$post_type.'_detail';
2470 2470
 
2471
-	if ( ! empty( $query_args ) ) {
2472
-		if ( ! empty( $query_args['gd_location'] ) && function_exists( 'geodir_default_location_where' ) ) {
2473
-			$where = geodir_default_location_where( $where, $table );
2471
+	if (!empty($query_args)) {
2472
+		if (!empty($query_args['gd_location']) && function_exists('geodir_default_location_where')) {
2473
+			$where = geodir_default_location_where($where, $table);
2474 2474
 		}
2475 2475
 
2476
-		if ( ! empty( $query_args['post_author'] ) ) {
2477
-			$where .= " AND " . $wpdb->posts . ".post_author = " . (int) $query_args['post_author'];
2476
+		if (!empty($query_args['post_author'])) {
2477
+			$where .= " AND ".$wpdb->posts.".post_author = ".(int) $query_args['post_author'];
2478 2478
 		}
2479 2479
 
2480
-		if ( ! empty( $query_args['show_featured_only'] ) ) {
2481
-			$where .= " AND " . $table . ".is_featured = '1'";
2480
+		if (!empty($query_args['show_featured_only'])) {
2481
+			$where .= " AND ".$table.".is_featured = '1'";
2482 2482
 		}
2483 2483
 
2484
-		if ( ! empty( $query_args['show_special_only'] ) ) {
2485
-			$where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
2484
+		if (!empty($query_args['show_special_only'])) {
2485
+			$where .= " AND ( ".$table.".geodir_special_offers != '' AND ".$table.".geodir_special_offers IS NOT NULL )";
2486 2486
 		}
2487 2487
 
2488
-		if ( ! empty( $query_args['with_pics_only'] ) ) {
2489
-			$where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL ";
2488
+		if (!empty($query_args['with_pics_only'])) {
2489
+			$where .= " AND ".GEODIR_ATTACHMENT_TABLE.".ID IS NOT NULL ";
2490 2490
 		}
2491 2491
 
2492
-		if ( ! empty( $query_args['featured_image_only'] ) ) {
2493
-			$where .= " AND " . $table . ".featured_image IS NOT NULL AND " . $table . ".featured_image!='' ";
2492
+		if (!empty($query_args['featured_image_only'])) {
2493
+			$where .= " AND ".$table.".featured_image IS NOT NULL AND ".$table.".featured_image!='' ";
2494 2494
 		}
2495 2495
 
2496
-		if ( ! empty( $query_args['with_videos_only'] ) ) {
2497
-			$where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
2496
+		if (!empty($query_args['with_videos_only'])) {
2497
+			$where .= " AND ( ".$table.".geodir_video != '' AND ".$table.".geodir_video IS NOT NULL )";
2498 2498
 		}
2499 2499
 
2500
-		if ( ! empty( $query_args['tax_query'] ) ) {
2501
-			$tax_queries = get_tax_sql( $query_args['tax_query'], $wpdb->posts, 'ID' );
2500
+		if (!empty($query_args['tax_query'])) {
2501
+			$tax_queries = get_tax_sql($query_args['tax_query'], $wpdb->posts, 'ID');
2502 2502
 
2503
-			if ( ! empty( $tax_queries['join'] ) && ! empty( $tax_queries['where'] ) ) {
2503
+			if (!empty($tax_queries['join']) && !empty($tax_queries['where'])) {
2504 2504
 				$where .= $tax_queries['where'];
2505 2505
 			}
2506 2506
 		}
@@ -2521,11 +2521,11 @@  discard block
 block discarded – undo
2521 2521
  *
2522 2522
  * @return string Modified orderby clause SQL.
2523 2523
  */
2524
-function geodir_function_widget_listings_orderby( $orderby ) {
2524
+function geodir_function_widget_listings_orderby($orderby) {
2525 2525
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2526 2526
 
2527 2527
 	$query_args = $gd_query_args_widgets;
2528
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2528
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2529 2529
 		return $orderby;
2530 2530
 	}
2531 2531
 
@@ -2544,15 +2544,15 @@  discard block
 block discarded – undo
2544 2544
  *
2545 2545
  * @return int Query limit.
2546 2546
  */
2547
-function geodir_function_widget_listings_limit( $limit ) {
2547
+function geodir_function_widget_listings_limit($limit) {
2548 2548
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2549 2549
 
2550 2550
 	$query_args = $gd_query_args_widgets;
2551
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2551
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2552 2552
 		return $limit;
2553 2553
 	}
2554 2554
 
2555
-	if ( ! empty( $query_args ) && ! empty( $query_args['posts_per_page'] ) ) {
2555
+	if (!empty($query_args) && !empty($query_args['posts_per_page'])) {
2556 2556
 		$limit = (int) $query_args['posts_per_page'];
2557 2557
 	}
2558 2558
 
@@ -2570,12 +2570,12 @@  discard block
 block discarded – undo
2570 2570
  *
2571 2571
  * @return int Large size width.
2572 2572
  */
2573
-function geodir_media_image_large_width( $default = 800, $params = '' ) {
2574
-	$large_size_w = get_option( 'large_size_w' );
2573
+function geodir_media_image_large_width($default = 800, $params = '') {
2574
+	$large_size_w = get_option('large_size_w');
2575 2575
 	$large_size_w = $large_size_w > 0 ? $large_size_w : $default;
2576
-	$large_size_w = absint( $large_size_w );
2576
+	$large_size_w = absint($large_size_w);
2577 2577
 
2578
-	if ( ! get_option( 'geodir_use_wp_media_large_size' ) ) {
2578
+	if (!get_option('geodir_use_wp_media_large_size')) {
2579 2579
 		$large_size_w = 800;
2580 2580
 	}
2581 2581
 
@@ -2588,7 +2588,7 @@  discard block
 block discarded – undo
2588 2588
 	 * @param int $default         Default width.
2589 2589
 	 * @param string|array $params Image parameters.
2590 2590
 	 */
2591
-	$large_size_w = apply_filters( 'geodir_filter_media_image_large_width', $large_size_w, $default, $params );
2591
+	$large_size_w = apply_filters('geodir_filter_media_image_large_width', $large_size_w, $default, $params);
2592 2592
 
2593 2593
 	return $large_size_w;
2594 2594
 }
@@ -2604,12 +2604,12 @@  discard block
 block discarded – undo
2604 2604
  *
2605 2605
  * @return int Large size height.
2606 2606
  */
2607
-function geodir_media_image_large_height( $default = 800, $params = '' ) {
2608
-	$large_size_h = get_option( 'large_size_h' );
2607
+function geodir_media_image_large_height($default = 800, $params = '') {
2608
+	$large_size_h = get_option('large_size_h');
2609 2609
 	$large_size_h = $large_size_h > 0 ? $large_size_h : $default;
2610
-	$large_size_h = absint( $large_size_h );
2610
+	$large_size_h = absint($large_size_h);
2611 2611
 
2612
-	if ( ! get_option( 'geodir_use_wp_media_large_size' ) ) {
2612
+	if (!get_option('geodir_use_wp_media_large_size')) {
2613 2613
 		$large_size_h = 800;
2614 2614
 	}
2615 2615
 
@@ -2622,7 +2622,7 @@  discard block
 block discarded – undo
2622 2622
 	 * @param int $default         Default height.
2623 2623
 	 * @param string|array $params Image parameters.
2624 2624
 	 */
2625
-	$large_size_h = apply_filters( 'geodir_filter_media_image_large_height', $large_size_h, $default, $params );
2625
+	$large_size_h = apply_filters('geodir_filter_media_image_large_height', $large_size_h, $default, $params);
2626 2626
 
2627 2627
 	return $large_size_h;
2628 2628
 }
@@ -2639,8 +2639,8 @@  discard block
 block discarded – undo
2639 2639
  *
2640 2640
  * @return string Sanitized name.
2641 2641
  */
2642
-function geodir_sanitize_location_name( $type, $name, $translate = true ) {
2643
-	if ( $name == '' ) {
2642
+function geodir_sanitize_location_name($type, $name, $translate = true) {
2643
+	if ($name == '') {
2644 2644
 		return null;
2645 2645
 	}
2646 2646
 
@@ -2649,13 +2649,13 @@  discard block
 block discarded – undo
2649 2649
 	$type = $type == 'gd_city' ? 'city' : $type;
2650 2650
 
2651 2651
 	$return = $name;
2652
-	if ( function_exists( 'get_actual_location_name' ) ) {
2653
-		$return = get_actual_location_name( $type, $name, $translate );
2652
+	if (function_exists('get_actual_location_name')) {
2653
+		$return = get_actual_location_name($type, $name, $translate);
2654 2654
 	} else {
2655
-		$return = preg_replace( '/-(\d+)$/', '', $return );
2656
-		$return = preg_replace( '/[_-]/', ' ', $return );
2657
-		$return = geodir_ucwords( $return );
2658
-		$return = $translate ? __( $return, 'geodirectory' ) : $return;
2655
+		$return = preg_replace('/-(\d+)$/', '', $return);
2656
+		$return = preg_replace('/[_-]/', ' ', $return);
2657
+		$return = geodir_ucwords($return);
2658
+		$return = $translate ? __($return, 'geodirectory') : $return;
2659 2659
 	}
2660 2660
 
2661 2661
 	return $return;
@@ -2670,14 +2670,14 @@  discard block
 block discarded – undo
2670 2670
  *
2671 2671
  * @param int $number Comments number.
2672 2672
  */
2673
-function geodir_comments_number( $number ) {
2673
+function geodir_comments_number($number) {
2674 2674
 
2675
-	if ( $number > 1 ) {
2676
-		$output = str_replace( '%', number_format_i18n( $number ), __( '% Reviews', 'geodirectory' ) );
2677
-	} elseif ( $number == 0 || $number == '' ) {
2678
-		$output = __( 'No Reviews', 'geodirectory' );
2675
+	if ($number > 1) {
2676
+		$output = str_replace('%', number_format_i18n($number), __('% Reviews', 'geodirectory'));
2677
+	} elseif ($number == 0 || $number == '') {
2678
+		$output = __('No Reviews', 'geodirectory');
2679 2679
 	} else { // must be one
2680
-		$output = __( '1 Review', 'geodirectory' );
2680
+		$output = __('1 Review', 'geodirectory');
2681 2681
 	}
2682 2682
 	echo $output;
2683 2683
 }
@@ -2692,18 +2692,18 @@  discard block
 block discarded – undo
2692 2692
  */
2693 2693
 function is_page_geodir_home() {
2694 2694
 	global $wpdb;
2695
-	$cur_url = str_replace( array( "https://", "http://", "www." ), array( '', '', '' ), geodir_curPageURL() );
2696
-	if ( function_exists( 'geodir_location_geo_home_link' ) ) {
2697
-		remove_filter( 'home_url', 'geodir_location_geo_home_link', 100000 );
2695
+	$cur_url = str_replace(array("https://", "http://", "www."), array('', '', ''), geodir_curPageURL());
2696
+	if (function_exists('geodir_location_geo_home_link')) {
2697
+		remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
2698 2698
 	}
2699
-	$home_url = home_url( '', 'http' );
2700
-	if ( function_exists( 'geodir_location_geo_home_link' ) ) {
2701
-		add_filter( 'home_url', 'geodir_location_geo_home_link', 100000, 2 );
2699
+	$home_url = home_url('', 'http');
2700
+	if (function_exists('geodir_location_geo_home_link')) {
2701
+		add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
2702 2702
 	}
2703
-	$home_url = str_replace( "www.", "", $home_url );
2704
-	if ( ( strpos( $home_url, $cur_url ) !== false || strpos( $home_url . '/', $cur_url ) !== false ) && ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && get_option( 'page_on_front' ) == get_option( 'geodir_home_page' ) ) ) {
2703
+	$home_url = str_replace("www.", "", $home_url);
2704
+	if ((strpos($home_url, $cur_url) !== false || strpos($home_url.'/', $cur_url) !== false) && ('page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page'))) {
2705 2705
 		return true;
2706
-	} elseif ( get_query_var( 'page_id' ) == get_option( 'page_on_front' ) && 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && get_option( 'page_on_front' ) == get_option( 'geodir_home_page' ) ) {
2706
+	} elseif (get_query_var('page_id') == get_option('page_on_front') && 'page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page')) {
2707 2707
 		return true;
2708 2708
 	} else {
2709 2709
 		return false;
@@ -2723,18 +2723,18 @@  discard block
 block discarded – undo
2723 2723
  *
2724 2724
  * @return string The canonical URL.
2725 2725
  */
2726
-function geodir_wpseo_homepage_canonical( $url ) {
2726
+function geodir_wpseo_homepage_canonical($url) {
2727 2727
 	global $post;
2728 2728
 
2729
-	if ( is_page_geodir_home() ) {
2729
+	if (is_page_geodir_home()) {
2730 2730
 		return home_url();
2731 2731
 	}
2732 2732
 
2733 2733
 	return $url;
2734 2734
 }
2735 2735
 
2736
-add_filter( 'wpseo_canonical', 'geodir_wpseo_homepage_canonical', 10 );
2737
-add_filter( 'aioseop_canonical_url', 'geodir_wpseo_homepage_canonical', 10 );
2736
+add_filter('wpseo_canonical', 'geodir_wpseo_homepage_canonical', 10);
2737
+add_filter('aioseop_canonical_url', 'geodir_wpseo_homepage_canonical', 10);
2738 2738
 
2739 2739
 /**
2740 2740
  * Add extra fields to google maps script call.
@@ -2747,20 +2747,20 @@  discard block
 block discarded – undo
2747 2747
  *
2748 2748
  * @return string Modified extra string.
2749 2749
  */
2750
-function geodir_googlemap_script_extra_details_page( $extra ) {
2750
+function geodir_googlemap_script_extra_details_page($extra) {
2751 2751
 	global $post;
2752 2752
 	$add_google_places_api = false;
2753
-	if ( isset( $post->post_content ) && has_shortcode( $post->post_content, 'gd_add_listing' ) ) {
2753
+	if (isset($post->post_content) && has_shortcode($post->post_content, 'gd_add_listing')) {
2754 2754
 		$add_google_places_api = true;
2755 2755
 	}
2756
-	if ( ! str_replace( 'libraries=places', '', $extra ) && ( geodir_is_page( 'detail' ) || $add_google_places_api ) ) {
2756
+	if (!str_replace('libraries=places', '', $extra) && (geodir_is_page('detail') || $add_google_places_api)) {
2757 2757
 		$extra .= "&amp;libraries=places";
2758 2758
 	}
2759 2759
 
2760 2760
 	return $extra;
2761 2761
 }
2762 2762
 
2763
-add_filter( 'geodir_googlemap_script_extra', 'geodir_googlemap_script_extra_details_page', 101, 1 );
2763
+add_filter('geodir_googlemap_script_extra', 'geodir_googlemap_script_extra_details_page', 101, 1);
2764 2764
 
2765 2765
 
2766 2766
 /**
@@ -2778,99 +2778,99 @@  discard block
 block discarded – undo
2778 2778
  *                                          after_widget.
2779 2779
  * @param array|string $instance            The settings for the particular instance of the widget.
2780 2780
  */
2781
-function geodir_popular_post_category_output( $args = '', $instance = '' ) {
2781
+function geodir_popular_post_category_output($args = '', $instance = '') {
2782 2782
 	// prints the widget
2783 2783
 	global $wpdb, $plugin_prefix, $geodir_post_category_str;
2784
-	extract( $args, EXTR_SKIP );
2784
+	extract($args, EXTR_SKIP);
2785 2785
 
2786 2786
 	echo $before_widget;
2787 2787
 
2788 2788
 	/** This filter is documented in geodirectory_widgets.php */
2789
-	$title = empty( $instance['title'] ) ? __( 'Popular Categories', 'geodirectory' ) : apply_filters( 'widget_title', __( $instance['title'], 'geodirectory' ) );
2789
+	$title = empty($instance['title']) ? __('Popular Categories', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
2790 2790
 
2791 2791
 	$gd_post_type = geodir_get_current_posttype();
2792 2792
 
2793
-	$category_limit = isset( $instance['category_limit'] ) && $instance['category_limit'] > 0 ? (int) $instance['category_limit'] : 15;
2794
-	if ( ! empty( $gd_post_type ) ) {
2793
+	$category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int) $instance['category_limit'] : 15;
2794
+	if (!empty($gd_post_type)) {
2795 2795
 		$default_post_type = $gd_post_type;
2796
-	} elseif ( isset( $instance['default_post_type'] ) && gdsc_is_post_type_valid( $instance['default_post_type'] ) ) {
2796
+	} elseif (isset($instance['default_post_type']) && gdsc_is_post_type_valid($instance['default_post_type'])) {
2797 2797
 		$default_post_type = $instance['default_post_type'];
2798 2798
 	} else {
2799 2799
 		$all_gd_post_type  = geodir_get_posttypes();
2800
-		$default_post_type = ( isset( $all_gd_post_type[0] ) ) ? $all_gd_post_type[0] : '';
2800
+		$default_post_type = (isset($all_gd_post_type[0])) ? $all_gd_post_type[0] : '';
2801 2801
 	}
2802
-	$parent_only = !empty( $instance['parent_only'] ) ? true : false;
2802
+	$parent_only = !empty($instance['parent_only']) ? true : false;
2803 2803
 
2804 2804
 	$taxonomy = array();
2805
-	if ( ! empty( $gd_post_type ) ) {
2806
-		$taxonomy[] = $gd_post_type . "category";
2805
+	if (!empty($gd_post_type)) {
2806
+		$taxonomy[] = $gd_post_type."category";
2807 2807
 	} else {
2808
-		$taxonomy = geodir_get_taxonomies( $gd_post_type );
2808
+		$taxonomy = geodir_get_taxonomies($gd_post_type);
2809 2809
 	}
2810 2810
     
2811
-	$term_args = array( 'taxonomy' => $taxonomy );
2812
-	if ( $parent_only ) {
2811
+	$term_args = array('taxonomy' => $taxonomy);
2812
+	if ($parent_only) {
2813 2813
 		$term_args['parent'] = 0;
2814 2814
 	}
2815 2815
 
2816
-	$terms   = get_terms( $term_args );
2816
+	$terms   = get_terms($term_args);
2817 2817
 	$a_terms = array();
2818 2818
 	$b_terms = array();
2819 2819
 
2820
-	foreach ( $terms as $term ) {
2821
-		if ( $term->count > 0 ) {
2822
-			$a_terms[ $term->taxonomy ][] = $term;
2820
+	foreach ($terms as $term) {
2821
+		if ($term->count > 0) {
2822
+			$a_terms[$term->taxonomy][] = $term;
2823 2823
 		}
2824 2824
 	}
2825 2825
 
2826
-	if ( ! empty( $a_terms ) ) {
2827
-		foreach ( $a_terms as $b_key => $b_val ) {
2828
-			$b_terms[ $b_key ] = geodir_sort_terms( $b_val, 'count' );
2826
+	if (!empty($a_terms)) {
2827
+		foreach ($a_terms as $b_key => $b_val) {
2828
+			$b_terms[$b_key] = geodir_sort_terms($b_val, 'count');
2829 2829
 		}
2830 2830
 
2831
-		$default_taxonomy = $default_post_type != '' && isset( $b_terms[ $default_post_type . 'category' ] ) ? $default_post_type . 'category' : '';
2831
+		$default_taxonomy = $default_post_type != '' && isset($b_terms[$default_post_type.'category']) ? $default_post_type.'category' : '';
2832 2832
 
2833 2833
 		$tax_change_output = '';
2834
-		if ( count( $b_terms ) > 1 ) {
2835
-			$tax_change_output .= "<select data-limit='$category_limit' data-parent='" . (int)$parent_only . "' class='geodir-cat-list-tax'  onchange='geodir_get_post_term(this);'>";
2836
-			foreach ( $b_terms as $key => $val ) {
2837
-				$ptype    = get_post_type_object( str_replace( "category", "", $key ) );
2838
-				$cpt_name = __( $ptype->labels->singular_name, 'geodirectory' );
2839
-				$tax_change_output .= "<option value='$key' " . selected( $key, $default_taxonomy, false ) . ">" . sprintf( __( '%s Categories', 'geodirectory' ), $cpt_name ) . "</option>";
2834
+		if (count($b_terms) > 1) {
2835
+			$tax_change_output .= "<select data-limit='$category_limit' data-parent='".(int) $parent_only."' class='geodir-cat-list-tax'  onchange='geodir_get_post_term(this);'>";
2836
+			foreach ($b_terms as $key => $val) {
2837
+				$ptype    = get_post_type_object(str_replace("category", "", $key));
2838
+				$cpt_name = __($ptype->labels->singular_name, 'geodirectory');
2839
+				$tax_change_output .= "<option value='$key' ".selected($key, $default_taxonomy, false).">".sprintf(__('%s Categories', 'geodirectory'), $cpt_name)."</option>";
2840 2840
 			}
2841 2841
 			$tax_change_output .= "</select>";
2842 2842
 		}
2843 2843
 
2844
-		if ( ! empty( $b_terms ) ) {
2845
-			$terms = $default_taxonomy != '' && isset( $b_terms[ $default_taxonomy ] ) ? $b_terms[ $default_taxonomy ] : reset( $b_terms );// get the first array
2846
-			global $cat_count;//make global so we can change via function
2844
+		if (!empty($b_terms)) {
2845
+			$terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms); // get the first array
2846
+			global $cat_count; //make global so we can change via function
2847 2847
 			$cat_count = 0;
2848 2848
 			?>
2849 2849
 			<div class="geodir-category-list-in clearfix">
2850 2850
 				<div class="geodir-cat-list clearfix">
2851 2851
 					<?php
2852
-					echo $before_title . __( $title ) . $after_title;
2852
+					echo $before_title.__($title).$after_title;
2853 2853
 
2854 2854
 					echo $tax_change_output;
2855 2855
 
2856 2856
 					echo '<ul class="geodir-popular-cat-list">';
2857 2857
 
2858
-					geodir_helper_cat_list_output( $terms, $category_limit );
2858
+					geodir_helper_cat_list_output($terms, $category_limit);
2859 2859
 
2860 2860
 					echo '</ul>';
2861 2861
 					?>
2862 2862
 				</div>
2863 2863
 				<?php
2864 2864
 				$hide = '';
2865
-				if ( $cat_count < $category_limit ) {
2865
+				if ($cat_count < $category_limit) {
2866 2866
 					$hide = 'style="display:none;"';
2867 2867
 				}
2868 2868
 				echo "<div class='geodir-cat-list-more' $hide >";
2869
-				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">' . __( 'More Categories', 'geodirectory' ) . '</a>';
2870
-				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">' . __( 'Less Categories', 'geodirectory' ) . '</a>';
2869
+				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">'.__('More Categories', 'geodirectory').'</a>';
2870
+				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">'.__('Less Categories', 'geodirectory').'</a>';
2871 2871
 				echo "</div>";
2872 2872
 				/* add scripts */
2873
-				add_action( 'wp_footer', 'geodir_popular_category_add_scripts', 100 );
2873
+				add_action('wp_footer', 'geodir_popular_category_add_scripts', 100);
2874 2874
 				?>
2875 2875
 			</div>
2876 2876
 			<?php
@@ -2889,25 +2889,25 @@  discard block
 block discarded – undo
2889 2889
  * @param array $terms                      An array of term objects.
2890 2890
  * @param int $category_limit               Number of categories to display by default.
2891 2891
  */
2892
-function geodir_helper_cat_list_output( $terms, $category_limit ) {
2892
+function geodir_helper_cat_list_output($terms, $category_limit) {
2893 2893
 	global $geodir_post_category_str, $cat_count;
2894 2894
 	$term_icons = geodir_get_term_icon();
2895 2895
 
2896 2896
 	$geodir_post_category_str = array();
2897 2897
 
2898 2898
 
2899
-	foreach ( $terms as $cat ) {
2900
-		$post_type     = str_replace( "category", "", $cat->taxonomy );
2901
-		$term_icon_url = ! empty( $term_icons ) && isset( $term_icons[ $cat->term_id ] ) ? $term_icons[ $cat->term_id ] : '';
2899
+	foreach ($terms as $cat) {
2900
+		$post_type     = str_replace("category", "", $cat->taxonomy);
2901
+		$term_icon_url = !empty($term_icons) && isset($term_icons[$cat->term_id]) ? $term_icons[$cat->term_id] : '';
2902 2902
 
2903
-		$cat_count ++;
2903
+		$cat_count++;
2904 2904
 
2905
-		$geodir_post_category_str[] = array( 'posttype' => $post_type, 'termid' => $cat->term_id );
2905
+		$geodir_post_category_str[] = array('posttype' => $post_type, 'termid' => $cat->term_id);
2906 2906
 
2907 2907
 		$class_row  = $cat_count > $category_limit ? 'geodir-pcat-hide geodir-hide' : 'geodir-pcat-show';
2908 2908
 		$total_post = $cat->count;
2909 2909
 
2910
-		$term_link = get_term_link( $cat, $cat->taxonomy );
2910
+		$term_link = get_term_link($cat, $cat->taxonomy);
2911 2911
 		/**
2912 2912
 		 * Filer the category term link.
2913 2913
 		 *
@@ -2917,11 +2917,11 @@  discard block
 block discarded – undo
2917 2917
 		 * @param int $cat          ->term_id The term id.
2918 2918
 		 * @param string $post_type Wordpress post type.
2919 2919
 		 */
2920
-		$term_link = apply_filters( 'geodir_category_term_link', $term_link, $cat->term_id, $post_type );
2920
+		$term_link = apply_filters('geodir_category_term_link', $term_link, $cat->term_id, $post_type);
2921 2921
 
2922
-		echo '<li class="' . $class_row . '"><a href="' . $term_link . '">';
2923
-		echo '<img alt="' . esc_attr( $cat->name ) . ' icon" style="height:20px;vertical-align:middle;" src="' . $term_icon_url . '"/> <span class="cat-link">';
2924
-		echo $cat->name . '</span> <span class="geodir_term_class geodir_link_span geodir_category_class_' . $post_type . '_' . $cat->term_id . '">(' . $total_post . ')</span> ';
2922
+		echo '<li class="'.$class_row.'"><a href="'.$term_link.'">';
2923
+		echo '<img alt="'.esc_attr($cat->name).' icon" style="height:20px;vertical-align:middle;" src="'.$term_icon_url.'"/> <span class="cat-link">';
2924
+		echo $cat->name.'</span> <span class="geodir_term_class geodir_link_span geodir_category_class_'.$post_type.'_'.$cat->term_id.'">('.$total_post.')</span> ';
2925 2925
 		echo '</a></li>';
2926 2926
 	}
2927 2927
 }
@@ -2936,14 +2936,14 @@  discard block
 block discarded – undo
2936 2936
  * @param array|string $args     Display arguments including before_title, after_title, before_widget, and after_widget.
2937 2937
  * @param array|string $instance The settings for the particular instance of the widget.
2938 2938
  */
2939
-function geodir_listing_slider_widget_output( $args = '', $instance = '' ) {
2939
+function geodir_listing_slider_widget_output($args = '', $instance = '') {
2940 2940
 	// prints the widget
2941
-	extract( $args, EXTR_SKIP );
2941
+	extract($args, EXTR_SKIP);
2942 2942
 
2943 2943
 	echo $before_widget;
2944 2944
 
2945 2945
 	/** This filter is documented in geodirectory_widgets.php */
2946
-	$title = empty( $instance['title'] ) ? '' : apply_filters( 'widget_title', __( $instance['title'], 'geodirectory' ) );
2946
+	$title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
2947 2947
 	/**
2948 2948
 	 * Filter the widget post type.
2949 2949
 	 *
@@ -2951,7 +2951,7 @@  discard block
 block discarded – undo
2951 2951
 	 *
2952 2952
 	 * @param string $instance ['post_type'] Post type of listing.
2953 2953
 	 */
2954
-	$post_type = empty( $instance['post_type'] ) ? 'gd_place' : apply_filters( 'widget_post_type', $instance['post_type'] );
2954
+	$post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('widget_post_type', $instance['post_type']);
2955 2955
 	/**
2956 2956
 	 * Filter the widget's term.
2957 2957
 	 *
@@ -2959,7 +2959,7 @@  discard block
 block discarded – undo
2959 2959
 	 *
2960 2960
 	 * @param string $instance ['category'] Filter by term. Can be any valid term.
2961 2961
 	 */
2962
-	$category = empty( $instance['category'] ) ? '0' : apply_filters( 'widget_category', $instance['category'] );
2962
+	$category = empty($instance['category']) ? '0' : apply_filters('widget_category', $instance['category']);
2963 2963
 	/**
2964 2964
 	 * Filter widget's "add_location_filter" value.
2965 2965
 	 *
@@ -2967,7 +2967,7 @@  discard block
 block discarded – undo
2967 2967
 	 *
2968 2968
 	 * @param string|bool $instance ['add_location_filter'] Do you want to add location filter? Can be 1 or 0.
2969 2969
 	 */
2970
-	$add_location_filter = empty( $instance['add_location_filter'] ) ? '0' : apply_filters( 'widget_add_location_filter', $instance['add_location_filter'] );
2970
+	$add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_add_location_filter', $instance['add_location_filter']);
2971 2971
 	/**
2972 2972
 	 * Filter the widget listings limit.
2973 2973
 	 *
@@ -2975,7 +2975,7 @@  discard block
 block discarded – undo
2975 2975
 	 *
2976 2976
 	 * @param string $instance ['post_number'] Number of listings to display.
2977 2977
 	 */
2978
-	$post_number = empty( $instance['post_number'] ) ? '5' : apply_filters( 'widget_post_number', $instance['post_number'] );
2978
+	$post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']);
2979 2979
 	/**
2980 2980
 	 * Filter the widget listings limit shown at one time.
2981 2981
 	 *
@@ -2983,7 +2983,7 @@  discard block
 block discarded – undo
2983 2983
 	 *
2984 2984
 	 * @param string $instance ['max_show'] Number of listings to display on screen.
2985 2985
 	 */
2986
-	$max_show = empty( $instance['max_show'] ) ? '1' : apply_filters( 'widget_max_show', $instance['max_show'] );
2986
+	$max_show = empty($instance['max_show']) ? '1' : apply_filters('widget_max_show', $instance['max_show']);
2987 2987
 	/**
2988 2988
 	 * Filter the widget slide width.
2989 2989
 	 *
@@ -2991,7 +2991,7 @@  discard block
 block discarded – undo
2991 2991
 	 *
2992 2992
 	 * @param string $instance ['slide_width'] Width of the slides shown.
2993 2993
 	 */
2994
-	$slide_width = empty( $instance['slide_width'] ) ? '' : apply_filters( 'widget_slide_width', $instance['slide_width'] );
2994
+	$slide_width = empty($instance['slide_width']) ? '' : apply_filters('widget_slide_width', $instance['slide_width']);
2995 2995
 	/**
2996 2996
 	 * Filter widget's "show title" value.
2997 2997
 	 *
@@ -2999,7 +2999,7 @@  discard block
 block discarded – undo
2999 2999
 	 *
3000 3000
 	 * @param string|bool $instance ['show_title'] Do you want to display title? Can be 1 or 0.
3001 3001
 	 */
3002
-	$show_title = empty( $instance['show_title'] ) ? '' : apply_filters( 'widget_show_title', $instance['show_title'] );
3002
+	$show_title = empty($instance['show_title']) ? '' : apply_filters('widget_show_title', $instance['show_title']);
3003 3003
 	/**
3004 3004
 	 * Filter widget's "slideshow" value.
3005 3005
 	 *
@@ -3007,7 +3007,7 @@  discard block
 block discarded – undo
3007 3007
 	 *
3008 3008
 	 * @param int $instance ['slideshow'] Setup a slideshow for the slider to animate automatically.
3009 3009
 	 */
3010
-	$slideshow = empty( $instance['slideshow'] ) ? 0 : apply_filters( 'widget_slideshow', $instance['slideshow'] );
3010
+	$slideshow = empty($instance['slideshow']) ? 0 : apply_filters('widget_slideshow', $instance['slideshow']);
3011 3011
 	/**
3012 3012
 	 * Filter widget's "animationLoop" value.
3013 3013
 	 *
@@ -3015,7 +3015,7 @@  discard block
 block discarded – undo
3015 3015
 	 *
3016 3016
 	 * @param int $instance ['animationLoop'] Gives the slider a seamless infinite loop.
3017 3017
 	 */
3018
-	$animationLoop = empty( $instance['animationLoop'] ) ? 0 : apply_filters( 'widget_animationLoop', $instance['animationLoop'] );
3018
+	$animationLoop = empty($instance['animationLoop']) ? 0 : apply_filters('widget_animationLoop', $instance['animationLoop']);
3019 3019
 	/**
3020 3020
 	 * Filter widget's "directionNav" value.
3021 3021
 	 *
@@ -3023,7 +3023,7 @@  discard block
 block discarded – undo
3023 3023
 	 *
3024 3024
 	 * @param int $instance ['directionNav'] Enable previous/next arrow navigation?. Can be 1 or 0.
3025 3025
 	 */
3026
-	$directionNav = empty( $instance['directionNav'] ) ? 0 : apply_filters( 'widget_directionNav', $instance['directionNav'] );
3026
+	$directionNav = empty($instance['directionNav']) ? 0 : apply_filters('widget_directionNav', $instance['directionNav']);
3027 3027
 	/**
3028 3028
 	 * Filter widget's "slideshowSpeed" value.
3029 3029
 	 *
@@ -3031,7 +3031,7 @@  discard block
 block discarded – undo
3031 3031
 	 *
3032 3032
 	 * @param int $instance ['slideshowSpeed'] Set the speed of the slideshow cycling, in milliseconds.
3033 3033
 	 */
3034
-	$slideshowSpeed = empty( $instance['slideshowSpeed'] ) ? 5000 : apply_filters( 'widget_slideshowSpeed', $instance['slideshowSpeed'] );
3034
+	$slideshowSpeed = empty($instance['slideshowSpeed']) ? 5000 : apply_filters('widget_slideshowSpeed', $instance['slideshowSpeed']);
3035 3035
 	/**
3036 3036
 	 * Filter widget's "animationSpeed" value.
3037 3037
 	 *
@@ -3039,7 +3039,7 @@  discard block
 block discarded – undo
3039 3039
 	 *
3040 3040
 	 * @param int $instance ['animationSpeed'] Set the speed of animations, in milliseconds.
3041 3041
 	 */
3042
-	$animationSpeed = empty( $instance['animationSpeed'] ) ? 600 : apply_filters( 'widget_animationSpeed', $instance['animationSpeed'] );
3042
+	$animationSpeed = empty($instance['animationSpeed']) ? 600 : apply_filters('widget_animationSpeed', $instance['animationSpeed']);
3043 3043
 	/**
3044 3044
 	 * Filter widget's "animation" value.
3045 3045
 	 *
@@ -3047,7 +3047,7 @@  discard block
 block discarded – undo
3047 3047
 	 *
3048 3048
 	 * @param string $instance ['animation'] Controls the animation type, "fade" or "slide".
3049 3049
 	 */
3050
-	$animation = empty( $instance['animation'] ) ? 'slide' : apply_filters( 'widget_animation', $instance['animation'] );
3050
+	$animation = empty($instance['animation']) ? 'slide' : apply_filters('widget_animation', $instance['animation']);
3051 3051
 	/**
3052 3052
 	 * Filter widget's "list_sort" type.
3053 3053
 	 *
@@ -3055,10 +3055,10 @@  discard block
 block discarded – undo
3055 3055
 	 *
3056 3056
 	 * @param string $instance ['list_sort'] Listing sort by type.
3057 3057
 	 */
3058
-	$list_sort          = empty( $instance['list_sort'] ) ? 'latest' : apply_filters( 'widget_list_sort', $instance['list_sort'] );
3059
-	$show_featured_only = ! empty( $instance['show_featured_only'] ) ? 1 : null;
3058
+	$list_sort          = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']);
3059
+	$show_featured_only = !empty($instance['show_featured_only']) ? 1 : null;
3060 3060
 
3061
-	wp_enqueue_script( 'geodirectory-jquery-flexslider-js' );
3061
+	wp_enqueue_script('geodirectory-jquery-flexslider-js');
3062 3062
 	?>
3063 3063
 	<script type="text/javascript">
3064 3064
 		jQuery(window).load(function () {
@@ -3076,23 +3076,23 @@  discard block
 block discarded – undo
3076 3076
 				itemWidth: 75,
3077 3077
 				itemMargin: 5,
3078 3078
 				asNavFor: '#geodir_widget_slider',
3079
-				rtl: <?php echo( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?>
3079
+				rtl: <?php echo(is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?>
3080 3080
 			});
3081 3081
 
3082 3082
 			jQuery('#geodir_widget_slider').flexslider({
3083
-				animation: "<?php echo $animation;?>",
3083
+				animation: "<?php echo $animation; ?>",
3084 3084
 				selector: ".geodir-slides > li",
3085 3085
 				namespace: "geodir-",
3086 3086
 				controlNav: true,
3087
-				animationLoop: <?php echo $animationLoop;?>,
3088
-				slideshow: <?php echo $slideshow;?>,
3089
-				slideshowSpeed: <?php echo $slideshowSpeed;?>,
3090
-				animationSpeed: <?php echo $animationSpeed;?>,
3091
-				directionNav: <?php echo $directionNav;?>,
3092
-				maxItems: <?php echo $max_show;?>,
3087
+				animationLoop: <?php echo $animationLoop; ?>,
3088
+				slideshow: <?php echo $slideshow; ?>,
3089
+				slideshowSpeed: <?php echo $slideshowSpeed; ?>,
3090
+				animationSpeed: <?php echo $animationSpeed; ?>,
3091
+				directionNav: <?php echo $directionNav; ?>,
3092
+				maxItems: <?php echo $max_show; ?>,
3093 3093
 				move: 1,
3094
-				<?php if ( $slide_width ) {
3095
-				echo "itemWidth: " . $slide_width . ",";
3094
+				<?php if ($slide_width) {
3095
+				echo "itemWidth: ".$slide_width.",";
3096 3096
 			}?>
3097 3097
 				sync: "#geodir_widget_carousel",
3098 3098
 				start: function (slider) {
@@ -3104,7 +3104,7 @@  discard block
 block discarded – undo
3104 3104
 					jQuery('#geodir_widget_slider').css({'visibility': 'visible'});
3105 3105
 					jQuery('#geodir_widget_carousel').css({'visibility': 'visible'});
3106 3106
 				},
3107
-				rtl: <?php echo( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?>
3107
+				rtl: <?php echo(is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?>
3108 3108
 			});
3109 3109
 		});
3110 3110
 	</script>
@@ -3117,62 +3117,62 @@  discard block
 block discarded – undo
3117 3117
 		'order_by'       => $list_sort
3118 3118
 	);
3119 3119
 
3120
-	if ( $show_featured_only ) {
3120
+	if ($show_featured_only) {
3121 3121
 		$query_args['show_featured_only'] = 1;
3122 3122
 	}
3123 3123
 
3124
-	if ( $category != 0 || $category != '' ) {
3125
-		$category_taxonomy = geodir_get_taxonomies( $post_type );
3124
+	if ($category != 0 || $category != '') {
3125
+		$category_taxonomy = geodir_get_taxonomies($post_type);
3126 3126
 		$tax_query         = array(
3127 3127
 			'taxonomy' => $category_taxonomy[0],
3128 3128
 			'field'    => 'id',
3129 3129
 			'terms'    => $category
3130 3130
 		);
3131 3131
 
3132
-		$query_args['tax_query'] = array( $tax_query );
3132
+		$query_args['tax_query'] = array($tax_query);
3133 3133
 	}
3134 3134
 
3135 3135
 	// we want listings with featured image only
3136 3136
 	$query_args['featured_image_only'] = 1;
3137 3137
 
3138
-	if ( $post_type == 'gd_event' ) {
3138
+	if ($post_type == 'gd_event') {
3139 3139
 		$query_args['gedir_event_listing_filter'] = 'upcoming';
3140 3140
 	}// show only upcoming events
3141 3141
 
3142
-	$widget_listings = geodir_get_widget_listings( $query_args );
3143
-	if ( ! empty( $widget_listings ) || ( isset( $with_no_results ) && $with_no_results ) ) {
3144
-		if ( $title ) {
3145
-			echo $before_title . $title . $after_title;
3142
+	$widget_listings = geodir_get_widget_listings($query_args);
3143
+	if (!empty($widget_listings) || (isset($with_no_results) && $with_no_results)) {
3144
+		if ($title) {
3145
+			echo $before_title.$title.$after_title;
3146 3146
 		}
3147 3147
 
3148 3148
 		global $post;
3149 3149
 
3150
-		$current_post = $post;// keep current post info
3150
+		$current_post = $post; // keep current post info
3151 3151
 
3152 3152
 		$widget_main_slides = '';
3153 3153
 		$nav_slides         = '';
3154 3154
 		$widget_slides      = 0;
3155 3155
 
3156
-		foreach ( $widget_listings as $widget_listing ) {
3156
+		foreach ($widget_listings as $widget_listing) {
3157 3157
 			global $gd_widget_listing_type;
3158 3158
 			$post         = $widget_listing;
3159
-			$widget_image = geodir_get_featured_image( $post->ID, 'thumbnail', get_option( 'geodir_listing_no_img' ) );
3159
+			$widget_image = geodir_get_featured_image($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
3160 3160
 
3161
-			if ( ! empty( $widget_image ) ) {
3162
-				if ( $widget_image->height >= 200 ) {
3161
+			if (!empty($widget_image)) {
3162
+				if ($widget_image->height >= 200) {
3163 3163
 					$widget_spacer_height = 0;
3164 3164
 				} else {
3165
-					$widget_spacer_height = ( ( 200 - $widget_image->height ) / 2 );
3165
+					$widget_spacer_height = ((200 - $widget_image->height) / 2);
3166 3166
 				}
3167 3167
 
3168
-				$widget_main_slides .= '<li class="geodir-listing-slider-widget"><img class="geodir-listing-slider-spacer" src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:' . $widget_spacer_height . 'px !important;margin:0 auto;" width="100" />';
3168
+				$widget_main_slides .= '<li class="geodir-listing-slider-widget"><img class="geodir-listing-slider-spacer" src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:'.$widget_spacer_height.'px !important;margin:0 auto;" width="100" />';
3169 3169
 
3170 3170
 				$title = '';
3171
-				if ( $show_title ) {
3172
-					$title_html     = '<div class="geodir-slider-title"><a href="' . get_permalink( $post->ID ) . '">' . get_the_title( $post->ID ) . '</a></div>';
3171
+				if ($show_title) {
3172
+					$title_html     = '<div class="geodir-slider-title"><a href="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</a></div>';
3173 3173
 					$post_id        = $post->ID;
3174
-					$post_permalink = get_permalink( $post->ID );
3175
-					$post_title     = get_the_title( $post->ID );
3174
+					$post_permalink = get_permalink($post->ID);
3175
+					$post_title     = get_the_title($post->ID);
3176 3176
 					/**
3177 3177
 					 * Filter the listing slider widget title.
3178 3178
 					 *
@@ -3183,12 +3183,12 @@  discard block
 block discarded – undo
3183 3183
 					 * @param string $post_permalink The post permalink url.
3184 3184
 					 * @param string $post_title     The post title text.
3185 3185
 					 */
3186
-					$title = apply_filters( 'geodir_listing_slider_title', $title_html, $post_id, $post_permalink, $post_title );
3186
+					$title = apply_filters('geodir_listing_slider_title', $title_html, $post_id, $post_permalink, $post_title);
3187 3187
 				}
3188 3188
 
3189
-				$widget_main_slides .= $title . '<img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:200px;margin:0 auto;" /></li>';
3190
-				$nav_slides .= '<li><img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
3191
-				$widget_slides ++;
3189
+				$widget_main_slides .= $title.'<img src="'.$widget_image->src.'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:200px;margin:0 auto;" /></li>';
3190
+				$nav_slides .= '<li><img src="'.$widget_image->src.'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:48px;margin:0 auto;" /></li>';
3191
+				$widget_slides++;
3192 3192
 			}
3193 3193
 		}
3194 3194
 		?>
@@ -3197,7 +3197,7 @@  discard block
 block discarded – undo
3197 3197
 			<div id="geodir_widget_slider" class="geodir_flexslider">
3198 3198
 				<ul class="geodir-slides clearfix"><?php echo $widget_main_slides; ?></ul>
3199 3199
 			</div>
3200
-			<?php if ( $widget_slides > 1 ) { ?>
3200
+			<?php if ($widget_slides > 1) { ?>
3201 3201
 				<div id="geodir_widget_carousel" class="geodir_flexslider">
3202 3202
 					<ul class="geodir-slides clearfix"><?php echo $nav_slides; ?></ul>
3203 3203
 				</div>
@@ -3205,7 +3205,7 @@  discard block
 block discarded – undo
3205 3205
 		</div>
3206 3206
 		<?php
3207 3207
 		$GLOBALS['post'] = $current_post;
3208
-		setup_postdata( $current_post );
3208
+		setup_postdata($current_post);
3209 3209
 	}
3210 3210
 	echo $after_widget;
3211 3211
 }
@@ -3221,46 +3221,46 @@  discard block
 block discarded – undo
3221 3221
  * @param array|string $args     Display arguments including before_title, after_title, before_widget, and after_widget.
3222 3222
  * @param array|string $instance The settings for the particular instance of the widget.
3223 3223
  */
3224
-function geodir_loginwidget_output( $args = '', $instance = '' ) {
3224
+function geodir_loginwidget_output($args = '', $instance = '') {
3225 3225
 	//print_r($args);
3226 3226
 	//print_r($instance);
3227 3227
 	// prints the widget
3228
-	extract( $args, EXTR_SKIP );
3228
+	extract($args, EXTR_SKIP);
3229 3229
 
3230 3230
 	/** This filter is documented in geodirectory_widgets.php */
3231
-	$title = empty( $instance['title'] ) ? __( 'My Dashboard', 'geodirectory' ) : apply_filters( 'my_dashboard_widget_title', __( $instance['title'], 'geodirectory' ) );
3231
+	$title = empty($instance['title']) ? __('My Dashboard', 'geodirectory') : apply_filters('my_dashboard_widget_title', __($instance['title'], 'geodirectory'));
3232 3232
 
3233 3233
 	echo $before_widget;
3234
-	echo $before_title . $title . $after_title;
3234
+	echo $before_title.$title.$after_title;
3235 3235
 
3236
-	if ( is_user_logged_in() ) {
3236
+	if (is_user_logged_in()) {
3237 3237
 		global $current_user;
3238 3238
 
3239
-		$author_link = get_author_posts_url( $current_user->data->ID );
3240
-		$author_link = geodir_getlink( $author_link, array( 'geodir_dashbord' => 'true' ), false );
3239
+		$author_link = get_author_posts_url($current_user->data->ID);
3240
+		$author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true'), false);
3241 3241
 
3242 3242
 		echo '<ul class="geodir-loginbox-list">';
3243 3243
 		ob_start();
3244 3244
 		?>
3245 3245
 		<li><a class="signin"
3246
-		       href="<?php echo wp_logout_url( home_url() ); ?>"><?php _e( 'Logout', 'geodirectory' ); ?></a></li>
3246
+		       href="<?php echo wp_logout_url(home_url()); ?>"><?php _e('Logout', 'geodirectory'); ?></a></li>
3247 3247
 		<?php
3248
-		$post_types                           = geodir_get_posttypes( 'object' );
3249
-		$show_add_listing_post_types_main_nav = get_option( 'geodir_add_listing_link_user_dashboard' );
3250
-		$geodir_allow_posttype_frontend       = get_option( 'geodir_allow_posttype_frontend' );
3248
+		$post_types                           = geodir_get_posttypes('object');
3249
+		$show_add_listing_post_types_main_nav = get_option('geodir_add_listing_link_user_dashboard');
3250
+		$geodir_allow_posttype_frontend       = get_option('geodir_allow_posttype_frontend');
3251 3251
 
3252
-		if ( ! empty( $show_add_listing_post_types_main_nav ) ) {
3252
+		if (!empty($show_add_listing_post_types_main_nav)) {
3253 3253
 			$addlisting_links = '';
3254
-			foreach ( $post_types as $key => $postobj ) {
3254
+			foreach ($post_types as $key => $postobj) {
3255 3255
 
3256
-				if ( in_array( $key, $show_add_listing_post_types_main_nav ) ) {
3256
+				if (in_array($key, $show_add_listing_post_types_main_nav)) {
3257 3257
 
3258
-					if ( $add_link = geodir_get_addlisting_link( $key ) ) {
3258
+					if ($add_link = geodir_get_addlisting_link($key)) {
3259 3259
 
3260 3260
 						$name = $postobj->labels->name;
3261 3261
 
3262 3262
 						$selected = '';
3263
-						if ( geodir_get_current_posttype() == $key && geodir_is_page( 'add-listing' ) ) {
3263
+						if (geodir_get_current_posttype() == $key && geodir_is_page('add-listing')) {
3264 3264
 							$selected = 'selected="selected"';
3265 3265
 						}
3266 3266
 
@@ -3273,22 +3273,22 @@  discard block
 block discarded – undo
3273 3273
 						 * @param string $key       Add listing array key.
3274 3274
 						 * @param int $current_user ->ID Current user ID.
3275 3275
 						 */
3276
-						$add_link = apply_filters( 'geodir_dashboard_link_add_listing', $add_link, $key, $current_user->ID );
3276
+						$add_link = apply_filters('geodir_dashboard_link_add_listing', $add_link, $key, $current_user->ID);
3277 3277
 
3278
-						$addlisting_links .= '<option ' . $selected . ' value="' . $add_link . '">' . __( ucfirst( $name ), 'geodirectory' ) . '</option>';
3278
+						$addlisting_links .= '<option '.$selected.' value="'.$add_link.'">'.__(ucfirst($name), 'geodirectory').'</option>';
3279 3279
 
3280 3280
 					}
3281 3281
 				}
3282 3282
 
3283 3283
 			}
3284 3284
 
3285
-			if ( $addlisting_links != '' ) { ?>
3285
+			if ($addlisting_links != '') { ?>
3286 3286
 
3287 3287
 				<li><select id="geodir_add_listing" class="chosen_select" onchange="window.location.href=this.value"
3288 3288
 				            option-autoredirect="1" name="geodir_add_listing" option-ajaxchosen="false"
3289
-				            data-placeholder="<?php echo esc_attr( __( 'Add Listing', 'geodirectory' ) ); ?>">
3289
+				            data-placeholder="<?php echo esc_attr(__('Add Listing', 'geodirectory')); ?>">
3290 3290
 						<option value="" disabled="disabled" selected="selected"
3291
-						        style='display:none;'><?php echo esc_attr( __( 'Add Listing', 'geodirectory' ) ); ?></option>
3291
+						        style='display:none;'><?php echo esc_attr(__('Add Listing', 'geodirectory')); ?></option>
3292 3292
 						<?php echo $addlisting_links; ?>
3293 3293
 					</select></li> <?php
3294 3294
 
@@ -3296,23 +3296,23 @@  discard block
 block discarded – undo
3296 3296
 
3297 3297
 		}
3298 3298
 		// My Favourites in Dashboard
3299
-		$show_favorite_link_user_dashboard = get_option( 'geodir_favorite_link_user_dashboard' );
3299
+		$show_favorite_link_user_dashboard = get_option('geodir_favorite_link_user_dashboard');
3300 3300
 		$user_favourite                    = geodir_user_favourite_listing_count();
3301 3301
 
3302
-		if ( ! empty( $show_favorite_link_user_dashboard ) && ! empty( $user_favourite ) ) {
3302
+		if (!empty($show_favorite_link_user_dashboard) && !empty($user_favourite)) {
3303 3303
 			$favourite_links = '';
3304 3304
 
3305
-			foreach ( $post_types as $key => $postobj ) {
3306
-				if ( in_array( $key, $show_favorite_link_user_dashboard ) && array_key_exists( $key, $user_favourite ) ) {
3305
+			foreach ($post_types as $key => $postobj) {
3306
+				if (in_array($key, $show_favorite_link_user_dashboard) && array_key_exists($key, $user_favourite)) {
3307 3307
 					$name           = $postobj->labels->name;
3308
-					$post_type_link = geodir_getlink( $author_link, array(
3308
+					$post_type_link = geodir_getlink($author_link, array(
3309 3309
 						'stype' => $key,
3310 3310
 						'list'  => 'favourite'
3311
-					), false );
3311
+					), false);
3312 3312
 
3313 3313
 					$selected = '';
3314 3314
 
3315
-					if ( isset( $_REQUEST['list'] ) && $_REQUEST['list'] == 'favourite' && isset( $_REQUEST['stype'] ) && $_REQUEST['stype'] == $key && isset( $_REQUEST['geodir_dashbord'] ) ) {
3315
+					if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key && isset($_REQUEST['geodir_dashbord'])) {
3316 3316
 						$selected = 'selected="selected"';
3317 3317
 					}
3318 3318
 					/**
@@ -3324,20 +3324,20 @@  discard block
 block discarded – undo
3324 3324
 					 * @param string $key            Favorite listing array key.
3325 3325
 					 * @param int $current_user      ->ID Current user ID.
3326 3326
 					 */
3327
-					$post_type_link = apply_filters( 'geodir_dashboard_link_favorite_listing', $post_type_link, $key, $current_user->ID );
3327
+					$post_type_link = apply_filters('geodir_dashboard_link_favorite_listing', $post_type_link, $key, $current_user->ID);
3328 3328
 
3329
-					$favourite_links .= '<option ' . $selected . ' value="' . $post_type_link . '">' . __( ucfirst( $name ), 'geodirectory' ) . '</option>';
3329
+					$favourite_links .= '<option '.$selected.' value="'.$post_type_link.'">'.__(ucfirst($name), 'geodirectory').'</option>';
3330 3330
 				}
3331 3331
 			}
3332 3332
 
3333
-			if ( $favourite_links != '' ) {
3333
+			if ($favourite_links != '') {
3334 3334
 				?>
3335 3335
 				<li>
3336 3336
 					<select id="geodir_my_favourites" class="chosen_select" onchange="window.location.href=this.value"
3337 3337
 					        option-autoredirect="1" name="geodir_my_favourites" option-ajaxchosen="false"
3338
-					        data-placeholder="<?php echo esc_attr( __( 'My Favorites', 'geodirectory' ) ); ?>">
3338
+					        data-placeholder="<?php echo esc_attr(__('My Favorites', 'geodirectory')); ?>">
3339 3339
 						<option value="" disabled="disabled" selected="selected"
3340
-						        style='display:none;'><?php echo esc_attr( __( 'My Favorites', 'geodirectory' ) ); ?></option>
3340
+						        style='display:none;'><?php echo esc_attr(__('My Favorites', 'geodirectory')); ?></option>
3341 3341
 						<?php echo $favourite_links; ?>
3342 3342
 					</select>
3343 3343
 				</li>
@@ -3346,19 +3346,19 @@  discard block
 block discarded – undo
3346 3346
 		}
3347 3347
 
3348 3348
 
3349
-		$show_listing_link_user_dashboard = get_option( 'geodir_listing_link_user_dashboard' );
3349
+		$show_listing_link_user_dashboard = get_option('geodir_listing_link_user_dashboard');
3350 3350
 		$user_listing                     = geodir_user_post_listing_count();
3351 3351
 
3352
-		if ( ! empty( $show_listing_link_user_dashboard ) && ! empty( $user_listing ) ) {
3352
+		if (!empty($show_listing_link_user_dashboard) && !empty($user_listing)) {
3353 3353
 			$listing_links = '';
3354 3354
 
3355
-			foreach ( $post_types as $key => $postobj ) {
3356
-				if ( in_array( $key, $show_listing_link_user_dashboard ) && array_key_exists( $key, $user_listing ) ) {
3355
+			foreach ($post_types as $key => $postobj) {
3356
+				if (in_array($key, $show_listing_link_user_dashboard) && array_key_exists($key, $user_listing)) {
3357 3357
 					$name         = $postobj->labels->name;
3358
-					$listing_link = geodir_getlink( $author_link, array( 'stype' => $key ), false );
3358
+					$listing_link = geodir_getlink($author_link, array('stype' => $key), false);
3359 3359
 
3360 3360
 					$selected = '';
3361
-					if ( ! isset( $_REQUEST['list'] ) && isset( $_REQUEST['geodir_dashbord'] ) && isset( $_REQUEST['stype'] ) && $_REQUEST['stype'] == $key ) {
3361
+					if (!isset($_REQUEST['list']) && isset($_REQUEST['geodir_dashbord']) && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key) {
3362 3362
 						$selected = 'selected="selected"';
3363 3363
 					}
3364 3364
 
@@ -3371,20 +3371,20 @@  discard block
 block discarded – undo
3371 3371
 					 * @param string $key          My listing array key.
3372 3372
 					 * @param int $current_user    ->ID Current user ID.
3373 3373
 					 */
3374
-					$listing_link = apply_filters( 'geodir_dashboard_link_my_listing', $listing_link, $key, $current_user->ID );
3374
+					$listing_link = apply_filters('geodir_dashboard_link_my_listing', $listing_link, $key, $current_user->ID);
3375 3375
 
3376
-					$listing_links .= '<option ' . $selected . ' value="' . $listing_link . '">' . __( ucfirst( $name ), 'geodirectory' ) . '</option>';
3376
+					$listing_links .= '<option '.$selected.' value="'.$listing_link.'">'.__(ucfirst($name), 'geodirectory').'</option>';
3377 3377
 				}
3378 3378
 			}
3379 3379
 
3380
-			if ( $listing_links != '' ) {
3380
+			if ($listing_links != '') {
3381 3381
 				?>
3382 3382
 				<li>
3383 3383
 					<select id="geodir_my_listings" class="chosen_select" onchange="window.location.href=this.value"
3384 3384
 					        option-autoredirect="1" name="geodir_my_listings" option-ajaxchosen="false"
3385
-					        data-placeholder="<?php echo esc_attr( __( 'My Listings', 'geodirectory' ) ); ?>">
3385
+					        data-placeholder="<?php echo esc_attr(__('My Listings', 'geodirectory')); ?>">
3386 3386
 						<option value="" disabled="disabled" selected="selected"
3387
-						        style='display:none;'><?php echo esc_attr( __( 'My Listings', 'geodirectory' ) ); ?></option>
3387
+						        style='display:none;'><?php echo esc_attr(__('My Listings', 'geodirectory')); ?></option>
3388 3388
 						<?php echo $listing_links; ?>
3389 3389
 					</select>
3390 3390
 				</li>
@@ -3400,7 +3400,7 @@  discard block
 block discarded – undo
3400 3400
 		 *
3401 3401
 		 * @param string $dashboard_link Dashboard links HTML.
3402 3402
 		 */
3403
-		echo apply_filters( 'geodir_dashboard_links', $dashboard_link );
3403
+		echo apply_filters('geodir_dashboard_links', $dashboard_link);
3404 3404
 		echo '</ul>';
3405 3405
 
3406 3406
 		/**
@@ -3408,7 +3408,7 @@  discard block
 block discarded – undo
3408 3408
 		 *
3409 3409
 		 * @since 1.6.6
3410 3410
 		 */
3411
-		do_action( 'geodir_after_loginwidget_form_logged_in' );
3411
+		do_action('geodir_after_loginwidget_form_logged_in');
3412 3412
 
3413 3413
 
3414 3414
 	} else {
@@ -3423,18 +3423,18 @@  discard block
 block discarded – undo
3423 3423
 		<form name="loginform" class="loginform1"
3424 3424
 		      action="<?php echo geodir_login_url(); ?>"
3425 3425
 		      method="post">
3426
-			<div class="geodir_form_row"><input placeholder="<?php _e( 'Email', 'geodirectory' ); ?>" name="log"
3426
+			<div class="geodir_form_row"><input placeholder="<?php _e('Email', 'geodirectory'); ?>" name="log"
3427 3427
 			                                    type="text" class="textfield user_login1"/> <span
3428 3428
 					class="user_loginInfo"></span></div>
3429
-			<div class="geodir_form_row"><input placeholder="<?php _e( 'Password', 'geodirectory' ); ?>"
3429
+			<div class="geodir_form_row"><input placeholder="<?php _e('Password', 'geodirectory'); ?>"
3430 3430
 			                                    name="pwd" type="password"
3431 3431
 			                                    class="textfield user_pass1 input-text"/><span
3432 3432
 					class="user_passInfo"></span></div>
3433 3433
 
3434
-			<input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars( geodir_curPageURL() ); ?>"/>
3434
+			<input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars(geodir_curPageURL()); ?>"/>
3435 3435
 			<input type="hidden" name="testcookie" value="1"/>
3436 3436
 
3437
-				<?php do_action( 'login_form' ); ?>
3437
+				<?php do_action('login_form'); ?>
3438 3438
 
3439 3439
 			<div class="geodir_form_row clearfix"><input type="submit" name="submit"
3440 3440
 			                                             value="<?php echo SIGN_IN_BUTTON; ?>" class="b_signin"/>
@@ -3447,7 +3447,7 @@  discard block
 block discarded – undo
3447 3447
 					 * @since 1.0.0
3448 3448
 					 */
3449 3449
 					?>
3450
-					<a href="<?php echo geodir_login_url( array( 'signup' => true ) ); ?>"
3450
+					<a href="<?php echo geodir_login_url(array('signup' => true)); ?>"
3451 3451
 					   class="goedir-newuser-link"><?php echo NEW_USER_TEXT; ?></a>
3452 3452
 
3453 3453
 					<?php
@@ -3457,7 +3457,7 @@  discard block
 block discarded – undo
3457 3457
 					 * @since 1.0.0
3458 3458
 					 */
3459 3459
 					?>
3460
-					<a href="<?php echo geodir_login_url( array( 'forgot' => true ) ); ?>"
3460
+					<a href="<?php echo geodir_login_url(array('forgot' => true)); ?>"
3461 3461
 					   class="goedir-forgot-link"><?php echo FORGOT_PW_TEXT; ?></a></p></div>
3462 3462
 		</form>
3463 3463
 		<?php
@@ -3466,7 +3466,7 @@  discard block
 block discarded – undo
3466 3466
 		 *
3467 3467
 		 * @since 1.6.6
3468 3468
 		 */
3469
-		do_action( 'geodir_after_loginwidget_form_logged_out' );
3469
+		do_action('geodir_after_loginwidget_form_logged_out');
3470 3470
 	}
3471 3471
 
3472 3472
 	echo $after_widget;
@@ -3488,16 +3488,16 @@  discard block
 block discarded – undo
3488 3488
  *                                         after_widget.
3489 3489
  * @param array|string $instance           The settings for the particular instance of the widget.
3490 3490
  */
3491
-function geodir_popular_postview_output( $args = '', $instance = '' ) {
3491
+function geodir_popular_postview_output($args = '', $instance = '') {
3492 3492
 	global $gd_session;
3493 3493
 
3494 3494
 	// prints the widget
3495
-	extract( $args, EXTR_SKIP );
3495
+	extract($args, EXTR_SKIP);
3496 3496
 
3497 3497
 	echo $before_widget;
3498 3498
 
3499 3499
 	/** This filter is documented in geodirectory_widgets.php */
3500
-	$title = empty( $instance['title'] ) ? geodir_ucwords( $instance['category_title'] ) : apply_filters( 'widget_title', __( $instance['title'], 'geodirectory' ) );
3500
+	$title = empty($instance['title']) ? geodir_ucwords($instance['category_title']) : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
3501 3501
 	/**
3502 3502
 	 * Filter the widget post type.
3503 3503
 	 *
@@ -3505,7 +3505,7 @@  discard block
 block discarded – undo
3505 3505
 	 *
3506 3506
 	 * @param string $instance ['post_type'] Post type of listing.
3507 3507
 	 */
3508
-	$post_type = empty( $instance['post_type'] ) ? 'gd_place' : apply_filters( 'widget_post_type', $instance['post_type'] );
3508
+	$post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('widget_post_type', $instance['post_type']);
3509 3509
 	/**
3510 3510
 	 * Filter the widget's term.
3511 3511
 	 *
@@ -3513,7 +3513,7 @@  discard block
 block discarded – undo
3513 3513
 	 *
3514 3514
 	 * @param string $instance ['category'] Filter by term. Can be any valid term.
3515 3515
 	 */
3516
-	$category = empty( $instance['category'] ) ? '0' : apply_filters( 'widget_category', $instance['category'] );
3516
+	$category = empty($instance['category']) ? '0' : apply_filters('widget_category', $instance['category']);
3517 3517
 	/**
3518 3518
 	 * Filter the widget listings limit.
3519 3519
 	 *
@@ -3521,7 +3521,7 @@  discard block
 block discarded – undo
3521 3521
 	 *
3522 3522
 	 * @param string $instance ['post_number'] Number of listings to display.
3523 3523
 	 */
3524
-	$post_number = empty( $instance['post_number'] ) ? '5' : apply_filters( 'widget_post_number', $instance['post_number'] );
3524
+	$post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']);
3525 3525
 	/**
3526 3526
 	 * Filter widget's "layout" type.
3527 3527
 	 *
@@ -3529,7 +3529,7 @@  discard block
 block discarded – undo
3529 3529
 	 *
3530 3530
 	 * @param string $instance ['layout'] Widget layout type.
3531 3531
 	 */
3532
-	$layout = empty( $instance['layout'] ) ? 'gridview_onehalf' : apply_filters( 'widget_layout', $instance['layout'] );
3532
+	$layout = empty($instance['layout']) ? 'gridview_onehalf' : apply_filters('widget_layout', $instance['layout']);
3533 3533
 	/**
3534 3534
 	 * Filter widget's "add_location_filter" value.
3535 3535
 	 *
@@ -3537,7 +3537,7 @@  discard block
 block discarded – undo
3537 3537
 	 *
3538 3538
 	 * @param string|bool $instance ['add_location_filter'] Do you want to add location filter? Can be 1 or 0.
3539 3539
 	 */
3540
-	$add_location_filter = empty( $instance['add_location_filter'] ) ? '0' : apply_filters( 'widget_add_location_filter', $instance['add_location_filter'] );
3540
+	$add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_add_location_filter', $instance['add_location_filter']);
3541 3541
 	/**
3542 3542
 	 * Filter widget's listing width.
3543 3543
 	 *
@@ -3545,7 +3545,7 @@  discard block
 block discarded – undo
3545 3545
 	 *
3546 3546
 	 * @param string $instance ['listing_width'] Listing width.
3547 3547
 	 */
3548
-	$listing_width = empty( $instance['listing_width'] ) ? '' : apply_filters( 'widget_listing_width', $instance['listing_width'] );
3548
+	$listing_width = empty($instance['listing_width']) ? '' : apply_filters('widget_listing_width', $instance['listing_width']);
3549 3549
 	/**
3550 3550
 	 * Filter widget's "list_sort" type.
3551 3551
 	 *
@@ -3553,25 +3553,25 @@  discard block
 block discarded – undo
3553 3553
 	 *
3554 3554
 	 * @param string $instance ['list_sort'] Listing sort by type.
3555 3555
 	 */
3556
-	$list_sort             = empty( $instance['list_sort'] ) ? 'latest' : apply_filters( 'widget_list_sort', $instance['list_sort'] );
3557
-	$use_viewing_post_type = ! empty( $instance['use_viewing_post_type'] ) ? true : false;
3556
+	$list_sort             = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']);
3557
+	$use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false;
3558 3558
 
3559 3559
 	// set post type to current viewing post type
3560
-	if ( $use_viewing_post_type ) {
3560
+	if ($use_viewing_post_type) {
3561 3561
 		$current_post_type = geodir_get_current_posttype();
3562
-		if ( $current_post_type != '' && $current_post_type != $post_type ) {
3562
+		if ($current_post_type != '' && $current_post_type != $post_type) {
3563 3563
 			$post_type = $current_post_type;
3564 3564
 			$category  = array(); // old post type category will not work for current changed post type
3565 3565
 		}
3566 3566
 	}
3567 3567
 	// replace widget title dynamically
3568
-	$posttype_plural_label   = __( get_post_type_plural_label( $post_type ), 'geodirectory' );
3569
-	$posttype_singular_label = __( get_post_type_singular_label( $post_type ), 'geodirectory' );
3568
+	$posttype_plural_label   = __(get_post_type_plural_label($post_type), 'geodirectory');
3569
+	$posttype_singular_label = __(get_post_type_singular_label($post_type), 'geodirectory');
3570 3570
 
3571
-	$title = str_replace( "%posttype_plural_label%", $posttype_plural_label, $title );
3572
-	$title = str_replace( "%posttype_singular_label%", $posttype_singular_label, $title );
3571
+	$title = str_replace("%posttype_plural_label%", $posttype_plural_label, $title);
3572
+	$title = str_replace("%posttype_singular_label%", $posttype_singular_label, $title);
3573 3573
 
3574
-	if ( isset( $instance['character_count'] ) ) {
3574
+	if (isset($instance['character_count'])) {
3575 3575
 		/**
3576 3576
 		 * Filter the widget's excerpt character count.
3577 3577
 		 *
@@ -3579,37 +3579,37 @@  discard block
 block discarded – undo
3579 3579
 		 *
3580 3580
 		 * @param int $instance ['character_count'] Excerpt character count.
3581 3581
 		 */
3582
-		$character_count = apply_filters( 'widget_list_character_count', $instance['character_count'] );
3582
+		$character_count = apply_filters('widget_list_character_count', $instance['character_count']);
3583 3583
 	} else {
3584 3584
 		$character_count = '';
3585 3585
 	}
3586 3586
 
3587
-	if ( empty( $title ) || $title == 'All' ) {
3588
-		$title .= ' ' . __( get_post_type_plural_label( $post_type ), 'geodirectory' );
3587
+	if (empty($title) || $title == 'All') {
3588
+		$title .= ' '.__(get_post_type_plural_label($post_type), 'geodirectory');
3589 3589
 	}
3590 3590
 
3591 3591
 	$location_url = array();
3592
-	$city         = get_query_var( 'gd_city' );
3593
-	if ( ! empty( $city ) ) {
3594
-		$country = get_query_var( 'gd_country' );
3595
-		$region  = get_query_var( 'gd_region' );
3592
+	$city         = get_query_var('gd_city');
3593
+	if (!empty($city)) {
3594
+		$country = get_query_var('gd_country');
3595
+		$region  = get_query_var('gd_region');
3596 3596
 
3597
-		$geodir_show_location_url = get_option( 'geodir_show_location_url' );
3597
+		$geodir_show_location_url = get_option('geodir_show_location_url');
3598 3598
 
3599
-		if ( $geodir_show_location_url == 'all' ) {
3600
-			if ( $country != '' ) {
3599
+		if ($geodir_show_location_url == 'all') {
3600
+			if ($country != '') {
3601 3601
 				$location_url[] = $country;
3602 3602
 			}
3603 3603
 
3604
-			if ( $region != '' ) {
3604
+			if ($region != '') {
3605 3605
 				$location_url[] = $region;
3606 3606
 			}
3607
-		} else if ( $geodir_show_location_url == 'country_city' ) {
3608
-			if ( $country != '' ) {
3607
+		} else if ($geodir_show_location_url == 'country_city') {
3608
+			if ($country != '') {
3609 3609
 				$location_url[] = $country;
3610 3610
 			}
3611
-		} else if ( $geodir_show_location_url == 'region_city' ) {
3612
-			if ( $region != '' ) {
3611
+		} else if ($geodir_show_location_url == 'region_city') {
3612
+			if ($region != '') {
3613 3613
 				$location_url[] = $region;
3614 3614
 			}
3615 3615
 		}
@@ -3617,37 +3617,37 @@  discard block
 block discarded – undo
3617 3617
 		$location_url[] = $city;
3618 3618
 	}
3619 3619
 
3620
-	$location_url  = implode( '/', $location_url );
3620
+	$location_url  = implode('/', $location_url);
3621 3621
 	$skip_location = false;
3622
-	if ( ! $add_location_filter && $gd_session->get( 'gd_multi_location' ) ) {
3622
+	if (!$add_location_filter && $gd_session->get('gd_multi_location')) {
3623 3623
 		$skip_location = true;
3624
-		$gd_session->un_set( 'gd_multi_location' );
3624
+		$gd_session->un_set('gd_multi_location');
3625 3625
 	}
3626 3626
 
3627
-	if ( get_option( 'permalink_structure' ) ) {
3628
-		$viewall_url = get_post_type_archive_link( $post_type );
3627
+	if (get_option('permalink_structure')) {
3628
+		$viewall_url = get_post_type_archive_link($post_type);
3629 3629
 	} else {
3630
-		$viewall_url = get_post_type_archive_link( $post_type );
3630
+		$viewall_url = get_post_type_archive_link($post_type);
3631 3631
 	}
3632 3632
 
3633
-	if ( ! empty( $category ) && $category[0] != '0' ) {
3633
+	if (!empty($category) && $category[0] != '0') {
3634 3634
 		global $geodir_add_location_url;
3635 3635
 
3636 3636
 		$geodir_add_location_url = '0';
3637 3637
 
3638
-		if ( $add_location_filter != '0' ) {
3638
+		if ($add_location_filter != '0') {
3639 3639
 			$geodir_add_location_url = '1';
3640 3640
 		}
3641 3641
 
3642
-		$viewall_url = get_term_link( (int) $category[0], $post_type . 'category' );
3642
+		$viewall_url = get_term_link((int) $category[0], $post_type.'category');
3643 3643
 
3644 3644
 		$geodir_add_location_url = null;
3645 3645
 	}
3646
-	if ( $skip_location ) {
3647
-		$gd_session->set( 'gd_multi_location', 1 );
3646
+	if ($skip_location) {
3647
+		$gd_session->set('gd_multi_location', 1);
3648 3648
 	}
3649 3649
 
3650
-	if ( is_wp_error( $viewall_url ) ) {
3650
+	if (is_wp_error($viewall_url)) {
3651 3651
 		$viewall_url = '';
3652 3652
 	}
3653 3653
 
@@ -3659,34 +3659,34 @@  discard block
 block discarded – undo
3659 3659
 		'order_by'       => $list_sort
3660 3660
 	);
3661 3661
 
3662
-	if ( $character_count ) {
3662
+	if ($character_count) {
3663 3663
 		$query_args['excerpt_length'] = $character_count;
3664 3664
 	}
3665 3665
 
3666
-	if ( ! empty( $instance['show_featured_only'] ) ) {
3666
+	if (!empty($instance['show_featured_only'])) {
3667 3667
 		$query_args['show_featured_only'] = 1;
3668 3668
 	}
3669 3669
 
3670
-	if ( ! empty( $instance['show_special_only'] ) ) {
3670
+	if (!empty($instance['show_special_only'])) {
3671 3671
 		$query_args['show_special_only'] = 1;
3672 3672
 	}
3673 3673
 
3674
-	if ( ! empty( $instance['with_pics_only'] ) ) {
3674
+	if (!empty($instance['with_pics_only'])) {
3675 3675
 		$query_args['with_pics_only']      = 0;
3676 3676
 		$query_args['featured_image_only'] = 1;
3677 3677
 	}
3678 3678
 
3679
-	if ( ! empty( $instance['with_videos_only'] ) ) {
3679
+	if (!empty($instance['with_videos_only'])) {
3680 3680
 		$query_args['with_videos_only'] = 1;
3681 3681
 	}
3682
-	$with_no_results = ! empty( $instance['without_no_results'] ) ? false : true;
3682
+	$with_no_results = !empty($instance['without_no_results']) ? false : true;
3683 3683
 
3684
-	if ( ! empty( $category ) && $category[0] != '0' ) {
3685
-		$category_taxonomy = geodir_get_taxonomies( $post_type );
3684
+	if (!empty($category) && $category[0] != '0') {
3685
+		$category_taxonomy = geodir_get_taxonomies($post_type);
3686 3686
 
3687 3687
 		######### WPML #########
3688
-		if ( function_exists( 'icl_object_id' ) ) {
3689
-			$category = gd_lang_object_ids( $category, $category_taxonomy[0] );
3688
+		if (function_exists('icl_object_id')) {
3689
+			$category = gd_lang_object_ids($category, $category_taxonomy[0]);
3690 3690
 		}
3691 3691
 		######### WPML #########
3692 3692
 
@@ -3696,14 +3696,14 @@  discard block
 block discarded – undo
3696 3696
 			'terms'    => $category
3697 3697
 		);
3698 3698
 
3699
-		$query_args['tax_query'] = array( $tax_query );
3699
+		$query_args['tax_query'] = array($tax_query);
3700 3700
 	}
3701 3701
 
3702 3702
 	global $gridview_columns_widget, $geodir_is_widget_listing;
3703 3703
 
3704
-	$widget_listings = geodir_get_widget_listings( $query_args );
3704
+	$widget_listings = geodir_get_widget_listings($query_args);
3705 3705
 
3706
-	if ( ! empty( $widget_listings ) || $with_no_results ) {
3706
+	if (!empty($widget_listings) || $with_no_results) {
3707 3707
 		?>
3708 3708
 		<div class="geodir_locations geodir_location_listing">
3709 3709
 
@@ -3713,11 +3713,11 @@  discard block
 block discarded – undo
3713 3713
 			 *
3714 3714
 			 * @since 1.0.0
3715 3715
 			 */
3716
-			do_action( 'geodir_before_view_all_link_in_widget' ); ?>
3716
+			do_action('geodir_before_view_all_link_in_widget'); ?>
3717 3717
 			<div class="geodir_list_heading clearfix">
3718
-				<?php echo $before_title . $title . $after_title; ?>
3718
+				<?php echo $before_title.$title.$after_title; ?>
3719 3719
 				<a href="<?php echo $viewall_url; ?>"
3720
-				   class="geodir-viewall"><?php _e( 'View all', 'geodirectory' ); ?></a>
3720
+				   class="geodir-viewall"><?php _e('View all', 'geodirectory'); ?></a>
3721 3721
 			</div>
3722 3722
 			<?php
3723 3723
 			/**
@@ -3725,10 +3725,10 @@  discard block
 block discarded – undo
3725 3725
 			 *
3726 3726
 			 * @since 1.0.0
3727 3727
 			 */
3728
-			do_action( 'geodir_after_view_all_link_in_widget' ); ?>
3728
+			do_action('geodir_after_view_all_link_in_widget'); ?>
3729 3729
 			<?php
3730
-			if ( strstr( $layout, 'gridview' ) ) {
3731
-				$listing_view_exp        = explode( '_', $layout );
3730
+			if (strstr($layout, 'gridview')) {
3731
+				$listing_view_exp        = explode('_', $layout);
3732 3732
 				$gridview_columns_widget = $layout;
3733 3733
 				$layout                  = $listing_view_exp[0];
3734 3734
 			} else {
@@ -3740,8 +3740,8 @@  discard block
 block discarded – undo
3740 3740
 			 *
3741 3741
 			 * @since 1.0.0
3742 3742
 			 */
3743
-			$template = apply_filters( "geodir_template_part-widget-listing-listview", geodir_locate_template( 'widget-listing-listview' ) );
3744
-			if ( ! isset( $character_count ) ) {
3743
+			$template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
3744
+			if (!isset($character_count)) {
3745 3745
 				/**
3746 3746
 				 * Filter the widget's excerpt character count.
3747 3747
 				 *
@@ -3749,7 +3749,7 @@  discard block
 block discarded – undo
3749 3749
 				 *
3750 3750
 				 * @param int $instance ['character_count'] Excerpt character count.
3751 3751
 				 */
3752
-				$character_count = $character_count == '' ? 50 : apply_filters( 'widget_character_count', $character_count );
3752
+				$character_count = $character_count == '' ? 50 : apply_filters('widget_character_count', $character_count);
3753 3753
 			}
3754 3754
 
3755 3755
 			global $post, $map_jason, $map_canvas_arr;
@@ -3764,13 +3764,13 @@  discard block
 block discarded – undo
3764 3764
 			 *
3765 3765
 			 * @since 1.0.0
3766 3766
 			 */
3767
-			include( $template );
3767
+			include($template);
3768 3768
 
3769 3769
 			$geodir_is_widget_listing = false;
3770 3770
 
3771 3771
 			$GLOBALS['post'] = $current_post;
3772
-			if ( ! empty( $current_post ) ) {
3773
-				setup_postdata( $current_post );
3772
+			if (!empty($current_post)) {
3773
+				setup_postdata($current_post);
3774 3774
 			}
3775 3775
 			$map_jason      = $current_map_jason;
3776 3776
 			$map_canvas_arr = $current_map_canvas_arr;
@@ -3801,12 +3801,12 @@  discard block
 block discarded – undo
3801 3801
  *
3802 3802
  * @return int Reviews count.
3803 3803
  */
3804
-function geodir_count_reviews_by_term_id( $term_id, $taxonomy, $post_type ) {
3804
+function geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type) {
3805 3805
 	global $wpdb, $plugin_prefix;
3806 3806
 
3807
-	$detail_table = $plugin_prefix . $post_type . '_detail';
3807
+	$detail_table = $plugin_prefix.$post_type.'_detail';
3808 3808
 
3809
-	$sql = "SELECT COALESCE(SUM(rating_count),0) FROM " . $detail_table . " WHERE post_status = 'publish' AND rating_count > 0 AND FIND_IN_SET(" . $term_id . ", " . $taxonomy . ")";
3809
+	$sql = "SELECT COALESCE(SUM(rating_count),0) FROM ".$detail_table." WHERE post_status = 'publish' AND rating_count > 0 AND FIND_IN_SET(".$term_id.", ".$taxonomy.")";
3810 3810
 
3811 3811
 	/**
3812 3812
 	 * Filter count review sql query.
@@ -3818,9 +3818,9 @@  discard block
 block discarded – undo
3818 3818
 	 * @param int $taxonomy     The taxonomy Id.
3819 3819
 	 * @param string $post_type The post type.
3820 3820
 	 */
3821
-	$sql = apply_filters( 'geodir_count_reviews_by_term_sql', $sql, $term_id, $taxonomy, $post_type );
3821
+	$sql = apply_filters('geodir_count_reviews_by_term_sql', $sql, $term_id, $taxonomy, $post_type);
3822 3822
 
3823
-	$count = $wpdb->get_var( $sql );
3823
+	$count = $wpdb->get_var($sql);
3824 3824
 
3825 3825
 	return $count;
3826 3826
 }
@@ -3838,7 +3838,7 @@  discard block
 block discarded – undo
3838 3838
  *
3839 3839
  * @return array Term array data.
3840 3840
  */
3841
-function geodir_count_reviews_by_terms( $force_update = false, $post_ID = 0 ) {
3841
+function geodir_count_reviews_by_terms($force_update = false, $post_ID = 0) {
3842 3842
 	/**
3843 3843
 	 * Filter review count option data.
3844 3844
 	 *
@@ -3848,78 +3848,78 @@  discard block
 block discarded – undo
3848 3848
 	 * @param bool $force_update Force update option value?. Default.false.
3849 3849
 	 * @param int $post_ID       The post id to update if any.
3850 3850
 	 */
3851
-	$option_data = apply_filters( 'geodir_count_reviews_by_terms_before', '', $force_update, $post_ID );
3852
-	if ( ! empty( $option_data ) ) {
3851
+	$option_data = apply_filters('geodir_count_reviews_by_terms_before', '', $force_update, $post_ID);
3852
+	if (!empty($option_data)) {
3853 3853
 		return $option_data;
3854 3854
 	}
3855 3855
 
3856
-	$option_data = get_option( 'geodir_global_review_count' );
3856
+	$option_data = get_option('geodir_global_review_count');
3857 3857
 
3858
-	if ( ! $option_data || $force_update ) {
3859
-		if ( (int) $post_ID > 0 ) { // Update reviews count for specific post categories only.
3858
+	if (!$option_data || $force_update) {
3859
+		if ((int) $post_ID > 0) { // Update reviews count for specific post categories only.
3860 3860
 			global $gd_session;
3861 3861
 			$term_array = (array) $option_data;
3862
-			$post_type  = get_post_type( $post_ID );
3863
-			$taxonomy   = $post_type . 'category';
3864
-			$terms      = wp_get_object_terms( $post_ID, $taxonomy, array( 'fields' => 'ids' ) );
3865
-
3866
-			if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
3867
-				foreach ( $terms as $term_id ) {
3868
-					$count                  = geodir_count_reviews_by_term_id( $term_id, $taxonomy, $post_type );
3869
-					$children               = get_term_children( $term_id, $taxonomy );
3870
-					$term_array[ $term_id ] = $count;
3862
+			$post_type  = get_post_type($post_ID);
3863
+			$taxonomy   = $post_type.'category';
3864
+			$terms      = wp_get_object_terms($post_ID, $taxonomy, array('fields' => 'ids'));
3865
+
3866
+			if (!empty($terms) && !is_wp_error($terms)) {
3867
+				foreach ($terms as $term_id) {
3868
+					$count                  = geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type);
3869
+					$children               = get_term_children($term_id, $taxonomy);
3870
+					$term_array[$term_id] = $count;
3871 3871
 				}
3872 3872
 			}
3873 3873
 
3874
-			$session_listing = $gd_session->get( 'listing' );
3874
+			$session_listing = $gd_session->get('listing');
3875 3875
 
3876 3876
 			$terms = array();
3877
-			if ( isset( $_POST['post_category'][ $taxonomy ] ) ) {
3878
-				$terms = (array) $_POST['post_category'][ $taxonomy ];
3879
-			} else if ( ! empty( $session_listing ) && isset( $session_listing['post_category'][ $taxonomy ] ) ) {
3880
-				$terms = (array) $session_listing['post_category'][ $taxonomy ];
3877
+			if (isset($_POST['post_category'][$taxonomy])) {
3878
+				$terms = (array) $_POST['post_category'][$taxonomy];
3879
+			} else if (!empty($session_listing) && isset($session_listing['post_category'][$taxonomy])) {
3880
+				$terms = (array) $session_listing['post_category'][$taxonomy];
3881 3881
 			}
3882 3882
 
3883
-			if ( ! empty( $terms ) ) {
3884
-				foreach ( $terms as $term_id ) {
3885
-					if ( $term_id > 0 ) {
3886
-						$count                  = geodir_count_reviews_by_term_id( $term_id, $taxonomy, $post_type );
3887
-						$children               = get_term_children( $term_id, $taxonomy );
3888
-						$term_array[ $term_id ] = $count;
3883
+			if (!empty($terms)) {
3884
+				foreach ($terms as $term_id) {
3885
+					if ($term_id > 0) {
3886
+						$count                  = geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type);
3887
+						$children               = get_term_children($term_id, $taxonomy);
3888
+						$term_array[$term_id] = $count;
3889 3889
 					}
3890 3890
 				}
3891 3891
 			}
3892 3892
 		} else { // Update reviews count for all post categories.
3893 3893
 			$term_array = array();
3894 3894
 			$post_types = geodir_get_posttypes();
3895
-			foreach ( $post_types as $post_type ) {
3895
+			foreach ($post_types as $post_type) {
3896 3896
 
3897
-				$taxonomy = geodir_get_taxonomies( $post_type );
3897
+				$taxonomy = geodir_get_taxonomies($post_type);
3898 3898
 				$taxonomy = $taxonomy[0];
3899 3899
 
3900 3900
 				$args = array(
3901 3901
 					'hide_empty' => false
3902 3902
 				);
3903 3903
 
3904
-				$terms = get_terms( $taxonomy, $args );
3904
+				$terms = get_terms($taxonomy, $args);
3905 3905
 
3906
-				foreach ( $terms as $term ) {
3907
-					$count    = geodir_count_reviews_by_term_id( $term->term_id, $taxonomy, $post_type );
3908
-					$children = get_term_children( $term->term_id, $taxonomy );
3906
+				foreach ($terms as $term) {
3907
+					$count    = geodir_count_reviews_by_term_id($term->term_id, $taxonomy, $post_type);
3908
+					$children = get_term_children($term->term_id, $taxonomy);
3909 3909
 					/*if ( is_array( $children ) ) {
3910 3910
                         foreach ( $children as $child_id ) {
3911 3911
                             $child_count = geodir_count_reviews_by_term_id($child_id, $taxonomy, $post_type);
3912 3912
                             $count = $count + $child_count;
3913 3913
                         }
3914 3914
                     }*/
3915
-					$term_array[ $term->term_id ] = $count;
3915
+					$term_array[$term->term_id] = $count;
3916 3916
 				}
3917 3917
 			}
3918 3918
 		}
3919 3919
 
3920
-		update_option( 'geodir_global_review_count', $term_array );
3920
+		update_option('geodir_global_review_count', $term_array);
3921 3921
 		//clear cache
3922
-		wp_cache_delete( 'geodir_global_review_count' );
3922
+		wp_cache_delete('geodir_global_review_count');
3923 3923
 
3924 3924
 		return $term_array;
3925 3925
 	} else {
@@ -3935,39 +3935,39 @@  discard block
 block discarded – undo
3935 3935
  * @package GeoDirectory
3936 3936
  * @return bool
3937 3937
  */
3938
-function geodir_term_review_count_force_update( $new_status, $old_status = '', $post = '' ) {
3939
-	if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'geodir_import_export' ) {
3938
+function geodir_term_review_count_force_update($new_status, $old_status = '', $post = '') {
3939
+	if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'geodir_import_export') {
3940 3940
 		return; // do not run if importing listings
3941 3941
 	}
3942 3942
 
3943
-	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
3943
+	if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
3944 3944
 		return;
3945 3945
 	}
3946 3946
 
3947 3947
 	$post_ID = 0;
3948
-	if ( ! empty( $post ) ) {
3949
-		if ( isset( $post->post_type ) && strpos( $post->post_type, 'gd_' ) !== 0 ) {
3948
+	if (!empty($post)) {
3949
+		if (isset($post->post_type) && strpos($post->post_type, 'gd_') !== 0) {
3950 3950
 			return;
3951 3951
 		}
3952 3952
 
3953
-		if ( $new_status == 'auto-draft' && $old_status == 'new' ) {
3953
+		if ($new_status == 'auto-draft' && $old_status == 'new') {
3954 3954
 			return;
3955 3955
 		}
3956 3956
 
3957
-		if ( ! empty( $post->ID ) ) {
3957
+		if (!empty($post->ID)) {
3958 3958
 			$post_ID = $post->ID;
3959 3959
 		}
3960 3960
 	}
3961 3961
 
3962
-	if ( $new_status != $old_status ) {
3963
-		geodir_count_reviews_by_terms( true, $post_ID );
3962
+	if ($new_status != $old_status) {
3963
+		geodir_count_reviews_by_terms(true, $post_ID);
3964 3964
 	}
3965 3965
 
3966 3966
 	return true;
3967 3967
 }
3968 3968
 
3969
-function geodir_term_review_count_force_update_single_post( $post_id ) {
3970
-	geodir_count_reviews_by_terms( true, $post_id );
3969
+function geodir_term_review_count_force_update_single_post($post_id) {
3970
+	geodir_count_reviews_by_terms(true, $post_id);
3971 3971
 }
3972 3972
 
3973 3973
 /*-----------------------------------------------------------------------------------*/
@@ -3984,11 +3984,11 @@  discard block
 block discarded – undo
3984 3984
  *
3985 3985
  * @return int Post count.
3986 3986
  */
3987
-function geodir_count_posts_by_term( $data, $term ) {
3987
+function geodir_count_posts_by_term($data, $term) {
3988 3988
 
3989
-	if ( $data ) {
3990
-		if ( isset( $data[ $term->term_id ] ) ) {
3991
-			return $data[ $term->term_id ];
3989
+	if ($data) {
3990
+		if (isset($data[$term->term_id])) {
3991
+			return $data[$term->term_id];
3992 3992
 		} else {
3993 3993
 			return 0;
3994 3994
 		}
@@ -4005,8 +4005,8 @@  discard block
 block discarded – undo
4005 4005
  * param array $terms An array of term objects.
4006 4006
  * @return array Sorted terms array.
4007 4007
  */
4008
-function geodir_sort_terms_by_count( $terms ) {
4009
-	usort( $terms, "geodir_sort_by_count_obj" );
4008
+function geodir_sort_terms_by_count($terms) {
4009
+	usort($terms, "geodir_sort_by_count_obj");
4010 4010
 
4011 4011
 	return $terms;
4012 4012
 }
@@ -4021,8 +4021,8 @@  discard block
 block discarded – undo
4021 4021
  *
4022 4022
  * @return array Sorted terms array.
4023 4023
  */
4024
-function geodir_sort_terms_by_review_count( $terms ) {
4025
-	usort( $terms, "geodir_sort_by_review_count_obj" );
4024
+function geodir_sort_terms_by_review_count($terms) {
4025
+	usort($terms, "geodir_sort_by_review_count_obj");
4026 4026
 
4027 4027
 	return $terms;
4028 4028
 }
@@ -4038,12 +4038,12 @@  discard block
 block discarded – undo
4038 4038
  *
4039 4039
  * @return array Sorted terms array.
4040 4040
  */
4041
-function geodir_sort_terms( $terms, $sort = 'count' ) {
4042
-	if ( $sort == 'count' ) {
4043
-		return geodir_sort_terms_by_count( $terms );
4041
+function geodir_sort_terms($terms, $sort = 'count') {
4042
+	if ($sort == 'count') {
4043
+		return geodir_sort_terms_by_count($terms);
4044 4044
 	}
4045
-	if ( $sort == 'review_count' ) {
4046
-		return geodir_sort_terms_by_review_count( $terms );
4045
+	if ($sort == 'review_count') {
4046
+		return geodir_sort_terms_by_review_count($terms);
4047 4047
 	}
4048 4048
 }
4049 4049
 
@@ -4061,7 +4061,7 @@  discard block
 block discarded – undo
4061 4061
  *
4062 4062
  * @return bool
4063 4063
  */
4064
-function geodir_sort_by_count( $a, $b ) {
4064
+function geodir_sort_by_count($a, $b) {
4065 4065
 	return $a['count'] < $b['count'];
4066 4066
 }
4067 4067
 
@@ -4076,7 +4076,7 @@  discard block
 block discarded – undo
4076 4076
  *
4077 4077
  * @return bool
4078 4078
  */
4079
-function geodir_sort_by_count_obj( $a, $b ) {
4079
+function geodir_sort_by_count_obj($a, $b) {
4080 4080
 	return $a->count < $b->count;
4081 4081
 }
4082 4082
 
@@ -4091,7 +4091,7 @@  discard block
 block discarded – undo
4091 4091
  *
4092 4092
  * @return bool
4093 4093
  */
4094
-function geodir_sort_by_review_count_obj( $a, $b ) {
4094
+function geodir_sort_by_review_count_obj($a, $b) {
4095 4095
 	return $a->review_count < $b->review_count;
4096 4096
 }
4097 4097
 
@@ -4108,35 +4108,35 @@  discard block
 block discarded – undo
4108 4108
 	 * @since   1.4.2
4109 4109
 	 * @package GeoDirectory
4110 4110
 	 */
4111
-	$locale = apply_filters( 'plugin_locale', get_locale(), 'geodirectory' );
4111
+	$locale = apply_filters('plugin_locale', get_locale(), 'geodirectory');
4112 4112
 
4113
-	load_textdomain( 'geodirectory', WP_LANG_DIR . '/' . 'geodirectory' . '/' . 'geodirectory' . '-' . $locale . '.mo' );
4114
-	load_plugin_textdomain( 'geodirectory', false, plugin_basename( dirname( dirname( __FILE__ ) ) ) . '/geodirectory-languages' );
4113
+	load_textdomain('geodirectory', WP_LANG_DIR.'/'.'geodirectory'.'/'.'geodirectory'.'-'.$locale.'.mo');
4114
+	load_plugin_textdomain('geodirectory', false, plugin_basename(dirname(dirname(__FILE__))).'/geodirectory-languages');
4115 4115
 
4116 4116
 	/**
4117 4117
 	 * Define language constants.
4118 4118
 	 *
4119 4119
 	 * @since 1.0.0
4120 4120
 	 */
4121
-	require_once( geodir_plugin_path() . '/language.php' );
4121
+	require_once(geodir_plugin_path().'/language.php');
4122 4122
 
4123
-	$language_file = geodir_plugin_path() . '/db-language.php';
4123
+	$language_file = geodir_plugin_path().'/db-language.php';
4124 4124
 
4125 4125
 	// Load language string file if not created yet
4126
-	if ( ! file_exists( $language_file ) ) {
4126
+	if (!file_exists($language_file)) {
4127 4127
 		geodirectory_load_db_language();
4128 4128
 	}
4129 4129
 
4130
-	if ( file_exists( $language_file ) ) {
4130
+	if (file_exists($language_file)) {
4131 4131
 		/**
4132 4132
 		 * Language strings from database.
4133 4133
 		 *
4134 4134
 		 * @since 1.4.2
4135 4135
 		 */
4136 4136
 		try {
4137
-			require_once( $language_file );
4138
-		} catch ( Exception $e ) {
4139
-			error_log( 'Language Error: ' . $e->getMessage() );
4137
+			require_once($language_file);
4138
+		} catch (Exception $e) {
4139
+			error_log('Language Error: '.$e->getMessage());
4140 4140
 		}
4141 4141
 	}
4142 4142
 }
@@ -4153,19 +4153,19 @@  discard block
 block discarded – undo
4153 4153
  */
4154 4154
 function geodirectory_load_db_language() {
4155 4155
 	global $wp_filesystem;
4156
-	if ( empty( $wp_filesystem ) ) {
4157
-		require_once( ABSPATH . '/wp-admin/includes/file.php' );
4156
+	if (empty($wp_filesystem)) {
4157
+		require_once(ABSPATH.'/wp-admin/includes/file.php');
4158 4158
 		WP_Filesystem();
4159 4159
 		global $wp_filesystem;
4160 4160
 	}
4161 4161
 
4162
-	$language_file = geodir_plugin_path() . '/db-language.php';
4162
+	$language_file = geodir_plugin_path().'/db-language.php';
4163 4163
 
4164
-	if ( is_file( $language_file ) && ! is_writable( $language_file ) ) {
4164
+	if (is_file($language_file) && !is_writable($language_file)) {
4165 4165
 		return false;
4166 4166
 	} // Not possible to create.
4167 4167
 
4168
-	if ( ! is_file( $language_file ) && ! is_writable( dirname( $language_file ) ) ) {
4168
+	if (!is_file($language_file) && !is_writable(dirname($language_file))) {
4169 4169
 		return false;
4170 4170
 	} // Not possible to create.
4171 4171
 
@@ -4178,9 +4178,9 @@  discard block
 block discarded – undo
4178 4178
 	 *
4179 4179
 	 * @param array $contents_strings Array of strings.
4180 4180
 	 */
4181
-	$contents_strings = apply_filters( 'geodir_load_db_language', $contents_strings );
4181
+	$contents_strings = apply_filters('geodir_load_db_language', $contents_strings);
4182 4182
 
4183
-	$contents_strings = array_unique( $contents_strings );
4183
+	$contents_strings = array_unique($contents_strings);
4184 4184
 
4185 4185
 	$contents_head   = array();
4186 4186
 	$contents_head[] = "<?php";
@@ -4197,20 +4197,20 @@  discard block
 block discarded – undo
4197 4197
 	$contents_foot[] = "";
4198 4198
 	$contents_foot[] = "";
4199 4199
 
4200
-	$contents = implode( PHP_EOL, $contents_head );
4200
+	$contents = implode(PHP_EOL, $contents_head);
4201 4201
 
4202
-	if ( ! empty( $contents_strings ) ) {
4203
-		foreach ( $contents_strings as $string ) {
4204
-			if ( is_scalar( $string ) && $string != '' ) {
4205
-				$string = str_replace( "'", "\'", $string );
4206
-				$contents .= PHP_EOL . "__('" . $string . "', 'geodirectory');";
4202
+	if (!empty($contents_strings)) {
4203
+		foreach ($contents_strings as $string) {
4204
+			if (is_scalar($string) && $string != '') {
4205
+				$string = str_replace("'", "\'", $string);
4206
+				$contents .= PHP_EOL."__('".$string."', 'geodirectory');";
4207 4207
 			}
4208 4208
 		}
4209 4209
 	}
4210 4210
 
4211
-	$contents .= implode( PHP_EOL, $contents_foot );
4211
+	$contents .= implode(PHP_EOL, $contents_foot);
4212 4212
 
4213
-	if ( $wp_filesystem->put_contents( $language_file, $contents, FS_CHMOD_FILE ) ) {
4213
+	if ($wp_filesystem->put_contents($language_file, $contents, FS_CHMOD_FILE)) {
4214 4214
 		return false;
4215 4215
 	} // Failure; could not write file.
4216 4216
 
@@ -4231,49 +4231,49 @@  discard block
 block discarded – undo
4231 4231
  *
4232 4232
  * @return array Translation texts.
4233 4233
  */
4234
-function geodir_load_custom_field_translation( $translation_texts = array() ) {
4234
+function geodir_load_custom_field_translation($translation_texts = array()) {
4235 4235
 	global $wpdb;
4236 4236
 
4237 4237
 	// Custom fields table
4238
-	$sql  = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values, validation_msg FROM " . GEODIR_CUSTOM_FIELDS_TABLE;
4239
-	$rows = $wpdb->get_results( $sql );
4238
+	$sql  = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values, validation_msg FROM ".GEODIR_CUSTOM_FIELDS_TABLE;
4239
+	$rows = $wpdb->get_results($sql);
4240 4240
 
4241
-	if ( ! empty( $rows ) ) {
4242
-		foreach ( $rows as $row ) {
4243
-			if ( ! empty( $row->admin_title ) ) {
4244
-				$translation_texts[] = stripslashes_deep( $row->admin_title );
4241
+	if (!empty($rows)) {
4242
+		foreach ($rows as $row) {
4243
+			if (!empty($row->admin_title)) {
4244
+				$translation_texts[] = stripslashes_deep($row->admin_title);
4245 4245
 			}
4246 4246
 
4247
-			if ( ! empty( $row->admin_desc ) ) {
4248
-				$translation_texts[] = stripslashes_deep( $row->admin_desc );
4247
+			if (!empty($row->admin_desc)) {
4248
+				$translation_texts[] = stripslashes_deep($row->admin_desc);
4249 4249
 			}
4250 4250
 
4251
-			if ( ! empty( $row->site_title ) ) {
4252
-				$translation_texts[] = stripslashes_deep( $row->site_title );
4251
+			if (!empty($row->site_title)) {
4252
+				$translation_texts[] = stripslashes_deep($row->site_title);
4253 4253
 			}
4254 4254
 
4255
-			if ( ! empty( $row->clabels ) ) {
4256
-				$translation_texts[] = stripslashes_deep( $row->clabels );
4255
+			if (!empty($row->clabels)) {
4256
+				$translation_texts[] = stripslashes_deep($row->clabels);
4257 4257
 			}
4258 4258
 
4259
-			if ( ! empty( $row->required_msg ) ) {
4260
-				$translation_texts[] = stripslashes_deep( $row->required_msg );
4259
+			if (!empty($row->required_msg)) {
4260
+				$translation_texts[] = stripslashes_deep($row->required_msg);
4261 4261
 			}
4262 4262
             
4263
-			if ( ! empty( $row->validation_msg ) ) {
4264
-				$translation_texts[] = stripslashes_deep( $row->validation_msg );
4263
+			if (!empty($row->validation_msg)) {
4264
+				$translation_texts[] = stripslashes_deep($row->validation_msg);
4265 4265
 			}
4266 4266
 
4267
-			if ( ! empty( $row->default_value ) ) {
4268
-				$translation_texts[] = stripslashes_deep( $row->default_value );
4267
+			if (!empty($row->default_value)) {
4268
+				$translation_texts[] = stripslashes_deep($row->default_value);
4269 4269
 			}
4270 4270
 
4271
-			if ( ! empty( $row->option_values ) ) {
4272
-				$option_values = geodir_string_values_to_options( stripslashes_deep( $row->option_values ) );
4271
+			if (!empty($row->option_values)) {
4272
+				$option_values = geodir_string_values_to_options(stripslashes_deep($row->option_values));
4273 4273
 
4274
-				if ( ! empty( $option_values ) ) {
4275
-					foreach ( $option_values as $option_value ) {
4276
-						if ( ! empty( $option_value['label'] ) ) {
4274
+				if (!empty($option_values)) {
4275
+					foreach ($option_values as $option_value) {
4276
+						if (!empty($option_value['label'])) {
4277 4277
 							$translation_texts[] = $option_value['label'];
4278 4278
 						}
4279 4279
 					}
@@ -4283,56 +4283,56 @@  discard block
 block discarded – undo
4283 4283
 	}
4284 4284
 
4285 4285
 	// Custom sorting fields table
4286
-	$sql  = "SELECT site_title, asc_title, desc_title FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE;
4287
-	$rows = $wpdb->get_results( $sql );
4286
+	$sql  = "SELECT site_title, asc_title, desc_title FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE;
4287
+	$rows = $wpdb->get_results($sql);
4288 4288
 
4289
-	if ( ! empty( $rows ) ) {
4290
-		foreach ( $rows as $row ) {
4291
-			if ( ! empty( $row->site_title ) ) {
4292
-				$translation_texts[] = stripslashes_deep( $row->site_title );
4289
+	if (!empty($rows)) {
4290
+		foreach ($rows as $row) {
4291
+			if (!empty($row->site_title)) {
4292
+				$translation_texts[] = stripslashes_deep($row->site_title);
4293 4293
 			}
4294 4294
 
4295
-			if ( ! empty( $row->asc_title ) ) {
4296
-				$translation_texts[] = stripslashes_deep( $row->asc_title );
4295
+			if (!empty($row->asc_title)) {
4296
+				$translation_texts[] = stripslashes_deep($row->asc_title);
4297 4297
 			}
4298 4298
 
4299
-			if ( ! empty( $row->desc_title ) ) {
4300
-				$translation_texts[] = stripslashes_deep( $row->desc_title );
4299
+			if (!empty($row->desc_title)) {
4300
+				$translation_texts[] = stripslashes_deep($row->desc_title);
4301 4301
 			}
4302 4302
 		}
4303 4303
 	}
4304 4304
 
4305 4305
 	// Advance search filter fields table
4306
-	if ( defined( 'GEODIR_ADVANCE_SEARCH_TABLE' ) ) {
4307
-		$sql  = "SELECT field_site_name, front_search_title, first_search_text, last_search_text, field_desc FROM " . GEODIR_ADVANCE_SEARCH_TABLE;
4308
-		$rows = $wpdb->get_results( $sql );
4309
-
4310
-		if ( ! empty( $rows ) ) {
4311
-			foreach ( $rows as $row ) {
4312
-				if ( ! empty( $row->field_site_name ) ) {
4313
-					$translation_texts[] = stripslashes_deep( $row->field_site_name );
4306
+	if (defined('GEODIR_ADVANCE_SEARCH_TABLE')) {
4307
+		$sql  = "SELECT field_site_name, front_search_title, first_search_text, last_search_text, field_desc FROM ".GEODIR_ADVANCE_SEARCH_TABLE;
4308
+		$rows = $wpdb->get_results($sql);
4309
+
4310
+		if (!empty($rows)) {
4311
+			foreach ($rows as $row) {
4312
+				if (!empty($row->field_site_name)) {
4313
+					$translation_texts[] = stripslashes_deep($row->field_site_name);
4314 4314
 				}
4315 4315
 
4316
-				if ( ! empty( $row->front_search_title ) ) {
4317
-					$translation_texts[] = stripslashes_deep( $row->front_search_title );
4316
+				if (!empty($row->front_search_title)) {
4317
+					$translation_texts[] = stripslashes_deep($row->front_search_title);
4318 4318
 				}
4319 4319
 
4320
-				if ( ! empty( $row->first_search_text ) ) {
4321
-					$translation_texts[] = stripslashes_deep( $row->first_search_text );
4320
+				if (!empty($row->first_search_text)) {
4321
+					$translation_texts[] = stripslashes_deep($row->first_search_text);
4322 4322
 				}
4323 4323
 
4324
-				if ( ! empty( $row->last_search_text ) ) {
4325
-					$translation_texts[] = stripslashes_deep( $row->last_search_text );
4324
+				if (!empty($row->last_search_text)) {
4325
+					$translation_texts[] = stripslashes_deep($row->last_search_text);
4326 4326
 				}
4327 4327
 
4328
-				if ( ! empty( $row->field_desc ) ) {
4329
-					$translation_texts[] = stripslashes_deep( $row->field_desc );
4328
+				if (!empty($row->field_desc)) {
4329
+					$translation_texts[] = stripslashes_deep($row->field_desc);
4330 4330
 				}
4331 4331
 			}
4332 4332
 		}
4333 4333
 	}
4334 4334
 
4335
-	$translation_texts = ! empty( $translation_texts ) ? array_unique( $translation_texts ) : $translation_texts;
4335
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
4336 4336
 
4337 4337
 	return $translation_texts;
4338 4338
 }
@@ -4354,7 +4354,7 @@  discard block
 block discarded – undo
4354 4354
 	 *
4355 4355
 	 * @param array $geodir_allowed_mime_types and file extensions.
4356 4356
 	 */
4357
-	return apply_filters( 'geodir_allowed_mime_types', array(
4357
+	return apply_filters('geodir_allowed_mime_types', array(
4358 4358
 			'Image'       => array( // Image formats.
4359 4359
 				'jpg'  => 'image/jpeg',
4360 4360
 				'jpe'  => 'image/jpeg',
@@ -4422,18 +4422,18 @@  discard block
 block discarded – undo
4422 4422
  *
4423 4423
  * @return string User display name.
4424 4424
  */
4425
-function geodir_get_client_name( $user_id ) {
4425
+function geodir_get_client_name($user_id) {
4426 4426
 	$client_name = '';
4427 4427
 
4428
-	$user_data = get_userdata( $user_id );
4428
+	$user_data = get_userdata($user_id);
4429 4429
 
4430
-	if ( ! empty( $user_data ) ) {
4431
-		if ( isset( $user_data->display_name ) && trim( $user_data->display_name ) != '' ) {
4432
-			$client_name = trim( $user_data->display_name );
4433
-		} else if ( isset( $user_data->user_nicename ) && trim( $user_data->user_nicename ) != '' ) {
4434
-			$client_name = trim( $user_data->user_nicename );
4430
+	if (!empty($user_data)) {
4431
+		if (isset($user_data->display_name) && trim($user_data->display_name) != '') {
4432
+			$client_name = trim($user_data->display_name);
4433
+		} else if (isset($user_data->user_nicename) && trim($user_data->user_nicename) != '') {
4434
+			$client_name = trim($user_data->user_nicename);
4435 4435
 		} else {
4436
-			$client_name = trim( $user_data->user_login );
4436
+			$client_name = trim($user_data->user_login);
4437 4437
 		}
4438 4438
 	}
4439 4439
 
@@ -4441,19 +4441,19 @@  discard block
 block discarded – undo
4441 4441
 }
4442 4442
 
4443 4443
 
4444
-add_filter( 'wpseo_replacements', 'geodir_wpseo_replacements', 10, 1 );
4444
+add_filter('wpseo_replacements', 'geodir_wpseo_replacements', 10, 1);
4445 4445
 /*
4446 4446
  * Add location variables to wpseo replacements.
4447 4447
  *
4448 4448
  * @since 1.5.4
4449 4449
  */
4450
-function geodir_wpseo_replacements( $vars ) {
4450
+function geodir_wpseo_replacements($vars) {
4451 4451
 
4452 4452
 	global $wp;
4453 4453
 	$title = '';
4454 4454
 	// location variables
4455 4455
 	$gd_post_type   = geodir_get_current_posttype();
4456
-	$location_array = geodir_get_current_location_terms( 'query_vars', $gd_post_type );
4456
+	$location_array = geodir_get_current_location_terms('query_vars', $gd_post_type);
4457 4457
 	/**
4458 4458
 	 * Filter the title variables location variables array
4459 4459
 	 *
@@ -4463,105 +4463,105 @@  discard block
 block discarded – undo
4463 4463
 	 * @param array $location_array The array of location variables.
4464 4464
 	 * @param array $vars           The page title variables.
4465 4465
 	 */
4466
-	$location_array  = apply_filters( 'geodir_filter_title_variables_location_arr_seo', $location_array, $vars );
4466
+	$location_array  = apply_filters('geodir_filter_title_variables_location_arr_seo', $location_array, $vars);
4467 4467
 	$location_titles = array();
4468
-	if ( get_query_var( 'gd_country_full' ) ) {
4469
-		if ( get_query_var( 'gd_country_full' ) ) {
4470
-			$location_array['gd_country'] = get_query_var( 'gd_country_full' );
4468
+	if (get_query_var('gd_country_full')) {
4469
+		if (get_query_var('gd_country_full')) {
4470
+			$location_array['gd_country'] = get_query_var('gd_country_full');
4471 4471
 		}
4472
-		if ( get_query_var( 'gd_region_full' ) ) {
4473
-			$location_array['gd_region'] = get_query_var( 'gd_region_full' );
4472
+		if (get_query_var('gd_region_full')) {
4473
+			$location_array['gd_region'] = get_query_var('gd_region_full');
4474 4474
 		}
4475
-		if ( get_query_var( 'gd_city_full' ) ) {
4476
-			$location_array['gd_city'] = get_query_var( 'gd_city_full' );
4475
+		if (get_query_var('gd_city_full')) {
4476
+			$location_array['gd_city'] = get_query_var('gd_city_full');
4477 4477
 		}
4478 4478
 	}
4479 4479
 	$location_single = '';
4480
-	$gd_country      = ( isset( $wp->query_vars['gd_country'] ) && $wp->query_vars['gd_country'] != '' ) ? $wp->query_vars['gd_country'] : '';
4481
-	$gd_region       = ( isset( $wp->query_vars['gd_region'] ) && $wp->query_vars['gd_region'] != '' ) ? $wp->query_vars['gd_region'] : '';
4482
-	$gd_city         = ( isset( $wp->query_vars['gd_city'] ) && $wp->query_vars['gd_city'] != '' ) ? $wp->query_vars['gd_city'] : '';
4480
+	$gd_country      = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
4481
+	$gd_region       = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
4482
+	$gd_city         = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
4483 4483
 
4484 4484
 	$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
4485 4485
 
4486
-	if ( function_exists( 'get_actual_location_name' ) ) {
4487
-		$gd_country_actual = $gd_country != '' ? get_actual_location_name( 'country', $gd_country, true ) : $gd_country;
4488
-		$gd_region_actual  = $gd_region != '' ? get_actual_location_name( 'region', $gd_region ) : $gd_region;
4489
-		$gd_city_actual    = $gd_city != '' ? get_actual_location_name( 'city', $gd_city ) : $gd_city;
4486
+	if (function_exists('get_actual_location_name')) {
4487
+		$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
4488
+		$gd_region_actual  = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
4489
+		$gd_city_actual    = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
4490 4490
 	}
4491 4491
 
4492
-	if ( $gd_city != '' ) {
4493
-		if ( $gd_city_actual != '' ) {
4492
+	if ($gd_city != '') {
4493
+		if ($gd_city_actual != '') {
4494 4494
 			$gd_city = $gd_city_actual;
4495 4495
 		} else {
4496
-			$gd_city = preg_replace( '/-(\d+)$/', '', $gd_city );
4497
-			$gd_city = preg_replace( '/[_-]/', ' ', $gd_city );
4498
-			$gd_city = __( geodir_ucwords( $gd_city ), 'geodirectory' );
4496
+			$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
4497
+			$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
4498
+			$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
4499 4499
 		}
4500 4500
 		$location_single = $gd_city;
4501 4501
 
4502
-	} else if ( $gd_region != '' ) {
4503
-		if ( $gd_region_actual != '' ) {
4502
+	} else if ($gd_region != '') {
4503
+		if ($gd_region_actual != '') {
4504 4504
 			$gd_region = $gd_region_actual;
4505 4505
 		} else {
4506
-			$gd_region = preg_replace( '/-(\d+)$/', '', $gd_region );
4507
-			$gd_region = preg_replace( '/[_-]/', ' ', $gd_region );
4508
-			$gd_region = __( geodir_ucwords( $gd_region ), 'geodirectory' );
4506
+			$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
4507
+			$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
4508
+			$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
4509 4509
 		}
4510 4510
 
4511 4511
 		$location_single = $gd_region;
4512
-	} else if ( $gd_country != '' ) {
4513
-		if ( $gd_country_actual != '' ) {
4512
+	} else if ($gd_country != '') {
4513
+		if ($gd_country_actual != '') {
4514 4514
 			$gd_country = $gd_country_actual;
4515 4515
 		} else {
4516
-			$gd_country = preg_replace( '/-(\d+)$/', '', $gd_country );
4517
-			$gd_country = preg_replace( '/[_-]/', ' ', $gd_country );
4518
-			$gd_country = __( geodir_ucwords( $gd_country ), 'geodirectory' );
4516
+			$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
4517
+			$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
4518
+			$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
4519 4519
 		}
4520 4520
 
4521 4521
 		$location_single = $gd_country;
4522 4522
 	}
4523 4523
 
4524
-	if ( ! empty( $location_array ) ) {
4524
+	if (!empty($location_array)) {
4525 4525
 
4526
-		$actual_location_name = function_exists( 'get_actual_location_name' ) ? true : false;
4527
-		$location_array       = array_reverse( $location_array );
4526
+		$actual_location_name = function_exists('get_actual_location_name') ? true : false;
4527
+		$location_array       = array_reverse($location_array);
4528 4528
 
4529
-		foreach ( $location_array as $location_type => $location ) {
4530
-			$gd_location_link_text = preg_replace( '/-(\d+)$/', '', $location );
4531
-			$gd_location_link_text = preg_replace( '/[_-]/', ' ', $gd_location_link_text );
4529
+		foreach ($location_array as $location_type => $location) {
4530
+			$gd_location_link_text = preg_replace('/-(\d+)$/', '', $location);
4531
+			$gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
4532 4532
 
4533
-			$location_name = geodir_ucwords( $gd_location_link_text );
4534
-			$location_name = __( $location_name, 'geodirectory' );
4533
+			$location_name = geodir_ucwords($gd_location_link_text);
4534
+			$location_name = __($location_name, 'geodirectory');
4535 4535
 
4536
-			if ( $actual_location_name ) {
4537
-				$location_type = strpos( $location_type, 'gd_' ) === 0 ? substr( $location_type, 3 ) : $location_type;
4538
-				$location_name = get_actual_location_name( $location_type, $location, true );
4536
+			if ($actual_location_name) {
4537
+				$location_type = strpos($location_type, 'gd_') === 0 ? substr($location_type, 3) : $location_type;
4538
+				$location_name = get_actual_location_name($location_type, $location, true);
4539 4539
 			}
4540 4540
 
4541 4541
 			$location_titles[] = $location_name;
4542 4542
 		}
4543
-		if ( ! empty( $location_titles ) ) {
4544
-			$location_titles = array_unique( $location_titles );
4543
+		if (!empty($location_titles)) {
4544
+			$location_titles = array_unique($location_titles);
4545 4545
 		}
4546 4546
 	}
4547 4547
 
4548 4548
 
4549
-	if ( ! empty( $location_titles ) ) {
4550
-		$vars['%%location%%'] = implode( ", ", $location_titles );
4549
+	if (!empty($location_titles)) {
4550
+		$vars['%%location%%'] = implode(", ", $location_titles);
4551 4551
 	}
4552 4552
 
4553 4553
 
4554
-	if ( ! empty( $location_titles ) ) {
4555
-		$vars['%%in_location%%'] = __( 'in ', 'geodirectory' ) . implode( ", ", $location_titles );
4554
+	if (!empty($location_titles)) {
4555
+		$vars['%%in_location%%'] = __('in ', 'geodirectory').implode(", ", $location_titles);
4556 4556
 	}
4557 4557
 
4558 4558
 
4559
-	if ( $location_single ) {
4560
-		$vars['%%in_location_single%%'] = __( 'in', 'geodirectory' ) . ' ' . $location_single;
4559
+	if ($location_single) {
4560
+		$vars['%%in_location_single%%'] = __('in', 'geodirectory').' '.$location_single;
4561 4561
 	}
4562 4562
 
4563 4563
 
4564
-	if ( $location_single ) {
4564
+	if ($location_single) {
4565 4565
 		$vars['%%location_single%%'] = $location_single;
4566 4566
 	}
4567 4567
 
@@ -4574,13 +4574,13 @@  discard block
 block discarded – undo
4574 4574
 	 * @param string $vars          The title with variables.
4575 4575
 	 * @param array $location_array The array of location variables.
4576 4576
 	 */
4577
-	return apply_filters( 'geodir_wpseo_replacements_vars', $vars, $location_array );
4577
+	return apply_filters('geodir_wpseo_replacements_vars', $vars, $location_array);
4578 4578
 }
4579 4579
 
4580 4580
 
4581
-add_filter( 'geodir_seo_meta_title', 'geodir_filter_title_variables', 10, 3 );
4582
-add_filter( 'geodir_seo_page_title', 'geodir_filter_title_variables', 10, 2 );
4583
-add_filter( 'geodir_seo_meta_description_pre', 'geodir_filter_title_variables', 10, 3 );
4581
+add_filter('geodir_seo_meta_title', 'geodir_filter_title_variables', 10, 3);
4582
+add_filter('geodir_seo_page_title', 'geodir_filter_title_variables', 10, 2);
4583
+add_filter('geodir_seo_meta_description_pre', 'geodir_filter_title_variables', 10, 3);
4584 4584
 
4585 4585
 /**
4586 4586
  * Filter the title variables.
@@ -4622,14 +4622,14 @@  discard block
 block discarded – undo
4622 4622
  *
4623 4623
  * @return string Title after filtered variables.
4624 4624
  */
4625
-function geodir_filter_title_variables( $title, $gd_page, $sep = '' ) {
4625
+function geodir_filter_title_variables($title, $gd_page, $sep = '') {
4626 4626
 	global $wp, $post;
4627 4627
 
4628
-	if ( ! $gd_page || ! $title ) {
4628
+	if (!$gd_page || !$title) {
4629 4629
 		return $title; // if no a GD page then bail.
4630 4630
 	}
4631 4631
 
4632
-	if ( $sep == '' ) {
4632
+	if ($sep == '') {
4633 4633
 		/**
4634 4634
 		 * Filter the page title separator.
4635 4635
 		 *
@@ -4638,100 +4638,100 @@  discard block
 block discarded – undo
4638 4638
 		 *
4639 4639
 		 * @param string $sep The separator, default: `|`.
4640 4640
 		 */
4641
-		$sep = apply_filters( 'geodir_page_title_separator', '|' );
4641
+		$sep = apply_filters('geodir_page_title_separator', '|');
4642 4642
 	}
4643 4643
 
4644
-	if ( strpos( $title, '%%title%%' ) !== false ) {
4645
-		$title = str_replace( "%%title%%", $post->post_title, $title );
4644
+	if (strpos($title, '%%title%%') !== false) {
4645
+		$title = str_replace("%%title%%", $post->post_title, $title);
4646 4646
 	}
4647 4647
 
4648
-	if ( strpos( $title, '%%sitename%%' ) !== false ) {
4649
-		$title = str_replace( "%%sitename%%", get_bloginfo( 'name' ), $title );
4648
+	if (strpos($title, '%%sitename%%') !== false) {
4649
+		$title = str_replace("%%sitename%%", get_bloginfo('name'), $title);
4650 4650
 	}
4651 4651
 
4652
-	if ( strpos( $title, '%%sitedesc%%' ) !== false ) {
4653
-		$title = str_replace( "%%sitedesc%%", get_bloginfo( 'description' ), $title );
4652
+	if (strpos($title, '%%sitedesc%%') !== false) {
4653
+		$title = str_replace("%%sitedesc%%", get_bloginfo('description'), $title);
4654 4654
 	}
4655 4655
 
4656
-	if ( strpos( $title, '%%excerpt%%' ) !== false ) {
4657
-		$title = str_replace( "%%excerpt%%", strip_tags( get_the_excerpt() ), $title );
4656
+	if (strpos($title, '%%excerpt%%') !== false) {
4657
+		$title = str_replace("%%excerpt%%", strip_tags(get_the_excerpt()), $title);
4658 4658
 	}
4659 4659
 
4660
-	if ( $gd_page == 'search' || $gd_page == 'author' ) {
4661
-		$post_type = isset( $_REQUEST['stype'] ) ? sanitize_text_field( $_REQUEST['stype'] ) : '';
4662
-	} else if ( $gd_page == 'add-listing' ) {
4663
-		$post_type = ( isset( $_REQUEST['listing_type'] ) ) ? sanitize_text_field( $_REQUEST['listing_type'] ) : '';
4664
-		$post_type = ! $post_type && ! empty( $_REQUEST['pid'] ) ? get_post_type( (int) $_REQUEST['pid'] ) : $post_type;
4665
-	} else if ( isset( $post->post_type ) && $post->post_type && in_array( $post->post_type, geodir_get_posttypes() ) ) {
4660
+	if ($gd_page == 'search' || $gd_page == 'author') {
4661
+		$post_type = isset($_REQUEST['stype']) ? sanitize_text_field($_REQUEST['stype']) : '';
4662
+	} else if ($gd_page == 'add-listing') {
4663
+		$post_type = (isset($_REQUEST['listing_type'])) ? sanitize_text_field($_REQUEST['listing_type']) : '';
4664
+		$post_type = !$post_type && !empty($_REQUEST['pid']) ? get_post_type((int) $_REQUEST['pid']) : $post_type;
4665
+	} else if (isset($post->post_type) && $post->post_type && in_array($post->post_type, geodir_get_posttypes())) {
4666 4666
 		$post_type = $post->post_type;
4667 4667
 	} else {
4668
-		$post_type = get_query_var( 'post_type' );
4668
+		$post_type = get_query_var('post_type');
4669 4669
 	}
4670 4670
 
4671
-	if ( strpos( $title, '%%pt_single%%' ) !== false ) {
4671
+	if (strpos($title, '%%pt_single%%') !== false) {
4672 4672
 		$singular_name = '';
4673
-		if ( $post_type && $singular_name = get_post_type_singular_label( $post_type ) ) {
4674
-			$singular_name = __( $singular_name, 'geodirectory' );
4673
+		if ($post_type && $singular_name = get_post_type_singular_label($post_type)) {
4674
+			$singular_name = __($singular_name, 'geodirectory');
4675 4675
 		}
4676 4676
 
4677
-		$title = str_replace( "%%pt_single%%", $singular_name, $title );
4677
+		$title = str_replace("%%pt_single%%", $singular_name, $title);
4678 4678
 	}
4679 4679
 
4680
-	if ( strpos( $title, '%%pt_plural%%' ) !== false ) {
4680
+	if (strpos($title, '%%pt_plural%%') !== false) {
4681 4681
 		$plural_name = '';
4682
-		if ( $post_type && $plural_name = get_post_type_plural_label( $post_type ) ) {
4683
-			$plural_name = __( $plural_name, 'geodirectory' );
4682
+		if ($post_type && $plural_name = get_post_type_plural_label($post_type)) {
4683
+			$plural_name = __($plural_name, 'geodirectory');
4684 4684
 		}
4685 4685
 
4686
-		$title = str_replace( "%%pt_plural%%", $plural_name, $title );
4686
+		$title = str_replace("%%pt_plural%%", $plural_name, $title);
4687 4687
 	}
4688 4688
 
4689
-	if ( strpos( $title, '%%category%%' ) !== false ) {
4689
+	if (strpos($title, '%%category%%') !== false) {
4690 4690
 		$cat_name = '';
4691 4691
 
4692
-		if ( $gd_page == 'detail' ) {
4693
-			if ( $post->default_category ) {
4694
-				$cat      = get_term( $post->default_category, $post->post_type . 'category' );
4695
-				$cat_name = ( isset( $cat->name ) ) ? $cat->name : '';
4692
+		if ($gd_page == 'detail') {
4693
+			if ($post->default_category) {
4694
+				$cat      = get_term($post->default_category, $post->post_type.'category');
4695
+				$cat_name = (isset($cat->name)) ? $cat->name : '';
4696 4696
 			}
4697
-		} else if ( $gd_page == 'listing' ) {
4697
+		} else if ($gd_page == 'listing') {
4698 4698
 			$queried_object = get_queried_object();
4699
-			if ( isset( $queried_object->name ) ) {
4699
+			if (isset($queried_object->name)) {
4700 4700
 				$cat_name = $queried_object->name;
4701 4701
 			}
4702 4702
 		}
4703
-		$title = str_replace( "%%category%%", $cat_name, $title );
4703
+		$title = str_replace("%%category%%", $cat_name, $title);
4704 4704
 	}
4705 4705
 
4706
-	if ( strpos( $title, '%%tag%%' ) !== false ) {
4706
+	if (strpos($title, '%%tag%%') !== false) {
4707 4707
 		$cat_name = '';
4708 4708
 
4709
-		if ( $gd_page == 'detail' ) {
4710
-			if ( $post->default_category ) {
4711
-				$cat      = get_term( $post->default_category, $post->post_type . 'category' );
4712
-				$cat_name = ( isset( $cat->name ) ) ? $cat->name : '';
4709
+		if ($gd_page == 'detail') {
4710
+			if ($post->default_category) {
4711
+				$cat      = get_term($post->default_category, $post->post_type.'category');
4712
+				$cat_name = (isset($cat->name)) ? $cat->name : '';
4713 4713
 			}
4714
-		} else if ( $gd_page == 'listing' ) {
4714
+		} else if ($gd_page == 'listing') {
4715 4715
 			$queried_object = get_queried_object();
4716
-			if ( isset( $queried_object->name ) ) {
4716
+			if (isset($queried_object->name)) {
4717 4717
 				$cat_name = $queried_object->name;
4718 4718
 			}
4719 4719
 		}
4720
-		$title = str_replace( "%%tag%%", $cat_name, $title );
4720
+		$title = str_replace("%%tag%%", $cat_name, $title);
4721 4721
 	}
4722 4722
 
4723
-	if ( strpos( $title, '%%id%%' ) !== false ) {
4724
-		$ID    = ( isset( $post->ID ) ) ? $post->ID : '';
4725
-		$title = str_replace( "%%id%%", $ID, $title );
4723
+	if (strpos($title, '%%id%%') !== false) {
4724
+		$ID    = (isset($post->ID)) ? $post->ID : '';
4725
+		$title = str_replace("%%id%%", $ID, $title);
4726 4726
 	}
4727 4727
 
4728
-	if ( strpos( $title, '%%sep%%' ) !== false ) {
4729
-		$title = str_replace( "%%sep%%", $sep, $title );
4728
+	if (strpos($title, '%%sep%%') !== false) {
4729
+		$title = str_replace("%%sep%%", $sep, $title);
4730 4730
 	}
4731 4731
 
4732 4732
 	// location variables
4733 4733
 	$gd_post_type   = geodir_get_current_posttype();
4734
-	$location_array = geodir_get_current_location_terms( 'query_vars', $gd_post_type );
4734
+	$location_array = geodir_get_current_location_terms('query_vars', $gd_post_type);
4735 4735
 	/**
4736 4736
 	 * Filter the title variables location variables array
4737 4737
 	 *
@@ -4743,166 +4743,166 @@  discard block
 block discarded – undo
4743 4743
 	 * @param string $gd_page       The page being filtered.
4744 4744
 	 * @param string $sep           The separator, default: `|`.
4745 4745
 	 */
4746
-	$location_array  = apply_filters( 'geodir_filter_title_variables_location_arr', $location_array, $title, $gd_page, $sep );
4746
+	$location_array  = apply_filters('geodir_filter_title_variables_location_arr', $location_array, $title, $gd_page, $sep);
4747 4747
 	$location_titles = array();
4748
-	if ( $gd_page == 'location' && get_query_var( 'gd_country_full' ) ) {
4749
-		if ( get_query_var( 'gd_country_full' ) ) {
4750
-			$location_array['gd_country'] = get_query_var( 'gd_country_full' );
4748
+	if ($gd_page == 'location' && get_query_var('gd_country_full')) {
4749
+		if (get_query_var('gd_country_full')) {
4750
+			$location_array['gd_country'] = get_query_var('gd_country_full');
4751 4751
 		}
4752
-		if ( get_query_var( 'gd_region_full' ) ) {
4753
-			$location_array['gd_region'] = get_query_var( 'gd_region_full' );
4752
+		if (get_query_var('gd_region_full')) {
4753
+			$location_array['gd_region'] = get_query_var('gd_region_full');
4754 4754
 		}
4755
-		if ( get_query_var( 'gd_city_full' ) ) {
4756
-			$location_array['gd_city'] = get_query_var( 'gd_city_full' );
4755
+		if (get_query_var('gd_city_full')) {
4756
+			$location_array['gd_city'] = get_query_var('gd_city_full');
4757 4757
 		}
4758 4758
 	}
4759 4759
 	$location_single = '';
4760
-	$gd_country      = ( isset( $wp->query_vars['gd_country'] ) && $wp->query_vars['gd_country'] != '' ) ? $wp->query_vars['gd_country'] : '';
4761
-	$gd_region       = ( isset( $wp->query_vars['gd_region'] ) && $wp->query_vars['gd_region'] != '' ) ? $wp->query_vars['gd_region'] : '';
4762
-	$gd_city         = ( isset( $wp->query_vars['gd_city'] ) && $wp->query_vars['gd_city'] != '' ) ? $wp->query_vars['gd_city'] : '';
4760
+	$gd_country      = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
4761
+	$gd_region       = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
4762
+	$gd_city         = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
4763 4763
 
4764 4764
 	$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
4765 4765
 
4766
-	if ( function_exists( 'get_actual_location_name' ) ) {
4767
-		$gd_country_actual = $gd_country != '' ? get_actual_location_name( 'country', $gd_country, true ) : $gd_country;
4768
-		$gd_region_actual  = $gd_region != '' ? get_actual_location_name( 'region', $gd_region ) : $gd_region;
4769
-		$gd_city_actual    = $gd_city != '' ? get_actual_location_name( 'city', $gd_city ) : $gd_city;
4766
+	if (function_exists('get_actual_location_name')) {
4767
+		$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
4768
+		$gd_region_actual  = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
4769
+		$gd_city_actual    = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
4770 4770
 	}
4771 4771
 
4772
-	if ( $gd_city != '' ) {
4773
-		if ( $gd_city_actual != '' ) {
4772
+	if ($gd_city != '') {
4773
+		if ($gd_city_actual != '') {
4774 4774
 			$gd_city = $gd_city_actual;
4775 4775
 		} else {
4776
-			$gd_city = preg_replace( '/-(\d+)$/', '', $gd_city );
4777
-			$gd_city = preg_replace( '/[_-]/', ' ', $gd_city );
4778
-			$gd_city = __( geodir_ucwords( $gd_city ), 'geodirectory' );
4776
+			$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
4777
+			$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
4778
+			$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
4779 4779
 		}
4780 4780
 		$location_single = $gd_city;
4781 4781
 
4782
-	} else if ( $gd_region != '' ) {
4783
-		if ( $gd_region_actual != '' ) {
4782
+	} else if ($gd_region != '') {
4783
+		if ($gd_region_actual != '') {
4784 4784
 			$gd_region = $gd_region_actual;
4785 4785
 		} else {
4786
-			$gd_region = preg_replace( '/-(\d+)$/', '', $gd_region );
4787
-			$gd_region = preg_replace( '/[_-]/', ' ', $gd_region );
4788
-			$gd_region = __( geodir_ucwords( $gd_region ), 'geodirectory' );
4786
+			$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
4787
+			$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
4788
+			$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
4789 4789
 		}
4790 4790
 
4791 4791
 		$location_single = $gd_region;
4792
-	} else if ( $gd_country != '' ) {
4793
-		if ( $gd_country_actual != '' ) {
4792
+	} else if ($gd_country != '') {
4793
+		if ($gd_country_actual != '') {
4794 4794
 			$gd_country = $gd_country_actual;
4795 4795
 		} else {
4796
-			$gd_country = preg_replace( '/-(\d+)$/', '', $gd_country );
4797
-			$gd_country = preg_replace( '/[_-]/', ' ', $gd_country );
4798
-			$gd_country = __( geodir_ucwords( $gd_country ), 'geodirectory' );
4796
+			$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
4797
+			$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
4798
+			$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
4799 4799
 		}
4800 4800
 
4801 4801
 		$location_single = $gd_country;
4802 4802
 	}
4803 4803
 
4804
-	if ( ! empty( $location_array ) ) {
4804
+	if (!empty($location_array)) {
4805 4805
 
4806
-		$actual_location_name = function_exists( 'get_actual_location_name' ) ? true : false;
4807
-		$location_array       = array_reverse( $location_array );
4806
+		$actual_location_name = function_exists('get_actual_location_name') ? true : false;
4807
+		$location_array       = array_reverse($location_array);
4808 4808
 
4809
-		foreach ( $location_array as $location_type => $location ) {
4810
-			$gd_location_link_text = preg_replace( '/-(\d+)$/', '', $location );
4811
-			$gd_location_link_text = preg_replace( '/[_-]/', ' ', $gd_location_link_text );
4809
+		foreach ($location_array as $location_type => $location) {
4810
+			$gd_location_link_text = preg_replace('/-(\d+)$/', '', $location);
4811
+			$gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
4812 4812
 
4813
-			$location_name = geodir_ucwords( $gd_location_link_text );
4814
-			$location_name = __( $location_name, 'geodirectory' );
4813
+			$location_name = geodir_ucwords($gd_location_link_text);
4814
+			$location_name = __($location_name, 'geodirectory');
4815 4815
 
4816
-			if ( $actual_location_name ) {
4817
-				$location_type = strpos( $location_type, 'gd_' ) === 0 ? substr( $location_type, 3 ) : $location_type;
4818
-				$location_name = get_actual_location_name( $location_type, $location, true );
4816
+			if ($actual_location_name) {
4817
+				$location_type = strpos($location_type, 'gd_') === 0 ? substr($location_type, 3) : $location_type;
4818
+				$location_name = get_actual_location_name($location_type, $location, true);
4819 4819
 			}
4820 4820
 
4821 4821
 			$location_titles[] = $location_name;
4822 4822
 		}
4823
-		if ( ! empty( $location_titles ) ) {
4824
-			$location_titles = array_unique( $location_titles );
4823
+		if (!empty($location_titles)) {
4824
+			$location_titles = array_unique($location_titles);
4825 4825
 		}
4826 4826
 	}
4827 4827
 
4828 4828
 
4829
-	if ( strpos( $title, '%%location%%' ) !== false ) {
4829
+	if (strpos($title, '%%location%%') !== false) {
4830 4830
 		$location = '';
4831
-		if ( $location_titles ) {
4832
-			$location = implode( ", ", $location_titles );
4831
+		if ($location_titles) {
4832
+			$location = implode(", ", $location_titles);
4833 4833
 		}
4834
-		$title = str_replace( "%%location%%", $location, $title );
4834
+		$title = str_replace("%%location%%", $location, $title);
4835 4835
 	}
4836 4836
 
4837
-	if ( strpos( $title, '%%in_location%%' ) !== false ) {
4837
+	if (strpos($title, '%%in_location%%') !== false) {
4838 4838
 		$location = '';
4839
-		if ( $location_titles ) {
4840
-			$location = __( 'in ', 'geodirectory' ) . implode( ", ", $location_titles );
4839
+		if ($location_titles) {
4840
+			$location = __('in ', 'geodirectory').implode(", ", $location_titles);
4841 4841
 		}
4842
-		$title = str_replace( "%%in_location%%", $location, $title );
4842
+		$title = str_replace("%%in_location%%", $location, $title);
4843 4843
 	}
4844 4844
 
4845
-	if ( strpos( $title, '%%in_location_single%%' ) !== false ) {
4846
-		if ( $location_single ) {
4847
-			$location_single = __( 'in', 'geodirectory' ) . ' ' . $location_single;
4845
+	if (strpos($title, '%%in_location_single%%') !== false) {
4846
+		if ($location_single) {
4847
+			$location_single = __('in', 'geodirectory').' '.$location_single;
4848 4848
 		}
4849
-		$title = str_replace( "%%in_location_single%%", $location_single, $title );
4849
+		$title = str_replace("%%in_location_single%%", $location_single, $title);
4850 4850
 	}
4851 4851
 
4852
-	if ( strpos( $title, '%%location_single%%' ) !== false ) {
4853
-		$title = str_replace( "%%location_single%%", $location_single, $title );
4852
+	if (strpos($title, '%%location_single%%') !== false) {
4853
+		$title = str_replace("%%location_single%%", $location_single, $title);
4854 4854
 	}
4855 4855
 
4856 4856
 
4857
-	if ( strpos( $title, '%%search_term%%' ) !== false ) {
4857
+	if (strpos($title, '%%search_term%%') !== false) {
4858 4858
 		$search_term = '';
4859
-		if ( isset( $_REQUEST['s'] ) ) {
4860
-			$search_term = esc_attr( $_REQUEST['s'] );
4859
+		if (isset($_REQUEST['s'])) {
4860
+			$search_term = esc_attr($_REQUEST['s']);
4861 4861
 		}
4862
-		$title = str_replace( "%%search_term%%", $search_term, $title );
4862
+		$title = str_replace("%%search_term%%", $search_term, $title);
4863 4863
 	}
4864 4864
 
4865
-	if ( strpos( $title, '%%search_near%%' ) !== false ) {
4865
+	if (strpos($title, '%%search_near%%') !== false) {
4866 4866
 		$search_term = '';
4867
-		if ( isset( $_REQUEST['snear'] ) ) {
4868
-			$search_term = esc_attr( $_REQUEST['snear'] );
4867
+		if (isset($_REQUEST['snear'])) {
4868
+			$search_term = esc_attr($_REQUEST['snear']);
4869 4869
 		}
4870
-		$title = str_replace( "%%search_near%%", $search_term, $title );
4870
+		$title = str_replace("%%search_near%%", $search_term, $title);
4871 4871
 	}
4872 4872
 
4873
-	if ( strpos( $title, '%%name%%' ) !== false ) {
4874
-		if ( is_author() ) {
4875
-			$curauth     = ( get_query_var( 'author_name' ) ) ? get_user_by( 'slug', get_query_var( 'author_name' ) ) : get_userdata( get_query_var( 'author' ) );
4873
+	if (strpos($title, '%%name%%') !== false) {
4874
+		if (is_author()) {
4875
+			$curauth     = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
4876 4876
 			$author_name = $curauth->display_name;
4877 4877
 		} else {
4878 4878
 			$author_name = get_the_author();
4879 4879
 		}
4880
-		if ( ! $author_name || $author_name === '' ) {
4880
+		if (!$author_name || $author_name === '') {
4881 4881
 			$queried_object = get_queried_object();
4882 4882
 
4883
-			if ( isset( $queried_object->data->user_nicename ) ) {
4883
+			if (isset($queried_object->data->user_nicename)) {
4884 4884
 				$author_name = $queried_object->data->display_name;
4885 4885
 			}
4886 4886
 		}
4887
-		$title = str_replace( "%%name%%", $author_name, $title );
4887
+		$title = str_replace("%%name%%", $author_name, $title);
4888 4888
 	}
4889 4889
 
4890
-	if ( strpos( $title, '%%page%%' ) !== false ) {
4891
-		$page  = geodir_title_meta_page( $sep );
4892
-		$title = str_replace( "%%page%%", $page, $title );
4890
+	if (strpos($title, '%%page%%') !== false) {
4891
+		$page  = geodir_title_meta_page($sep);
4892
+		$title = str_replace("%%page%%", $page, $title);
4893 4893
 	}
4894
-	if ( strpos( $title, '%%pagenumber%%' ) !== false ) {
4894
+	if (strpos($title, '%%pagenumber%%') !== false) {
4895 4895
 		$pagenumber = geodir_title_meta_pagenumber();
4896
-		$title      = str_replace( "%%pagenumber%%", $pagenumber, $title );
4896
+		$title      = str_replace("%%pagenumber%%", $pagenumber, $title);
4897 4897
 	}
4898
-	if ( strpos( $title, '%%pagetotal%%' ) !== false ) {
4898
+	if (strpos($title, '%%pagetotal%%') !== false) {
4899 4899
 		$pagetotal = geodir_title_meta_pagetotal();
4900
-		$title     = str_replace( "%%pagetotal%%", $pagetotal, $title );
4900
+		$title     = str_replace("%%pagetotal%%", $pagetotal, $title);
4901 4901
 	}
4902 4902
 
4903
-	$title = wptexturize( $title );
4904
-	$title = convert_chars( $title );
4905
-	$title = esc_html( $title );
4903
+	$title = wptexturize($title);
4904
+	$title = convert_chars($title);
4905
+	$title = esc_html($title);
4906 4906
 
4907 4907
 	/**
4908 4908
 	 * Filter the title variables after standard ones have been filtered.
@@ -4916,7 +4916,7 @@  discard block
 block discarded – undo
4916 4916
 	 * @param string $sep           The separator, default: `|`.
4917 4917
 	 */
4918 4918
 
4919
-	return apply_filters( 'geodir_filter_title_variables_vars', $title, $location_array, $gd_page, $sep );
4919
+	return apply_filters('geodir_filter_title_variables_vars', $title, $location_array, $gd_page, $sep);
4920 4920
 }
4921 4921
 
4922 4922
 /**
@@ -4929,82 +4929,82 @@  discard block
 block discarded – undo
4929 4929
  *
4930 4930
  * @return array Translation texts.
4931 4931
  */
4932
-function geodir_load_cpt_text_translation( $translation_texts = array() ) {
4933
-	$gd_post_types = geodir_get_posttypes( 'array' );
4932
+function geodir_load_cpt_text_translation($translation_texts = array()) {
4933
+	$gd_post_types = geodir_get_posttypes('array');
4934 4934
 
4935
-	if ( ! empty( $gd_post_types ) ) {
4936
-		foreach ( $gd_post_types as $post_type => $cpt_info ) {
4937
-			$labels      = isset( $cpt_info['labels'] ) ? $cpt_info['labels'] : '';
4938
-			$description = isset( $cpt_info['description'] ) ? $cpt_info['description'] : '';
4939
-			$seo         = isset( $cpt_info['seo'] ) ? $cpt_info['seo'] : '';
4935
+	if (!empty($gd_post_types)) {
4936
+		foreach ($gd_post_types as $post_type => $cpt_info) {
4937
+			$labels      = isset($cpt_info['labels']) ? $cpt_info['labels'] : '';
4938
+			$description = isset($cpt_info['description']) ? $cpt_info['description'] : '';
4939
+			$seo         = isset($cpt_info['seo']) ? $cpt_info['seo'] : '';
4940 4940
 
4941
-			if ( ! empty( $labels ) ) {
4942
-				if ( $labels['name'] != '' && ! in_array( $labels['name'], $translation_texts ) ) {
4941
+			if (!empty($labels)) {
4942
+				if ($labels['name'] != '' && !in_array($labels['name'], $translation_texts)) {
4943 4943
 					$translation_texts[] = $labels['name'];
4944 4944
 				}
4945
-				if ( $labels['singular_name'] != '' && ! in_array( $labels['singular_name'], $translation_texts ) ) {
4945
+				if ($labels['singular_name'] != '' && !in_array($labels['singular_name'], $translation_texts)) {
4946 4946
 					$translation_texts[] = $labels['singular_name'];
4947 4947
 				}
4948
-				if ( $labels['add_new'] != '' && ! in_array( $labels['add_new'], $translation_texts ) ) {
4948
+				if ($labels['add_new'] != '' && !in_array($labels['add_new'], $translation_texts)) {
4949 4949
 					$translation_texts[] = $labels['add_new'];
4950 4950
 				}
4951
-				if ( $labels['add_new_item'] != '' && ! in_array( $labels['add_new_item'], $translation_texts ) ) {
4951
+				if ($labels['add_new_item'] != '' && !in_array($labels['add_new_item'], $translation_texts)) {
4952 4952
 					$translation_texts[] = $labels['add_new_item'];
4953 4953
 				}
4954
-				if ( $labels['edit_item'] != '' && ! in_array( $labels['edit_item'], $translation_texts ) ) {
4954
+				if ($labels['edit_item'] != '' && !in_array($labels['edit_item'], $translation_texts)) {
4955 4955
 					$translation_texts[] = $labels['edit_item'];
4956 4956
 				}
4957
-				if ( $labels['new_item'] != '' && ! in_array( $labels['new_item'], $translation_texts ) ) {
4957
+				if ($labels['new_item'] != '' && !in_array($labels['new_item'], $translation_texts)) {
4958 4958
 					$translation_texts[] = $labels['new_item'];
4959 4959
 				}
4960
-				if ( $labels['view_item'] != '' && ! in_array( $labels['view_item'], $translation_texts ) ) {
4960
+				if ($labels['view_item'] != '' && !in_array($labels['view_item'], $translation_texts)) {
4961 4961
 					$translation_texts[] = $labels['view_item'];
4962 4962
 				}
4963
-				if ( $labels['search_items'] != '' && ! in_array( $labels['search_items'], $translation_texts ) ) {
4963
+				if ($labels['search_items'] != '' && !in_array($labels['search_items'], $translation_texts)) {
4964 4964
 					$translation_texts[] = $labels['search_items'];
4965 4965
 				}
4966
-				if ( $labels['not_found'] != '' && ! in_array( $labels['not_found'], $translation_texts ) ) {
4966
+				if ($labels['not_found'] != '' && !in_array($labels['not_found'], $translation_texts)) {
4967 4967
 					$translation_texts[] = $labels['not_found'];
4968 4968
 				}
4969
-				if ( $labels['not_found_in_trash'] != '' && ! in_array( $labels['not_found_in_trash'], $translation_texts ) ) {
4969
+				if ($labels['not_found_in_trash'] != '' && !in_array($labels['not_found_in_trash'], $translation_texts)) {
4970 4970
 					$translation_texts[] = $labels['not_found_in_trash'];
4971 4971
 				}
4972
-				if ( isset( $labels['label_post_profile'] ) && $labels['label_post_profile'] != '' && ! in_array( $labels['label_post_profile'], $translation_texts ) ) {
4972
+				if (isset($labels['label_post_profile']) && $labels['label_post_profile'] != '' && !in_array($labels['label_post_profile'], $translation_texts)) {
4973 4973
 					$translation_texts[] = $labels['label_post_profile'];
4974 4974
 				}
4975
-				if ( isset( $labels['label_post_info'] ) && $labels['label_post_info'] != '' && ! in_array( $labels['label_post_info'], $translation_texts ) ) {
4975
+				if (isset($labels['label_post_info']) && $labels['label_post_info'] != '' && !in_array($labels['label_post_info'], $translation_texts)) {
4976 4976
 					$translation_texts[] = $labels['label_post_info'];
4977 4977
 				}
4978
-				if ( isset( $labels['label_post_images'] ) && $labels['label_post_images'] != '' && ! in_array( $labels['label_post_images'], $translation_texts ) ) {
4978
+				if (isset($labels['label_post_images']) && $labels['label_post_images'] != '' && !in_array($labels['label_post_images'], $translation_texts)) {
4979 4979
 					$translation_texts[] = $labels['label_post_images'];
4980 4980
 				}
4981
-				if ( isset( $labels['label_post_map'] ) && $labels['label_post_map'] != '' && ! in_array( $labels['label_post_map'], $translation_texts ) ) {
4981
+				if (isset($labels['label_post_map']) && $labels['label_post_map'] != '' && !in_array($labels['label_post_map'], $translation_texts)) {
4982 4982
 					$translation_texts[] = $labels['label_post_map'];
4983 4983
 				}
4984
-				if ( isset( $labels['label_reviews'] ) && $labels['label_reviews'] != '' && ! in_array( $labels['label_reviews'], $translation_texts ) ) {
4984
+				if (isset($labels['label_reviews']) && $labels['label_reviews'] != '' && !in_array($labels['label_reviews'], $translation_texts)) {
4985 4985
 					$translation_texts[] = $labels['label_reviews'];
4986 4986
 				}
4987
-				if ( isset( $labels['label_related_listing'] ) && $labels['label_related_listing'] != '' && ! in_array( $labels['label_related_listing'], $translation_texts ) ) {
4987
+				if (isset($labels['label_related_listing']) && $labels['label_related_listing'] != '' && !in_array($labels['label_related_listing'], $translation_texts)) {
4988 4988
 					$translation_texts[] = $labels['label_related_listing'];
4989 4989
 				}
4990 4990
 			}
4991 4991
 
4992
-			if ( $description != '' && ! in_array( $description, $translation_texts ) ) {
4993
-				$translation_texts[] = normalize_whitespace( $description );
4992
+			if ($description != '' && !in_array($description, $translation_texts)) {
4993
+				$translation_texts[] = normalize_whitespace($description);
4994 4994
 			}
4995 4995
 
4996
-			if ( ! empty( $seo ) ) {
4997
-				if ( isset( $seo['meta_keyword'] ) && $seo['meta_keyword'] != '' && ! in_array( $seo['meta_keyword'], $translation_texts ) ) {
4998
-					$translation_texts[] = normalize_whitespace( $seo['meta_keyword'] );
4996
+			if (!empty($seo)) {
4997
+				if (isset($seo['meta_keyword']) && $seo['meta_keyword'] != '' && !in_array($seo['meta_keyword'], $translation_texts)) {
4998
+					$translation_texts[] = normalize_whitespace($seo['meta_keyword']);
4999 4999
 				}
5000 5000
 
5001
-				if ( isset( $seo['meta_description'] ) && $seo['meta_description'] != '' && ! in_array( $seo['meta_description'], $translation_texts ) ) {
5002
-					$translation_texts[] = normalize_whitespace( $seo['meta_description'] );
5001
+				if (isset($seo['meta_description']) && $seo['meta_description'] != '' && !in_array($seo['meta_description'], $translation_texts)) {
5002
+					$translation_texts[] = normalize_whitespace($seo['meta_description']);
5003 5003
 				}
5004 5004
 			}
5005 5005
 		}
5006 5006
 	}
5007
-	$translation_texts = ! empty( $translation_texts ) ? array_unique( $translation_texts ) : $translation_texts;
5007
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
5008 5008
 
5009 5009
 	return $translation_texts;
5010 5010
 }
@@ -5019,27 +5019,27 @@  discard block
 block discarded – undo
5019 5019
  *
5020 5020
  * @return array Location terms.
5021 5021
  */
5022
-function geodir_remove_location_terms( $location_terms = array() ) {
5023
-	$location_manager = defined( 'POST_LOCATION_TABLE' ) ? true : false;
5022
+function geodir_remove_location_terms($location_terms = array()) {
5023
+	$location_manager = defined('POST_LOCATION_TABLE') ? true : false;
5024 5024
 
5025
-	if ( ! empty( $location_terms ) && $location_manager ) {
5026
-		$hide_country_part = get_option( 'geodir_location_hide_country_part' );
5027
-		$hide_region_part  = get_option( 'geodir_location_hide_region_part' );
5025
+	if (!empty($location_terms) && $location_manager) {
5026
+		$hide_country_part = get_option('geodir_location_hide_country_part');
5027
+		$hide_region_part  = get_option('geodir_location_hide_region_part');
5028 5028
 
5029
-		if ( $hide_region_part && $hide_country_part ) {
5030
-			if ( isset( $location_terms['gd_country'] ) ) {
5031
-				unset( $location_terms['gd_country'] );
5029
+		if ($hide_region_part && $hide_country_part) {
5030
+			if (isset($location_terms['gd_country'])) {
5031
+				unset($location_terms['gd_country']);
5032 5032
 			}
5033
-			if ( isset( $location_terms['gd_region'] ) ) {
5034
-				unset( $location_terms['gd_region'] );
5033
+			if (isset($location_terms['gd_region'])) {
5034
+				unset($location_terms['gd_region']);
5035 5035
 			}
5036
-		} else if ( $hide_region_part && ! $hide_country_part ) {
5037
-			if ( isset( $location_terms['gd_region'] ) ) {
5038
-				unset( $location_terms['gd_region'] );
5036
+		} else if ($hide_region_part && !$hide_country_part) {
5037
+			if (isset($location_terms['gd_region'])) {
5038
+				unset($location_terms['gd_region']);
5039 5039
 			}
5040
-		} else if ( ! $hide_region_part && $hide_country_part ) {
5041
-			if ( isset( $location_terms['gd_country'] ) ) {
5042
-				unset( $location_terms['gd_country'] );
5040
+		} else if (!$hide_region_part && $hide_country_part) {
5041
+			if (isset($location_terms['gd_country'])) {
5042
+				unset($location_terms['gd_country']);
5043 5043
 			}
5044 5044
 		}
5045 5045
 	}
@@ -5057,33 +5057,33 @@  discard block
 block discarded – undo
5057 5057
  * @param WP_Post $post Post object.
5058 5058
  * @param bool $update  Whether this is an existing listing being updated or not.
5059 5059
  */
5060
-function geodir_on_wp_insert_post( $post_ID, $post, $update ) {
5061
-	if ( ! $update ) {
5060
+function geodir_on_wp_insert_post($post_ID, $post, $update) {
5061
+	if (!$update) {
5062 5062
 		return;
5063 5063
 	}
5064 5064
 
5065
-	$action      = isset( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
5066
-	$is_admin    = is_admin() && ( ! defined( 'DOING_AJAX' ) || ( defined( 'DOING_AJAX' ) && ! DOING_AJAX ) ) ? true : false;
5065
+	$action      = isset($_REQUEST['action']) ? sanitize_text_field($_REQUEST['action']) : '';
5066
+	$is_admin    = is_admin() && (!defined('DOING_AJAX') || (defined('DOING_AJAX') && !DOING_AJAX)) ? true : false;
5067 5067
 	$inline_save = $action == 'inline-save' ? true : false;
5068 5068
 
5069
-	if ( empty( $post->post_type ) || $is_admin || $inline_save || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ) {
5069
+	if (empty($post->post_type) || $is_admin || $inline_save || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)) {
5070 5070
 		return;
5071 5071
 	}
5072 5072
 
5073
-	if ( $action != '' && in_array( $action, array( 'geodir_import_export' ) ) ) {
5073
+	if ($action != '' && in_array($action, array('geodir_import_export'))) {
5074 5074
 		return;
5075 5075
 	}
5076 5076
 
5077 5077
 	$user_id = (int) get_current_user_id();
5078 5078
 
5079
-	if ( $user_id > 0 && get_option( 'geodir_notify_post_edited' ) && ! wp_is_post_revision( $post_ID ) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
5080
-		$author_id = ! empty( $post->post_author ) ? $post->post_author : 0;
5079
+	if ($user_id > 0 && get_option('geodir_notify_post_edited') && !wp_is_post_revision($post_ID) && in_array($post->post_type, geodir_get_posttypes())) {
5080
+		$author_id = !empty($post->post_author) ? $post->post_author : 0;
5081 5081
 
5082
-		if ( $user_id == $author_id && ! is_super_admin() ) {
5083
-			$from_email   = get_option( 'site_email' );
5082
+		if ($user_id == $author_id && !is_super_admin()) {
5083
+			$from_email   = get_option('site_email');
5084 5084
 			$from_name    = get_site_emailName();
5085
-			$to_email     = get_option( 'admin_email' );
5086
-			$to_name      = get_option( 'name' );
5085
+			$to_email     = get_option('admin_email');
5086
+			$to_name      = get_option('name');
5087 5087
 			$message_type = 'listing_edited';
5088 5088
 
5089 5089
 			$notify_edited = true;
@@ -5095,9 +5095,9 @@  discard block
 block discarded – undo
5095 5095
 			 * @param bool $notify_edited Notify on listing edited by author?
5096 5096
 			 * @param object $post        The current post object.
5097 5097
 			 */
5098
-			$notify_edited = apply_filters( 'geodir_notify_on_listing_edited', $notify_edited, $post );
5098
+			$notify_edited = apply_filters('geodir_notify_on_listing_edited', $notify_edited, $post);
5099 5099
 
5100
-			geodir_sendEmail( $from_email, $from_name, $to_email, $to_name, '', '', '', $message_type, $post_ID );
5100
+			geodir_sendEmail($from_email, $from_name, $to_email, $to_name, '', '', '', $message_type, $post_ID);
5101 5101
 		}
5102 5102
 	}
5103 5103
 }
@@ -5112,14 +5112,14 @@  discard block
 block discarded – undo
5112 5112
  *
5113 5113
  * @return string|null The current page start & end numbering.
5114 5114
  */
5115
-function geodir_title_meta_page( $sep ) {
5115
+function geodir_title_meta_page($sep) {
5116 5116
 	$replacement = null;
5117 5117
 
5118
-	$max = geodir_title_meta_pagenumbering( 'max' );
5119
-	$nr  = geodir_title_meta_pagenumbering( 'nr' );
5118
+	$max = geodir_title_meta_pagenumbering('max');
5119
+	$nr  = geodir_title_meta_pagenumbering('nr');
5120 5120
 
5121
-	if ( $max > 1 && $nr > 1 ) {
5122
-		$replacement = sprintf( $sep . ' ' . __( 'Page %1$d of %2$d', 'geodirectory' ), $nr, $max );
5121
+	if ($max > 1 && $nr > 1) {
5122
+		$replacement = sprintf($sep.' '.__('Page %1$d of %2$d', 'geodirectory'), $nr, $max);
5123 5123
 	}
5124 5124
 
5125 5125
 	return $replacement;
@@ -5136,8 +5136,8 @@  discard block
 block discarded – undo
5136 5136
 function geodir_title_meta_pagenumber() {
5137 5137
 	$replacement = null;
5138 5138
 
5139
-	$nr = geodir_title_meta_pagenumbering( 'nr' );
5140
-	if ( isset( $nr ) && $nr > 0 ) {
5139
+	$nr = geodir_title_meta_pagenumbering('nr');
5140
+	if (isset($nr) && $nr > 0) {
5141 5141
 		$replacement = (string) $nr;
5142 5142
 	}
5143 5143
 
@@ -5155,8 +5155,8 @@  discard block
 block discarded – undo
5155 5155
 function geodir_title_meta_pagetotal() {
5156 5156
 	$replacement = null;
5157 5157
 
5158
-	$max = geodir_title_meta_pagenumbering( 'max' );
5159
-	if ( isset( $max ) && $max > 0 ) {
5158
+	$max = geodir_title_meta_pagenumbering('max');
5159
+	if (isset($max) && $max > 0) {
5160 5160
 		$replacement = (string) $max;
5161 5161
 	}
5162 5162
 
@@ -5176,36 +5176,36 @@  discard block
 block discarded – undo
5176 5176
  *
5177 5177
  * @return int|null The current page numbering.
5178 5178
  */
5179
-function geodir_title_meta_pagenumbering( $request = 'nr' ) {
5179
+function geodir_title_meta_pagenumbering($request = 'nr') {
5180 5180
 	global $wp_query, $post;
5181 5181
 	$max_num_pages = null;
5182 5182
 	$page_number   = null;
5183 5183
 
5184 5184
 	$max_num_pages = 1;
5185 5185
 
5186
-	if ( ! is_singular() ) {
5187
-		$page_number = get_query_var( 'paged' );
5188
-		if ( $page_number === 0 || $page_number === '' ) {
5186
+	if (!is_singular()) {
5187
+		$page_number = get_query_var('paged');
5188
+		if ($page_number === 0 || $page_number === '') {
5189 5189
 			$page_number = 1;
5190 5190
 		}
5191 5191
 
5192
-		if ( isset( $wp_query->max_num_pages ) && ( $wp_query->max_num_pages != '' && $wp_query->max_num_pages != 0 ) ) {
5192
+		if (isset($wp_query->max_num_pages) && ($wp_query->max_num_pages != '' && $wp_query->max_num_pages != 0)) {
5193 5193
 			$max_num_pages = $wp_query->max_num_pages;
5194 5194
 		}
5195 5195
 	} else {
5196
-		$page_number = get_query_var( 'page' );
5197
-		if ( $page_number === 0 || $page_number === '' ) {
5196
+		$page_number = get_query_var('page');
5197
+		if ($page_number === 0 || $page_number === '') {
5198 5198
 			$page_number = 1;
5199 5199
 		}
5200 5200
 
5201
-		if ( isset( $post->post_content ) ) {
5202
-			$max_num_pages = ( substr_count( $post->post_content, '<!--nextpage-->' ) + 1 );
5201
+		if (isset($post->post_content)) {
5202
+			$max_num_pages = (substr_count($post->post_content, '<!--nextpage-->') + 1);
5203 5203
 		}
5204 5204
 	}
5205 5205
 
5206 5206
 	$return = null;
5207 5207
 
5208
-	switch ( $request ) {
5208
+	switch ($request) {
5209 5209
 		case 'nr':
5210 5210
 			$return = $page_number;
5211 5211
 			break;
@@ -5226,14 +5226,14 @@  discard block
 block discarded – undo
5226 5226
  *
5227 5227
  * @return array Terms.
5228 5228
  */
5229
-function geodir_filter_empty_terms( $terms ) {
5230
-	if ( empty( $terms ) ) {
5229
+function geodir_filter_empty_terms($terms) {
5230
+	if (empty($terms)) {
5231 5231
 		return $terms;
5232 5232
 	}
5233 5233
 
5234 5234
 	$return = array();
5235
-	foreach ( $terms as $term ) {
5236
-		if ( isset( $term->count ) && $term->count > 0 ) {
5235
+	foreach ($terms as $term) {
5236
+		if (isset($term->count) && $term->count > 0) {
5237 5237
 			$return[] = $term;
5238 5238
 		} else {
5239 5239
 			/**
@@ -5244,7 +5244,7 @@  discard block
 block discarded – undo
5244 5244
 			 * @param array $return The array of terms to return.
5245 5245
 			 * @param object $term  The term object.
5246 5246
 			 */
5247
-			$return = apply_filters( 'geodir_filter_empty_terms_filter', $return, $term );
5247
+			$return = apply_filters('geodir_filter_empty_terms_filter', $return, $term);
5248 5248
 		}
5249 5249
 	}
5250 5250
 
@@ -5261,12 +5261,12 @@  discard block
 block discarded – undo
5261 5261
  *
5262 5262
  * @return array
5263 5263
  */
5264
-function geodir_remove_hentry( $class ) {
5265
-	if ( geodir_is_page( 'detail' ) ) {
5266
-		$class = array_diff( $class, array( 'hentry' ) );
5264
+function geodir_remove_hentry($class) {
5265
+	if (geodir_is_page('detail')) {
5266
+		$class = array_diff($class, array('hentry'));
5267 5267
 	}
5268 5268
 
5269 5269
 	return $class;
5270 5270
 }
5271 5271
 
5272
-add_filter( 'post_class', 'geodir_remove_hentry' );
5273 5272
\ No newline at end of file
5273
+add_filter('post_class', 'geodir_remove_hentry');
5274 5274
\ No newline at end of file
Please login to merge, or discard this patch.
upgrade.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -324,7 +324,7 @@
 block discarded – undo
324 324
 
325 325
             if(!empty($show_in_arr )){
326 326
                 $show_in_arr = implode(',',$show_in_arr);
327
-            }else{
327
+            } else{
328 328
                 $show_in_arr = '';
329 329
             }
330 330
 
Please login to merge, or discard this patch.
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 global $wpdb;
11 11
 
12
-if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) {
12
+if (get_option('geodirectory'.'_db_version') != GEODIRECTORY_VERSION) {
13 13
     /**
14 14
      * Include custom database table related functions.
15 15
      *
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 
49 49
 
50 50
 
51
-    add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
51
+    add_action('init', 'gd_fix_cpt_rewrite_slug', 11); // this needs to be kept for a few versions
52 52
 
53
-    update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
53
+    update_option('geodirectory'.'_db_version', GEODIRECTORY_VERSION);
54 54
 
55 55
 }
56 56
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
  * @since 1.0.0
87 87
  * @package GeoDirectory
88 88
  */
89
-function geodir_upgrade_146(){
89
+function geodir_upgrade_146() {
90 90
     gd_convert_virtual_pages();
91 91
 }
92 92
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
  * @since 1.5.0
97 97
  * @package GeoDirectory
98 98
  */
99
-function geodir_upgrade_150(){
99
+function geodir_upgrade_150() {
100 100
     gd_fix_cpt_rewrite_slug();
101 101
 }
102 102
 
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
  * @since 1.4.8
109 109
  * @package GeoDirectory
110 110
  */
111
-function geodir_upgrade_148(){
111
+function geodir_upgrade_148() {
112 112
     /*
113 113
      * Blank the users google password if present as we now use oAuth 2.0
114 114
      */
115
-    update_option('geodir_ga_pass','');
116
-    update_option('geodir_ga_user','');
115
+    update_option('geodir_ga_pass', '');
116
+    update_option('geodir_ga_user', '');
117 117
 
118 118
 }
119 119
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
  * @since 1.5.3
125 125
  * @package GeoDirectory
126 126
  */
127
-function geodir_upgrade_153(){
127
+function geodir_upgrade_153() {
128 128
     geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
129 129
     geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
130 130
 }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
  * @since 1.5.3
136 136
  * @package GeoDirectory
137 137
  */
138
-function geodir_upgrade_154(){
138
+function geodir_upgrade_154() {
139 139
     geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
140 140
 }
141 141
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
  * @since 1.5.2
146 146
  * @package GeoDirectory
147 147
  */
148
-function geodir_upgrade_152(){
148
+function geodir_upgrade_152() {
149 149
     gd_fix_address_detail_table_limit();
150 150
 }
151 151
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 function geodir_fix_review_date()
182 182
 {
183 183
     global $wpdb;
184
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
184
+    $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
185 185
 }
186 186
 
187 187
 /**
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 function geodir_fix_review_post_status()
195 195
 {
196 196
     global $wpdb;
197
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
197
+    $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
198 198
 }
199 199
 
200 200
 /**
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 function geodir_fix_review_content()
209 209
 {
210 210
     global $wpdb;
211
-    if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
211
+    if ($wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
212 212
         return true;
213 213
     } else {
214 214
         return false;
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
         foreach ($all_postypes as $key) {
234 234
             // update each GD CTP
235 235
 
236
-            $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
236
+            $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN ".$wpdb->prefix."geodir_".$key."_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
237 237
 
238 238
         }
239 239
         return true;
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     if (!empty($all_postypes)) {
258 258
         foreach ($all_postypes as $key) {
259 259
             // update each GD CTP
260
-            $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
260
+            $reviews = $wpdb->get_results("SELECT post_id FROM ".$wpdb->prefix."geodir_".$key."_detail d");
261 261
 
262 262
             if (!empty($reviews)) {
263 263
                 foreach ($reviews as $post_id) {
@@ -272,51 +272,51 @@  discard block
 block discarded – undo
272 272
 }
273 273
 
274 274
 
275
-function gd_convert_custom_field_display(){
275
+function gd_convert_custom_field_display() {
276 276
     global $wpdb;
277 277
 
278
-    $field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE);
278
+    $field_info = $wpdb->get_results("select * from ".GEODIR_CUSTOM_FIELDS_TABLE);
279 279
 
280 280
     $has_run = get_option('gd_convert_custom_field_display');
281
-    if($has_run){return;}
281
+    if ($has_run) {return; }
282 282
 
283 283
     // set the field_type_key for standard fields
284 284
     $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type");
285 285
 
286 286
 
287
-    if(is_array( $field_info)){
287
+    if (is_array($field_info)) {
288 288
 
289
-        foreach( $field_info as $cf){
289
+        foreach ($field_info as $cf) {
290 290
 
291 291
             $id = $cf->id;
292 292
 
293
-            if(!property_exists($cf,'show_in') || !$id){return;}
293
+            if (!property_exists($cf, 'show_in') || !$id) {return; }
294 294
 
295 295
             $show_in_arr = array();
296 296
 
297
-            if($cf->is_default){
297
+            if ($cf->is_default) {
298 298
                 $show_in_arr[] = "[detail]";
299 299
             }
300 300
 
301
-            if($cf->show_on_detail){
301
+            if ($cf->show_on_detail) {
302 302
                 $show_in_arr[] = "[moreinfo]";
303 303
             }
304 304
 
305
-            if($cf->show_on_listing){
305
+            if ($cf->show_on_listing) {
306 306
                 $show_in_arr[] = "[listing]";
307 307
             }
308 308
 
309
-            if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){
309
+            if ($cf->show_as_tab || $cf->htmlvar_name == 'geodir_video' || $cf->htmlvar_name == 'geodir_special_offers') {
310 310
                 $show_in_arr[] = "[owntab]";
311 311
             }
312 312
 
313
-            if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){
313
+            if ($cf->htmlvar_name == 'post' || $cf->htmlvar_name == 'geodir_contact' || $cf->htmlvar_name == 'geodir_timing') {
314 314
                 $show_in_arr[] = "[mapbubble]";
315 315
             }
316 316
 
317
-            if(!empty($show_in_arr )){
318
-                $show_in_arr = implode(',',$show_in_arr);
319
-            }else{
317
+            if (!empty($show_in_arr)) {
318
+                $show_in_arr = implode(',', $show_in_arr);
319
+            } else {
320 320
                 $show_in_arr = '';
321 321
             }
322 322
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 
325 325
         }
326 326
 
327
-        update_option('gd_convert_custom_field_display',1);
327
+        update_option('gd_convert_custom_field_display', 1);
328 328
     }
329 329
 }
330 330
 
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
 
702 702
     update_option('gd_theme_compats', $theme_compat);
703 703
 
704
-    gd_set_theme_compat();// set the compat pack if avail
704
+    gd_set_theme_compat(); // set the compat pack if avail
705 705
 }
706 706
 
707 707
 
@@ -712,61 +712,61 @@  discard block
 block discarded – undo
712 712
  * @package GeoDirectory
713 713
  * @global object $wpdb WordPress Database object.
714 714
  */
715
-function gd_convert_virtual_pages(){
715
+function gd_convert_virtual_pages() {
716 716
     global $wpdb;
717 717
 
718 718
     // Update the add listing page settings
719 719
     $add_listing_page = $wpdb->get_var(
720 720
         $wpdb->prepare(
721
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
721
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
722 722
             array('add-listing')
723 723
         )
724 724
     );
725 725
 
726
-    if($add_listing_page){
727
-        wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
728
-        update_option( 'geodir_add_listing_page', $add_listing_page);
726
+    if ($add_listing_page) {
727
+        wp_update_post(array('ID' => $add_listing_page, 'post_status' => 'publish'));
728
+        update_option('geodir_add_listing_page', $add_listing_page);
729 729
     }
730 730
 
731 731
     // Update the listing preview page settings
732 732
     $listing_preview_page = $wpdb->get_var(
733 733
         $wpdb->prepare(
734
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
734
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
735 735
             array('listing-preview')
736 736
         )
737 737
     );
738 738
 
739
-    if($listing_preview_page){
740
-        wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
741
-        update_option( 'geodir_preview_page', $listing_preview_page);
739
+    if ($listing_preview_page) {
740
+        wp_update_post(array('ID' => $listing_preview_page, 'post_status' => 'publish'));
741
+        update_option('geodir_preview_page', $listing_preview_page);
742 742
     }
743 743
 
744 744
     // Update the listing success page settings
745 745
     $listing_success_page = $wpdb->get_var(
746 746
         $wpdb->prepare(
747
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
747
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
748 748
             array('listing-success')
749 749
         )
750 750
     );
751 751
 
752
-    if($listing_success_page){
753
-        wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
754
-        update_option( 'geodir_success_page', $listing_success_page);
752
+    if ($listing_success_page) {
753
+        wp_update_post(array('ID' => $listing_success_page, 'post_status' => 'publish'));
754
+        update_option('geodir_success_page', $listing_success_page);
755 755
     }
756 756
 
757 757
     // Update the listing success page settings
758 758
     $location_page = $wpdb->get_var(
759 759
         $wpdb->prepare(
760
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
760
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
761 761
             array('location')
762 762
         )
763 763
     );
764 764
 
765
-    if($location_page){
765
+    if ($location_page) {
766 766
         $location_slug = get_option('geodir_location_prefix');
767
-        if(!$location_slug ){$location_slug  = 'location';}
768
-        wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
769
-        update_option( 'geodir_location_page', $location_page);
767
+        if (!$location_slug) {$location_slug = 'location'; }
768
+        wp_update_post(array('ID' => $location_page, 'post_status' => 'publish', 'post_name' => $location_slug));
769
+        update_option('geodir_location_page', $location_page);
770 770
     }
771 771
 
772 772
 }
@@ -785,13 +785,13 @@  discard block
 block discarded – undo
785 785
     $post_types = get_option('geodir_post_types');
786 786
 
787 787
 
788
-    if (is_array($post_types)){
788
+    if (is_array($post_types)) {
789 789
 
790 790
         foreach ($post_types as $post_type => $args) {
791 791
 
792 792
 
793
-            if(isset($args['rewrite']['slug'])){
794
-                $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
793
+            if (isset($args['rewrite']['slug'])) {
794
+                $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%", "", $args['rewrite']['slug']);
795 795
             }
796 796
 
797 797
                 $alt_post_types[$post_type] = $args;
@@ -799,8 +799,8 @@  discard block
 block discarded – undo
799 799
         }
800 800
     }
801 801
 
802
-    if(!empty($alt_post_types)) {
803
-        update_option('geodir_post_types',$alt_post_types);
802
+    if (!empty($alt_post_types)) {
803
+        update_option('geodir_post_types', $alt_post_types);
804 804
         }
805 805
 
806 806
 
@@ -826,9 +826,9 @@  discard block
 block discarded – undo
826 826
         foreach ($all_postypes as $key) {
827 827
             // update each GD CTP
828 828
             try {
829
-                $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
830
-            } catch(Exception $e) {
831
-                error_log( 'Error: ' . $e->getMessage() );
829
+                $wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_".$key."_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
830
+            } catch (Exception $e) {
831
+                error_log('Error: '.$e->getMessage());
832 832
             }
833 833
         }
834 834
     }
Please login to merge, or discard this patch.
Indentation   +558 added lines, -558 removed lines patch added patch discarded remove patch
@@ -10,47 +10,47 @@  discard block
 block discarded – undo
10 10
 global $wpdb;
11 11
 
12 12
 if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) {
13
-    /**
14
-     * Include custom database table related functions.
15
-     *
16
-     * @since 1.0.0
17
-     * @package GeoDirectory
18
-     */
19
-    include_once('geodirectory-admin/admin_db_install.php');
20
-    add_action('plugins_loaded', 'geodirectory_upgrade_all', 10);
21
-    if (GEODIRECTORY_VERSION <= '1.3.6') {
22
-        add_action('plugins_loaded', 'geodir_upgrade_136', 11);
23
-    }
13
+	/**
14
+	 * Include custom database table related functions.
15
+	 *
16
+	 * @since 1.0.0
17
+	 * @package GeoDirectory
18
+	 */
19
+	include_once('geodirectory-admin/admin_db_install.php');
20
+	add_action('plugins_loaded', 'geodirectory_upgrade_all', 10);
21
+	if (GEODIRECTORY_VERSION <= '1.3.6') {
22
+		add_action('plugins_loaded', 'geodir_upgrade_136', 11);
23
+	}
24 24
 
25
-    if (GEODIRECTORY_VERSION <= '1.4.6') {
26
-        add_action('init', 'geodir_upgrade_146', 11);
27
-    }
25
+	if (GEODIRECTORY_VERSION <= '1.4.6') {
26
+		add_action('init', 'geodir_upgrade_146', 11);
27
+	}
28 28
 
29
-    if (GEODIRECTORY_VERSION <= '1.4.8') {
30
-        add_action('init', 'geodir_upgrade_148', 11);
31
-    }
29
+	if (GEODIRECTORY_VERSION <= '1.4.8') {
30
+		add_action('init', 'geodir_upgrade_148', 11);
31
+	}
32 32
 
33
-    if (GEODIRECTORY_VERSION <= '1.5.0') {
34
-        add_action('init', 'geodir_upgrade_150', 11);
35
-    }
33
+	if (GEODIRECTORY_VERSION <= '1.5.0') {
34
+		add_action('init', 'geodir_upgrade_150', 11);
35
+	}
36 36
 
37
-    if (GEODIRECTORY_VERSION <= '1.5.2') {
38
-        add_action('init', 'geodir_upgrade_152', 11);
39
-    }
37
+	if (GEODIRECTORY_VERSION <= '1.5.2') {
38
+		add_action('init', 'geodir_upgrade_152', 11);
39
+	}
40 40
 
41
-    if (GEODIRECTORY_VERSION <= '1.5.3') {
42
-        add_action('init', 'geodir_upgrade_153', 11);
43
-    }
41
+	if (GEODIRECTORY_VERSION <= '1.5.3') {
42
+		add_action('init', 'geodir_upgrade_153', 11);
43
+	}
44 44
 
45
-    if (GEODIRECTORY_VERSION <= '1.5.4') {
46
-        add_action('init', 'geodir_upgrade_154', 11);
47
-    }
45
+	if (GEODIRECTORY_VERSION <= '1.5.4') {
46
+		add_action('init', 'geodir_upgrade_154', 11);
47
+	}
48 48
 
49 49
 
50 50
 
51
-    add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
51
+	add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
52 52
 
53
-    update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
53
+	update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
54 54
 
55 55
 }
56 56
 
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
  */
64 64
 function geodirectory_upgrade_all()
65 65
 {
66
-    geodir_create_tables();
67
-    geodir_update_review_db();
68
-    gd_install_theme_compat();
69
-    gd_convert_custom_field_display();
66
+	geodir_create_tables();
67
+	geodir_update_review_db();
68
+	gd_install_theme_compat();
69
+	gd_convert_custom_field_display();
70 70
 }
71 71
 
72 72
 /**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
  */
78 78
 function geodir_upgrade_136()
79 79
 {
80
-    geodir_fix_review_overall_rating();
80
+	geodir_fix_review_overall_rating();
81 81
 }
82 82
 
83 83
 /**
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
  * @package GeoDirectory
88 88
  */
89 89
 function geodir_upgrade_146(){
90
-    gd_convert_virtual_pages();
90
+	gd_convert_virtual_pages();
91 91
 }
92 92
 
93 93
 /**
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
  * @package GeoDirectory
98 98
  */
99 99
 function geodir_upgrade_150(){
100
-    gd_fix_cpt_rewrite_slug();
100
+	gd_fix_cpt_rewrite_slug();
101 101
 }
102 102
 
103 103
 
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
  * @package GeoDirectory
110 110
  */
111 111
 function geodir_upgrade_148(){
112
-    /*
112
+	/*
113 113
      * Blank the users google password if present as we now use oAuth 2.0
114 114
      */
115
-    update_option('geodir_ga_pass','');
116
-    update_option('geodir_ga_user','');
115
+	update_option('geodir_ga_pass','');
116
+	update_option('geodir_ga_user','');
117 117
 
118 118
 }
119 119
 
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
  * @package GeoDirectory
126 126
  */
127 127
 function geodir_upgrade_153(){
128
-    geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
129
-    geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
128
+	geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
129
+	geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
130 130
 }
131 131
 
132 132
 /**
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
  * @package GeoDirectory
137 137
  */
138 138
 function geodir_upgrade_154(){
139
-    geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
139
+	geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
140 140
 }
141 141
 
142 142
 /**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
  * @package GeoDirectory
147 147
  */
148 148
 function geodir_upgrade_152(){
149
-    gd_fix_address_detail_table_limit();
149
+	gd_fix_address_detail_table_limit();
150 150
 }
151 151
 
152 152
 
@@ -162,12 +162,12 @@  discard block
 block discarded – undo
162 162
  */
163 163
 function geodir_update_review_db()
164 164
 {
165
-    global $wpdb, $plugin_prefix;
165
+	global $wpdb, $plugin_prefix;
166 166
 
167
-    geodir_fix_review_date();
168
-    geodir_fix_review_post_status();
169
-    geodir_fix_review_content();
170
-    geodir_fix_review_location();
167
+	geodir_fix_review_date();
168
+	geodir_fix_review_post_status();
169
+	geodir_fix_review_content();
170
+	geodir_fix_review_location();
171 171
 
172 172
 }
173 173
 
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
  */
181 181
 function geodir_fix_review_date()
182 182
 {
183
-    global $wpdb;
184
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
183
+	global $wpdb;
184
+	$wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
185 185
 }
186 186
 
187 187
 /**
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
  */
194 194
 function geodir_fix_review_post_status()
195 195
 {
196
-    global $wpdb;
197
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
196
+	global $wpdb;
197
+	$wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
198 198
 }
199 199
 
200 200
 /**
@@ -207,12 +207,12 @@  discard block
 block discarded – undo
207 207
  */
208 208
 function geodir_fix_review_content()
209 209
 {
210
-    global $wpdb;
211
-    if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
212
-        return true;
213
-    } else {
214
-        return false;
215
-    }
210
+	global $wpdb;
211
+	if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
212
+		return true;
213
+	} else {
214
+		return false;
215
+	}
216 216
 }
217 217
 
218 218
 /**
@@ -225,20 +225,20 @@  discard block
 block discarded – undo
225 225
  */
226 226
 function geodir_fix_review_location()
227 227
 {
228
-    global $wpdb;
228
+	global $wpdb;
229 229
 
230
-    $all_postypes = geodir_get_posttypes();
230
+	$all_postypes = geodir_get_posttypes();
231 231
 
232
-    if (!empty($all_postypes)) {
233
-        foreach ($all_postypes as $key) {
234
-            // update each GD CTP
232
+	if (!empty($all_postypes)) {
233
+		foreach ($all_postypes as $key) {
234
+			// update each GD CTP
235 235
 
236
-            $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
236
+			$wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
237 237
 
238
-        }
239
-        return true;
240
-    }
241
-    return false;
238
+		}
239
+		return true;
240
+	}
241
+	return false;
242 242
 }
243 243
 
244 244
 /**
@@ -250,82 +250,82 @@  discard block
 block discarded – undo
250 250
  */
251 251
 function geodir_fix_review_overall_rating()
252 252
 {
253
-    global $wpdb;
253
+	global $wpdb;
254 254
 
255
-    $all_postypes = geodir_get_posttypes();
255
+	$all_postypes = geodir_get_posttypes();
256 256
 
257
-    if (!empty($all_postypes)) {
258
-        foreach ($all_postypes as $key) {
259
-            // update each GD CTP
260
-            $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
257
+	if (!empty($all_postypes)) {
258
+		foreach ($all_postypes as $key) {
259
+			// update each GD CTP
260
+			$reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
261 261
 
262
-            if (!empty($reviews)) {
263
-                foreach ($reviews as $post_id) {
264
-                    geodir_update_postrating($post_id->post_id, $key);
265
-                }
262
+			if (!empty($reviews)) {
263
+				foreach ($reviews as $post_id) {
264
+					geodir_update_postrating($post_id->post_id, $key);
265
+				}
266 266
 
267
-            }
267
+			}
268 268
 
269
-        }
269
+		}
270 270
 
271
-    }
271
+	}
272 272
 }
273 273
 
274 274
 
275 275
 function gd_convert_custom_field_display(){
276
-    global $wpdb;
276
+	global $wpdb;
277 277
 
278
-    $field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE);
278
+	$field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE);
279 279
 
280
-    $has_run = get_option('gd_convert_custom_field_display');
281
-    if($has_run){return;}
280
+	$has_run = get_option('gd_convert_custom_field_display');
281
+	if($has_run){return;}
282 282
 
283
-    // set the field_type_key for standard fields
284
-    $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type");
283
+	// set the field_type_key for standard fields
284
+	$wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type");
285 285
 
286 286
 
287
-    if(is_array( $field_info)){
287
+	if(is_array( $field_info)){
288 288
 
289
-        foreach( $field_info as $cf){
289
+		foreach( $field_info as $cf){
290 290
 
291
-            $id = $cf->id;
291
+			$id = $cf->id;
292 292
 
293
-            if(!property_exists($cf,'show_in') || !$id){return;}
293
+			if(!property_exists($cf,'show_in') || !$id){return;}
294 294
 
295
-            $show_in_arr = array();
295
+			$show_in_arr = array();
296 296
 
297
-            if($cf->is_default){
298
-                $show_in_arr[] = "[detail]";
299
-            }
297
+			if($cf->is_default){
298
+				$show_in_arr[] = "[detail]";
299
+			}
300 300
 
301
-            if($cf->show_on_detail){
302
-                $show_in_arr[] = "[moreinfo]";
303
-            }
301
+			if($cf->show_on_detail){
302
+				$show_in_arr[] = "[moreinfo]";
303
+			}
304 304
 
305
-            if($cf->show_on_listing){
306
-                $show_in_arr[] = "[listing]";
307
-            }
305
+			if($cf->show_on_listing){
306
+				$show_in_arr[] = "[listing]";
307
+			}
308 308
 
309
-            if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){
310
-                $show_in_arr[] = "[owntab]";
311
-            }
309
+			if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){
310
+				$show_in_arr[] = "[owntab]";
311
+			}
312 312
 
313
-            if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){
314
-                $show_in_arr[] = "[mapbubble]";
315
-            }
313
+			if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){
314
+				$show_in_arr[] = "[mapbubble]";
315
+			}
316 316
 
317
-            if(!empty($show_in_arr )){
318
-                $show_in_arr = implode(',',$show_in_arr);
319
-            }else{
320
-                $show_in_arr = '';
321
-            }
317
+			if(!empty($show_in_arr )){
318
+				$show_in_arr = implode(',',$show_in_arr);
319
+			}else{
320
+				$show_in_arr = '';
321
+			}
322 322
 
323
-            $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET show_in='$show_in_arr' WHERE id=$id");
323
+			$wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET show_in='$show_in_arr' WHERE id=$id");
324 324
 
325
-        }
325
+		}
326 326
 
327
-        update_option('gd_convert_custom_field_display',1);
328
-    }
327
+		update_option('gd_convert_custom_field_display',1);
328
+	}
329 329
 }
330 330
 
331 331
 ############################################
@@ -341,384 +341,384 @@  discard block
 block discarded – undo
341 341
  */
342 342
 function gd_install_theme_compat()
343 343
 {
344
-    global $wpdb;
344
+	global $wpdb;
345 345
 
346
-    $theme_compat = array();
347
-    $theme_compat = get_option('gd_theme_compats');
346
+	$theme_compat = array();
347
+	$theme_compat = get_option('gd_theme_compats');
348 348
 //GDF
349
-    $theme_compat['GeoDirectory_Framework'] = array(
350
-        'geodir_wrapper_open_id' => 'geodir_wrapper',
351
-        'geodir_wrapper_open_class' => '',
352
-        'geodir_wrapper_open_replace' => '',
353
-        'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
354
-        'geodir_wrapper_content_open_id' => 'geodir_content',
355
-        'geodir_wrapper_content_open_class' => '',
356
-        'geodir_wrapper_content_open_replace' => '',
357
-        'geodir_wrapper_content_close_replace' => '',
358
-        'geodir_article_open_id' => '',
359
-        'geodir_article_open_class' => '',
360
-        'geodir_article_open_replace' => '',
361
-        'geodir_article_close_replace' => '',
362
-        'geodir_sidebar_right_open_id' => '',
363
-        'geodir_sidebar_right_open_class' => '',
364
-        'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
365
-        'geodir_sidebar_right_close_replace' => '',
366
-        'geodir_sidebar_left_open_id' => '',
367
-        'geodir_sidebar_left_open_class' => '',
368
-        'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
369
-        'geodir_sidebar_left_close_replace' => '',
370
-        'geodir_main_content_open_id' => '',
371
-        'geodir_main_content_open_class' => '',
372
-        'geodir_main_content_open_replace' => '<!-- removed -->',
373
-        'geodir_main_content_close_replace' => '<!-- removed -->',
374
-        'geodir_top_content_add' => '',
375
-        'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
376
-        'geodir_before_widget_filter' => '',
377
-        'geodir_after_widget_filter' => '',
378
-        'geodir_theme_compat_css' => '',
379
-        'geodir_theme_compat_js' => '',
380
-        'geodir_theme_compat_default_options' => '',
381
-        'geodir_theme_compat_code' => ''
382
-    );
349
+	$theme_compat['GeoDirectory_Framework'] = array(
350
+		'geodir_wrapper_open_id' => 'geodir_wrapper',
351
+		'geodir_wrapper_open_class' => '',
352
+		'geodir_wrapper_open_replace' => '',
353
+		'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
354
+		'geodir_wrapper_content_open_id' => 'geodir_content',
355
+		'geodir_wrapper_content_open_class' => '',
356
+		'geodir_wrapper_content_open_replace' => '',
357
+		'geodir_wrapper_content_close_replace' => '',
358
+		'geodir_article_open_id' => '',
359
+		'geodir_article_open_class' => '',
360
+		'geodir_article_open_replace' => '',
361
+		'geodir_article_close_replace' => '',
362
+		'geodir_sidebar_right_open_id' => '',
363
+		'geodir_sidebar_right_open_class' => '',
364
+		'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
365
+		'geodir_sidebar_right_close_replace' => '',
366
+		'geodir_sidebar_left_open_id' => '',
367
+		'geodir_sidebar_left_open_class' => '',
368
+		'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
369
+		'geodir_sidebar_left_close_replace' => '',
370
+		'geodir_main_content_open_id' => '',
371
+		'geodir_main_content_open_class' => '',
372
+		'geodir_main_content_open_replace' => '<!-- removed -->',
373
+		'geodir_main_content_close_replace' => '<!-- removed -->',
374
+		'geodir_top_content_add' => '',
375
+		'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
376
+		'geodir_before_widget_filter' => '',
377
+		'geodir_after_widget_filter' => '',
378
+		'geodir_theme_compat_css' => '',
379
+		'geodir_theme_compat_js' => '',
380
+		'geodir_theme_compat_default_options' => '',
381
+		'geodir_theme_compat_code' => ''
382
+	);
383 383
 
384 384
 //Directory Theme
385
-    $theme_compat['Directory_Starter'] = array(
386
-        'geodir_wrapper_open_id' => 'geodir_wrapper',
387
-        'geodir_wrapper_open_class' => '',
388
-        'geodir_wrapper_open_replace' => '',
389
-        'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
390
-        'geodir_wrapper_content_open_id' => 'geodir_content',
391
-        'geodir_wrapper_content_open_class' => '',
392
-        'geodir_wrapper_content_open_replace' => '',
393
-        'geodir_wrapper_content_close_replace' => '',
394
-        'geodir_article_open_id' => '',
395
-        'geodir_article_open_class' => '',
396
-        'geodir_article_open_replace' => '',
397
-        'geodir_article_close_replace' => '',
398
-        'geodir_sidebar_right_open_id' => '',
399
-        'geodir_sidebar_right_open_class' => '',
400
-        'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
401
-        'geodir_sidebar_right_close_replace' => '',
402
-        'geodir_sidebar_left_open_id' => '',
403
-        'geodir_sidebar_left_open_class' => '',
404
-        'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
405
-        'geodir_sidebar_left_close_replace' => '',
406
-        'geodir_main_content_open_id' => '',
407
-        'geodir_main_content_open_class' => '',
408
-        'geodir_main_content_open_replace' => '<!-- removed -->',
409
-        'geodir_main_content_close_replace' => '<!-- removed -->',
410
-        'geodir_top_content_add' => '',
411
-        'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
412
-        'geodir_before_widget_filter' => '',
413
-        'geodir_after_widget_filter' => '',
414
-        'geodir_theme_compat_css' => '',
415
-        'geodir_theme_compat_js' => '',
416
-        'geodir_theme_compat_default_options' => '',
417
-        'geodir_theme_compat_code' => ''
418
-    );
385
+	$theme_compat['Directory_Starter'] = array(
386
+		'geodir_wrapper_open_id' => 'geodir_wrapper',
387
+		'geodir_wrapper_open_class' => '',
388
+		'geodir_wrapper_open_replace' => '',
389
+		'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
390
+		'geodir_wrapper_content_open_id' => 'geodir_content',
391
+		'geodir_wrapper_content_open_class' => '',
392
+		'geodir_wrapper_content_open_replace' => '',
393
+		'geodir_wrapper_content_close_replace' => '',
394
+		'geodir_article_open_id' => '',
395
+		'geodir_article_open_class' => '',
396
+		'geodir_article_open_replace' => '',
397
+		'geodir_article_close_replace' => '',
398
+		'geodir_sidebar_right_open_id' => '',
399
+		'geodir_sidebar_right_open_class' => '',
400
+		'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
401
+		'geodir_sidebar_right_close_replace' => '',
402
+		'geodir_sidebar_left_open_id' => '',
403
+		'geodir_sidebar_left_open_class' => '',
404
+		'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
405
+		'geodir_sidebar_left_close_replace' => '',
406
+		'geodir_main_content_open_id' => '',
407
+		'geodir_main_content_open_class' => '',
408
+		'geodir_main_content_open_replace' => '<!-- removed -->',
409
+		'geodir_main_content_close_replace' => '<!-- removed -->',
410
+		'geodir_top_content_add' => '',
411
+		'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
412
+		'geodir_before_widget_filter' => '',
413
+		'geodir_after_widget_filter' => '',
414
+		'geodir_theme_compat_css' => '',
415
+		'geodir_theme_compat_js' => '',
416
+		'geodir_theme_compat_default_options' => '',
417
+		'geodir_theme_compat_code' => ''
418
+	);
419 419
 
420 420
 //Jobby
421
-    $theme_compat['Jobby'] = $theme_compat['Directory_Starter'];
421
+	$theme_compat['Jobby'] = $theme_compat['Directory_Starter'];
422 422
 
423 423
 //GeoProperty
424
-    $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter'];
424
+	$theme_compat['GeoProperty'] = $theme_compat['Directory_Starter'];
425 425
 
426 426
 //Avada
427
-    $theme_compat['Avada'] = array(
428
-        'geodir_wrapper_open_id' => '',
429
-        'geodir_wrapper_open_class' => '',
430
-        'geodir_wrapper_open_replace' => '<!-- removed -->',
431
-        'geodir_wrapper_close_replace' => '<!-- removed -->',
432
-        'geodir_wrapper_content_open_id' => 'content',
433
-        'geodir_wrapper_content_open_class' => '',
434
-        'geodir_wrapper_content_open_replace' => '',
435
-        'geodir_wrapper_content_close_replace' => '',
436
-        'geodir_article_open_id' => '',
437
-        'geodir_article_open_class' => '',
438
-        'geodir_article_open_replace' => '',
439
-        'geodir_article_close_replace' => '',
440
-        'geodir_sidebar_right_open_id' => '',
441
-        'geodir_sidebar_right_open_class' => '',
442
-        'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
443
-        'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->',
444
-        'geodir_sidebar_left_open_id' => '',
445
-        'geodir_sidebar_left_open_class' => '',
446
-        'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
447
-        'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->',
448
-        'geodir_main_content_open_id' => '',
449
-        'geodir_main_content_open_class' => '',
450
-        'geodir_main_content_open_replace' => '<!-- removed -->',
451
-        'geodir_main_content_close_replace' => '<!-- removed -->',
452
-        'geodir_top_content_add' => '',
453
-        'geodir_before_main_content_add' => '',
454
-        'geodir_before_widget_filter' => '',
455
-        'geodir_after_widget_filter' => '',
456
-        'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'),
457
-        'geodir_theme_compat_js' => '',
458
-        'geodir_theme_compat_default_options' => '',
459
-        'geodir_theme_compat_code' => 'Avada'
460
-    );
427
+	$theme_compat['Avada'] = array(
428
+		'geodir_wrapper_open_id' => '',
429
+		'geodir_wrapper_open_class' => '',
430
+		'geodir_wrapper_open_replace' => '<!-- removed -->',
431
+		'geodir_wrapper_close_replace' => '<!-- removed -->',
432
+		'geodir_wrapper_content_open_id' => 'content',
433
+		'geodir_wrapper_content_open_class' => '',
434
+		'geodir_wrapper_content_open_replace' => '',
435
+		'geodir_wrapper_content_close_replace' => '',
436
+		'geodir_article_open_id' => '',
437
+		'geodir_article_open_class' => '',
438
+		'geodir_article_open_replace' => '',
439
+		'geodir_article_close_replace' => '',
440
+		'geodir_sidebar_right_open_id' => '',
441
+		'geodir_sidebar_right_open_class' => '',
442
+		'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
443
+		'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->',
444
+		'geodir_sidebar_left_open_id' => '',
445
+		'geodir_sidebar_left_open_class' => '',
446
+		'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
447
+		'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->',
448
+		'geodir_main_content_open_id' => '',
449
+		'geodir_main_content_open_class' => '',
450
+		'geodir_main_content_open_replace' => '<!-- removed -->',
451
+		'geodir_main_content_close_replace' => '<!-- removed -->',
452
+		'geodir_top_content_add' => '',
453
+		'geodir_before_main_content_add' => '',
454
+		'geodir_before_widget_filter' => '',
455
+		'geodir_after_widget_filter' => '',
456
+		'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'),
457
+		'geodir_theme_compat_js' => '',
458
+		'geodir_theme_compat_default_options' => '',
459
+		'geodir_theme_compat_code' => 'Avada'
460
+	);
461 461
 
462 462
 //Enfold
463
-    $theme_compat['Enfold'] = array(
464
-        'geodir_wrapper_open_id' => '',
465
-        'geodir_wrapper_open_class' => '',
466
-        'geodir_wrapper_open_replace' => '',
467
-        'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
468
-        'geodir_wrapper_content_open_id' => '',
469
-        'geodir_wrapper_content_open_class' => '',
470
-        'geodir_wrapper_content_open_replace' => '',
471
-        'geodir_wrapper_content_close_replace' => '</div></main>',
472
-        'geodir_article_open_id' => '',
473
-        'geodir_article_open_class' => '',
474
-        'geodir_article_open_replace' => '',
475
-        'geodir_article_close_replace' => '',
476
-        'geodir_sidebar_right_open_id' => '',
477
-        'geodir_sidebar_right_open_class' => '',
478
-        'geodir_sidebar_right_open_replace' => '',
479
-        'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->',
480
-        'geodir_sidebar_left_open_id' => '',
481
-        'geodir_sidebar_left_open_class' => '',
482
-        'geodir_sidebar_left_open_replace' => '',
483
-        'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->',
484
-        'geodir_main_content_open_id' => '',
485
-        'geodir_main_content_open_class' => '',
486
-        'geodir_main_content_open_replace' => '',
487
-        'geodir_main_content_close_replace' => '',
488
-        'geodir_top_content_add' => '',
489
-        'geodir_before_main_content_add' => '',
490
-        'geodir_before_widget_filter' => '',
491
-        'geodir_after_widget_filter' => '',
492
-        'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'),
493
-        'geodir_theme_compat_js' => '',
494
-        'geodir_theme_compat_default_options' => '',
495
-        'geodir_theme_compat_code' => 'Enfold'
496
-    );
463
+	$theme_compat['Enfold'] = array(
464
+		'geodir_wrapper_open_id' => '',
465
+		'geodir_wrapper_open_class' => '',
466
+		'geodir_wrapper_open_replace' => '',
467
+		'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
468
+		'geodir_wrapper_content_open_id' => '',
469
+		'geodir_wrapper_content_open_class' => '',
470
+		'geodir_wrapper_content_open_replace' => '',
471
+		'geodir_wrapper_content_close_replace' => '</div></main>',
472
+		'geodir_article_open_id' => '',
473
+		'geodir_article_open_class' => '',
474
+		'geodir_article_open_replace' => '',
475
+		'geodir_article_close_replace' => '',
476
+		'geodir_sidebar_right_open_id' => '',
477
+		'geodir_sidebar_right_open_class' => '',
478
+		'geodir_sidebar_right_open_replace' => '',
479
+		'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->',
480
+		'geodir_sidebar_left_open_id' => '',
481
+		'geodir_sidebar_left_open_class' => '',
482
+		'geodir_sidebar_left_open_replace' => '',
483
+		'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->',
484
+		'geodir_main_content_open_id' => '',
485
+		'geodir_main_content_open_class' => '',
486
+		'geodir_main_content_open_replace' => '',
487
+		'geodir_main_content_close_replace' => '',
488
+		'geodir_top_content_add' => '',
489
+		'geodir_before_main_content_add' => '',
490
+		'geodir_before_widget_filter' => '',
491
+		'geodir_after_widget_filter' => '',
492
+		'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'),
493
+		'geodir_theme_compat_js' => '',
494
+		'geodir_theme_compat_default_options' => '',
495
+		'geodir_theme_compat_code' => 'Enfold'
496
+	);
497 497
 
498 498
 // X
499
-    $theme_compat['X'] = array(
500
-        'geodir_wrapper_open_id' => '',
501
-        'geodir_wrapper_open_class' => '',
502
-        'geodir_wrapper_open_replace' => '',
503
-        'geodir_wrapper_close_replace' => '',
504
-        'geodir_wrapper_content_open_id' => '',
505
-        'geodir_wrapper_content_open_class' => '',
506
-        'geodir_wrapper_content_open_replace' => '',
507
-        'geodir_wrapper_content_close_replace' => '',
508
-        'geodir_article_open_id' => '',
509
-        'geodir_article_open_class' => '',
510
-        'geodir_article_open_replace' => '',
511
-        'geodir_article_close_replace' => '',
512
-        'geodir_sidebar_right_open_id' => '',
513
-        'geodir_sidebar_right_open_class' => '',
514
-        'geodir_sidebar_right_open_replace' => '',
515
-        'geodir_sidebar_right_close_replace' => '',
516
-        'geodir_sidebar_left_open_id' => '',
517
-        'geodir_sidebar_left_open_class' => '',
518
-        'geodir_sidebar_left_open_replace' => '',
519
-        'geodir_sidebar_left_close_replace' => '',
520
-        'geodir_main_content_open_id' => '',
521
-        'geodir_main_content_open_class' => '',
522
-        'geodir_main_content_open_replace' => '',
523
-        'geodir_main_content_close_replace' => '',
524
-        'geodir_top_content_add' => '',
525
-        'geodir_before_main_content_add' => '',
526
-        'geodir_before_widget_filter' => '',
527
-        'geodir_after_widget_filter' => '',
528
-        'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
529
-        'geodir_theme_compat_js' => '',
530
-        'geodir_theme_compat_default_options' => '',
531
-        'geodir_theme_compat_code' => 'X'
532
-    );
499
+	$theme_compat['X'] = array(
500
+		'geodir_wrapper_open_id' => '',
501
+		'geodir_wrapper_open_class' => '',
502
+		'geodir_wrapper_open_replace' => '',
503
+		'geodir_wrapper_close_replace' => '',
504
+		'geodir_wrapper_content_open_id' => '',
505
+		'geodir_wrapper_content_open_class' => '',
506
+		'geodir_wrapper_content_open_replace' => '',
507
+		'geodir_wrapper_content_close_replace' => '',
508
+		'geodir_article_open_id' => '',
509
+		'geodir_article_open_class' => '',
510
+		'geodir_article_open_replace' => '',
511
+		'geodir_article_close_replace' => '',
512
+		'geodir_sidebar_right_open_id' => '',
513
+		'geodir_sidebar_right_open_class' => '',
514
+		'geodir_sidebar_right_open_replace' => '',
515
+		'geodir_sidebar_right_close_replace' => '',
516
+		'geodir_sidebar_left_open_id' => '',
517
+		'geodir_sidebar_left_open_class' => '',
518
+		'geodir_sidebar_left_open_replace' => '',
519
+		'geodir_sidebar_left_close_replace' => '',
520
+		'geodir_main_content_open_id' => '',
521
+		'geodir_main_content_open_class' => '',
522
+		'geodir_main_content_open_replace' => '',
523
+		'geodir_main_content_close_replace' => '',
524
+		'geodir_top_content_add' => '',
525
+		'geodir_before_main_content_add' => '',
526
+		'geodir_before_widget_filter' => '',
527
+		'geodir_after_widget_filter' => '',
528
+		'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
529
+		'geodir_theme_compat_js' => '',
530
+		'geodir_theme_compat_default_options' => '',
531
+		'geodir_theme_compat_code' => 'X'
532
+	);
533 533
 
534 534
 // Divi
535
-    $theme_compat['Divi'] = array(
536
-        'geodir_wrapper_open_id' => 'main-content',
537
-        'geodir_wrapper_open_class' => '',
538
-        'geodir_wrapper_open_replace' => '',
539
-        'geodir_wrapper_close_replace' => '',
540
-        'geodir_wrapper_content_open_id' => 'left-area',
541
-        'geodir_wrapper_content_open_class' => '',
542
-        'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >',
543
-        'geodir_wrapper_content_close_replace' => '',
544
-        'geodir_article_open_id' => '',
545
-        'geodir_article_open_class' => '',
546
-        'geodir_article_open_replace' => '',
547
-        'geodir_article_close_replace' => '',
548
-        'geodir_sidebar_right_open_id' => 'sidebar',
549
-        'geodir_sidebar_right_open_class' => '',
550
-        'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
551
-        'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
552
-        'geodir_sidebar_left_open_id' => 'sidebar',
553
-        'geodir_sidebar_left_open_class' => '',
554
-        'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
555
-        'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
556
-        'geodir_main_content_open_id' => '',
557
-        'geodir_main_content_open_class' => '',
558
-        'geodir_main_content_open_replace' => '',
559
-        'geodir_main_content_close_replace' => '',
560
-        'geodir_top_content_add' => '',
561
-        'geodir_before_main_content_add' => '',
562
-        'geodir_before_widget_filter' => '',
563
-        'geodir_after_widget_filter' => '',
564
-        'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{padding:0 15px;width:100%}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type=button],.geodir_full_page .geodir-search input[type=submit],.geodir_full_page .geodir-search input[type=text],.geodir_full_page .geodir-search select{display:inline-block;float:none}'),
565
-        'geodir_theme_compat_js' => '',
566
-        'geodir_theme_compat_default_options' => '',
567
-        'geodir_theme_compat_code' => 'Divi'
568
-    );
535
+	$theme_compat['Divi'] = array(
536
+		'geodir_wrapper_open_id' => 'main-content',
537
+		'geodir_wrapper_open_class' => '',
538
+		'geodir_wrapper_open_replace' => '',
539
+		'geodir_wrapper_close_replace' => '',
540
+		'geodir_wrapper_content_open_id' => 'left-area',
541
+		'geodir_wrapper_content_open_class' => '',
542
+		'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >',
543
+		'geodir_wrapper_content_close_replace' => '',
544
+		'geodir_article_open_id' => '',
545
+		'geodir_article_open_class' => '',
546
+		'geodir_article_open_replace' => '',
547
+		'geodir_article_close_replace' => '',
548
+		'geodir_sidebar_right_open_id' => 'sidebar',
549
+		'geodir_sidebar_right_open_class' => '',
550
+		'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
551
+		'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
552
+		'geodir_sidebar_left_open_id' => 'sidebar',
553
+		'geodir_sidebar_left_open_class' => '',
554
+		'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
555
+		'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
556
+		'geodir_main_content_open_id' => '',
557
+		'geodir_main_content_open_class' => '',
558
+		'geodir_main_content_open_replace' => '',
559
+		'geodir_main_content_close_replace' => '',
560
+		'geodir_top_content_add' => '',
561
+		'geodir_before_main_content_add' => '',
562
+		'geodir_before_widget_filter' => '',
563
+		'geodir_after_widget_filter' => '',
564
+		'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{padding:0 15px;width:100%}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type=button],.geodir_full_page .geodir-search input[type=submit],.geodir_full_page .geodir-search input[type=text],.geodir_full_page .geodir-search select{display:inline-block;float:none}'),
565
+		'geodir_theme_compat_js' => '',
566
+		'geodir_theme_compat_default_options' => '',
567
+		'geodir_theme_compat_code' => 'Divi'
568
+	);
569 569
 
570 570
 // Genesis
571
-    $theme_compat['Genesis'] = array(
572
-        'geodir_wrapper_open_id' => '',
573
-        'geodir_wrapper_open_class' => 'content-sidebar-wrap',
574
-        'geodir_wrapper_open_replace' => '',
575
-        'geodir_wrapper_close_replace' => '',
576
-        'geodir_wrapper_content_open_id' => '',
577
-        'geodir_wrapper_content_open_class' => 'content',
578
-        'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >',
579
-        'geodir_wrapper_content_close_replace' => '',
580
-        'geodir_article_open_id' => '',
581
-        'geodir_article_open_class' => '',
582
-        'geodir_article_open_replace' => '',
583
-        'geodir_article_close_replace' => '',
584
-        'geodir_sidebar_right_open_id' => '',
585
-        'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area',
586
-        'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
587
-        'geodir_sidebar_right_close_replace' => '',
588
-        'geodir_sidebar_left_open_id' => '',
589
-        'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area',
590
-        'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
591
-        'geodir_sidebar_left_close_replace' => '',
592
-        'geodir_main_content_open_id' => '',
593
-        'geodir_main_content_open_class' => '',
594
-        'geodir_main_content_open_replace' => '<main  id="[id]" class="entry [class]"  role="main">',
595
-        'geodir_main_content_close_replace' => '',
596
-        'geodir_top_content_add' => '',
597
-        'geodir_before_main_content_add' => '',
598
-        'geodir_before_widget_filter' => '',
599
-        'geodir_after_widget_filter' => '',
600
-        'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher',
601
-        'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'),
602
-        'geodir_theme_compat_js' => '',
603
-        'geodir_theme_compat_default_options' => '',
604
-        'geodir_theme_compat_code' => 'Genesis'
605
-    );
571
+	$theme_compat['Genesis'] = array(
572
+		'geodir_wrapper_open_id' => '',
573
+		'geodir_wrapper_open_class' => 'content-sidebar-wrap',
574
+		'geodir_wrapper_open_replace' => '',
575
+		'geodir_wrapper_close_replace' => '',
576
+		'geodir_wrapper_content_open_id' => '',
577
+		'geodir_wrapper_content_open_class' => 'content',
578
+		'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >',
579
+		'geodir_wrapper_content_close_replace' => '',
580
+		'geodir_article_open_id' => '',
581
+		'geodir_article_open_class' => '',
582
+		'geodir_article_open_replace' => '',
583
+		'geodir_article_close_replace' => '',
584
+		'geodir_sidebar_right_open_id' => '',
585
+		'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area',
586
+		'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
587
+		'geodir_sidebar_right_close_replace' => '',
588
+		'geodir_sidebar_left_open_id' => '',
589
+		'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area',
590
+		'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
591
+		'geodir_sidebar_left_close_replace' => '',
592
+		'geodir_main_content_open_id' => '',
593
+		'geodir_main_content_open_class' => '',
594
+		'geodir_main_content_open_replace' => '<main  id="[id]" class="entry [class]"  role="main">',
595
+		'geodir_main_content_close_replace' => '',
596
+		'geodir_top_content_add' => '',
597
+		'geodir_before_main_content_add' => '',
598
+		'geodir_before_widget_filter' => '',
599
+		'geodir_after_widget_filter' => '',
600
+		'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher',
601
+		'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'),
602
+		'geodir_theme_compat_js' => '',
603
+		'geodir_theme_compat_default_options' => '',
604
+		'geodir_theme_compat_code' => 'Genesis'
605
+	);
606 606
 
607 607
 // Jupiter
608
-    $theme_compat['Jupiter'] = array(
609
-        'geodir_wrapper_open_id' => '',
610
-        'geodir_wrapper_open_class' => '',
611
-        'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div  class="theme-page-wrapper mk-main-wrapper  mk-grid vc_row-fluid">',
612
-        'geodir_wrapper_close_replace' => '</div></div></div>',
613
-        'geodir_wrapper_content_open_id' => '',
614
-        'geodir_wrapper_content_open_class' => '',
615
-        'geodir_wrapper_content_open_replace' => '',
616
-        'geodir_wrapper_content_close_replace' => '',
617
-        'geodir_article_open_id' => '',
618
-        'geodir_article_open_class' => '',
619
-        'geodir_article_open_replace' => '',
620
-        'geodir_article_close_replace' => '',
621
-        'geodir_sidebar_right_open_id' => 'mk-sidebar',
622
-        'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
623
-        'geodir_sidebar_right_open_replace' => '',
624
-        'geodir_sidebar_right_close_replace' => '',
625
-        'geodir_sidebar_left_open_id' => 'mk-sidebar',
626
-        'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
627
-        'geodir_sidebar_left_open_replace' => '',
628
-        'geodir_sidebar_left_close_replace' => '',
629
-        'geodir_main_content_open_id' => '',
630
-        'geodir_main_content_open_class' => '',
631
-        'geodir_main_content_open_replace' => '',
632
-        'geodir_main_content_close_replace' => '',
633
-        'geodir_top_content_add' => '',
634
-        'geodir_before_main_content_add' => '',
635
-        'geodir_before_widget_filter' => '',
636
-        'geodir_after_widget_filter' => '',
637
-        'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">',
638
-        'geodir_after_title_filter' => '',
639
-        'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu',
640
-        'geodir_sub_menu_ul_class_filter' => '',
641
-        'geodir_sub_menu_li_class_filter' => '',
642
-        'geodir_menu_a_class_filter' => 'menu-item-link',
643
-        'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item',
644
-        'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu',
645
-        'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link',
646
-        'geodir_location_switcher_menu_sub_ul_class_filter' => '',
647
-        'geodir_location_switcher_menu_sub_li_class_filter' => '',
648
-        'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
649
-        'geodir_theme_compat_js' => '',
650
-        'geodir_theme_compat_default_options' => '',
651
-        'geodir_theme_compat_code' => 'Jupiter'
652
-    );
608
+	$theme_compat['Jupiter'] = array(
609
+		'geodir_wrapper_open_id' => '',
610
+		'geodir_wrapper_open_class' => '',
611
+		'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div  class="theme-page-wrapper mk-main-wrapper  mk-grid vc_row-fluid">',
612
+		'geodir_wrapper_close_replace' => '</div></div></div>',
613
+		'geodir_wrapper_content_open_id' => '',
614
+		'geodir_wrapper_content_open_class' => '',
615
+		'geodir_wrapper_content_open_replace' => '',
616
+		'geodir_wrapper_content_close_replace' => '',
617
+		'geodir_article_open_id' => '',
618
+		'geodir_article_open_class' => '',
619
+		'geodir_article_open_replace' => '',
620
+		'geodir_article_close_replace' => '',
621
+		'geodir_sidebar_right_open_id' => 'mk-sidebar',
622
+		'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
623
+		'geodir_sidebar_right_open_replace' => '',
624
+		'geodir_sidebar_right_close_replace' => '',
625
+		'geodir_sidebar_left_open_id' => 'mk-sidebar',
626
+		'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
627
+		'geodir_sidebar_left_open_replace' => '',
628
+		'geodir_sidebar_left_close_replace' => '',
629
+		'geodir_main_content_open_id' => '',
630
+		'geodir_main_content_open_class' => '',
631
+		'geodir_main_content_open_replace' => '',
632
+		'geodir_main_content_close_replace' => '',
633
+		'geodir_top_content_add' => '',
634
+		'geodir_before_main_content_add' => '',
635
+		'geodir_before_widget_filter' => '',
636
+		'geodir_after_widget_filter' => '',
637
+		'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">',
638
+		'geodir_after_title_filter' => '',
639
+		'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu',
640
+		'geodir_sub_menu_ul_class_filter' => '',
641
+		'geodir_sub_menu_li_class_filter' => '',
642
+		'geodir_menu_a_class_filter' => 'menu-item-link',
643
+		'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item',
644
+		'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu',
645
+		'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link',
646
+		'geodir_location_switcher_menu_sub_ul_class_filter' => '',
647
+		'geodir_location_switcher_menu_sub_li_class_filter' => '',
648
+		'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
649
+		'geodir_theme_compat_js' => '',
650
+		'geodir_theme_compat_default_options' => '',
651
+		'geodir_theme_compat_code' => 'Jupiter'
652
+	);
653 653
 
654 654
 // Multi News
655
-    $theme_compat['Multi_News'] = array(
656
-        'geodir_wrapper_open_id' => '',
657
-        'geodir_wrapper_open_class' => 'main-container clearfix',
658
-        'geodir_wrapper_open_replace' => '',
659
-        'geodir_wrapper_close_replace' => '',
660
-        'geodir_wrapper_content_open_id' => '',
661
-        'geodir_wrapper_content_open_class' => '',
662
-        'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content  "><div class="site-content page-wrap">',
663
-        'geodir_wrapper_content_close_replace' => '</div></div></div>',
664
-        'geodir_article_open_id' => '',
665
-        'geodir_article_open_class' => '',
666
-        'geodir_article_open_replace' => '',
667
-        'geodir_article_close_replace' => '',
668
-        'geodir_sidebar_right_open_id' => '',
669
-        'geodir_sidebar_right_open_class' => '',
670
-        'geodir_sidebar_right_open_replace' => '<aside  class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
671
-        'geodir_sidebar_right_close_replace' => '',
672
-        'geodir_sidebar_left_open_id' => '',
673
-        'geodir_sidebar_left_open_class' => '',
674
-        'geodir_sidebar_left_open_replace' => '<aside  class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
675
-        'geodir_sidebar_left_close_replace' => '',
676
-        'geodir_main_content_open_id' => '',
677
-        'geodir_main_content_open_class' => '',
678
-        'geodir_main_content_open_replace' => '<div class="site-content page-wrap">',
679
-        'geodir_main_content_close_replace' => '</div>',
680
-        'geodir_top_content_add' => '',
681
-        'geodir_before_main_content_add' => '',
682
-        'geodir_full_page_class_filter' => 'section full-width-section',
683
-        'geodir_before_widget_filter' => '',
684
-        'geodir_after_widget_filter' => '',
685
-        'geodir_before_title_filter' => '<div class="widget-title"><h2>',
686
-        'geodir_after_title_filter' => '</h2></div>',
687
-        'geodir_menu_li_class_filter' => '',
688
-        'geodir_sub_menu_ul_class_filter' => '',
689
-        'geodir_sub_menu_li_class_filter' => '',
690
-        'geodir_menu_a_class_filter' => '',
691
-        'geodir_sub_menu_a_class_filter' => '',
692
-        'geodir_location_switcher_menu_li_class_filter' => '',
693
-        'geodir_location_switcher_menu_a_class_filter' => '',
694
-        'geodir_location_switcher_menu_sub_ul_class_filter' => '',
695
-        'geodir_location_switcher_menu_sub_li_class_filter' => '',
696
-        'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'),
697
-        'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});',
698
-        'geodir_theme_compat_default_options' => '',
699
-        'geodir_theme_compat_code' => 'Multi_News'
700
-    );
701
-
702
-    // Kelo
703
-    $theme_compat['Kleo'] = array(
704
-        'geodir_theme_compat_code' => 'Kleo'
705
-    );
706
-
707
-
708
-    // Twenty Seventeen
709
-    $theme_compat['Twenty_Seventeen'] = array(
710
-        'geodir_wrapper_open_replace' => '<div class="wrap">',
711
-        'geodir_wrapper_content_open_replace' => '<div id="primary" class="content-area" >',
712
-        'geodir_sidebar_right_open_replace' => '<aside id="secondary"  class="widget-area" itemscope itemtype="[itemtype]" >',
713
-        'geodir_sidebar_left_open_replace' => '<aside id="secondary"  class="widget-area" itemscope itemtype="[itemtype]" >',
714
-        'geodir_theme_compat_css' => stripslashes('body.geodir-page #primary header.entry-header {margin-left:0;float:none !important;} .gxeodir_flex-container{float:left;} .geodir-tabs-content.entry-content{width:100% !important;} dl.geodir-tab-head, .geodir_map_container {z-index:2;} .geodir-cat-list ul.geodir-popular-cat-list  li + li {    margin-top: 0;} .geodir-cat-list .geodir-popular-cat-list a img, .entry-content .gm-style a img, .widget .gm-style a img {    box-sizing: none; -webkit-box-shadow: none; -moz-box-shadow: none;}'),
715
-        'geodir_theme_compat_code' => 'Twenty_Seventeen'
716
-    );
717
-
718
-
719
-    update_option('gd_theme_compats', $theme_compat);
720
-
721
-    gd_set_theme_compat();// set the compat pack if avail
655
+	$theme_compat['Multi_News'] = array(
656
+		'geodir_wrapper_open_id' => '',
657
+		'geodir_wrapper_open_class' => 'main-container clearfix',
658
+		'geodir_wrapper_open_replace' => '',
659
+		'geodir_wrapper_close_replace' => '',
660
+		'geodir_wrapper_content_open_id' => '',
661
+		'geodir_wrapper_content_open_class' => '',
662
+		'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content  "><div class="site-content page-wrap">',
663
+		'geodir_wrapper_content_close_replace' => '</div></div></div>',
664
+		'geodir_article_open_id' => '',
665
+		'geodir_article_open_class' => '',
666
+		'geodir_article_open_replace' => '',
667
+		'geodir_article_close_replace' => '',
668
+		'geodir_sidebar_right_open_id' => '',
669
+		'geodir_sidebar_right_open_class' => '',
670
+		'geodir_sidebar_right_open_replace' => '<aside  class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
671
+		'geodir_sidebar_right_close_replace' => '',
672
+		'geodir_sidebar_left_open_id' => '',
673
+		'geodir_sidebar_left_open_class' => '',
674
+		'geodir_sidebar_left_open_replace' => '<aside  class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
675
+		'geodir_sidebar_left_close_replace' => '',
676
+		'geodir_main_content_open_id' => '',
677
+		'geodir_main_content_open_class' => '',
678
+		'geodir_main_content_open_replace' => '<div class="site-content page-wrap">',
679
+		'geodir_main_content_close_replace' => '</div>',
680
+		'geodir_top_content_add' => '',
681
+		'geodir_before_main_content_add' => '',
682
+		'geodir_full_page_class_filter' => 'section full-width-section',
683
+		'geodir_before_widget_filter' => '',
684
+		'geodir_after_widget_filter' => '',
685
+		'geodir_before_title_filter' => '<div class="widget-title"><h2>',
686
+		'geodir_after_title_filter' => '</h2></div>',
687
+		'geodir_menu_li_class_filter' => '',
688
+		'geodir_sub_menu_ul_class_filter' => '',
689
+		'geodir_sub_menu_li_class_filter' => '',
690
+		'geodir_menu_a_class_filter' => '',
691
+		'geodir_sub_menu_a_class_filter' => '',
692
+		'geodir_location_switcher_menu_li_class_filter' => '',
693
+		'geodir_location_switcher_menu_a_class_filter' => '',
694
+		'geodir_location_switcher_menu_sub_ul_class_filter' => '',
695
+		'geodir_location_switcher_menu_sub_li_class_filter' => '',
696
+		'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'),
697
+		'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});',
698
+		'geodir_theme_compat_default_options' => '',
699
+		'geodir_theme_compat_code' => 'Multi_News'
700
+	);
701
+
702
+	// Kelo
703
+	$theme_compat['Kleo'] = array(
704
+		'geodir_theme_compat_code' => 'Kleo'
705
+	);
706
+
707
+
708
+	// Twenty Seventeen
709
+	$theme_compat['Twenty_Seventeen'] = array(
710
+		'geodir_wrapper_open_replace' => '<div class="wrap">',
711
+		'geodir_wrapper_content_open_replace' => '<div id="primary" class="content-area" >',
712
+		'geodir_sidebar_right_open_replace' => '<aside id="secondary"  class="widget-area" itemscope itemtype="[itemtype]" >',
713
+		'geodir_sidebar_left_open_replace' => '<aside id="secondary"  class="widget-area" itemscope itemtype="[itemtype]" >',
714
+		'geodir_theme_compat_css' => stripslashes('body.geodir-page #primary header.entry-header {margin-left:0;float:none !important;} .gxeodir_flex-container{float:left;} .geodir-tabs-content.entry-content{width:100% !important;} dl.geodir-tab-head, .geodir_map_container {z-index:2;} .geodir-cat-list ul.geodir-popular-cat-list  li + li {    margin-top: 0;} .geodir-cat-list .geodir-popular-cat-list a img, .entry-content .gm-style a img, .widget .gm-style a img {    box-sizing: none; -webkit-box-shadow: none; -moz-box-shadow: none;}'),
715
+		'geodir_theme_compat_code' => 'Twenty_Seventeen'
716
+	);
717
+
718
+
719
+	update_option('gd_theme_compats', $theme_compat);
720
+
721
+	gd_set_theme_compat();// set the compat pack if avail
722 722
 }
723 723
 
724 724
 
@@ -730,61 +730,61 @@  discard block
 block discarded – undo
730 730
  * @global object $wpdb WordPress Database object.
731 731
  */
732 732
 function gd_convert_virtual_pages(){
733
-    global $wpdb;
734
-
735
-    // Update the add listing page settings
736
-    $add_listing_page = $wpdb->get_var(
737
-        $wpdb->prepare(
738
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
739
-            array('add-listing')
740
-        )
741
-    );
742
-
743
-    if($add_listing_page){
744
-        wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
745
-        update_option( 'geodir_add_listing_page', $add_listing_page);
746
-    }
747
-
748
-    // Update the listing preview page settings
749
-    $listing_preview_page = $wpdb->get_var(
750
-        $wpdb->prepare(
751
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
752
-            array('listing-preview')
753
-        )
754
-    );
755
-
756
-    if($listing_preview_page){
757
-        wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
758
-        update_option( 'geodir_preview_page', $listing_preview_page);
759
-    }
760
-
761
-    // Update the listing success page settings
762
-    $listing_success_page = $wpdb->get_var(
763
-        $wpdb->prepare(
764
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
765
-            array('listing-success')
766
-        )
767
-    );
768
-
769
-    if($listing_success_page){
770
-        wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
771
-        update_option( 'geodir_success_page', $listing_success_page);
772
-    }
773
-
774
-    // Update the listing success page settings
775
-    $location_page = $wpdb->get_var(
776
-        $wpdb->prepare(
777
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
778
-            array('location')
779
-        )
780
-    );
781
-
782
-    if($location_page){
783
-        $location_slug = get_option('geodir_location_prefix');
784
-        if(!$location_slug ){$location_slug  = 'location';}
785
-        wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
786
-        update_option( 'geodir_location_page', $location_page);
787
-    }
733
+	global $wpdb;
734
+
735
+	// Update the add listing page settings
736
+	$add_listing_page = $wpdb->get_var(
737
+		$wpdb->prepare(
738
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
739
+			array('add-listing')
740
+		)
741
+	);
742
+
743
+	if($add_listing_page){
744
+		wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
745
+		update_option( 'geodir_add_listing_page', $add_listing_page);
746
+	}
747
+
748
+	// Update the listing preview page settings
749
+	$listing_preview_page = $wpdb->get_var(
750
+		$wpdb->prepare(
751
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
752
+			array('listing-preview')
753
+		)
754
+	);
755
+
756
+	if($listing_preview_page){
757
+		wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
758
+		update_option( 'geodir_preview_page', $listing_preview_page);
759
+	}
760
+
761
+	// Update the listing success page settings
762
+	$listing_success_page = $wpdb->get_var(
763
+		$wpdb->prepare(
764
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
765
+			array('listing-success')
766
+		)
767
+	);
768
+
769
+	if($listing_success_page){
770
+		wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
771
+		update_option( 'geodir_success_page', $listing_success_page);
772
+	}
773
+
774
+	// Update the listing success page settings
775
+	$location_page = $wpdb->get_var(
776
+		$wpdb->prepare(
777
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
778
+			array('location')
779
+		)
780
+	);
781
+
782
+	if($location_page){
783
+		$location_slug = get_option('geodir_location_prefix');
784
+		if(!$location_slug ){$location_slug  = 'location';}
785
+		wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
786
+		update_option( 'geodir_location_page', $location_page);
787
+	}
788 788
 
789 789
 }
790 790
 
@@ -798,31 +798,31 @@  discard block
 block discarded – undo
798 798
 function gd_fix_cpt_rewrite_slug()
799 799
 {
800 800
 
801
-    $alt_post_types = array();
802
-    $post_types = get_option('geodir_post_types');
801
+	$alt_post_types = array();
802
+	$post_types = get_option('geodir_post_types');
803 803
 
804 804
 
805
-    if (is_array($post_types)){
805
+	if (is_array($post_types)){
806 806
 
807
-        foreach ($post_types as $post_type => $args) {
807
+		foreach ($post_types as $post_type => $args) {
808 808
 
809 809
 
810
-            if(isset($args['rewrite']['slug'])){
811
-                $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
812
-            }
810
+			if(isset($args['rewrite']['slug'])){
811
+				$args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
812
+			}
813 813
 
814
-                $alt_post_types[$post_type] = $args;
814
+				$alt_post_types[$post_type] = $args;
815 815
 
816
-        }
817
-    }
816
+		}
817
+	}
818 818
 
819
-    if(!empty($alt_post_types)) {
820
-        update_option('geodir_post_types',$alt_post_types);
821
-        }
819
+	if(!empty($alt_post_types)) {
820
+		update_option('geodir_post_types',$alt_post_types);
821
+		}
822 822
 
823 823
 
824
-    // flush the rewrite rules
825
-    flush_rewrite_rules();
824
+	// flush the rewrite rules
825
+	flush_rewrite_rules();
826 826
 }
827 827
 
828 828
 
@@ -835,18 +835,18 @@  discard block
 block discarded – undo
835 835
  */
836 836
 function gd_fix_address_detail_table_limit()
837 837
 {
838
-    global $wpdb;
839
-
840
-    $all_postypes = geodir_get_posttypes();
841
-
842
-    if (!empty($all_postypes)) {
843
-        foreach ($all_postypes as $key) {
844
-            // update each GD CTP
845
-            try {
846
-                $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
847
-            } catch(Exception $e) {
848
-                error_log( 'Error: ' . $e->getMessage() );
849
-            }
850
-        }
851
-    }
838
+	global $wpdb;
839
+
840
+	$all_postypes = geodir_get_posttypes();
841
+
842
+	if (!empty($all_postypes)) {
843
+		foreach ($all_postypes as $key) {
844
+			// update each GD CTP
845
+			try {
846
+				$wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
847
+			} catch(Exception $e) {
848
+				error_log( 'Error: ' . $e->getMessage() );
849
+			}
850
+		}
851
+	}
852 852
 }
Please login to merge, or discard this patch.