@@ -38,13 +38,13 @@ |
||
38 | 38 | <?php |
39 | 39 | global $geodir_signup_error; |
40 | 40 | if ($geodir_signup_error != '') { |
41 | - echo '<p class="error_msg">' . $geodir_signup_error . '</p>'; |
|
41 | + echo '<p class="error_msg">'.$geodir_signup_error.'</p>'; |
|
42 | 42 | unset($geodir_signup_error); |
43 | 43 | } else { |
44 | 44 | if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 1) { |
45 | - echo '<p class="error_msg">' . EMAIL_USERNAME_EXIST_MSG . '</p>'; |
|
45 | + echo '<p class="error_msg">'.EMAIL_USERNAME_EXIST_MSG.'</p>'; |
|
46 | 46 | } else if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'regnewusr') { |
47 | - echo '<p class="error_msg">' . REGISTRATION_DESABLED_MSG . '</p>'; |
|
47 | + echo '<p class="error_msg">'.REGISTRATION_DESABLED_MSG.'</p>'; |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | ?> |
@@ -9,13 +9,13 @@ discard block |
||
9 | 9 | * @package GeoDirectory |
10 | 10 | */ |
11 | 11 | if (isset($_GET['redirect_to']) && $_GET['redirect_to'] != '') { |
12 | - $redirect_to = $_GET['redirect_to']; |
|
12 | + $redirect_to = $_GET['redirect_to']; |
|
13 | 13 | } else { |
14 | - //echo $_SERVER['HTTP_HOST'] ; |
|
15 | - $redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; |
|
16 | - if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) { |
|
17 | - $redirect_to = home_url(); |
|
18 | - } |
|
14 | + //echo $_SERVER['HTTP_HOST'] ; |
|
15 | + $redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; |
|
16 | + if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) { |
|
17 | + $redirect_to = home_url(); |
|
18 | + } |
|
19 | 19 | } |
20 | 20 | ?> |
21 | 21 | <div id="sign_up"> |
@@ -26,28 +26,28 @@ discard block |
||
26 | 26 | <h4> |
27 | 27 | <?php |
28 | 28 | |
29 | - /** |
|
30 | - * Filter the `REGISTRATION_NOW_TEXT` title text on the register form template. |
|
31 | - * |
|
32 | - * @since 1.0.0 |
|
33 | - */ |
|
34 | - echo apply_filters('geodir_registration_page_title', REGISTRATION_NOW_TEXT); |
|
29 | + /** |
|
30 | + * Filter the `REGISTRATION_NOW_TEXT` title text on the register form template. |
|
31 | + * |
|
32 | + * @since 1.0.0 |
|
33 | + */ |
|
34 | + echo apply_filters('geodir_registration_page_title', REGISTRATION_NOW_TEXT); |
|
35 | 35 | |
36 | - ?> |
|
36 | + ?> |
|
37 | 37 | </h4> |
38 | 38 | <?php |
39 | - global $geodir_signup_error; |
|
40 | - if ($geodir_signup_error != '') { |
|
41 | - echo '<p class="error_msg">' . $geodir_signup_error . '</p>'; |
|
42 | - unset($geodir_signup_error); |
|
43 | - } else { |
|
44 | - if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 1) { |
|
45 | - echo '<p class="error_msg">' . EMAIL_USERNAME_EXIST_MSG . '</p>'; |
|
46 | - } else if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'regnewusr') { |
|
47 | - echo '<p class="error_msg">' . REGISTRATION_DESABLED_MSG . '</p>'; |
|
48 | - } |
|
49 | - } |
|
50 | - ?> |
|
39 | + global $geodir_signup_error; |
|
40 | + if ($geodir_signup_error != '') { |
|
41 | + echo '<p class="error_msg">' . $geodir_signup_error . '</p>'; |
|
42 | + unset($geodir_signup_error); |
|
43 | + } else { |
|
44 | + if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 1) { |
|
45 | + echo '<p class="error_msg">' . EMAIL_USERNAME_EXIST_MSG . '</p>'; |
|
46 | + } else if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'regnewusr') { |
|
47 | + echo '<p class="error_msg">' . REGISTRATION_DESABLED_MSG . '</p>'; |
|
48 | + } |
|
49 | + } |
|
50 | + ?> |
|
51 | 51 | |
52 | 52 | <form name="cus_registerform" id="cus_registerform" method="post"> |
53 | 53 | <input type="hidden" name="action" value="register"/> |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | <div class="form_row clearfix"> |
58 | 58 | <input placeholder='<?php echo FIRST_NAME_TEXT; ?>' type="text" name="user_fname" id="user_fname" |
59 | 59 | class="textfield" value="<?php if (isset($user_fname)) { |
60 | - echo esc_attr(stripslashes($user_fname)); |
|
61 | - } ?>" size="25"/> |
|
60 | + echo esc_attr(stripslashes($user_fname)); |
|
61 | + } ?>" size="25"/> |
|
62 | 62 | <span id="user_fnameInfo"></span> |
63 | 63 | </div> |
64 | 64 | </div> |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | <div class="form_row clearfix"> |
67 | 67 | <input placeholder='<?php echo EMAIL_TEXT; ?>' type="text" name="user_email" id="user_email" |
68 | 68 | class="textfield" value="<?php global $user_email; |
69 | - if (!isset($user_email)) { |
|
70 | - $user_email = ''; |
|
71 | - } |
|
72 | - echo esc_attr(stripslashes($user_email)); ?>" size="25"/> |
|
69 | + if (!isset($user_email)) { |
|
70 | + $user_email = ''; |
|
71 | + } |
|
72 | + echo esc_attr(stripslashes($user_email)); ?>" size="25"/> |
|
73 | 73 | |
74 | 74 | <?php if (!get_option('geodir_allow_cpass')) { ?> |
75 | 75 | <div id="reg_passmail"> |
@@ -100,14 +100,14 @@ discard block |
||
100 | 100 | <?php } ?> |
101 | 101 | |
102 | 102 | <?php |
103 | - /** |
|
104 | - * Called just before the register new user button on the register form template. |
|
105 | - * |
|
106 | - * Also used by other plugins to add social connect buttons. |
|
107 | - * |
|
108 | - * @since 1.0.0 |
|
109 | - */ |
|
110 | - do_action('social_connect_form'); ?> |
|
103 | + /** |
|
104 | + * Called just before the register new user button on the register form template. |
|
105 | + * |
|
106 | + * Also used by other plugins to add social connect buttons. |
|
107 | + * |
|
108 | + * @since 1.0.0 |
|
109 | + */ |
|
110 | + do_action('social_connect_form'); ?> |
|
111 | 111 | <input type="submit" name="registernow" value="<?php echo REGISTER_NOW_TEXT; ?>" class="geodir_button"/> |
112 | 112 | </form> |
113 | 113 | </div> |
@@ -74,17 +74,20 @@ discard block |
||
74 | 74 | $tab_link = $args['url']; |
75 | 75 | } |
76 | 76 | |
77 | - if (!empty($args['request'])) |
|
78 | - $tab_link = geodir_getlink($tab_link, $args['request']); |
|
77 | + if (!empty($args['request'])) { |
|
78 | + $tab_link = geodir_getlink($tab_link, $args['request']); |
|
79 | + } |
|
79 | 80 | |
80 | 81 | if (isset($args['target']) && $args['target'] != '') { |
81 | 82 | $tab_target = " target='" . sanitize_text_field($args['target']) . "' "; |
82 | - } else |
|
83 | - $tab_target = ''; |
|
83 | + } else { |
|
84 | + $tab_target = ''; |
|
85 | + } |
|
84 | 86 | |
85 | 87 | $tab_active = ''; |
86 | - if ($current_tab == $name) |
|
87 | - $tab_active = ' class="tab-active" '; |
|
88 | + if ($current_tab == $name) { |
|
89 | + $tab_active = ' class="tab-active" '; |
|
90 | + } |
|
88 | 91 | /** |
89 | 92 | * Called before the individual settings tabs are output. |
90 | 93 | * |
@@ -122,8 +125,9 @@ discard block |
||
122 | 125 | |
123 | 126 | <?php |
124 | 127 | unset($subtabs); |
125 | - if (isset($tabs[$current_tab]['subtabs'])) |
|
126 | - $subtabs = $tabs[$current_tab]['subtabs']; |
|
128 | + if (isset($tabs[$current_tab]['subtabs'])) { |
|
129 | + $subtabs = $tabs[$current_tab]['subtabs']; |
|
130 | + } |
|
127 | 131 | $form_action = ''; |
128 | 132 | |
129 | 133 | if (!empty($subtabs)): |
@@ -189,7 +193,10 @@ discard block |
||
189 | 193 | jQuery('#last_tab').val( jQuery(this).attr('href') ); |
190 | 194 | return false;*/ |
191 | 195 | }); |
192 | - <?php if (isset($_GET['subtab']) && $_GET['subtab']) echo 'jQuery(\'ul.subsubsub li a[href="#' . sanitize_text_field($_GET['subtab']) . '"]\').click();'; ?> |
|
196 | + <?php if (isset($_GET['subtab']) && $_GET['subtab']) { |
|
197 | + echo 'jQuery(\'ul.subsubsub li a[href="#' . sanitize_text_field($_GET['subtab']) . '"]\').click();'; |
|
198 | +} |
|
199 | +?> |
|
193 | 200 | // Countries |
194 | 201 | jQuery('select#geodirectory_allowed_countries').change(function () { |
195 | 202 | if (jQuery(this).val() == "specific") { |
@@ -312,10 +319,11 @@ discard block |
||
312 | 319 | geodir_register_defaults(); |
313 | 320 | }*/ |
314 | 321 | |
315 | - if (isset($_REQUEST['active_tab']) && ($_REQUEST['active_tab'] == 'dummy_data_settings' || $_REQUEST['active_tab'] == 'csv_upload_settings')) |
|
316 | - $hide_save_button = "style='display:none;'"; |
|
317 | - else |
|
318 | - $hide_save_button = ''; |
|
322 | + if (isset($_REQUEST['active_tab']) && ($_REQUEST['active_tab'] == 'dummy_data_settings' || $_REQUEST['active_tab'] == 'csv_upload_settings')) { |
|
323 | + $hide_save_button = "style='display:none;'"; |
|
324 | + } else { |
|
325 | + $hide_save_button = ''; |
|
326 | + } |
|
319 | 327 | |
320 | 328 | /** |
321 | 329 | * Filter weather the default save button in the GD admin settings pages should be shown. |
@@ -7,33 +7,33 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | if (!function_exists('geodir_admin_panel')) { |
10 | - /** |
|
11 | - * GeoDirectory Backend Admin Panel. |
|
12 | - * |
|
13 | - * Handles the display of the main GeoDirectory admin panel. |
|
14 | - * |
|
15 | - * @since 1.0.0 |
|
16 | - * @package GeoDirectory |
|
17 | - * @global string $current_tab Current tab in geodirectory settings. |
|
18 | - * @global object $geodirectory GeoDirectory plugin object. |
|
19 | - */ |
|
20 | - function geodir_admin_panel() |
|
21 | - { |
|
22 | - global $geodirectory; |
|
23 | - global $current_tab; |
|
24 | - |
|
25 | - |
|
26 | - ?> |
|
10 | + /** |
|
11 | + * GeoDirectory Backend Admin Panel. |
|
12 | + * |
|
13 | + * Handles the display of the main GeoDirectory admin panel. |
|
14 | + * |
|
15 | + * @since 1.0.0 |
|
16 | + * @package GeoDirectory |
|
17 | + * @global string $current_tab Current tab in geodirectory settings. |
|
18 | + * @global object $geodirectory GeoDirectory plugin object. |
|
19 | + */ |
|
20 | + function geodir_admin_panel() |
|
21 | + { |
|
22 | + global $geodirectory; |
|
23 | + global $current_tab; |
|
24 | + |
|
25 | + |
|
26 | + ?> |
|
27 | 27 | |
28 | 28 | <div id="gd-wrapper-main" class="wrap geodirectory"> |
29 | 29 | <?php |
30 | - /** |
|
31 | - * Called just after the opening wrapper div for the GD settings page in the admin area. |
|
32 | - * |
|
33 | - * @since 1.0.0 |
|
34 | - */ |
|
35 | - do_action('geodir_before_admin_panel'); |
|
36 | - ?> |
|
30 | + /** |
|
31 | + * Called just after the opening wrapper div for the GD settings page in the admin area. |
|
32 | + * |
|
33 | + * @since 1.0.0 |
|
34 | + */ |
|
35 | + do_action('geodir_before_admin_panel'); |
|
36 | + ?> |
|
37 | 37 | |
38 | 38 | <div class="gd-wrapper gd-wrapper-vr clearfix"> |
39 | 39 | |
@@ -44,75 +44,75 @@ discard block |
||
44 | 44 | alt="geo-logo" class="geo-logoalter"/> |
45 | 45 | <ul> |
46 | 46 | <?php |
47 | - $tabs = array(); |
|
48 | - /** |
|
49 | - * Filter the GD admin settings tabs on the left of the admin menu. |
|
50 | - * |
|
51 | - * @since 1.0.0 |
|
52 | - * @param array $tabs The array of tabs to display. |
|
53 | - */ |
|
54 | - $tabs = apply_filters('geodir_settings_tabs_array', $tabs); |
|
55 | - update_option('geodir_tabs', $tabs);// Important to show settings menu dropdown |
|
56 | - |
|
57 | - foreach ($tabs as $name => $args) : |
|
58 | - $label = $args['label']; |
|
59 | - |
|
60 | - |
|
61 | - $query_string = ''; |
|
62 | - if (isset($args['subtabs']) && !empty($args['subtabs'])): |
|
63 | - |
|
64 | - $subtabs = $args['subtabs']; |
|
65 | - |
|
66 | - $query_string = '&subtab=' . $subtabs[0]['subtab']; |
|
67 | - |
|
68 | - endif; |
|
69 | - |
|
70 | - |
|
71 | - $tab_link = admin_url('admin.php?page=geodirectory&tab=' . $name . $query_string); |
|
72 | - |
|
73 | - if (isset($args['url']) && $args['url'] != '') { |
|
74 | - $tab_link = $args['url']; |
|
75 | - } |
|
76 | - |
|
77 | - if (!empty($args['request'])) |
|
78 | - $tab_link = geodir_getlink($tab_link, $args['request']); |
|
79 | - |
|
80 | - if (isset($args['target']) && $args['target'] != '') { |
|
81 | - $tab_target = " target='" . sanitize_text_field($args['target']) . "' "; |
|
82 | - } else |
|
83 | - $tab_target = ''; |
|
84 | - |
|
85 | - $tab_active = ''; |
|
86 | - if ($current_tab == $name) |
|
87 | - $tab_active = ' class="tab-active" '; |
|
88 | - /** |
|
89 | - * Called before the individual settings tabs are output. |
|
90 | - * |
|
91 | - * @since 1.0.0 |
|
92 | - * @param string $name The name of the settings tab. |
|
93 | - * @see 'geodir_after_settings_tabs' |
|
94 | - */ |
|
95 | - do_action('geodir_before_settings_tabs', $name); |
|
96 | - echo '<li ' . $tab_active . ' ><a href="' . esc_url($tab_link) . '" ' . $tab_target . ' >' . $label . '</a></li>'; |
|
97 | - /** |
|
98 | - * Called after the individual settings tabs are output. |
|
99 | - * |
|
100 | - * @since 1.0.0 |
|
101 | - * @param string $name The name of the settings tab. |
|
102 | - * @see 'geodir_before_settings_tabs' |
|
103 | - */ |
|
104 | - do_action('geodir_after_settings_tabs', $name); |
|
105 | - endforeach; |
|
106 | - |
|
107 | - /** |
|
108 | - * Called after the GD settings tabs have been output. |
|
109 | - * |
|
110 | - * Called before the closing `ul` so can be used to add new settings tab links. |
|
111 | - * |
|
112 | - * @since 1.0.0 |
|
113 | - */ |
|
114 | - do_action('geodir_settings_tabs'); |
|
115 | - ?> |
|
47 | + $tabs = array(); |
|
48 | + /** |
|
49 | + * Filter the GD admin settings tabs on the left of the admin menu. |
|
50 | + * |
|
51 | + * @since 1.0.0 |
|
52 | + * @param array $tabs The array of tabs to display. |
|
53 | + */ |
|
54 | + $tabs = apply_filters('geodir_settings_tabs_array', $tabs); |
|
55 | + update_option('geodir_tabs', $tabs);// Important to show settings menu dropdown |
|
56 | + |
|
57 | + foreach ($tabs as $name => $args) : |
|
58 | + $label = $args['label']; |
|
59 | + |
|
60 | + |
|
61 | + $query_string = ''; |
|
62 | + if (isset($args['subtabs']) && !empty($args['subtabs'])): |
|
63 | + |
|
64 | + $subtabs = $args['subtabs']; |
|
65 | + |
|
66 | + $query_string = '&subtab=' . $subtabs[0]['subtab']; |
|
67 | + |
|
68 | + endif; |
|
69 | + |
|
70 | + |
|
71 | + $tab_link = admin_url('admin.php?page=geodirectory&tab=' . $name . $query_string); |
|
72 | + |
|
73 | + if (isset($args['url']) && $args['url'] != '') { |
|
74 | + $tab_link = $args['url']; |
|
75 | + } |
|
76 | + |
|
77 | + if (!empty($args['request'])) |
|
78 | + $tab_link = geodir_getlink($tab_link, $args['request']); |
|
79 | + |
|
80 | + if (isset($args['target']) && $args['target'] != '') { |
|
81 | + $tab_target = " target='" . sanitize_text_field($args['target']) . "' "; |
|
82 | + } else |
|
83 | + $tab_target = ''; |
|
84 | + |
|
85 | + $tab_active = ''; |
|
86 | + if ($current_tab == $name) |
|
87 | + $tab_active = ' class="tab-active" '; |
|
88 | + /** |
|
89 | + * Called before the individual settings tabs are output. |
|
90 | + * |
|
91 | + * @since 1.0.0 |
|
92 | + * @param string $name The name of the settings tab. |
|
93 | + * @see 'geodir_after_settings_tabs' |
|
94 | + */ |
|
95 | + do_action('geodir_before_settings_tabs', $name); |
|
96 | + echo '<li ' . $tab_active . ' ><a href="' . esc_url($tab_link) . '" ' . $tab_target . ' >' . $label . '</a></li>'; |
|
97 | + /** |
|
98 | + * Called after the individual settings tabs are output. |
|
99 | + * |
|
100 | + * @since 1.0.0 |
|
101 | + * @param string $name The name of the settings tab. |
|
102 | + * @see 'geodir_before_settings_tabs' |
|
103 | + */ |
|
104 | + do_action('geodir_after_settings_tabs', $name); |
|
105 | + endforeach; |
|
106 | + |
|
107 | + /** |
|
108 | + * Called after the GD settings tabs have been output. |
|
109 | + * |
|
110 | + * Called before the closing `ul` so can be used to add new settings tab links. |
|
111 | + * |
|
112 | + * @since 1.0.0 |
|
113 | + */ |
|
114 | + do_action('geodir_settings_tabs'); |
|
115 | + ?> |
|
116 | 116 | </ul> |
117 | 117 | </div> |
118 | 118 | <!--gd-left-nav ends here--> |
@@ -121,52 +121,52 @@ discard block |
||
121 | 121 | <div class="gd-tabs-main"> |
122 | 122 | |
123 | 123 | <?php |
124 | - unset($subtabs); |
|
125 | - if (isset($tabs[$current_tab]['subtabs'])) |
|
126 | - $subtabs = $tabs[$current_tab]['subtabs']; |
|
127 | - $form_action = ''; |
|
124 | + unset($subtabs); |
|
125 | + if (isset($tabs[$current_tab]['subtabs'])) |
|
126 | + $subtabs = $tabs[$current_tab]['subtabs']; |
|
127 | + $form_action = ''; |
|
128 | 128 | |
129 | - if (!empty($subtabs)): |
|
130 | - ?> |
|
129 | + if (!empty($subtabs)): |
|
130 | + ?> |
|
131 | 131 | <dl class="gd-tab-head"> |
132 | 132 | <?php |
133 | - foreach ($subtabs as $sub) { |
|
134 | - $subtab_active = ''; |
|
135 | - if (isset($_REQUEST['subtab']) && $sub['subtab'] == $_REQUEST['subtab']) { |
|
136 | - $subtab_active = 'class="gd-tab-active"'; |
|
137 | - $form_action = isset($sub['form_action']) ? $sub['form_action'] : ''; |
|
138 | - } |
|
139 | - |
|
140 | - $sub_tabs_link = admin_url() . 'admin.php?page=geodirectory&tab=' . $current_tab . '&subtab=' . $sub['subtab']; |
|
141 | - if (isset($sub['request']) && is_array($sub['request']) && !empty($sub['request'])) { |
|
142 | - $sub_tabs_link = geodir_getlink($sub_tabs_link, $sub['request']); |
|
143 | - } |
|
144 | - echo '<dd ' . $subtab_active . ' id="claim_listing"><a href="' . esc_url($sub_tabs_link) . '" >' . sanitize_text_field($sub['label']) . '</a></dd>'; |
|
145 | - } |
|
146 | - ?> |
|
133 | + foreach ($subtabs as $sub) { |
|
134 | + $subtab_active = ''; |
|
135 | + if (isset($_REQUEST['subtab']) && $sub['subtab'] == $_REQUEST['subtab']) { |
|
136 | + $subtab_active = 'class="gd-tab-active"'; |
|
137 | + $form_action = isset($sub['form_action']) ? $sub['form_action'] : ''; |
|
138 | + } |
|
139 | + |
|
140 | + $sub_tabs_link = admin_url() . 'admin.php?page=geodirectory&tab=' . $current_tab . '&subtab=' . $sub['subtab']; |
|
141 | + if (isset($sub['request']) && is_array($sub['request']) && !empty($sub['request'])) { |
|
142 | + $sub_tabs_link = geodir_getlink($sub_tabs_link, $sub['request']); |
|
143 | + } |
|
144 | + echo '<dd ' . $subtab_active . ' id="claim_listing"><a href="' . esc_url($sub_tabs_link) . '" >' . sanitize_text_field($sub['label']) . '</a></dd>'; |
|
145 | + } |
|
146 | + ?> |
|
147 | 147 | </dl> |
148 | 148 | |
149 | 149 | <?php endif; ?> |
150 | 150 | <div class="gd-tab-content <?php if (empty($subtabs)) { |
151 | - echo "inner_contet_tabs"; |
|
152 | - } ?>"> |
|
151 | + echo "inner_contet_tabs"; |
|
152 | + } ?>"> |
|
153 | 153 | <form method="post" id="mainform" |
154 | 154 | class="geodir_optionform <?php echo $current_tab . ' '; ?><?php if (isset($sub['subtab'])) { |
155 | - echo sanitize_text_field($sub['subtab']); |
|
156 | - } ?>" action="<?php echo $form_action; ?>" enctype="multipart/form-data"> |
|
155 | + echo sanitize_text_field($sub['subtab']); |
|
156 | + } ?>" action="<?php echo $form_action; ?>" enctype="multipart/form-data"> |
|
157 | 157 | <input type="hidden" class="active_tab" name="active_tab" |
158 | 158 | value="<?php if (isset($_REQUEST['active_tab'])) { |
159 | - echo sanitize_text_field($_REQUEST['active_tab']); |
|
160 | - } ?>"/> |
|
159 | + echo sanitize_text_field($_REQUEST['active_tab']); |
|
160 | + } ?>"/> |
|
161 | 161 | <?php wp_nonce_field('geodir-settings', '_wpnonce', true, true); ?> |
162 | 162 | <?php wp_nonce_field('geodir-settings-' . $current_tab, '_wpnonce-' . $current_tab, true, true); ?> |
163 | 163 | <?php |
164 | - /** |
|
165 | - * Used to call the content of each GD settings tab page. |
|
166 | - * |
|
167 | - * @since 1.0.0 |
|
168 | - */ |
|
169 | - do_action('geodir_admin_option_form', $current_tab); ?> |
|
164 | + /** |
|
165 | + * Used to call the content of each GD settings tab page. |
|
166 | + * |
|
167 | + * @since 1.0.0 |
|
168 | + */ |
|
169 | + do_action('geodir_admin_option_form', $current_tab); ?> |
|
170 | 170 | </form> |
171 | 171 | </div> |
172 | 172 | |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | </script> |
268 | 268 | <?php |
269 | 269 | |
270 | - } |
|
270 | + } |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | |
@@ -283,48 +283,48 @@ discard block |
||
283 | 283 | function geodir_admin_option_form($tab_name) |
284 | 284 | { |
285 | 285 | |
286 | - //echo $tab_name.'_array.php' ; |
|
287 | - global $geodir_settings, $is_default, $mapzoom; |
|
288 | - if (file_exists(dirname(__FILE__) . '/option-pages/' . $tab_name . '_array.php')) { |
|
289 | - /** |
|
290 | - * Contains settings array for given tab. |
|
291 | - * |
|
292 | - * @since 1.0.0 |
|
293 | - * @package GeoDirectory |
|
294 | - */ |
|
295 | - include_once('option-pages/' . $tab_name . '_array.php'); |
|
296 | - } |
|
297 | - |
|
298 | - $listing_type = isset($_REQUEST['listing_type']) ? $_REQUEST['listing_type'] : ''; |
|
299 | - |
|
300 | - switch ($tab_name) { |
|
301 | - |
|
302 | - case 'general_settings': |
|
303 | - |
|
304 | - geodir_admin_fields($geodir_settings['general_settings']); |
|
305 | - /** |
|
306 | - * |
|
307 | - * Update Taxonomy Options * |
|
308 | - * |
|
309 | - **/ |
|
310 | - /*add_action('updated_option_place_prefix','update_listing_prefix'); |
|
286 | + //echo $tab_name.'_array.php' ; |
|
287 | + global $geodir_settings, $is_default, $mapzoom; |
|
288 | + if (file_exists(dirname(__FILE__) . '/option-pages/' . $tab_name . '_array.php')) { |
|
289 | + /** |
|
290 | + * Contains settings array for given tab. |
|
291 | + * |
|
292 | + * @since 1.0.0 |
|
293 | + * @package GeoDirectory |
|
294 | + */ |
|
295 | + include_once('option-pages/' . $tab_name . '_array.php'); |
|
296 | + } |
|
297 | + |
|
298 | + $listing_type = isset($_REQUEST['listing_type']) ? $_REQUEST['listing_type'] : ''; |
|
299 | + |
|
300 | + switch ($tab_name) { |
|
301 | + |
|
302 | + case 'general_settings': |
|
303 | + |
|
304 | + geodir_admin_fields($geodir_settings['general_settings']); |
|
305 | + /** |
|
306 | + * |
|
307 | + * Update Taxonomy Options * |
|
308 | + * |
|
309 | + **/ |
|
310 | + /*add_action('updated_option_place_prefix','update_listing_prefix'); |
|
311 | 311 | function update_listing_prefix(){ |
312 | 312 | geodir_register_defaults(); |
313 | 313 | }*/ |
314 | 314 | |
315 | - if (isset($_REQUEST['active_tab']) && ($_REQUEST['active_tab'] == 'dummy_data_settings' || $_REQUEST['active_tab'] == 'csv_upload_settings')) |
|
316 | - $hide_save_button = "style='display:none;'"; |
|
317 | - else |
|
318 | - $hide_save_button = ''; |
|
315 | + if (isset($_REQUEST['active_tab']) && ($_REQUEST['active_tab'] == 'dummy_data_settings' || $_REQUEST['active_tab'] == 'csv_upload_settings')) |
|
316 | + $hide_save_button = "style='display:none;'"; |
|
317 | + else |
|
318 | + $hide_save_button = ''; |
|
319 | 319 | |
320 | - /** |
|
321 | - * Filter weather the default save button in the GD admin settings pages should be shown. |
|
322 | - * |
|
323 | - * @since 1.0.0 |
|
324 | - * @param string $hide_save_button The style element, either blank or: style='display:none;'. |
|
325 | - */ |
|
326 | - $hide_save_button = apply_filters('geodir_hide_save_button', $hide_save_button); |
|
327 | - ?> |
|
320 | + /** |
|
321 | + * Filter weather the default save button in the GD admin settings pages should be shown. |
|
322 | + * |
|
323 | + * @since 1.0.0 |
|
324 | + * @param string $hide_save_button The style element, either blank or: style='display:none;'. |
|
325 | + */ |
|
326 | + $hide_save_button = apply_filters('geodir_hide_save_button', $hide_save_button); |
|
327 | + ?> |
|
328 | 328 | |
329 | 329 | <p class="submit"> |
330 | 330 | <input <?php echo $hide_save_button;?> name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" /> |
@@ -334,38 +334,38 @@ discard block |
||
334 | 334 | </div> |
335 | 335 | |
336 | 336 | <?php break; |
337 | - case 'design_settings' : |
|
337 | + case 'design_settings' : |
|
338 | 338 | |
339 | - add_thickbox(); |
|
340 | - geodir_admin_fields($geodir_settings['design_settings']); |
|
339 | + add_thickbox(); |
|
340 | + geodir_admin_fields($geodir_settings['design_settings']); |
|
341 | 341 | |
342 | 342 | |
343 | 343 | |
344 | - ?> |
|
344 | + ?> |
|
345 | 345 | <p class="submit"> |
346 | 346 | <input name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" /> |
347 | 347 | <input type="hidden" name="subtab" id="last_tab" /> |
348 | 348 | </p> |
349 | 349 | </div> |
350 | 350 | <?php break; |
351 | - case 'permalink_settings' : |
|
352 | - geodir_admin_fields($geodir_settings['permalink_settings']); ?> |
|
351 | + case 'permalink_settings' : |
|
352 | + geodir_admin_fields($geodir_settings['permalink_settings']); ?> |
|
353 | 353 | <p class="submit"> |
354 | 354 | <input name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" /> |
355 | 355 | <input type="hidden" name="subtab" id="last_tab" /> |
356 | 356 | </p> |
357 | 357 | </div> |
358 | 358 | <?php break; |
359 | - case 'title_meta_settings' : |
|
360 | - geodir_admin_fields($geodir_settings['title_meta_settings']); ?> |
|
359 | + case 'title_meta_settings' : |
|
360 | + geodir_admin_fields($geodir_settings['title_meta_settings']); ?> |
|
361 | 361 | <p class="submit"> |
362 | 362 | <input name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" /> |
363 | 363 | <input type="hidden" name="subtab" id="last_tab" /> |
364 | 364 | </p> |
365 | 365 | </div> |
366 | 366 | <?php break; |
367 | - case 'notifications_settings' : |
|
368 | - geodir_admin_fields($geodir_settings['notifications_settings']); ?> |
|
367 | + case 'notifications_settings' : |
|
368 | + geodir_admin_fields($geodir_settings['notifications_settings']); ?> |
|
369 | 369 | |
370 | 370 | <p class="submit"> |
371 | 371 | |
@@ -375,36 +375,36 @@ discard block |
||
375 | 375 | </div> |
376 | 376 | |
377 | 377 | <?php break; |
378 | - case 'default_location_settings' : |
|
379 | - ?> |
|
378 | + case 'default_location_settings' : |
|
379 | + ?> |
|
380 | 380 | <div class="inner_content_tab_main"> |
381 | 381 | <div class="gd-content-heading"> |
382 | 382 | <?php global $wpdb; |
383 | 383 | |
384 | 384 | |
385 | - $location_result = geodir_get_default_location(); |
|
385 | + $location_result = geodir_get_default_location(); |
|
386 | 386 | |
387 | - $prefix = ''; |
|
387 | + $prefix = ''; |
|
388 | 388 | |
389 | 389 | |
390 | - $lat = isset($location_result->city_latitude) ? $location_result->city_latitude : ''; |
|
391 | - $lng = isset($location_result->city_longitude) ? $location_result->city_longitude : ''; |
|
392 | - $city = isset($location_result->city) ? $location_result->city : ''; |
|
393 | - $region = isset($location_result->region) ? $location_result->region : ''; |
|
394 | - $country = isset($location_result->country) ? $location_result->country : ''; |
|
390 | + $lat = isset($location_result->city_latitude) ? $location_result->city_latitude : ''; |
|
391 | + $lng = isset($location_result->city_longitude) ? $location_result->city_longitude : ''; |
|
392 | + $city = isset($location_result->city) ? $location_result->city : ''; |
|
393 | + $region = isset($location_result->region) ? $location_result->region : ''; |
|
394 | + $country = isset($location_result->country) ? $location_result->country : ''; |
|
395 | 395 | |
396 | 396 | |
397 | - $map_title = __("Set Address On Map", 'geodirectory'); |
|
397 | + $map_title = __("Set Address On Map", 'geodirectory'); |
|
398 | 398 | |
399 | - ?> |
|
399 | + ?> |
|
400 | 400 | |
401 | 401 | <h3><?php _e('Set Default Location', 'geodirectory');?></h3> |
402 | 402 | |
403 | 403 | <input type="hidden" name="add_location" value="location"> |
404 | 404 | |
405 | 405 | <input type="hidden" name="update_city" value="<?php if (isset($location_result->location_id)) { |
406 | - echo $location_result->location_id; |
|
407 | - } ?>"> |
|
406 | + echo $location_result->location_id; |
|
407 | + } ?>"> |
|
408 | 408 | |
409 | 409 | <input type="hidden" name="address" id="<?php echo $prefix;?>address" value=""> |
410 | 410 | |
@@ -417,8 +417,8 @@ discard block |
||
417 | 417 | <input class="require" type="text" size="80" style="width:440px" |
418 | 418 | id="<?php echo $prefix;?>city" name="city" |
419 | 419 | value="<?php if (isset($location_result->city)) { |
420 | - echo $location_result->city; |
|
421 | - } ?>"/> |
|
420 | + echo $location_result->city; |
|
421 | + } ?>"/> |
|
422 | 422 | |
423 | 423 | <div |
424 | 424 | class="gd-location_message_error"> <?php _e('This field is required.', 'geodirectory'); ?></div> |
@@ -433,8 +433,8 @@ discard block |
||
433 | 433 | <input class="require" type="text" size="80" style="width:440px" |
434 | 434 | id="<?php echo $prefix;?>region" name="region" |
435 | 435 | value="<?php if (isset($location_result->region)) { |
436 | - echo $location_result->region; |
|
437 | - } ?>"/> |
|
436 | + echo $location_result->region; |
|
437 | + } ?>"/> |
|
438 | 438 | |
439 | 439 | <div |
440 | 440 | class="gd-location_message_error"> <?php _e('This field is required.', 'geodirectory'); ?></div> |
@@ -448,8 +448,8 @@ discard block |
||
448 | 448 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
449 | 449 | <?php |
450 | 450 | |
451 | - $country_result = isset($location_result->country) ? $location_result->country : ''; |
|
452 | - ?> |
|
451 | + $country_result = isset($location_result->country) ? $location_result->country : ''; |
|
452 | + ?> |
|
453 | 453 | <select id="<?php echo $prefix ?>country" class="chosen_select" |
454 | 454 | data-location_type="country" name="<?php echo $prefix ?>country" |
455 | 455 | data-placeholder="<?php _e('Choose a country.', 'geodirectory');?>" |
@@ -472,12 +472,12 @@ discard block |
||
472 | 472 | scope="row"><?php _e('Set Location on Map', 'geodirectory');?></th> |
473 | 473 | <td class="forminp"> |
474 | 474 | <?php |
475 | - /** |
|
476 | - * Contains add listing page map functions. |
|
477 | - * |
|
478 | - * @since 1.0.0 |
|
479 | - */ |
|
480 | - include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");?> |
|
475 | + /** |
|
476 | + * Contains add listing page map functions. |
|
477 | + * |
|
478 | + * @since 1.0.0 |
|
479 | + */ |
|
480 | + include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");?> |
|
481 | 481 | </td> |
482 | 482 | </tr> |
483 | 483 | <tr valign="top" class="single_select_page"> |
@@ -487,8 +487,8 @@ discard block |
||
487 | 487 | <input type="text" class="require" size="80" style="width:440px" |
488 | 488 | id="<?php echo $prefix;?>latitude" name="latitude" |
489 | 489 | value="<?php if (isset($location_result->city_latitude)) { |
490 | - echo $location_result->city_latitude; |
|
491 | - } ?>"/> |
|
490 | + echo $location_result->city_latitude; |
|
491 | + } ?>"/> |
|
492 | 492 | |
493 | 493 | <div |
494 | 494 | class="gd-location_message_error"><?php _e('This field is required.', 'geodirectory'); ?></div> |
@@ -504,8 +504,8 @@ discard block |
||
504 | 504 | <input type="text" class="require" size="80" style="width:440px" |
505 | 505 | id="<?php echo $prefix;?>longitude" name="longitude" |
506 | 506 | value="<?php if (isset($location_result->city_longitude)) { |
507 | - echo $location_result->city_longitude; |
|
508 | - } ?>"/> |
|
507 | + echo $location_result->city_longitude; |
|
508 | + } ?>"/> |
|
509 | 509 | |
510 | 510 | <div |
511 | 511 | class="gd-location_message_error"><?php _e('This field is required.', 'geodirectory'); ?></div> |
@@ -537,22 +537,22 @@ discard block |
||
537 | 537 | </div> |
538 | 538 | </div> |
539 | 539 | <?php break; |
540 | - case $listing_type . '_fields_settings' : |
|
540 | + case $listing_type . '_fields_settings' : |
|
541 | 541 | |
542 | - geodir_custom_post_type_form(); |
|
542 | + geodir_custom_post_type_form(); |
|
543 | 543 | |
544 | - break; |
|
545 | - case 'tools_settings' : |
|
546 | - geodir_diagnostic_tools_setting_page(); |
|
547 | - break; |
|
548 | - case 'compatibility_settings' : |
|
549 | - geodir_theme_compatibility_setting_page(); |
|
550 | - break; |
|
544 | + break; |
|
545 | + case 'tools_settings' : |
|
546 | + geodir_diagnostic_tools_setting_page(); |
|
547 | + break; |
|
548 | + case 'compatibility_settings' : |
|
549 | + geodir_theme_compatibility_setting_page(); |
|
550 | + break; |
|
551 | 551 | case 'import_export' : |
552 | - geodir_import_export_page(); |
|
553 | - break; |
|
552 | + geodir_import_export_page(); |
|
553 | + break; |
|
554 | 554 | |
555 | - }// end of switch |
|
555 | + }// end of switch |
|
556 | 556 | } |
557 | 557 | |
558 | 558 | |
@@ -592,170 +592,170 @@ discard block |
||
592 | 592 | function geodir_update_options_compatibility_settings() |
593 | 593 | { |
594 | 594 | |
595 | - global $wpdb; |
|
595 | + global $wpdb; |
|
596 | 596 | |
597 | 597 | |
598 | - $theme_settings = array(); |
|
598 | + $theme_settings = array(); |
|
599 | 599 | |
600 | - $theme_settings['geodir_wrapper_open_id'] = $_POST['geodir_wrapper_open_id']; |
|
601 | - $theme_settings['geodir_wrapper_open_class'] = $_POST['geodir_wrapper_open_class']; |
|
602 | - $theme_settings['geodir_wrapper_open_replace'] = stripslashes($_POST['geodir_wrapper_open_replace']); |
|
600 | + $theme_settings['geodir_wrapper_open_id'] = $_POST['geodir_wrapper_open_id']; |
|
601 | + $theme_settings['geodir_wrapper_open_class'] = $_POST['geodir_wrapper_open_class']; |
|
602 | + $theme_settings['geodir_wrapper_open_replace'] = stripslashes($_POST['geodir_wrapper_open_replace']); |
|
603 | 603 | |
604 | - $theme_settings['geodir_wrapper_close_replace'] = stripslashes($_POST['geodir_wrapper_close_replace']); |
|
604 | + $theme_settings['geodir_wrapper_close_replace'] = stripslashes($_POST['geodir_wrapper_close_replace']); |
|
605 | 605 | |
606 | - $theme_settings['geodir_wrapper_content_open_id'] = $_POST['geodir_wrapper_content_open_id']; |
|
607 | - $theme_settings['geodir_wrapper_content_open_class'] = $_POST['geodir_wrapper_content_open_class']; |
|
608 | - $theme_settings['geodir_wrapper_content_open_replace'] = stripslashes($_POST['geodir_wrapper_content_open_replace']); |
|
606 | + $theme_settings['geodir_wrapper_content_open_id'] = $_POST['geodir_wrapper_content_open_id']; |
|
607 | + $theme_settings['geodir_wrapper_content_open_class'] = $_POST['geodir_wrapper_content_open_class']; |
|
608 | + $theme_settings['geodir_wrapper_content_open_replace'] = stripslashes($_POST['geodir_wrapper_content_open_replace']); |
|
609 | 609 | |
610 | - $theme_settings['geodir_wrapper_content_close_replace'] = stripslashes($_POST['geodir_wrapper_content_close_replace']); |
|
610 | + $theme_settings['geodir_wrapper_content_close_replace'] = stripslashes($_POST['geodir_wrapper_content_close_replace']); |
|
611 | 611 | |
612 | - $theme_settings['geodir_article_open_id'] = $_POST['geodir_article_open_id']; |
|
613 | - $theme_settings['geodir_article_open_class'] = $_POST['geodir_article_open_class']; |
|
614 | - $theme_settings['geodir_article_open_replace'] = stripslashes($_POST['geodir_article_open_replace']); |
|
612 | + $theme_settings['geodir_article_open_id'] = $_POST['geodir_article_open_id']; |
|
613 | + $theme_settings['geodir_article_open_class'] = $_POST['geodir_article_open_class']; |
|
614 | + $theme_settings['geodir_article_open_replace'] = stripslashes($_POST['geodir_article_open_replace']); |
|
615 | 615 | |
616 | - $theme_settings['geodir_article_close_replace'] = stripslashes($_POST['geodir_article_close_replace']); |
|
616 | + $theme_settings['geodir_article_close_replace'] = stripslashes($_POST['geodir_article_close_replace']); |
|
617 | 617 | |
618 | - $theme_settings['geodir_sidebar_right_open_id'] = $_POST['geodir_sidebar_right_open_id']; |
|
619 | - $theme_settings['geodir_sidebar_right_open_class'] = $_POST['geodir_sidebar_right_open_class']; |
|
620 | - $theme_settings['geodir_sidebar_right_open_replace'] = stripslashes($_POST['geodir_sidebar_right_open_replace']); |
|
618 | + $theme_settings['geodir_sidebar_right_open_id'] = $_POST['geodir_sidebar_right_open_id']; |
|
619 | + $theme_settings['geodir_sidebar_right_open_class'] = $_POST['geodir_sidebar_right_open_class']; |
|
620 | + $theme_settings['geodir_sidebar_right_open_replace'] = stripslashes($_POST['geodir_sidebar_right_open_replace']); |
|
621 | 621 | |
622 | - $theme_settings['geodir_sidebar_right_close_replace'] = stripslashes($_POST['geodir_sidebar_right_close_replace']); |
|
622 | + $theme_settings['geodir_sidebar_right_close_replace'] = stripslashes($_POST['geodir_sidebar_right_close_replace']); |
|
623 | 623 | |
624 | - $theme_settings['geodir_sidebar_left_open_id'] = $_POST['geodir_sidebar_left_open_id']; |
|
625 | - $theme_settings['geodir_sidebar_left_open_class'] = $_POST['geodir_sidebar_left_open_class']; |
|
626 | - $theme_settings['geodir_sidebar_left_open_replace'] = stripslashes($_POST['geodir_sidebar_left_open_replace']); |
|
624 | + $theme_settings['geodir_sidebar_left_open_id'] = $_POST['geodir_sidebar_left_open_id']; |
|
625 | + $theme_settings['geodir_sidebar_left_open_class'] = $_POST['geodir_sidebar_left_open_class']; |
|
626 | + $theme_settings['geodir_sidebar_left_open_replace'] = stripslashes($_POST['geodir_sidebar_left_open_replace']); |
|
627 | 627 | |
628 | - $theme_settings['geodir_sidebar_left_close_replace'] = stripslashes($_POST['geodir_sidebar_left_close_replace']); |
|
628 | + $theme_settings['geodir_sidebar_left_close_replace'] = stripslashes($_POST['geodir_sidebar_left_close_replace']); |
|
629 | 629 | |
630 | - $theme_settings['geodir_main_content_open_id'] = $_POST['geodir_main_content_open_id']; |
|
631 | - $theme_settings['geodir_main_content_open_class'] = $_POST['geodir_main_content_open_class']; |
|
632 | - $theme_settings['geodir_main_content_open_replace'] = stripslashes($_POST['geodir_main_content_open_replace']); |
|
630 | + $theme_settings['geodir_main_content_open_id'] = $_POST['geodir_main_content_open_id']; |
|
631 | + $theme_settings['geodir_main_content_open_class'] = $_POST['geodir_main_content_open_class']; |
|
632 | + $theme_settings['geodir_main_content_open_replace'] = stripslashes($_POST['geodir_main_content_open_replace']); |
|
633 | 633 | |
634 | - $theme_settings['geodir_main_content_close_replace'] = stripslashes($_POST['geodir_main_content_close_replace']); |
|
634 | + $theme_settings['geodir_main_content_close_replace'] = stripslashes($_POST['geodir_main_content_close_replace']); |
|
635 | 635 | |
636 | 636 | // Other Actions |
637 | - $theme_settings['geodir_top_content_add'] = stripslashes($_POST['geodir_top_content_add']); |
|
638 | - $theme_settings['geodir_before_main_content_add'] = stripslashes($_POST['geodir_before_main_content_add']); |
|
637 | + $theme_settings['geodir_top_content_add'] = stripslashes($_POST['geodir_top_content_add']); |
|
638 | + $theme_settings['geodir_before_main_content_add'] = stripslashes($_POST['geodir_before_main_content_add']); |
|
639 | 639 | |
640 | 640 | // Filters |
641 | - $theme_settings['geodir_full_page_class_filter'] = stripslashes($_POST['geodir_full_page_class_filter']); |
|
642 | - $theme_settings['geodir_before_widget_filter'] = stripslashes($_POST['geodir_before_widget_filter']); |
|
643 | - $theme_settings['geodir_after_widget_filter'] = stripslashes($_POST['geodir_after_widget_filter']); |
|
644 | - $theme_settings['geodir_before_title_filter'] = stripslashes($_POST['geodir_before_title_filter']); |
|
645 | - $theme_settings['geodir_after_title_filter'] = stripslashes($_POST['geodir_after_title_filter']); |
|
646 | - $theme_settings['geodir_menu_li_class_filter'] = stripslashes($_POST['geodir_menu_li_class_filter']); |
|
647 | - $theme_settings['geodir_sub_menu_ul_class_filter'] = stripslashes($_POST['geodir_sub_menu_ul_class_filter']); |
|
648 | - $theme_settings['geodir_sub_menu_li_class_filter'] = stripslashes($_POST['geodir_sub_menu_li_class_filter']); |
|
649 | - $theme_settings['geodir_menu_a_class_filter'] = stripslashes($_POST['geodir_menu_a_class_filter']); |
|
650 | - $theme_settings['geodir_sub_menu_a_class_filter'] = stripslashes($_POST['geodir_sub_menu_a_class_filter']); |
|
641 | + $theme_settings['geodir_full_page_class_filter'] = stripslashes($_POST['geodir_full_page_class_filter']); |
|
642 | + $theme_settings['geodir_before_widget_filter'] = stripslashes($_POST['geodir_before_widget_filter']); |
|
643 | + $theme_settings['geodir_after_widget_filter'] = stripslashes($_POST['geodir_after_widget_filter']); |
|
644 | + $theme_settings['geodir_before_title_filter'] = stripslashes($_POST['geodir_before_title_filter']); |
|
645 | + $theme_settings['geodir_after_title_filter'] = stripslashes($_POST['geodir_after_title_filter']); |
|
646 | + $theme_settings['geodir_menu_li_class_filter'] = stripslashes($_POST['geodir_menu_li_class_filter']); |
|
647 | + $theme_settings['geodir_sub_menu_ul_class_filter'] = stripslashes($_POST['geodir_sub_menu_ul_class_filter']); |
|
648 | + $theme_settings['geodir_sub_menu_li_class_filter'] = stripslashes($_POST['geodir_sub_menu_li_class_filter']); |
|
649 | + $theme_settings['geodir_menu_a_class_filter'] = stripslashes($_POST['geodir_menu_a_class_filter']); |
|
650 | + $theme_settings['geodir_sub_menu_a_class_filter'] = stripslashes($_POST['geodir_sub_menu_a_class_filter']); |
|
651 | 651 | //location manager filters |
652 | - $theme_settings['geodir_location_switcher_menu_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_li_class_filter']); |
|
653 | - $theme_settings['geodir_location_switcher_menu_a_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_a_class_filter']); |
|
654 | - $theme_settings['geodir_location_switcher_menu_sub_ul_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_ul_class_filter']); |
|
655 | - $theme_settings['geodir_location_switcher_menu_sub_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_li_class_filter']); |
|
652 | + $theme_settings['geodir_location_switcher_menu_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_li_class_filter']); |
|
653 | + $theme_settings['geodir_location_switcher_menu_a_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_a_class_filter']); |
|
654 | + $theme_settings['geodir_location_switcher_menu_sub_ul_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_ul_class_filter']); |
|
655 | + $theme_settings['geodir_location_switcher_menu_sub_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_li_class_filter']); |
|
656 | 656 | |
657 | 657 | |
658 | 658 | // theme required css |
659 | - $theme_settings['geodir_theme_compat_css'] = stripslashes($_POST['geodir_theme_compat_css']); |
|
659 | + $theme_settings['geodir_theme_compat_css'] = stripslashes($_POST['geodir_theme_compat_css']); |
|
660 | 660 | |
661 | 661 | // theme required js |
662 | - $theme_settings['geodir_theme_compat_js'] = stripslashes($_POST['geodir_theme_compat_js']); |
|
662 | + $theme_settings['geodir_theme_compat_js'] = stripslashes($_POST['geodir_theme_compat_js']); |
|
663 | 663 | |
664 | 664 | // theme compat name |
665 | - $theme_settings['gd_theme_compat'] = $_POST['gd_theme_compat']; |
|
666 | - if ($theme_settings['gd_theme_compat'] == '') { |
|
667 | - update_option('gd_theme_compat', ''); |
|
668 | - update_option('theme_compatibility_setting', ''); |
|
669 | - return; |
|
670 | - } |
|
665 | + $theme_settings['gd_theme_compat'] = $_POST['gd_theme_compat']; |
|
666 | + if ($theme_settings['gd_theme_compat'] == '') { |
|
667 | + update_option('gd_theme_compat', ''); |
|
668 | + update_option('theme_compatibility_setting', ''); |
|
669 | + return; |
|
670 | + } |
|
671 | 671 | |
672 | 672 | // theme default options |
673 | - $theme_settings['geodir_theme_compat_default_options'] = ''; |
|
673 | + $theme_settings['geodir_theme_compat_default_options'] = ''; |
|
674 | 674 | |
675 | 675 | |
676 | 676 | //supported theme code |
677 | - $theme_settings['geodir_theme_compat_code'] = false; |
|
678 | - |
|
679 | - $theme = wp_get_theme(); |
|
680 | - |
|
681 | - if ($theme->parent()) { |
|
682 | - $theme_name = str_replace(" ", "_", $theme->parent()->get('Name')); |
|
683 | - } else { |
|
684 | - $theme_name = str_replace(" ", "_", $theme->get('Name')); |
|
685 | - } |
|
686 | - |
|
687 | - if (in_array($theme_name, array('Avada', 'Enfold', 'X', 'Divi', 'Genesis', 'Jupiter', 'Multi_News','Kleo','Twenty_Seventeen'))) {// list of themes that have php files |
|
688 | - $theme_settings['geodir_theme_compat_code'] = $theme_name; |
|
689 | - } |
|
690 | - |
|
691 | - |
|
692 | - $theme_name = $theme_name . "_custom"; |
|
693 | - $theme_arr = get_option('gd_theme_compats'); |
|
694 | - update_option('gd_theme_compat', $theme_name); |
|
695 | - /** |
|
696 | - * Called before the theme compatibility settings are saved to the DB. |
|
697 | - * |
|
698 | - * @since 1.4.0 |
|
699 | - * @param array $theme_settings { |
|
700 | - * Attributes of the theme compatibility settings array. |
|
701 | - * |
|
702 | - * @type string $geodir_wrapper_open_id Geodir wrapper open html id. |
|
703 | - * @type string $geodir_wrapper_open_class Geodir wrapper open html class. |
|
704 | - * @type string $geodir_wrapper_open_replace Geodir wrapper open content replace. |
|
705 | - * @type string $geodir_wrapper_close_replace Geodir wrapper close content replace. |
|
706 | - * @type string $geodir_wrapper_content_open_id Geodir wrapper content open html id. |
|
707 | - * @type string $geodir_wrapper_content_open_class Geodir wrapper content open html class. |
|
708 | - * @type string $geodir_wrapper_content_open_replace Geodir wrapper content open content replace. |
|
709 | - * @type string $geodir_wrapper_content_close_replace Geodir wrapper content close content replace. |
|
710 | - * @type string $geodir_article_open_id Geodir article open html id. |
|
711 | - * @type string $geodir_article_open_class Geodir article open html class. |
|
712 | - * @type string $geodir_article_open_replace Geodir article open content replace. |
|
713 | - * @type string $geodir_article_close_replace Geodir article close content replace. |
|
714 | - * @type string $geodir_sidebar_right_open_id Geodir sidebar right open html id. |
|
715 | - * @type string $geodir_sidebar_right_open_class Geodir sidebar right open html class. |
|
716 | - * @type string $geodir_sidebar_right_open_replace Geodir sidebar right open content replace. |
|
717 | - * @type string $geodir_sidebar_right_close_replace Geodir sidebar right close content replace. |
|
718 | - * @type string $geodir_sidebar_left_open_id Geodir sidebar left open html id. |
|
719 | - * @type string $geodir_sidebar_left_open_class Geodir sidebar left open html class. |
|
720 | - * @type string $geodir_sidebar_left_open_replace Geodir sidebar left open content replace. |
|
721 | - * @type string $geodir_sidebar_left_close_replace Geodir sidebar left close content replace. |
|
722 | - * @type string $geodir_main_content_open_id Geodir main content open html id. |
|
723 | - * @type string $geodir_main_content_open_class Geodir main content open html class. |
|
724 | - * @type string $geodir_main_content_open_replace Geodir main content open content replace. |
|
725 | - * @type string $geodir_main_content_close_replace Geodir main content close content replace. |
|
726 | - * @type string $geodir_top_content_add Geodir top content add. |
|
727 | - * @type string $geodir_before_main_content_add Geodir before main content add. |
|
728 | - * @type string $geodir_full_page_class_filter Geodir full page class filter. |
|
729 | - * @type string $geodir_before_widget_filter Geodir before widget filter. |
|
730 | - * @type string $geodir_after_widget_filter Geodir after widget filter. |
|
731 | - * @type string $geodir_before_title_filter Geodir before title filter. |
|
732 | - * @type string $geodir_after_title_filter Geodir after title filter. |
|
733 | - * @type string $geodir_menu_li_class_filter Geodir menu li class filter. |
|
734 | - * @type string $geodir_sub_menu_ul_class_filter Geodir sub menu ul class filter. |
|
735 | - * @type string $geodir_sub_menu_li_class_filter Geodir sub menu li class filter. |
|
736 | - * @type string $geodir_menu_a_class_filter Geodir menu a class filter. |
|
737 | - * @type string $geodir_sub_menu_a_class_filter Geodir sub menu a class filter. |
|
738 | - * @type string $geodir_location_switcher_menu_li_class_filter Geodir location switcher menu li class filter. |
|
739 | - * @type string $geodir_location_switcher_menu_a_class_filter Geodir location switcher menu a class filter. |
|
740 | - * @type string $geodir_location_switcher_menu_sub_ul_class_filter Geodir location switcher menu sub ul class filter. |
|
741 | - * @type string $geodir_location_switcher_menu_sub_li_class_filter Geodir location switcher menu sub li class filter. |
|
742 | - * @type string $geodir_theme_compat_css Geodir theme compatibility css. |
|
743 | - * @type string $geodir_theme_compat_js Geodir theme compatibility js. |
|
744 | - * @type string $gd_theme_compat Gd theme compatibility. |
|
745 | - * @type string $geodir_theme_compat_default_options Geodir theme compatibility default options. |
|
746 | - * @type bool $geodir_theme_compat_code Geodir theme compatibility code Ex: 'Avada. |
|
747 | - * |
|
748 | - * } |
|
749 | - */ |
|
750 | - do_action('gd_compat_save_settings', $theme_settings); |
|
677 | + $theme_settings['geodir_theme_compat_code'] = false; |
|
678 | + |
|
679 | + $theme = wp_get_theme(); |
|
680 | + |
|
681 | + if ($theme->parent()) { |
|
682 | + $theme_name = str_replace(" ", "_", $theme->parent()->get('Name')); |
|
683 | + } else { |
|
684 | + $theme_name = str_replace(" ", "_", $theme->get('Name')); |
|
685 | + } |
|
686 | + |
|
687 | + if (in_array($theme_name, array('Avada', 'Enfold', 'X', 'Divi', 'Genesis', 'Jupiter', 'Multi_News','Kleo','Twenty_Seventeen'))) {// list of themes that have php files |
|
688 | + $theme_settings['geodir_theme_compat_code'] = $theme_name; |
|
689 | + } |
|
690 | + |
|
691 | + |
|
692 | + $theme_name = $theme_name . "_custom"; |
|
693 | + $theme_arr = get_option('gd_theme_compats'); |
|
694 | + update_option('gd_theme_compat', $theme_name); |
|
695 | + /** |
|
696 | + * Called before the theme compatibility settings are saved to the DB. |
|
697 | + * |
|
698 | + * @since 1.4.0 |
|
699 | + * @param array $theme_settings { |
|
700 | + * Attributes of the theme compatibility settings array. |
|
701 | + * |
|
702 | + * @type string $geodir_wrapper_open_id Geodir wrapper open html id. |
|
703 | + * @type string $geodir_wrapper_open_class Geodir wrapper open html class. |
|
704 | + * @type string $geodir_wrapper_open_replace Geodir wrapper open content replace. |
|
705 | + * @type string $geodir_wrapper_close_replace Geodir wrapper close content replace. |
|
706 | + * @type string $geodir_wrapper_content_open_id Geodir wrapper content open html id. |
|
707 | + * @type string $geodir_wrapper_content_open_class Geodir wrapper content open html class. |
|
708 | + * @type string $geodir_wrapper_content_open_replace Geodir wrapper content open content replace. |
|
709 | + * @type string $geodir_wrapper_content_close_replace Geodir wrapper content close content replace. |
|
710 | + * @type string $geodir_article_open_id Geodir article open html id. |
|
711 | + * @type string $geodir_article_open_class Geodir article open html class. |
|
712 | + * @type string $geodir_article_open_replace Geodir article open content replace. |
|
713 | + * @type string $geodir_article_close_replace Geodir article close content replace. |
|
714 | + * @type string $geodir_sidebar_right_open_id Geodir sidebar right open html id. |
|
715 | + * @type string $geodir_sidebar_right_open_class Geodir sidebar right open html class. |
|
716 | + * @type string $geodir_sidebar_right_open_replace Geodir sidebar right open content replace. |
|
717 | + * @type string $geodir_sidebar_right_close_replace Geodir sidebar right close content replace. |
|
718 | + * @type string $geodir_sidebar_left_open_id Geodir sidebar left open html id. |
|
719 | + * @type string $geodir_sidebar_left_open_class Geodir sidebar left open html class. |
|
720 | + * @type string $geodir_sidebar_left_open_replace Geodir sidebar left open content replace. |
|
721 | + * @type string $geodir_sidebar_left_close_replace Geodir sidebar left close content replace. |
|
722 | + * @type string $geodir_main_content_open_id Geodir main content open html id. |
|
723 | + * @type string $geodir_main_content_open_class Geodir main content open html class. |
|
724 | + * @type string $geodir_main_content_open_replace Geodir main content open content replace. |
|
725 | + * @type string $geodir_main_content_close_replace Geodir main content close content replace. |
|
726 | + * @type string $geodir_top_content_add Geodir top content add. |
|
727 | + * @type string $geodir_before_main_content_add Geodir before main content add. |
|
728 | + * @type string $geodir_full_page_class_filter Geodir full page class filter. |
|
729 | + * @type string $geodir_before_widget_filter Geodir before widget filter. |
|
730 | + * @type string $geodir_after_widget_filter Geodir after widget filter. |
|
731 | + * @type string $geodir_before_title_filter Geodir before title filter. |
|
732 | + * @type string $geodir_after_title_filter Geodir after title filter. |
|
733 | + * @type string $geodir_menu_li_class_filter Geodir menu li class filter. |
|
734 | + * @type string $geodir_sub_menu_ul_class_filter Geodir sub menu ul class filter. |
|
735 | + * @type string $geodir_sub_menu_li_class_filter Geodir sub menu li class filter. |
|
736 | + * @type string $geodir_menu_a_class_filter Geodir menu a class filter. |
|
737 | + * @type string $geodir_sub_menu_a_class_filter Geodir sub menu a class filter. |
|
738 | + * @type string $geodir_location_switcher_menu_li_class_filter Geodir location switcher menu li class filter. |
|
739 | + * @type string $geodir_location_switcher_menu_a_class_filter Geodir location switcher menu a class filter. |
|
740 | + * @type string $geodir_location_switcher_menu_sub_ul_class_filter Geodir location switcher menu sub ul class filter. |
|
741 | + * @type string $geodir_location_switcher_menu_sub_li_class_filter Geodir location switcher menu sub li class filter. |
|
742 | + * @type string $geodir_theme_compat_css Geodir theme compatibility css. |
|
743 | + * @type string $geodir_theme_compat_js Geodir theme compatibility js. |
|
744 | + * @type string $gd_theme_compat Gd theme compatibility. |
|
745 | + * @type string $geodir_theme_compat_default_options Geodir theme compatibility default options. |
|
746 | + * @type bool $geodir_theme_compat_code Geodir theme compatibility code Ex: 'Avada. |
|
747 | + * |
|
748 | + * } |
|
749 | + */ |
|
750 | + do_action('gd_compat_save_settings', $theme_settings); |
|
751 | 751 | |
752 | 752 | //if($_POST['gd_theme_compat'])== |
753 | - $theme_arr[$theme_name] = $theme_settings; |
|
754 | - update_option('gd_theme_compats', $theme_arr); |
|
753 | + $theme_arr[$theme_name] = $theme_settings; |
|
754 | + update_option('gd_theme_compats', $theme_arr); |
|
755 | 755 | |
756 | 756 | |
757 | 757 | //print_r($theme_settings);exit; |
758 | - update_option('theme_compatibility_setting', $theme_settings); |
|
758 | + update_option('theme_compatibility_setting', $theme_settings); |
|
759 | 759 | |
760 | 760 | } |
761 | 761 | |
@@ -768,12 +768,12 @@ discard block |
||
768 | 768 | */ |
769 | 769 | function geodir_theme_compatibility_setting_page() |
770 | 770 | { |
771 | - global $wpdb; |
|
772 | - $tc = get_option('theme_compatibility_setting'); |
|
773 | - //print_r($tc); |
|
774 | - //print_r(wp_get_theme()); |
|
771 | + global $wpdb; |
|
772 | + $tc = get_option('theme_compatibility_setting'); |
|
773 | + //print_r($tc); |
|
774 | + //print_r(wp_get_theme()); |
|
775 | 775 | |
776 | - ?> |
|
776 | + ?> |
|
777 | 777 | <div class="inner_content_tab_main"> |
778 | 778 | <div class="gd-content-heading"> |
779 | 779 | |
@@ -815,21 +815,21 @@ discard block |
||
815 | 815 | <option value=""><?php _e('Select Theme', 'geodirectory');?></option> |
816 | 816 | <option value="custom"><?php _e('Custom', 'geodirectory');?></option> |
817 | 817 | <?php |
818 | - $theme_arr = get_option('gd_theme_compats'); |
|
819 | - $theme_active = get_option('gd_theme_compat'); |
|
820 | - if (is_array($theme_arr)) { |
|
821 | - foreach ($theme_arr as $key => $theme) { |
|
822 | - $sel = ''; |
|
823 | - if ($theme_active == $key) { |
|
824 | - $sel = "selected"; |
|
825 | - } |
|
826 | - echo "<option $sel>$key</option>"; |
|
827 | - } |
|
818 | + $theme_arr = get_option('gd_theme_compats'); |
|
819 | + $theme_active = get_option('gd_theme_compat'); |
|
820 | + if (is_array($theme_arr)) { |
|
821 | + foreach ($theme_arr as $key => $theme) { |
|
822 | + $sel = ''; |
|
823 | + if ($theme_active == $key) { |
|
824 | + $sel = "selected"; |
|
825 | + } |
|
826 | + echo "<option $sel>$key</option>"; |
|
827 | + } |
|
828 | 828 | |
829 | 829 | |
830 | - } |
|
830 | + } |
|
831 | 831 | |
832 | - ?> |
|
832 | + ?> |
|
833 | 833 | </select> |
834 | 834 | <button onclick="gd_comp_export();" type="button" |
835 | 835 | class="button-primary"><?php _e('Export', 'geodirectory');?></button> |
@@ -938,11 +938,11 @@ discard block |
||
938 | 938 | <small>geodir_wrapper_open</small> |
939 | 939 | </td> |
940 | 940 | <td><input value="<?php if (isset($tc['geodir_wrapper_open_id'])) { |
941 | - echo $tc['geodir_wrapper_open_id']; |
|
942 | - }?>" type="text" name="geodir_wrapper_open_id" placeholder="geodir-wrapper"/></td> |
|
941 | + echo $tc['geodir_wrapper_open_id']; |
|
942 | + }?>" type="text" name="geodir_wrapper_open_id" placeholder="geodir-wrapper"/></td> |
|
943 | 943 | <td><input value="<?php if (isset($tc['geodir_wrapper_open_class'])) { |
944 | - echo $tc['geodir_wrapper_open_class']; |
|
945 | - }?>" type="text" name="geodir_wrapper_open_class" placeholder=""/></td> |
|
944 | + echo $tc['geodir_wrapper_open_class']; |
|
945 | + }?>" type="text" name="geodir_wrapper_open_class" placeholder=""/></td> |
|
946 | 946 | </tr> |
947 | 947 | |
948 | 948 | <tr class="gd-theme-comp-out"> |
@@ -950,8 +950,8 @@ discard block |
||
950 | 950 | <span><?php _e('Output:', 'geodirectory');?></span> |
951 | 951 | <textarea name="geodir_wrapper_open_replace" |
952 | 952 | placeholder='<div id="[id]" class="[class]">'><?php if (isset($tc['geodir_wrapper_open_replace'])) { |
953 | - echo $tc['geodir_wrapper_open_replace']; |
|
954 | - }?></textarea> |
|
953 | + echo $tc['geodir_wrapper_open_replace']; |
|
954 | + }?></textarea> |
|
955 | 955 | </td> |
956 | 956 | </tr> |
957 | 957 | |
@@ -971,8 +971,8 @@ discard block |
||
971 | 971 | <span><?php _e('Output:', 'geodirectory');?></span> |
972 | 972 | <textarea name="geodir_wrapper_close_replace" |
973 | 973 | placeholder='</div><!-- wrapper ends here-->'><?php if (isset($tc['geodir_wrapper_close_replace'])) { |
974 | - echo $tc['geodir_wrapper_close_replace']; |
|
975 | - }?></textarea> |
|
974 | + echo $tc['geodir_wrapper_close_replace']; |
|
975 | + }?></textarea> |
|
976 | 976 | </td> |
977 | 977 | </tr> |
978 | 978 | |
@@ -982,12 +982,12 @@ discard block |
||
982 | 982 | <small>geodir_wrapper_content_open</small> |
983 | 983 | </td> |
984 | 984 | <td><input value="<?php if (isset($tc['geodir_wrapper_content_open_id'])) { |
985 | - echo $tc['geodir_wrapper_content_open_id']; |
|
986 | - }?>" type="text" name="geodir_wrapper_content_open_id" placeholder="geodir-wrapper-content"/> |
|
985 | + echo $tc['geodir_wrapper_content_open_id']; |
|
986 | + }?>" type="text" name="geodir_wrapper_content_open_id" placeholder="geodir-wrapper-content"/> |
|
987 | 987 | </td> |
988 | 988 | <td><input value="<?php if (isset($tc['geodir_wrapper_content_open_class'])) { |
989 | - echo $tc['geodir_wrapper_content_open_class']; |
|
990 | - }?>" type="text" name="geodir_wrapper_content_open_class" placeholder=""/></td> |
|
989 | + echo $tc['geodir_wrapper_content_open_class']; |
|
990 | + }?>" type="text" name="geodir_wrapper_content_open_class" placeholder=""/></td> |
|
991 | 991 | </tr> |
992 | 992 | |
993 | 993 | <tr class="gd-theme-comp-out"> |
@@ -995,8 +995,8 @@ discard block |
||
995 | 995 | <span><?php _e('Output:', 'geodirectory');?></span> |
996 | 996 | <textarea name="geodir_wrapper_content_open_replace" |
997 | 997 | placeholder='<div id="[id]" class="[class]" role="main" [width_css]>'><?php if (isset($tc['geodir_wrapper_content_open_replace'])) { |
998 | - echo $tc['geodir_wrapper_content_open_replace']; |
|
999 | - }?></textarea> |
|
998 | + echo $tc['geodir_wrapper_content_open_replace']; |
|
999 | + }?></textarea> |
|
1000 | 1000 | </td> |
1001 | 1001 | </tr> |
1002 | 1002 | |
@@ -1016,8 +1016,8 @@ discard block |
||
1016 | 1016 | <span><?php _e('Output:', 'geodirectory');?></span> |
1017 | 1017 | <textarea name="geodir_wrapper_content_close_replace" |
1018 | 1018 | placeholder='</div><!-- content ends here-->'><?php if (isset($tc['geodir_wrapper_content_close_replace'])) { |
1019 | - echo $tc['geodir_wrapper_content_close_replace']; |
|
1020 | - }?></textarea> |
|
1019 | + echo $tc['geodir_wrapper_content_close_replace']; |
|
1020 | + }?></textarea> |
|
1021 | 1021 | </td> |
1022 | 1022 | </tr> |
1023 | 1023 | |
@@ -1026,11 +1026,11 @@ discard block |
||
1026 | 1026 | <small>geodir_article_open</small> |
1027 | 1027 | </td> |
1028 | 1028 | <td><input value="<?php if (isset($tc['geodir_article_open_id'])) { |
1029 | - echo $tc['geodir_article_open_id']; |
|
1030 | - }?>" type="text" name="geodir_article_open_id" placeholder="geodir-wrapper-content"/></td> |
|
1029 | + echo $tc['geodir_article_open_id']; |
|
1030 | + }?>" type="text" name="geodir_article_open_id" placeholder="geodir-wrapper-content"/></td> |
|
1031 | 1031 | <td><input value="<?php if (isset($tc['geodir_article_open_class'])) { |
1032 | - echo $tc['geodir_article_open_class']; |
|
1033 | - }?>" type="text" name="geodir_article_open_class" placeholder=""/></td> |
|
1032 | + echo $tc['geodir_article_open_class']; |
|
1033 | + }?>" type="text" name="geodir_article_open_class" placeholder=""/></td> |
|
1034 | 1034 | </tr> |
1035 | 1035 | |
1036 | 1036 | <tr class="gd-theme-comp-out"> |
@@ -1038,8 +1038,8 @@ discard block |
||
1038 | 1038 | <span><?php _e('Output:', 'geodirectory');?></span> |
1039 | 1039 | <textarea name="geodir_article_open_replace" |
1040 | 1040 | placeholder='<article id="[id]" class="[class]" itemscope itemtype="[itemtype]">'><?php if (isset($tc['geodir_article_open_replace'])) { |
1041 | - echo $tc['geodir_article_open_replace']; |
|
1042 | - }?></textarea> |
|
1041 | + echo $tc['geodir_article_open_replace']; |
|
1042 | + }?></textarea> |
|
1043 | 1043 | </td> |
1044 | 1044 | </tr> |
1045 | 1045 | |
@@ -1058,8 +1058,8 @@ discard block |
||
1058 | 1058 | <span><?php _e('Output:', 'geodirectory');?></span> |
1059 | 1059 | <textarea name="geodir_article_close_replace" |
1060 | 1060 | placeholder='</article><!-- article ends here-->'><?php if (isset($tc['geodir_article_close_replace'])) { |
1061 | - echo $tc['geodir_article_close_replace']; |
|
1062 | - }?></textarea> |
|
1061 | + echo $tc['geodir_article_close_replace']; |
|
1062 | + }?></textarea> |
|
1063 | 1063 | </td> |
1064 | 1064 | </tr> |
1065 | 1065 | |
@@ -1068,11 +1068,11 @@ discard block |
||
1068 | 1068 | <small>geodir_sidebar_right_open</small> |
1069 | 1069 | </td> |
1070 | 1070 | <td><input value="<?php if (isset($tc['geodir_sidebar_right_open_id'])) { |
1071 | - echo $tc['geodir_sidebar_right_open_id']; |
|
1072 | - }?>" type="text" name="geodir_sidebar_right_open_id" placeholder="geodir-sidebar-right"/></td> |
|
1071 | + echo $tc['geodir_sidebar_right_open_id']; |
|
1072 | + }?>" type="text" name="geodir_sidebar_right_open_id" placeholder="geodir-sidebar-right"/></td> |
|
1073 | 1073 | <td><input value="<?php if (isset($tc['geodir_sidebar_right_open_class'])) { |
1074 | - echo $tc['geodir_sidebar_right_open_class']; |
|
1075 | - }?>" type="text" name="geodir_sidebar_right_open_class" |
|
1074 | + echo $tc['geodir_sidebar_right_open_class']; |
|
1075 | + }?>" type="text" name="geodir_sidebar_right_open_class" |
|
1076 | 1076 | placeholder="geodir-sidebar-right geodir-listings-sidebar-right"/></td> |
1077 | 1077 | </tr> |
1078 | 1078 | |
@@ -1081,8 +1081,8 @@ discard block |
||
1081 | 1081 | <span><?php _e('Output:', 'geodirectory');?></span> |
1082 | 1082 | <textarea name="geodir_sidebar_right_open_replace" |
1083 | 1083 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_right_open_replace'])) { |
1084 | - echo $tc['geodir_sidebar_right_open_replace']; |
|
1085 | - }?></textarea> |
|
1084 | + echo $tc['geodir_sidebar_right_open_replace']; |
|
1085 | + }?></textarea> |
|
1086 | 1086 | </td> |
1087 | 1087 | </tr> |
1088 | 1088 | |
@@ -1101,8 +1101,8 @@ discard block |
||
1101 | 1101 | <span><?php _e('Output:', 'geodirectory');?></span> |
1102 | 1102 | <textarea name="geodir_sidebar_right_close_replace" |
1103 | 1103 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_right_close_replace'])) { |
1104 | - echo $tc['geodir_sidebar_right_close_replace']; |
|
1105 | - }?></textarea> |
|
1104 | + echo $tc['geodir_sidebar_right_close_replace']; |
|
1105 | + }?></textarea> |
|
1106 | 1106 | </td> |
1107 | 1107 | </tr> |
1108 | 1108 | |
@@ -1112,11 +1112,11 @@ discard block |
||
1112 | 1112 | <small>geodir_sidebar_left_open</small> |
1113 | 1113 | </td> |
1114 | 1114 | <td><input value="<?php if (isset($tc['geodir_sidebar_left_open_id'])) { |
1115 | - echo $tc['geodir_sidebar_left_open_id']; |
|
1116 | - }?>" type="text" name="geodir_sidebar_left_open_id" placeholder="geodir-sidebar-left"/></td> |
|
1115 | + echo $tc['geodir_sidebar_left_open_id']; |
|
1116 | + }?>" type="text" name="geodir_sidebar_left_open_id" placeholder="geodir-sidebar-left"/></td> |
|
1117 | 1117 | <td><input value="<?php if (isset($tc['geodir_sidebar_left_open_class'])) { |
1118 | - echo $tc['geodir_sidebar_left_open_class']; |
|
1119 | - }?>" type="text" name="geodir_sidebar_left_open_class" |
|
1118 | + echo $tc['geodir_sidebar_left_open_class']; |
|
1119 | + }?>" type="text" name="geodir_sidebar_left_open_class" |
|
1120 | 1120 | placeholder="geodir-sidebar-left geodir-listings-sidebar-left"/></td> |
1121 | 1121 | </tr> |
1122 | 1122 | |
@@ -1125,8 +1125,8 @@ discard block |
||
1125 | 1125 | <span><?php _e('Output:', 'geodirectory');?></span> |
1126 | 1126 | <textarea name="geodir_sidebar_left_open_replace" |
1127 | 1127 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_left_open_replace'])) { |
1128 | - echo $tc['geodir_sidebar_left_open_replace']; |
|
1129 | - }?></textarea> |
|
1128 | + echo $tc['geodir_sidebar_left_open_replace']; |
|
1129 | + }?></textarea> |
|
1130 | 1130 | </td> |
1131 | 1131 | </tr> |
1132 | 1132 | |
@@ -1145,8 +1145,8 @@ discard block |
||
1145 | 1145 | <span><?php _e('Output:', 'geodirectory');?></span> |
1146 | 1146 | <textarea name="geodir_sidebar_left_close_replace" |
1147 | 1147 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_left_close_replace'])) { |
1148 | - echo $tc['geodir_sidebar_left_close_replace']; |
|
1149 | - }?></textarea> |
|
1148 | + echo $tc['geodir_sidebar_left_close_replace']; |
|
1149 | + }?></textarea> |
|
1150 | 1150 | </td> |
1151 | 1151 | </tr> |
1152 | 1152 | |
@@ -1155,11 +1155,11 @@ discard block |
||
1155 | 1155 | <small>geodir_main_content_open</small> |
1156 | 1156 | </td> |
1157 | 1157 | <td><input value="<?php if (isset($tc['geodir_main_content_open_id'])) { |
1158 | - echo $tc['geodir_main_content_open_id']; |
|
1159 | - }?>" type="text" name="geodir_main_content_open_id" placeholder="geodir-main-content"/></td> |
|
1158 | + echo $tc['geodir_main_content_open_id']; |
|
1159 | + }?>" type="text" name="geodir_main_content_open_id" placeholder="geodir-main-content"/></td> |
|
1160 | 1160 | <td><input value="<?php if (isset($tc['geodir_main_content_open_class'])) { |
1161 | - echo $tc['geodir_main_content_open_class']; |
|
1162 | - }?>" type="text" name="geodir_main_content_open_class" placeholder="CURRENT-PAGE-page"/></td> |
|
1161 | + echo $tc['geodir_main_content_open_class']; |
|
1162 | + }?>" type="text" name="geodir_main_content_open_class" placeholder="CURRENT-PAGE-page"/></td> |
|
1163 | 1163 | </tr> |
1164 | 1164 | |
1165 | 1165 | <tr class="gd-theme-comp-out"> |
@@ -1167,8 +1167,8 @@ discard block |
||
1167 | 1167 | <span><?php _e('Output:', 'geodirectory');?></span> |
1168 | 1168 | <textarea name="geodir_main_content_open_replace" |
1169 | 1169 | placeholder='<main id="[id]" class="[class]" role="main">'><?php if (isset($tc['geodir_main_content_open_replace'])) { |
1170 | - echo $tc['geodir_main_content_open_replace']; |
|
1171 | - }?></textarea> |
|
1170 | + echo $tc['geodir_main_content_open_replace']; |
|
1171 | + }?></textarea> |
|
1172 | 1172 | </td> |
1173 | 1173 | </tr> |
1174 | 1174 | |
@@ -1187,8 +1187,8 @@ discard block |
||
1187 | 1187 | <span><?php _e('Output:', 'geodirectory');?></span> |
1188 | 1188 | <textarea name="geodir_main_content_close_replace" |
1189 | 1189 | placeholder='</main><!-- main ends here-->'><?php if (isset($tc['geodir_main_content_close_replace'])) { |
1190 | - echo $tc['geodir_main_content_close_replace']; |
|
1191 | - }?></textarea> |
|
1190 | + echo $tc['geodir_main_content_close_replace']; |
|
1191 | + }?></textarea> |
|
1192 | 1192 | </td> |
1193 | 1193 | </tr> |
1194 | 1194 | |
@@ -1212,8 +1212,8 @@ discard block |
||
1212 | 1212 | </td> |
1213 | 1213 | <td><textarea name="geodir_top_content_add" |
1214 | 1214 | placeholder=''><?php if (isset($tc['geodir_top_content_add'])) { |
1215 | - echo $tc['geodir_top_content_add']; |
|
1216 | - }?></textarea></td> |
|
1215 | + echo $tc['geodir_top_content_add']; |
|
1216 | + }?></textarea></td> |
|
1217 | 1217 | </tr> |
1218 | 1218 | |
1219 | 1219 | <tr> |
@@ -1222,8 +1222,8 @@ discard block |
||
1222 | 1222 | </td> |
1223 | 1223 | <td><textarea name="geodir_before_main_content_add" |
1224 | 1224 | placeholder=''><?php if (isset($tc['geodir_before_main_content_add'])) { |
1225 | - echo $tc['geodir_before_main_content_add']; |
|
1226 | - }?></textarea></td> |
|
1225 | + echo $tc['geodir_before_main_content_add']; |
|
1226 | + }?></textarea></td> |
|
1227 | 1227 | </tr> |
1228 | 1228 | |
1229 | 1229 | |
@@ -1246,8 +1246,8 @@ discard block |
||
1246 | 1246 | </td> |
1247 | 1247 | <td><textarea name="geodir_full_page_class_filter" |
1248 | 1248 | placeholder='geodir_full_page clearfix'><?php if (isset($tc['geodir_full_page_class_filter'])) { |
1249 | - echo $tc['geodir_full_page_class_filter']; |
|
1250 | - }?></textarea></td> |
|
1249 | + echo $tc['geodir_full_page_class_filter']; |
|
1250 | + }?></textarea></td> |
|
1251 | 1251 | </tr> |
1252 | 1252 | |
1253 | 1253 | <tr> |
@@ -1256,8 +1256,8 @@ discard block |
||
1256 | 1256 | </td> |
1257 | 1257 | <td><textarea name="geodir_before_widget_filter" |
1258 | 1258 | placeholder='<section id="%1$s" class="widget geodir-widget %2$s">'><?php if (isset($tc['geodir_before_widget_filter'])) { |
1259 | - echo $tc['geodir_before_widget_filter']; |
|
1260 | - }?></textarea></td> |
|
1259 | + echo $tc['geodir_before_widget_filter']; |
|
1260 | + }?></textarea></td> |
|
1261 | 1261 | </tr> |
1262 | 1262 | |
1263 | 1263 | <tr> |
@@ -1266,8 +1266,8 @@ discard block |
||
1266 | 1266 | </td> |
1267 | 1267 | <td><textarea name="geodir_after_widget_filter" |
1268 | 1268 | placeholder='</section>'><?php if (isset($tc['geodir_after_widget_filter'])) { |
1269 | - echo $tc['geodir_after_widget_filter']; |
|
1270 | - }?></textarea></td> |
|
1269 | + echo $tc['geodir_after_widget_filter']; |
|
1270 | + }?></textarea></td> |
|
1271 | 1271 | </tr> |
1272 | 1272 | |
1273 | 1273 | <tr> |
@@ -1276,8 +1276,8 @@ discard block |
||
1276 | 1276 | </td> |
1277 | 1277 | <td><textarea name="geodir_before_title_filter" |
1278 | 1278 | placeholder='<h3 class="widget-title">'><?php if (isset($tc['geodir_before_title_filter'])) { |
1279 | - echo $tc['geodir_before_title_filter']; |
|
1280 | - }?></textarea></td> |
|
1279 | + echo $tc['geodir_before_title_filter']; |
|
1280 | + }?></textarea></td> |
|
1281 | 1281 | </tr> |
1282 | 1282 | |
1283 | 1283 | <tr> |
@@ -1286,8 +1286,8 @@ discard block |
||
1286 | 1286 | </td> |
1287 | 1287 | <td><textarea name="geodir_after_title_filter" |
1288 | 1288 | placeholder='</h3>'><?php if (isset($tc['geodir_after_title_filter'])) { |
1289 | - echo $tc['geodir_after_title_filter']; |
|
1290 | - }?></textarea></td> |
|
1289 | + echo $tc['geodir_after_title_filter']; |
|
1290 | + }?></textarea></td> |
|
1291 | 1291 | </tr> |
1292 | 1292 | |
1293 | 1293 | <tr> |
@@ -1296,8 +1296,8 @@ discard block |
||
1296 | 1296 | </td> |
1297 | 1297 | <td><textarea name="geodir_menu_li_class_filter" |
1298 | 1298 | placeholder='menu-item'><?php if (isset($tc['geodir_menu_li_class_filter'])) { |
1299 | - echo $tc['geodir_menu_li_class_filter']; |
|
1300 | - }?></textarea></td> |
|
1299 | + echo $tc['geodir_menu_li_class_filter']; |
|
1300 | + }?></textarea></td> |
|
1301 | 1301 | </tr> |
1302 | 1302 | |
1303 | 1303 | <tr> |
@@ -1306,8 +1306,8 @@ discard block |
||
1306 | 1306 | </td> |
1307 | 1307 | <td><textarea name="geodir_sub_menu_ul_class_filter" |
1308 | 1308 | placeholder='sub-menu'><?php if (isset($tc['geodir_sub_menu_ul_class_filter'])) { |
1309 | - echo $tc['geodir_sub_menu_ul_class_filter']; |
|
1310 | - }?></textarea></td> |
|
1309 | + echo $tc['geodir_sub_menu_ul_class_filter']; |
|
1310 | + }?></textarea></td> |
|
1311 | 1311 | </tr> |
1312 | 1312 | |
1313 | 1313 | <tr> |
@@ -1316,8 +1316,8 @@ discard block |
||
1316 | 1316 | </td> |
1317 | 1317 | <td><textarea name="geodir_sub_menu_li_class_filter" |
1318 | 1318 | placeholder='menu-item'><?php if (isset($tc['geodir_sub_menu_li_class_filter'])) { |
1319 | - echo $tc['geodir_sub_menu_li_class_filter']; |
|
1320 | - }?></textarea></td> |
|
1319 | + echo $tc['geodir_sub_menu_li_class_filter']; |
|
1320 | + }?></textarea></td> |
|
1321 | 1321 | </tr> |
1322 | 1322 | |
1323 | 1323 | <tr> |
@@ -1326,8 +1326,8 @@ discard block |
||
1326 | 1326 | </td> |
1327 | 1327 | <td><textarea name="geodir_menu_a_class_filter" |
1328 | 1328 | placeholder=''><?php if (isset($tc['geodir_menu_a_class_filter'])) { |
1329 | - echo $tc['geodir_menu_a_class_filter']; |
|
1330 | - }?></textarea></td> |
|
1329 | + echo $tc['geodir_menu_a_class_filter']; |
|
1330 | + }?></textarea></td> |
|
1331 | 1331 | </tr> |
1332 | 1332 | |
1333 | 1333 | <tr> |
@@ -1336,8 +1336,8 @@ discard block |
||
1336 | 1336 | </td> |
1337 | 1337 | <td><textarea name="geodir_sub_menu_a_class_filter" |
1338 | 1338 | placeholder=''><?php if (isset($tc['geodir_sub_menu_a_class_filter'])) { |
1339 | - echo $tc['geodir_sub_menu_a_class_filter']; |
|
1340 | - }?></textarea></td> |
|
1339 | + echo $tc['geodir_sub_menu_a_class_filter']; |
|
1340 | + }?></textarea></td> |
|
1341 | 1341 | </tr> |
1342 | 1342 | |
1343 | 1343 | |
@@ -1347,8 +1347,8 @@ discard block |
||
1347 | 1347 | </td> |
1348 | 1348 | <td><textarea name="geodir_location_switcher_menu_li_class_filter" |
1349 | 1349 | placeholder='menu-item menu-item-type-social menu-item-type-social gd-location-switcher'><?php if (isset($tc['geodir_location_switcher_menu_li_class_filter'])) { |
1350 | - echo $tc['geodir_location_switcher_menu_li_class_filter']; |
|
1351 | - }?></textarea></td> |
|
1350 | + echo $tc['geodir_location_switcher_menu_li_class_filter']; |
|
1351 | + }?></textarea></td> |
|
1352 | 1352 | </tr> |
1353 | 1353 | |
1354 | 1354 | <tr> |
@@ -1357,8 +1357,8 @@ discard block |
||
1357 | 1357 | </td> |
1358 | 1358 | <td><textarea name="geodir_location_switcher_menu_a_class_filter" |
1359 | 1359 | placeholder=''><?php if (isset($tc['geodir_location_switcher_menu_a_class_filter'])) { |
1360 | - echo $tc['geodir_location_switcher_menu_a_class_filter']; |
|
1361 | - }?></textarea></td> |
|
1360 | + echo $tc['geodir_location_switcher_menu_a_class_filter']; |
|
1361 | + }?></textarea></td> |
|
1362 | 1362 | </tr> |
1363 | 1363 | |
1364 | 1364 | <tr> |
@@ -1367,8 +1367,8 @@ discard block |
||
1367 | 1367 | </td> |
1368 | 1368 | <td><textarea name="geodir_location_switcher_menu_sub_ul_class_filter" |
1369 | 1369 | placeholder='sub-menu'><?php if (isset($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) { |
1370 | - echo $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
1371 | - }?></textarea></td> |
|
1370 | + echo $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
1371 | + }?></textarea></td> |
|
1372 | 1372 | </tr> |
1373 | 1373 | |
1374 | 1374 | <tr> |
@@ -1377,21 +1377,21 @@ discard block |
||
1377 | 1377 | </td> |
1378 | 1378 | <td><textarea name="geodir_location_switcher_menu_sub_li_class_filter" |
1379 | 1379 | placeholder='menu-item gd-location-switcher-menu-item'><?php if (isset($tc['geodir_location_switcher_menu_sub_li_class_filter'])) { |
1380 | - echo $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
1381 | - }?></textarea></td> |
|
1380 | + echo $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
1381 | + }?></textarea></td> |
|
1382 | 1382 | </tr> |
1383 | 1383 | |
1384 | 1384 | |
1385 | 1385 | |
1386 | 1386 | <?php |
1387 | - /** |
|
1388 | - * Allows more filter setting to be added to theme compatibility settings page. |
|
1389 | - * |
|
1390 | - * Called after the last setting in "Other filters" section of theme compatibility settings. |
|
1391 | - * |
|
1392 | - * @since 1.4.0 |
|
1393 | - */ |
|
1394 | - do_action('gd_compat_other_filters');?> |
|
1387 | + /** |
|
1388 | + * Allows more filter setting to be added to theme compatibility settings page. |
|
1389 | + * |
|
1390 | + * Called after the last setting in "Other filters" section of theme compatibility settings. |
|
1391 | + * |
|
1392 | + * @since 1.4.0 |
|
1393 | + */ |
|
1394 | + do_action('gd_compat_other_filters');?> |
|
1395 | 1395 | |
1396 | 1396 | </tbody> |
1397 | 1397 | </table> |
@@ -1404,8 +1404,8 @@ discard block |
||
1404 | 1404 | <tr> |
1405 | 1405 | <td><textarea name="geodir_theme_compat_css" |
1406 | 1406 | placeholder=''><?php if (isset($tc['geodir_theme_compat_css'])) { |
1407 | - echo $tc['geodir_theme_compat_css']; |
|
1408 | - }?></textarea></td> |
|
1407 | + echo $tc['geodir_theme_compat_css']; |
|
1408 | + }?></textarea></td> |
|
1409 | 1409 | </tr> |
1410 | 1410 | |
1411 | 1411 | |
@@ -1419,8 +1419,8 @@ discard block |
||
1419 | 1419 | <tr> |
1420 | 1420 | <td><textarea name="geodir_theme_compat_js" |
1421 | 1421 | placeholder=''><?php if (isset($tc['geodir_theme_compat_js'])) { |
1422 | - echo $tc['geodir_theme_compat_js']; |
|
1423 | - }?></textarea></td> |
|
1422 | + echo $tc['geodir_theme_compat_js']; |
|
1423 | + }?></textarea></td> |
|
1424 | 1424 | </tr> |
1425 | 1425 | |
1426 | 1426 | |
@@ -1447,23 +1447,23 @@ discard block |
||
1447 | 1447 | */ |
1448 | 1448 | function geodir_custom_post_type_form() |
1449 | 1449 | { |
1450 | - $listing_type = ($_REQUEST['listing_type'] != '') ? $_REQUEST['listing_type'] : 'gd_place'; |
|
1450 | + $listing_type = ($_REQUEST['listing_type'] != '') ? $_REQUEST['listing_type'] : 'gd_place'; |
|
1451 | 1451 | |
1452 | - $sub_tab = ($_REQUEST['subtab'] != '') ? $_REQUEST['subtab'] : ''; |
|
1452 | + $sub_tab = ($_REQUEST['subtab'] != '') ? $_REQUEST['subtab'] : ''; |
|
1453 | 1453 | |
1454 | 1454 | |
1455 | - ?> |
|
1455 | + ?> |
|
1456 | 1456 | |
1457 | 1457 | <div class="gd-content-heading"> |
1458 | 1458 | <?php |
1459 | - /** |
|
1460 | - * Filter custom fields panel heading. |
|
1461 | - * |
|
1462 | - * @since 1.0.0 |
|
1463 | - * @param string $sub_tab Sub tab name. |
|
1464 | - * @param string $listing_type Post type. |
|
1465 | - */ |
|
1466 | - ?> |
|
1459 | + /** |
|
1460 | + * Filter custom fields panel heading. |
|
1461 | + * |
|
1462 | + * @since 1.0.0 |
|
1463 | + * @param string $sub_tab Sub tab name. |
|
1464 | + * @param string $listing_type Post type. |
|
1465 | + */ |
|
1466 | + ?> |
|
1467 | 1467 | <h3><?php echo apply_filters('geodir_custom_fields_panel_head', '', $sub_tab, $listing_type);?></h3> |
1468 | 1468 | </div> |
1469 | 1469 | <div id="container_general" class="clearfix"> |
@@ -1471,25 +1471,25 @@ discard block |
||
1471 | 1471 | |
1472 | 1472 | <div class="side-sortables" id="geodir-available-fields"> |
1473 | 1473 | <?php |
1474 | - /** |
|
1475 | - * Filter custom field available fields heading. |
|
1476 | - * |
|
1477 | - * @since 1.0.0 |
|
1478 | - * @param string $sub_tab Sub tab name. |
|
1479 | - * @param string $listing_type Post type. |
|
1480 | - */ |
|
1481 | - ?> |
|
1474 | + /** |
|
1475 | + * Filter custom field available fields heading. |
|
1476 | + * |
|
1477 | + * @since 1.0.0 |
|
1478 | + * @param string $sub_tab Sub tab name. |
|
1479 | + * @param string $listing_type Post type. |
|
1480 | + */ |
|
1481 | + ?> |
|
1482 | 1482 | <h3 class="hndle"><span><?php echo apply_filters('geodir_cf_panel_available_fields_head', '', $sub_tab, $listing_type);?> |
1483 | 1483 | </span></h3> |
1484 | 1484 | <?php |
1485 | - /** |
|
1486 | - * Filter custom field available fields note text. |
|
1487 | - * |
|
1488 | - * @since 1.0.0 |
|
1489 | - * @param string $sub_tab Sub tab name. |
|
1490 | - * @param string $listing_type Post type. |
|
1491 | - */ |
|
1492 | - ?> |
|
1485 | + /** |
|
1486 | + * Filter custom field available fields note text. |
|
1487 | + * |
|
1488 | + * @since 1.0.0 |
|
1489 | + * @param string $sub_tab Sub tab name. |
|
1490 | + * @param string $listing_type Post type. |
|
1491 | + */ |
|
1492 | + ?> |
|
1493 | 1493 | <p><?php echo apply_filters('geodir_cf_panel_available_fields_note', '', $sub_tab, $listing_type);?></p> |
1494 | 1494 | |
1495 | 1495 | <h3><?php _e('Setup New Field','geodirectory');?></h3> |
@@ -1498,13 +1498,13 @@ discard block |
||
1498 | 1498 | <div id="gt-form-builder-tab" class="gt-tabs-panel"> |
1499 | 1499 | |
1500 | 1500 | <?php |
1501 | - /** |
|
1502 | - * Adds the available fields to the custom fields settings page per post type. |
|
1503 | - * |
|
1504 | - * @since 1.0.0 |
|
1505 | - * @param string $sub_tab The current settings tab name. |
|
1506 | - */ |
|
1507 | - do_action('geodir_manage_available_fields', $sub_tab); ?> |
|
1501 | + /** |
|
1502 | + * Adds the available fields to the custom fields settings page per post type. |
|
1503 | + * |
|
1504 | + * @since 1.0.0 |
|
1505 | + * @param string $sub_tab The current settings tab name. |
|
1506 | + */ |
|
1507 | + do_action('geodir_manage_available_fields', $sub_tab); ?> |
|
1508 | 1508 | |
1509 | 1509 | <div style="clear:both"></div> |
1510 | 1510 | </div> |
@@ -1519,13 +1519,13 @@ discard block |
||
1519 | 1519 | <div id="gt-form-builder-tab" class="gt-tabs-panel"> |
1520 | 1520 | |
1521 | 1521 | <?php |
1522 | - /** |
|
1523 | - * Adds the available fields to the custom fields predefined settings page per post type. |
|
1524 | - * |
|
1525 | - * @since 1.6.9 |
|
1526 | - * @param string $sub_tab The current settings tab name. |
|
1527 | - */ |
|
1528 | - do_action('geodir_manage_available_fields_predefined', $sub_tab); ?> |
|
1522 | + /** |
|
1523 | + * Adds the available fields to the custom fields predefined settings page per post type. |
|
1524 | + * |
|
1525 | + * @since 1.6.9 |
|
1526 | + * @param string $sub_tab The current settings tab name. |
|
1527 | + */ |
|
1528 | + do_action('geodir_manage_available_fields_predefined', $sub_tab); ?> |
|
1529 | 1529 | |
1530 | 1530 | <div style="clear:both"></div> |
1531 | 1531 | </div> |
@@ -1538,13 +1538,13 @@ discard block |
||
1538 | 1538 | <div id="gt-form-builder-tab" class="gt-tabs-panel"> |
1539 | 1539 | |
1540 | 1540 | <?php |
1541 | - /** |
|
1542 | - * Adds the available fields to the custom fields custom added settings page per post type. |
|
1543 | - * |
|
1544 | - * @since 1.6.9 |
|
1545 | - * @param string $sub_tab The current settings tab name. |
|
1546 | - */ |
|
1547 | - do_action('geodir_manage_available_fields_custom', $sub_tab); ?> |
|
1541 | + /** |
|
1542 | + * Adds the available fields to the custom fields custom added settings page per post type. |
|
1543 | + * |
|
1544 | + * @since 1.6.9 |
|
1545 | + * @param string $sub_tab The current settings tab name. |
|
1546 | + */ |
|
1547 | + do_action('geodir_manage_available_fields_custom', $sub_tab); ?> |
|
1548 | 1548 | |
1549 | 1549 | <div style="clear:both"></div> |
1550 | 1550 | </div> |
@@ -1561,25 +1561,25 @@ discard block |
||
1561 | 1561 | <div class="side-sortables" id="geodir-selected-fields"> |
1562 | 1562 | <h3 class="hndle"> |
1563 | 1563 | <?php |
1564 | - /** |
|
1565 | - * Filter custom field selected fields heading. |
|
1566 | - * |
|
1567 | - * @since 1.0.0 |
|
1568 | - * @param string $sub_tab Sub tab name. |
|
1569 | - * @param string $listing_type Post type. |
|
1570 | - */ |
|
1571 | - ?> |
|
1564 | + /** |
|
1565 | + * Filter custom field selected fields heading. |
|
1566 | + * |
|
1567 | + * @since 1.0.0 |
|
1568 | + * @param string $sub_tab Sub tab name. |
|
1569 | + * @param string $listing_type Post type. |
|
1570 | + */ |
|
1571 | + ?> |
|
1572 | 1572 | <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type);?></span> |
1573 | 1573 | </h3> |
1574 | 1574 | <?php |
1575 | - /** |
|
1576 | - * Filter custom field selected fields note text. |
|
1577 | - * |
|
1578 | - * @since 1.0.0 |
|
1579 | - * @param string $sub_tab Sub tab name. |
|
1580 | - * @param string $listing_type Post type. |
|
1581 | - */ |
|
1582 | - ?> |
|
1575 | + /** |
|
1576 | + * Filter custom field selected fields note text. |
|
1577 | + * |
|
1578 | + * @since 1.0.0 |
|
1579 | + * @param string $sub_tab Sub tab name. |
|
1580 | + * @param string $listing_type Post type. |
|
1581 | + */ |
|
1582 | + ?> |
|
1583 | 1583 | <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type);?></p> |
1584 | 1584 | |
1585 | 1585 | <div class="inside"> |
@@ -1587,13 +1587,13 @@ discard block |
||
1587 | 1587 | <div id="gt-form-builder-tab" class="gt-tabs-panel"> |
1588 | 1588 | <div class="field_row_main"> |
1589 | 1589 | <?php |
1590 | - /** |
|
1591 | - * Adds the selected fields and setting to the custom fields settings page per post type. |
|
1592 | - * |
|
1593 | - * @since 1.0.0 |
|
1594 | - * @param string $sub_tab The current settings tab name. |
|
1595 | - */ |
|
1596 | - do_action('geodir_manage_selected_fields', $sub_tab); ?> |
|
1590 | + /** |
|
1591 | + * Adds the selected fields and setting to the custom fields settings page per post type. |
|
1592 | + * |
|
1593 | + * @since 1.0.0 |
|
1594 | + * @param string $sub_tab The current settings tab name. |
|
1595 | + */ |
|
1596 | + do_action('geodir_manage_selected_fields', $sub_tab); ?> |
|
1597 | 1597 | </div> |
1598 | 1598 | <div style="clear:both"></div> |
1599 | 1599 | </div> |
@@ -1616,7 +1616,7 @@ discard block |
||
1616 | 1616 | */ |
1617 | 1617 | function geodir_diagnostic_tools_setting_page() |
1618 | 1618 | { |
1619 | - ?> |
|
1619 | + ?> |
|
1620 | 1620 | <div class="inner_content_tab_main"> |
1621 | 1621 | <div class="gd-content-heading"> |
1622 | 1622 | |
@@ -1680,27 +1680,27 @@ discard block |
||
1680 | 1680 | |
1681 | 1681 | <tr> |
1682 | 1682 | <?php |
1683 | - $l_count = geodir_total_listings_count(); |
|
1684 | - $step_max_items = geodir_get_diagnose_step_max_items(); |
|
1685 | - if ($l_count > $step_max_items) { |
|
1686 | - $multiple = 'data-step="1"'; |
|
1687 | - } else { |
|
1688 | - $multiple = ""; |
|
1689 | - } |
|
1690 | - ?> |
|
1683 | + $l_count = geodir_total_listings_count(); |
|
1684 | + $step_max_items = geodir_get_diagnose_step_max_items(); |
|
1685 | + if ($l_count > $step_max_items) { |
|
1686 | + $multiple = 'data-step="1"'; |
|
1687 | + } else { |
|
1688 | + $multiple = ""; |
|
1689 | + } |
|
1690 | + ?> |
|
1691 | 1691 | <td><?php _e('Sync GD tags', 'geodirectory');?></td> |
1692 | 1692 | <td> |
1693 | 1693 | <small><?php _e('This tool can be used when tags are showing in the backend but missing from the front end.', 'geodirectory');?></small> |
1694 | 1694 | <?php |
1695 | - if ($l_count > $step_max_items) { |
|
1696 | - ?> |
|
1695 | + if ($l_count > $step_max_items) { |
|
1696 | + ?> |
|
1697 | 1697 | <table id="tags_sync_sub_table" class="widefat" style="display: none"> |
1698 | 1698 | <?php |
1699 | - $all_postypes = geodir_get_posttypes('array'); |
|
1699 | + $all_postypes = geodir_get_posttypes('array'); |
|
1700 | 1700 | |
1701 | - if (!empty($all_postypes)) { |
|
1702 | - foreach ($all_postypes as $key => $value) { |
|
1703 | - ?> |
|
1701 | + if (!empty($all_postypes)) { |
|
1702 | + foreach ($all_postypes as $key => $value) { |
|
1703 | + ?> |
|
1704 | 1704 | <tr id="tags_sync_<?php echo $key; ?>"> |
1705 | 1705 | <td> |
1706 | 1706 | <?php echo $value['labels']['name']; ?> |
@@ -1711,13 +1711,13 @@ discard block |
||
1711 | 1711 | </td> |
1712 | 1712 | </tr> |
1713 | 1713 | <?php |
1714 | - } |
|
1715 | - } |
|
1716 | - ?> |
|
1714 | + } |
|
1715 | + } |
|
1716 | + ?> |
|
1717 | 1717 | </table> |
1718 | 1718 | <?php |
1719 | - } |
|
1720 | - ?> |
|
1719 | + } |
|
1720 | + ?> |
|
1721 | 1721 | </td> |
1722 | 1722 | <td> |
1723 | 1723 | <input type="button" value="<?php _e('Run', 'geodirectory');?>" |
@@ -1765,13 +1765,13 @@ discard block |
||
1765 | 1765 | </td> |
1766 | 1766 | </tr> |
1767 | 1767 | <?php |
1768 | - /** |
|
1769 | - * Allows you to add more setting to the GD>Tools settings page. |
|
1770 | - * |
|
1771 | - * Called after the last setting on the GD>Tools page. |
|
1772 | - * @since 1.0.0 |
|
1773 | - */ |
|
1774 | - do_action('geodir_diagnostic_tool');?> |
|
1768 | + /** |
|
1769 | + * Allows you to add more setting to the GD>Tools settings page. |
|
1770 | + * |
|
1771 | + * Called after the last setting on the GD>Tools page. |
|
1772 | + * @since 1.0.0 |
|
1773 | + */ |
|
1774 | + do_action('geodir_diagnostic_tool');?> |
|
1775 | 1775 | |
1776 | 1776 | </tbody> |
1777 | 1777 | </table> |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @param array $tabs The array of tabs to display. |
53 | 53 | */ |
54 | 54 | $tabs = apply_filters('geodir_settings_tabs_array', $tabs); |
55 | - update_option('geodir_tabs', $tabs);// Important to show settings menu dropdown |
|
55 | + update_option('geodir_tabs', $tabs); // Important to show settings menu dropdown |
|
56 | 56 | |
57 | 57 | foreach ($tabs as $name => $args) : |
58 | 58 | $label = $args['label']; |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | |
64 | 64 | $subtabs = $args['subtabs']; |
65 | 65 | |
66 | - $query_string = '&subtab=' . $subtabs[0]['subtab']; |
|
66 | + $query_string = '&subtab='.$subtabs[0]['subtab']; |
|
67 | 67 | |
68 | 68 | endif; |
69 | 69 | |
70 | 70 | |
71 | - $tab_link = admin_url('admin.php?page=geodirectory&tab=' . $name . $query_string); |
|
71 | + $tab_link = admin_url('admin.php?page=geodirectory&tab='.$name.$query_string); |
|
72 | 72 | |
73 | 73 | if (isset($args['url']) && $args['url'] != '') { |
74 | 74 | $tab_link = $args['url']; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $tab_link = geodir_getlink($tab_link, $args['request']); |
79 | 79 | |
80 | 80 | if (isset($args['target']) && $args['target'] != '') { |
81 | - $tab_target = " target='" . sanitize_text_field($args['target']) . "' "; |
|
81 | + $tab_target = " target='".sanitize_text_field($args['target'])."' "; |
|
82 | 82 | } else |
83 | 83 | $tab_target = ''; |
84 | 84 | |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @see 'geodir_after_settings_tabs' |
94 | 94 | */ |
95 | 95 | do_action('geodir_before_settings_tabs', $name); |
96 | - echo '<li ' . $tab_active . ' ><a href="' . esc_url($tab_link) . '" ' . $tab_target . ' >' . $label . '</a></li>'; |
|
96 | + echo '<li '.$tab_active.' ><a href="'.esc_url($tab_link).'" '.$tab_target.' >'.$label.'</a></li>'; |
|
97 | 97 | /** |
98 | 98 | * Called after the individual settings tabs are output. |
99 | 99 | * |
@@ -137,11 +137,11 @@ discard block |
||
137 | 137 | $form_action = isset($sub['form_action']) ? $sub['form_action'] : ''; |
138 | 138 | } |
139 | 139 | |
140 | - $sub_tabs_link = admin_url() . 'admin.php?page=geodirectory&tab=' . $current_tab . '&subtab=' . $sub['subtab']; |
|
140 | + $sub_tabs_link = admin_url().'admin.php?page=geodirectory&tab='.$current_tab.'&subtab='.$sub['subtab']; |
|
141 | 141 | if (isset($sub['request']) && is_array($sub['request']) && !empty($sub['request'])) { |
142 | 142 | $sub_tabs_link = geodir_getlink($sub_tabs_link, $sub['request']); |
143 | 143 | } |
144 | - echo '<dd ' . $subtab_active . ' id="claim_listing"><a href="' . esc_url($sub_tabs_link) . '" >' . sanitize_text_field($sub['label']) . '</a></dd>'; |
|
144 | + echo '<dd '.$subtab_active.' id="claim_listing"><a href="'.esc_url($sub_tabs_link).'" >'.sanitize_text_field($sub['label']).'</a></dd>'; |
|
145 | 145 | } |
146 | 146 | ?> |
147 | 147 | </dl> |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | echo "inner_contet_tabs"; |
152 | 152 | } ?>"> |
153 | 153 | <form method="post" id="mainform" |
154 | - class="geodir_optionform <?php echo $current_tab . ' '; ?><?php if (isset($sub['subtab'])) { |
|
154 | + class="geodir_optionform <?php echo $current_tab.' '; ?><?php if (isset($sub['subtab'])) { |
|
155 | 155 | echo sanitize_text_field($sub['subtab']); |
156 | 156 | } ?>" action="<?php echo $form_action; ?>" enctype="multipart/form-data"> |
157 | 157 | <input type="hidden" class="active_tab" name="active_tab" |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | echo sanitize_text_field($_REQUEST['active_tab']); |
160 | 160 | } ?>"/> |
161 | 161 | <?php wp_nonce_field('geodir-settings', '_wpnonce', true, true); ?> |
162 | - <?php wp_nonce_field('geodir-settings-' . $current_tab, '_wpnonce-' . $current_tab, true, true); ?> |
|
162 | + <?php wp_nonce_field('geodir-settings-'.$current_tab, '_wpnonce-'.$current_tab, true, true); ?> |
|
163 | 163 | <?php |
164 | 164 | /** |
165 | 165 | * Used to call the content of each GD settings tab page. |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | jQuery('#last_tab').val( jQuery(this).attr('href') ); |
190 | 190 | return false;*/ |
191 | 191 | }); |
192 | - <?php if (isset($_GET['subtab']) && $_GET['subtab']) echo 'jQuery(\'ul.subsubsub li a[href="#' . sanitize_text_field($_GET['subtab']) . '"]\').click();'; ?> |
|
192 | + <?php if (isset($_GET['subtab']) && $_GET['subtab']) echo 'jQuery(\'ul.subsubsub li a[href="#'.sanitize_text_field($_GET['subtab']).'"]\').click();'; ?> |
|
193 | 193 | // Countries |
194 | 194 | jQuery('select#geodirectory_allowed_countries').change(function () { |
195 | 195 | if (jQuery(this).val() == "specific") { |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | jQuery('.geodirectory-nav-tab-wrapper a').click(function () { |
223 | 223 | if (changed) { |
224 | 224 | window.onbeforeunload = function () { |
225 | - return '<?php echo __( 'The changes you made will be lost if you navigate away from this page.', 'geodirectory'); ?>'; |
|
225 | + return '<?php echo __('The changes you made will be lost if you navigate away from this page.', 'geodirectory'); ?>'; |
|
226 | 226 | } |
227 | 227 | } else { |
228 | 228 | window.onbeforeunload = ''; |
@@ -285,14 +285,14 @@ discard block |
||
285 | 285 | |
286 | 286 | //echo $tab_name.'_array.php' ; |
287 | 287 | global $geodir_settings, $is_default, $mapzoom; |
288 | - if (file_exists(dirname(__FILE__) . '/option-pages/' . $tab_name . '_array.php')) { |
|
288 | + if (file_exists(dirname(__FILE__).'/option-pages/'.$tab_name.'_array.php')) { |
|
289 | 289 | /** |
290 | 290 | * Contains settings array for given tab. |
291 | 291 | * |
292 | 292 | * @since 1.0.0 |
293 | 293 | * @package GeoDirectory |
294 | 294 | */ |
295 | - include_once('option-pages/' . $tab_name . '_array.php'); |
|
295 | + include_once('option-pages/'.$tab_name.'_array.php'); |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | $listing_type = isset($_REQUEST['listing_type']) ? $_REQUEST['listing_type'] : ''; |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | ?> |
328 | 328 | |
329 | 329 | <p class="submit"> |
330 | - <input <?php echo $hide_save_button;?> name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" /> |
|
330 | + <input <?php echo $hide_save_button; ?> name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" /> |
|
331 | 331 | <input type="hidden" name="subtab" id="last_tab" /> |
332 | 332 | </p> |
333 | 333 | |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | |
399 | 399 | ?> |
400 | 400 | |
401 | - <h3><?php _e('Set Default Location', 'geodirectory');?></h3> |
|
401 | + <h3><?php _e('Set Default Location', 'geodirectory'); ?></h3> |
|
402 | 402 | |
403 | 403 | <input type="hidden" name="add_location" value="location"> |
404 | 404 | |
@@ -406,16 +406,16 @@ discard block |
||
406 | 406 | echo $location_result->location_id; |
407 | 407 | } ?>"> |
408 | 408 | |
409 | - <input type="hidden" name="address" id="<?php echo $prefix;?>address" value=""> |
|
409 | + <input type="hidden" name="address" id="<?php echo $prefix; ?>address" value=""> |
|
410 | 410 | |
411 | 411 | <table class="form-table default_location_form"> |
412 | 412 | <tbody> |
413 | 413 | <tr valign="top" class="single_select_page"> |
414 | - <th class="titledesc" scope="row"><?php _e('City', 'geodirectory');?></th> |
|
414 | + <th class="titledesc" scope="row"><?php _e('City', 'geodirectory'); ?></th> |
|
415 | 415 | <td class="forminp"> |
416 | 416 | <div class="gtd-formfeild required"> |
417 | 417 | <input class="require" type="text" size="80" style="width:440px" |
418 | - id="<?php echo $prefix;?>city" name="city" |
|
418 | + id="<?php echo $prefix; ?>city" name="city" |
|
419 | 419 | value="<?php if (isset($location_result->city)) { |
420 | 420 | echo $location_result->city; |
421 | 421 | } ?>"/> |
@@ -427,11 +427,11 @@ discard block |
||
427 | 427 | </td> |
428 | 428 | </tr> |
429 | 429 | <tr valign="top" class="single_select_page"> |
430 | - <th class="titledesc" scope="row"><?php _e('Region', 'geodirectory');?></th> |
|
430 | + <th class="titledesc" scope="row"><?php _e('Region', 'geodirectory'); ?></th> |
|
431 | 431 | <td class="forminp"> |
432 | 432 | <div class="gtd-formfeild required"> |
433 | 433 | <input class="require" type="text" size="80" style="width:440px" |
434 | - id="<?php echo $prefix;?>region" name="region" |
|
434 | + id="<?php echo $prefix; ?>region" name="region" |
|
435 | 435 | value="<?php if (isset($location_result->region)) { |
436 | 436 | echo $location_result->region; |
437 | 437 | } ?>"/> |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | </td> |
444 | 444 | </tr> |
445 | 445 | <tr valign="top" class="single_select_page"> |
446 | - <th class="titledesc" scope="row"><?php _e('Country', 'geodirectory');?></th> |
|
446 | + <th class="titledesc" scope="row"><?php _e('Country', 'geodirectory'); ?></th> |
|
447 | 447 | <td class="forminp"> |
448 | 448 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
449 | 449 | <?php |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | ?> |
453 | 453 | <select id="<?php echo $prefix ?>country" class="chosen_select" |
454 | 454 | data-location_type="country" name="<?php echo $prefix ?>country" |
455 | - data-placeholder="<?php _e('Choose a country.', 'geodirectory');?>" |
|
455 | + data-placeholder="<?php _e('Choose a country.', 'geodirectory'); ?>" |
|
456 | 456 | data-addsearchtermonnorecord="1" data-ajaxchosen="0" data-autoredirect="0" |
457 | 457 | data-showeverywhere="0"> |
458 | 458 | <?php geodir_get_country_dl($country, $prefix); ?> |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | </tr> |
470 | 470 | <tr valign="top" class="single_select_page gd-add-location-map"> |
471 | 471 | <th class="titledesc" |
472 | - scope="row"><?php _e('Set Location on Map', 'geodirectory');?></th> |
|
472 | + scope="row"><?php _e('Set Location on Map', 'geodirectory'); ?></th> |
|
473 | 473 | <td class="forminp"> |
474 | 474 | <?php |
475 | 475 | /** |
@@ -477,15 +477,15 @@ discard block |
||
477 | 477 | * |
478 | 478 | * @since 1.0.0 |
479 | 479 | */ |
480 | - include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");?> |
|
480 | + include(geodir_plugin_path()."/geodirectory-functions/map-functions/map_on_add_listing_page.php"); ?> |
|
481 | 481 | </td> |
482 | 482 | </tr> |
483 | 483 | <tr valign="top" class="single_select_page"> |
484 | - <th class="titledesc" scope="row"><?php _e('City Latitude', 'geodirectory');?></th> |
|
484 | + <th class="titledesc" scope="row"><?php _e('City Latitude', 'geodirectory'); ?></th> |
|
485 | 485 | <td class="forminp"> |
486 | 486 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
487 | 487 | <input type="text" class="require" size="80" style="width:440px" |
488 | - id="<?php echo $prefix;?>latitude" name="latitude" |
|
488 | + id="<?php echo $prefix; ?>latitude" name="latitude" |
|
489 | 489 | value="<?php if (isset($location_result->city_latitude)) { |
490 | 490 | echo $location_result->city_latitude; |
491 | 491 | } ?>"/> |
@@ -498,11 +498,11 @@ discard block |
||
498 | 498 | </tr> |
499 | 499 | <tr valign="top" class="single_select_page"> |
500 | 500 | <th class="titledesc" |
501 | - scope="row"><?php _e('City Longitude', 'geodirectory');?></th> |
|
501 | + scope="row"><?php _e('City Longitude', 'geodirectory'); ?></th> |
|
502 | 502 | <td class="forminp"> |
503 | 503 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
504 | 504 | <input type="text" class="require" size="80" style="width:440px" |
505 | - id="<?php echo $prefix;?>longitude" name="longitude" |
|
505 | + id="<?php echo $prefix; ?>longitude" name="longitude" |
|
506 | 506 | value="<?php if (isset($location_result->city_longitude)) { |
507 | 507 | echo $location_result->city_longitude; |
508 | 508 | } ?>"/> |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | </div> |
538 | 538 | </div> |
539 | 539 | <?php break; |
540 | - case $listing_type . '_fields_settings' : |
|
540 | + case $listing_type.'_fields_settings' : |
|
541 | 541 | |
542 | 542 | geodir_custom_post_type_form(); |
543 | 543 | |
@@ -684,12 +684,12 @@ discard block |
||
684 | 684 | $theme_name = str_replace(" ", "_", $theme->get('Name')); |
685 | 685 | } |
686 | 686 | |
687 | - if (in_array($theme_name, array('Avada', 'Enfold', 'X', 'Divi', 'Genesis', 'Jupiter', 'Multi_News','Kleo','Twenty_Seventeen'))) {// list of themes that have php files |
|
687 | + if (in_array($theme_name, array('Avada', 'Enfold', 'X', 'Divi', 'Genesis', 'Jupiter', 'Multi_News', 'Kleo', 'Twenty_Seventeen'))) {// list of themes that have php files |
|
688 | 688 | $theme_settings['geodir_theme_compat_code'] = $theme_name; |
689 | 689 | } |
690 | 690 | |
691 | 691 | |
692 | - $theme_name = $theme_name . "_custom"; |
|
692 | + $theme_name = $theme_name."_custom"; |
|
693 | 693 | $theme_arr = get_option('gd_theme_compats'); |
694 | 694 | update_option('gd_theme_compat', $theme_name); |
695 | 695 | /** |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | <div class="gd-content-heading"> |
779 | 779 | |
780 | 780 | |
781 | - <h3><?php _e('Theme Compatibility Settings', 'geodirectory');?></h3> |
|
781 | + <h3><?php _e('Theme Compatibility Settings', 'geodirectory'); ?></h3> |
|
782 | 782 | <style> |
783 | 783 | .gd-theme-compat-table { |
784 | 784 | width: 100%; |
@@ -809,11 +809,11 @@ discard block |
||
809 | 809 | </div> |
810 | 810 | <?php }?> |
811 | 811 | |
812 | - <h4><?php _e('Select Theme Compatibility Pack', 'geodirectory');?></h4> |
|
812 | + <h4><?php _e('Select Theme Compatibility Pack', 'geodirectory'); ?></h4> |
|
813 | 813 | |
814 | 814 | <select name="gd_theme_compat" id="gd_theme_compat"> |
815 | - <option value=""><?php _e('Select Theme', 'geodirectory');?></option> |
|
816 | - <option value="custom"><?php _e('Custom', 'geodirectory');?></option> |
|
815 | + <option value=""><?php _e('Select Theme', 'geodirectory'); ?></option> |
|
816 | + <option value="custom"><?php _e('Custom', 'geodirectory'); ?></option> |
|
817 | 817 | <?php |
818 | 818 | $theme_arr = get_option('gd_theme_compats'); |
819 | 819 | $theme_active = get_option('gd_theme_compat'); |
@@ -832,20 +832,20 @@ discard block |
||
832 | 832 | ?> |
833 | 833 | </select> |
834 | 834 | <button onclick="gd_comp_export();" type="button" |
835 | - class="button-primary"><?php _e('Export', 'geodirectory');?></button> |
|
835 | + class="button-primary"><?php _e('Export', 'geodirectory'); ?></button> |
|
836 | 836 | <button onclick="gd_comp_import();" type="button" |
837 | - class="button-primary"><?php _e('Import', 'geodirectory');?></button> |
|
837 | + class="button-primary"><?php _e('Import', 'geodirectory'); ?></button> |
|
838 | 838 | |
839 | 839 | <div class="gd-comp-import-export"> |
840 | 840 | <textarea id="gd-import-export-theme-comp" |
841 | - placeholder="<?php _e('Paste the JSON code here and then click import again', 'geodirectory');?>"></textarea> |
|
841 | + placeholder="<?php _e('Paste the JSON code here and then click import again', 'geodirectory'); ?>"></textarea> |
|
842 | 842 | </div> |
843 | 843 | <script> |
844 | 844 | |
845 | 845 | function gd_comp_export() { |
846 | 846 | theme = jQuery('#gd_theme_compat').val(); |
847 | 847 | if (theme == '' || theme == 'custom') { |
848 | - alert("<?php _e('Please select a theme to export','geodirectory');?>"); |
|
848 | + alert("<?php _e('Please select a theme to export', 'geodirectory'); ?>"); |
|
849 | 849 | return false; |
850 | 850 | } |
851 | 851 | jQuery('.gd-comp-import-export').show(); |
@@ -879,9 +879,9 @@ discard block |
||
879 | 879 | |
880 | 880 | jQuery.post(ajaxurl, data, function (response) { |
881 | 881 | if (response == '0') { |
882 | - alert("<?php _e('Something went wrong','geodirectory');?>"); |
|
882 | + alert("<?php _e('Something went wrong', 'geodirectory'); ?>"); |
|
883 | 883 | } else { |
884 | - alert("<?php _e('Theme Compatibility Imported','geodirectory');?>"); |
|
884 | + alert("<?php _e('Theme Compatibility Imported', 'geodirectory'); ?>"); |
|
885 | 885 | jQuery('#gd-import-export-theme-comp').val(''); |
886 | 886 | jQuery('.gd-comp-import-export').hide(); |
887 | 887 | jQuery('#gd_theme_compat').append(new Option(response, response)); |
@@ -922,14 +922,14 @@ discard block |
||
922 | 922 | |
923 | 923 | </script> |
924 | 924 | |
925 | - <h4><?php _e('Main Wrapper Actions', 'geodirectory');?></h4> |
|
925 | + <h4><?php _e('Main Wrapper Actions', 'geodirectory'); ?></h4> |
|
926 | 926 | |
927 | 927 | <table class="form-table gd-theme-compat-table"> |
928 | 928 | <tbody> |
929 | 929 | <tr> |
930 | - <td><strong><?php _e('Hook', 'geodirectory');?></strong></td> |
|
931 | - <td><strong><?php _e('ID', 'geodirectory');?></strong></td> |
|
932 | - <td><strong><?php _e('Class', 'geodirectory');?></strong></td> |
|
930 | + <td><strong><?php _e('Hook', 'geodirectory'); ?></strong></td> |
|
931 | + <td><strong><?php _e('ID', 'geodirectory'); ?></strong></td> |
|
932 | + <td><strong><?php _e('Class', 'geodirectory'); ?></strong></td> |
|
933 | 933 | </tr> |
934 | 934 | |
935 | 935 | |
@@ -947,7 +947,7 @@ discard block |
||
947 | 947 | |
948 | 948 | <tr class="gd-theme-comp-out"> |
949 | 949 | <td colspan="3"> |
950 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
950 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
951 | 951 | <textarea name="geodir_wrapper_open_replace" |
952 | 952 | placeholder='<div id="[id]" class="[class]">'><?php if (isset($tc['geodir_wrapper_open_replace'])) { |
953 | 953 | echo $tc['geodir_wrapper_open_replace']; |
@@ -961,14 +961,14 @@ discard block |
||
961 | 961 | <small>geodir_wrapper_close</small> |
962 | 962 | </td> |
963 | 963 | <td><input disabled="disabled" type="text" name="geodir_wrapper_open_id" |
964 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
964 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
965 | 965 | <td><input disabled="disabled" type="text" name="geodir_wrapper_open_class" |
966 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
966 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
967 | 967 | </tr> |
968 | 968 | |
969 | 969 | <tr class="gd-theme-comp-out"> |
970 | 970 | <td colspan="3"> |
971 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
971 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
972 | 972 | <textarea name="geodir_wrapper_close_replace" |
973 | 973 | placeholder='</div><!-- wrapper ends here-->'><?php if (isset($tc['geodir_wrapper_close_replace'])) { |
974 | 974 | echo $tc['geodir_wrapper_close_replace']; |
@@ -992,7 +992,7 @@ discard block |
||
992 | 992 | |
993 | 993 | <tr class="gd-theme-comp-out"> |
994 | 994 | <td colspan="3"> |
995 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
995 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
996 | 996 | <textarea name="geodir_wrapper_content_open_replace" |
997 | 997 | placeholder='<div id="[id]" class="[class]" role="main" [width_css]>'><?php if (isset($tc['geodir_wrapper_content_open_replace'])) { |
998 | 998 | echo $tc['geodir_wrapper_content_open_replace']; |
@@ -1006,14 +1006,14 @@ discard block |
||
1006 | 1006 | <small>geodir_wrapper_content_close</small> |
1007 | 1007 | </td> |
1008 | 1008 | <td><input disabled="disabled" type="text" name="geodir_wrapper_content_close_id" |
1009 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1009 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1010 | 1010 | <td><input disabled="disabled" type="text" name="geodir_wrapper_content_close_class" |
1011 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1011 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1012 | 1012 | </tr> |
1013 | 1013 | |
1014 | 1014 | <tr class="gd-theme-comp-out"> |
1015 | 1015 | <td colspan="3"> |
1016 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1016 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1017 | 1017 | <textarea name="geodir_wrapper_content_close_replace" |
1018 | 1018 | placeholder='</div><!-- content ends here-->'><?php if (isset($tc['geodir_wrapper_content_close_replace'])) { |
1019 | 1019 | echo $tc['geodir_wrapper_content_close_replace']; |
@@ -1035,7 +1035,7 @@ discard block |
||
1035 | 1035 | |
1036 | 1036 | <tr class="gd-theme-comp-out"> |
1037 | 1037 | <td colspan="3"> |
1038 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1038 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1039 | 1039 | <textarea name="geodir_article_open_replace" |
1040 | 1040 | placeholder='<article id="[id]" class="[class]" itemscope itemtype="[itemtype]">'><?php if (isset($tc['geodir_article_open_replace'])) { |
1041 | 1041 | echo $tc['geodir_article_open_replace']; |
@@ -1048,14 +1048,14 @@ discard block |
||
1048 | 1048 | <small>geodir_article_close</small> |
1049 | 1049 | </td> |
1050 | 1050 | <td><input disabled="disabled" type="text" name="geodir_article_close_id" |
1051 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1051 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1052 | 1052 | <td><input disabled="disabled" type="text" name="geodir_article_close_class" |
1053 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1053 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1054 | 1054 | </tr> |
1055 | 1055 | |
1056 | 1056 | <tr class="gd-theme-comp-out"> |
1057 | 1057 | <td colspan="3"> |
1058 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1058 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1059 | 1059 | <textarea name="geodir_article_close_replace" |
1060 | 1060 | placeholder='</article><!-- article ends here-->'><?php if (isset($tc['geodir_article_close_replace'])) { |
1061 | 1061 | echo $tc['geodir_article_close_replace']; |
@@ -1078,7 +1078,7 @@ discard block |
||
1078 | 1078 | |
1079 | 1079 | <tr class="gd-theme-comp-out"> |
1080 | 1080 | <td colspan="3"> |
1081 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1081 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1082 | 1082 | <textarea name="geodir_sidebar_right_open_replace" |
1083 | 1083 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_right_open_replace'])) { |
1084 | 1084 | echo $tc['geodir_sidebar_right_open_replace']; |
@@ -1091,14 +1091,14 @@ discard block |
||
1091 | 1091 | <small>geodir_sidebar_right_close</small> |
1092 | 1092 | </td> |
1093 | 1093 | <td><input disabled="disabled" type="text" name="geodir_sidebar_right_close_id" |
1094 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1094 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1095 | 1095 | <td><input disabled="disabled" type="text" name="geodir_sidebar_right_close_class" |
1096 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1096 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1097 | 1097 | </tr> |
1098 | 1098 | |
1099 | 1099 | <tr class="gd-theme-comp-out"> |
1100 | 1100 | <td colspan="3"> |
1101 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1101 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1102 | 1102 | <textarea name="geodir_sidebar_right_close_replace" |
1103 | 1103 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_right_close_replace'])) { |
1104 | 1104 | echo $tc['geodir_sidebar_right_close_replace']; |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | |
1123 | 1123 | <tr class="gd-theme-comp-out"> |
1124 | 1124 | <td colspan="3"> |
1125 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1125 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1126 | 1126 | <textarea name="geodir_sidebar_left_open_replace" |
1127 | 1127 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_left_open_replace'])) { |
1128 | 1128 | echo $tc['geodir_sidebar_left_open_replace']; |
@@ -1135,14 +1135,14 @@ discard block |
||
1135 | 1135 | <small>geodir_sidebar_left_close</small> |
1136 | 1136 | </td> |
1137 | 1137 | <td><input disabled="disabled" type="text" name="geodir_sidebar_left_close_id" |
1138 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1138 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1139 | 1139 | <td><input disabled="disabled" type="text" name="geodir_sidebar_left_close_class" |
1140 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1140 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1141 | 1141 | </tr> |
1142 | 1142 | |
1143 | 1143 | <tr class="gd-theme-comp-out"> |
1144 | 1144 | <td colspan="3"> |
1145 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1145 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1146 | 1146 | <textarea name="geodir_sidebar_left_close_replace" |
1147 | 1147 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_left_close_replace'])) { |
1148 | 1148 | echo $tc['geodir_sidebar_left_close_replace']; |
@@ -1164,7 +1164,7 @@ discard block |
||
1164 | 1164 | |
1165 | 1165 | <tr class="gd-theme-comp-out"> |
1166 | 1166 | <td colspan="3"> |
1167 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1167 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1168 | 1168 | <textarea name="geodir_main_content_open_replace" |
1169 | 1169 | placeholder='<main id="[id]" class="[class]" role="main">'><?php if (isset($tc['geodir_main_content_open_replace'])) { |
1170 | 1170 | echo $tc['geodir_main_content_open_replace']; |
@@ -1177,14 +1177,14 @@ discard block |
||
1177 | 1177 | <small>geodir_main_content_close</small> |
1178 | 1178 | </td> |
1179 | 1179 | <td><input disabled="disabled" type="text" name="geodir_main_content_close_id" |
1180 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1180 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1181 | 1181 | <td><input disabled="disabled" type="text" name="geodir_main_content_close_class" |
1182 | - placeholder="<?php _e('Not used', 'geodirectory');?>"/></td> |
|
1182 | + placeholder="<?php _e('Not used', 'geodirectory'); ?>"/></td> |
|
1183 | 1183 | </tr> |
1184 | 1184 | |
1185 | 1185 | <tr class="gd-theme-comp-out"> |
1186 | 1186 | <td colspan="3"> |
1187 | - <span><?php _e('Output:', 'geodirectory');?></span> |
|
1187 | + <span><?php _e('Output:', 'geodirectory'); ?></span> |
|
1188 | 1188 | <textarea name="geodir_main_content_close_replace" |
1189 | 1189 | placeholder='</main><!-- main ends here-->'><?php if (isset($tc['geodir_main_content_close_replace'])) { |
1190 | 1190 | echo $tc['geodir_main_content_close_replace']; |
@@ -1196,13 +1196,13 @@ discard block |
||
1196 | 1196 | </tbody> |
1197 | 1197 | </table> |
1198 | 1198 | |
1199 | - <h4><?php _e('Other Actions', 'geodirectory');?></h4> |
|
1199 | + <h4><?php _e('Other Actions', 'geodirectory'); ?></h4> |
|
1200 | 1200 | |
1201 | 1201 | <table class="form-table gd-theme-compat-table"> |
1202 | 1202 | <tbody> |
1203 | 1203 | <tr> |
1204 | - <td><strong><?php _e('Hook', 'geodirectory');?></strong></td> |
|
1205 | - <td><strong><?php _e('Content', 'geodirectory');?></strong></td> |
|
1204 | + <td><strong><?php _e('Hook', 'geodirectory'); ?></strong></td> |
|
1205 | + <td><strong><?php _e('Content', 'geodirectory'); ?></strong></td> |
|
1206 | 1206 | </tr> |
1207 | 1207 | |
1208 | 1208 | |
@@ -1231,13 +1231,13 @@ discard block |
||
1231 | 1231 | </table> |
1232 | 1232 | |
1233 | 1233 | |
1234 | - <h4><?php _e('Other Filters', 'geodirectory');?></h4> |
|
1234 | + <h4><?php _e('Other Filters', 'geodirectory'); ?></h4> |
|
1235 | 1235 | |
1236 | 1236 | <table class="form-table gd-theme-compat-table"> |
1237 | 1237 | <tbody> |
1238 | 1238 | <tr> |
1239 | - <td><strong><?php _e('Filter', 'geodirectory');?></strong></td> |
|
1240 | - <td><strong><?php _e('Content', 'geodirectory');?></strong></td> |
|
1239 | + <td><strong><?php _e('Filter', 'geodirectory'); ?></strong></td> |
|
1240 | + <td><strong><?php _e('Content', 'geodirectory'); ?></strong></td> |
|
1241 | 1241 | </tr> |
1242 | 1242 | |
1243 | 1243 | <tr> |
@@ -1391,13 +1391,13 @@ discard block |
||
1391 | 1391 | * |
1392 | 1392 | * @since 1.4.0 |
1393 | 1393 | */ |
1394 | - do_action('gd_compat_other_filters');?> |
|
1394 | + do_action('gd_compat_other_filters'); ?> |
|
1395 | 1395 | |
1396 | 1396 | </tbody> |
1397 | 1397 | </table> |
1398 | 1398 | |
1399 | 1399 | |
1400 | - <h4><?php _e('Required CSS', 'geodirectory');?></h4> |
|
1400 | + <h4><?php _e('Required CSS', 'geodirectory'); ?></h4> |
|
1401 | 1401 | |
1402 | 1402 | <table class="form-table gd-theme-compat-table"> |
1403 | 1403 | <tbody> |
@@ -1412,7 +1412,7 @@ discard block |
||
1412 | 1412 | </tbody> |
1413 | 1413 | </table> |
1414 | 1414 | |
1415 | - <h4><?php _e('Required JS', 'geodirectory');?></h4> |
|
1415 | + <h4><?php _e('Required JS', 'geodirectory'); ?></h4> |
|
1416 | 1416 | |
1417 | 1417 | <table class="form-table gd-theme-compat-table"> |
1418 | 1418 | <tbody> |
@@ -1430,7 +1430,7 @@ discard block |
||
1430 | 1430 | |
1431 | 1431 | <p class="submit"> |
1432 | 1432 | <input name="save" class="button-primary" type="submit" |
1433 | - value="<?php _e('Save changes', 'geodirectory');?>"> |
|
1433 | + value="<?php _e('Save changes', 'geodirectory'); ?>"> |
|
1434 | 1434 | </p> |
1435 | 1435 | |
1436 | 1436 | </div> |
@@ -1464,7 +1464,7 @@ discard block |
||
1464 | 1464 | * @param string $listing_type Post type. |
1465 | 1465 | */ |
1466 | 1466 | ?> |
1467 | - <h3><?php echo apply_filters('geodir_custom_fields_panel_head', '', $sub_tab, $listing_type);?></h3> |
|
1467 | + <h3><?php echo apply_filters('geodir_custom_fields_panel_head', '', $sub_tab, $listing_type); ?></h3> |
|
1468 | 1468 | </div> |
1469 | 1469 | <div id="container_general" class="clearfix"> |
1470 | 1470 | <div class="general-form-builder-frame"> |
@@ -1479,7 +1479,7 @@ discard block |
||
1479 | 1479 | * @param string $listing_type Post type. |
1480 | 1480 | */ |
1481 | 1481 | ?> |
1482 | - <h3 class="hndle"><span><?php echo apply_filters('geodir_cf_panel_available_fields_head', '', $sub_tab, $listing_type);?> |
|
1482 | + <h3 class="hndle"><span><?php echo apply_filters('geodir_cf_panel_available_fields_head', '', $sub_tab, $listing_type); ?> |
|
1483 | 1483 | </span></h3> |
1484 | 1484 | <?php |
1485 | 1485 | /** |
@@ -1490,9 +1490,9 @@ discard block |
||
1490 | 1490 | * @param string $listing_type Post type. |
1491 | 1491 | */ |
1492 | 1492 | ?> |
1493 | - <p><?php echo apply_filters('geodir_cf_panel_available_fields_note', '', $sub_tab, $listing_type);?></p> |
|
1493 | + <p><?php echo apply_filters('geodir_cf_panel_available_fields_note', '', $sub_tab, $listing_type); ?></p> |
|
1494 | 1494 | |
1495 | - <h3><?php _e('Setup New Field','geodirectory');?></h3> |
|
1495 | + <h3><?php _e('Setup New Field', 'geodirectory'); ?></h3> |
|
1496 | 1496 | <div class="inside"> |
1497 | 1497 | |
1498 | 1498 | <div id="gt-form-builder-tab" class="gt-tabs-panel"> |
@@ -1511,9 +1511,9 @@ discard block |
||
1511 | 1511 | |
1512 | 1512 | </div> |
1513 | 1513 | |
1514 | - <?php if($sub_tab=='custom_fields'){ ?> |
|
1514 | + <?php if ($sub_tab == 'custom_fields') { ?> |
|
1515 | 1515 | |
1516 | - <h3><?php _e('Predefined Fields','geodirectory');?></h3> |
|
1516 | + <h3><?php _e('Predefined Fields', 'geodirectory'); ?></h3> |
|
1517 | 1517 | <div class="inside"> |
1518 | 1518 | |
1519 | 1519 | <div id="gt-form-builder-tab" class="gt-tabs-panel"> |
@@ -1532,7 +1532,7 @@ discard block |
||
1532 | 1532 | |
1533 | 1533 | </div> |
1534 | 1534 | |
1535 | - <h3><?php _e('Custom Fields','geodirectory');?></h3> |
|
1535 | + <h3><?php _e('Custom Fields', 'geodirectory'); ?></h3> |
|
1536 | 1536 | <div class="inside"> |
1537 | 1537 | |
1538 | 1538 | <div id="gt-form-builder-tab" class="gt-tabs-panel"> |
@@ -1569,7 +1569,7 @@ discard block |
||
1569 | 1569 | * @param string $listing_type Post type. |
1570 | 1570 | */ |
1571 | 1571 | ?> |
1572 | - <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type);?></span> |
|
1572 | + <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type); ?></span> |
|
1573 | 1573 | </h3> |
1574 | 1574 | <?php |
1575 | 1575 | /** |
@@ -1580,7 +1580,7 @@ discard block |
||
1580 | 1580 | * @param string $listing_type Post type. |
1581 | 1581 | */ |
1582 | 1582 | ?> |
1583 | - <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type);?></p> |
|
1583 | + <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type); ?></p> |
|
1584 | 1584 | |
1585 | 1585 | <div class="inside"> |
1586 | 1586 | |
@@ -1621,7 +1621,7 @@ discard block |
||
1621 | 1621 | <div class="gd-content-heading"> |
1622 | 1622 | |
1623 | 1623 | |
1624 | - <h3><?php _e('GD Diagnostic Tools', 'geodirectory');?></h3> |
|
1624 | + <h3><?php _e('GD Diagnostic Tools', 'geodirectory'); ?></h3> |
|
1625 | 1625 | <style> |
1626 | 1626 | .gd-tools-table { |
1627 | 1627 | width: 100%; |
@@ -1640,40 +1640,40 @@ discard block |
||
1640 | 1640 | <table class="form-table gd-tools-table"> |
1641 | 1641 | <tbody> |
1642 | 1642 | <tr> |
1643 | - <td><strong><?php _e('Tool', 'geodirectory');?></strong></td> |
|
1644 | - <td><strong><?php _e('Description', 'geodirectory');?></strong></td> |
|
1645 | - <td><strong><?php _e('Action', 'geodirectory');?></strong></td> |
|
1643 | + <td><strong><?php _e('Tool', 'geodirectory'); ?></strong></td> |
|
1644 | + <td><strong><?php _e('Description', 'geodirectory'); ?></strong></td> |
|
1645 | + <td><strong><?php _e('Action', 'geodirectory'); ?></strong></td> |
|
1646 | 1646 | </tr> |
1647 | 1647 | |
1648 | 1648 | |
1649 | 1649 | <tr> |
1650 | - <td><?php _e('GD pages check', 'geodirectory');?></td> |
|
1650 | + <td><?php _e('GD pages check', 'geodirectory'); ?></td> |
|
1651 | 1651 | <td> |
1652 | - <small><?php _e('Checks if the GD pages are installed correctly or not.', 'geodirectory');?></small> |
|
1652 | + <small><?php _e('Checks if the GD pages are installed correctly or not.', 'geodirectory'); ?></small> |
|
1653 | 1653 | </td> |
1654 | 1654 | <td> |
1655 | - <input type="button" value="<?php _e('Run', 'geodirectory');?>" |
|
1655 | + <input type="button" value="<?php _e('Run', 'geodirectory'); ?>" |
|
1656 | 1656 | class="button-primary geodir_diagnosis_button" data-diagnose="default_pages"/> |
1657 | 1657 | </td> |
1658 | 1658 | </tr> |
1659 | 1659 | |
1660 | 1660 | |
1661 | 1661 | <tr> |
1662 | - <td><?php _e('Multisite DB conversion check', 'geodirectory');?></td> |
|
1662 | + <td><?php _e('Multisite DB conversion check', 'geodirectory'); ?></td> |
|
1663 | 1663 | <td> |
1664 | - <small><?php _e('Checks if the GD database tables have been converted to use multisite correctly.', 'geodirectory');?></small> |
|
1664 | + <small><?php _e('Checks if the GD database tables have been converted to use multisite correctly.', 'geodirectory'); ?></small> |
|
1665 | 1665 | </td> |
1666 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>" |
|
1666 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>" |
|
1667 | 1667 | class="button-primary geodir_diagnosis_button" data-diagnose="multisite_conversion"/> |
1668 | 1668 | </td> |
1669 | 1669 | </tr> |
1670 | 1670 | |
1671 | 1671 | <tr> |
1672 | - <td><?php _e('Ratings check', 'geodirectory');?></td> |
|
1672 | + <td><?php _e('Ratings check', 'geodirectory'); ?></td> |
|
1673 | 1673 | <td> |
1674 | - <small><?php _e('Checks ratings for correct location and content settings', 'geodirectory');?></small> |
|
1674 | + <small><?php _e('Checks ratings for correct location and content settings', 'geodirectory'); ?></small> |
|
1675 | 1675 | </td> |
1676 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>" |
|
1676 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>" |
|
1677 | 1677 | class="button-primary geodir_diagnosis_button" data-diagnose="ratings"/> |
1678 | 1678 | </td> |
1679 | 1679 | </tr> |
@@ -1688,9 +1688,9 @@ discard block |
||
1688 | 1688 | $multiple = ""; |
1689 | 1689 | } |
1690 | 1690 | ?> |
1691 | - <td><?php _e('Sync GD tags', 'geodirectory');?></td> |
|
1691 | + <td><?php _e('Sync GD tags', 'geodirectory'); ?></td> |
|
1692 | 1692 | <td> |
1693 | - <small><?php _e('This tool can be used when tags are showing in the backend but missing from the front end.', 'geodirectory');?></small> |
|
1693 | + <small><?php _e('This tool can be used when tags are showing in the backend but missing from the front end.', 'geodirectory'); ?></small> |
|
1694 | 1694 | <?php |
1695 | 1695 | if ($l_count > $step_max_items) { |
1696 | 1696 | ?> |
@@ -1706,7 +1706,7 @@ discard block |
||
1706 | 1706 | <?php echo $value['labels']['name']; ?> |
1707 | 1707 | </td> |
1708 | 1708 | <td> |
1709 | - <input type="button" value="<?php _e('Run', 'geodirectory');?>" |
|
1709 | + <input type="button" value="<?php _e('Run', 'geodirectory'); ?>" |
|
1710 | 1710 | class="button-primary geodir_diagnosis_button" data-ptype="<?php echo $key; ?>" data-diagnose="tags_sync"/> |
1711 | 1711 | </td> |
1712 | 1712 | </tr> |
@@ -1720,48 +1720,48 @@ discard block |
||
1720 | 1720 | ?> |
1721 | 1721 | </td> |
1722 | 1722 | <td> |
1723 | - <input type="button" value="<?php _e('Run', 'geodirectory');?>" |
|
1723 | + <input type="button" value="<?php _e('Run', 'geodirectory'); ?>" |
|
1724 | 1724 | class="button-primary geodir_diagnosis_button" <?php echo $multiple; ?> data-diagnose="tags_sync"/> |
1725 | 1725 | |
1726 | 1726 | </td> |
1727 | 1727 | </tr> |
1728 | 1728 | |
1729 | 1729 | <tr> |
1730 | - <td><?php _e('Sync GD Categories', 'geodirectory');?></td> |
|
1730 | + <td><?php _e('Sync GD Categories', 'geodirectory'); ?></td> |
|
1731 | 1731 | <td> |
1732 | - <small><?php _e('This tool can be used when categories are missing from the details table but showing in other places in the backend (only checks posts with missing category info in details table)', 'geodirectory');?></small> |
|
1732 | + <small><?php _e('This tool can be used when categories are missing from the details table but showing in other places in the backend (only checks posts with missing category info in details table)', 'geodirectory'); ?></small> |
|
1733 | 1733 | </td> |
1734 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>" |
|
1734 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>" |
|
1735 | 1735 | class="button-primary geodir_diagnosis_button" data-diagnose="cats_sync"/> |
1736 | 1736 | </td> |
1737 | 1737 | </tr> |
1738 | 1738 | |
1739 | 1739 | |
1740 | 1740 | <tr> |
1741 | - <td><?php _e('Clear all GD version numbers', 'geodirectory');?></td> |
|
1741 | + <td><?php _e('Clear all GD version numbers', 'geodirectory'); ?></td> |
|
1742 | 1742 | <td> |
1743 | - <small><?php _e('This tool will clear all GD version numbers so any upgrade functions will run again.', 'geodirectory');?></small> |
|
1743 | + <small><?php _e('This tool will clear all GD version numbers so any upgrade functions will run again.', 'geodirectory'); ?></small> |
|
1744 | 1744 | </td> |
1745 | - <td><input type="button" value="<?php _e('Run', 'geodirectory');?>" |
|
1745 | + <td><input type="button" value="<?php _e('Run', 'geodirectory'); ?>" |
|
1746 | 1746 | class="button-primary geodir_diagnosis_button" data-diagnose="version_clear"/> |
1747 | 1747 | </td> |
1748 | 1748 | </tr> |
1749 | 1749 | <tr> |
1750 | - <td><?php _e('Load custom fields translation', 'geodirectory');?></td> |
|
1750 | + <td><?php _e('Load custom fields translation', 'geodirectory'); ?></td> |
|
1751 | 1751 | <td> |
1752 | - <small><?php _e('This tool will load strings from the database into a file to translate via po editor.Ex: custom fields', 'geodirectory');?></small> |
|
1752 | + <small><?php _e('This tool will load strings from the database into a file to translate via po editor.Ex: custom fields', 'geodirectory'); ?></small> |
|
1753 | 1753 | </td> |
1754 | 1754 | <td> |
1755 | - <input type="button" value="<?php _e('Run', 'geodirectory');?>" class="button-primary geodir_diagnosis_button" data-diagnose="load_db_language"/> |
|
1755 | + <input type="button" value="<?php _e('Run', 'geodirectory'); ?>" class="button-primary geodir_diagnosis_button" data-diagnose="load_db_language"/> |
|
1756 | 1756 | </td> |
1757 | 1757 | </tr> |
1758 | 1758 | <tr> |
1759 | - <td><?php _e('Reload Countries table', 'geodirectory');?></td> |
|
1759 | + <td><?php _e('Reload Countries table', 'geodirectory'); ?></td> |
|
1760 | 1760 | <td> |
1761 | - <small><?php _e('This tool will drop and re-add the countries table, it is meant to refresh the list when countries are added/removed, if you have duplicate country problems you should merge those first or you could have orphaned posts.', 'geodirectory');?></small> |
|
1761 | + <small><?php _e('This tool will drop and re-add the countries table, it is meant to refresh the list when countries are added/removed, if you have duplicate country problems you should merge those first or you could have orphaned posts.', 'geodirectory'); ?></small> |
|
1762 | 1762 | </td> |
1763 | 1763 | <td> |
1764 | - <input type="button" value="<?php _e('Run', 'geodirectory');?>" class="button-primary geodir_diagnosis_button" data-diagnose="reload_db_countries"/> |
|
1764 | + <input type="button" value="<?php _e('Run', 'geodirectory'); ?>" class="button-primary geodir_diagnosis_button" data-diagnose="reload_db_countries"/> |
|
1765 | 1765 | </td> |
1766 | 1766 | </tr> |
1767 | 1767 | <?php |
@@ -1771,7 +1771,7 @@ discard block |
||
1771 | 1771 | * Called after the last setting on the GD>Tools page. |
1772 | 1772 | * @since 1.0.0 |
1773 | 1773 | */ |
1774 | - do_action('geodir_diagnostic_tool');?> |
|
1774 | + do_action('geodir_diagnostic_tool'); ?> |
|
1775 | 1775 | |
1776 | 1776 | </tbody> |
1777 | 1777 | </table> |
@@ -956,6 +956,9 @@ discard block |
||
956 | 956 | flush_rewrite_rules( true ); |
957 | 957 | } |
958 | 958 | |
959 | + /** |
|
960 | + * @param string $widget |
|
961 | + */ |
|
959 | 962 | function the_widget_form( $widget, $instance = array() ) { |
960 | 963 | global $wp_widget_factory; |
961 | 964 | |
@@ -968,6 +971,9 @@ discard block |
||
968 | 971 | $widget_obj->form($instance); |
969 | 972 | } |
970 | 973 | |
974 | + /** |
|
975 | + * @param string $widget |
|
976 | + */ |
|
971 | 977 | function the_widget_form_update( $widget, $new_instance = array(), $old_instance = array() ) { |
972 | 978 | global $wp_widget_factory; |
973 | 979 |
@@ -167,8 +167,9 @@ discard block |
||
167 | 167 | $geodir_is_widget_listing = false; |
168 | 168 | |
169 | 169 | $GLOBALS['post'] = $current_post; |
170 | - if (!empty($current_post)) |
|
171 | - setup_postdata($current_post); |
|
170 | + if (!empty($current_post)) { |
|
171 | + setup_postdata($current_post); |
|
172 | + } |
|
172 | 173 | $map_jason = $current_map_jason; |
173 | 174 | $map_canvas_arr = $current_map_canvas_arr; |
174 | 175 | |
@@ -916,8 +917,10 @@ discard block |
||
916 | 917 | elseif ( is_date() && $template = get_date_template() ) : |
917 | 918 | elseif ( is_archive() && $template = get_archive_template() ) : |
918 | 919 | elseif ( is_paged() && $template = get_paged_template() ) : |
919 | - else : |
|
920 | + else { |
|
921 | + : |
|
920 | 922 | $template = get_index_template(); |
923 | + } |
|
921 | 924 | endif; |
922 | 925 | /** |
923 | 926 | * Filter the path of the current template before including it. |
@@ -16,15 +16,15 @@ discard block |
||
16 | 16 | 'posts_per_page' => 1, |
17 | 17 | ); |
18 | 18 | |
19 | - $all_posts = new WP_Query( $query_args ); |
|
19 | + $all_posts = new WP_Query($query_args); |
|
20 | 20 | $post_id = null; |
21 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
21 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
22 | 22 | $post_id = get_the_ID(); |
23 | 23 | endwhile; |
24 | 24 | |
25 | 25 | $this->assertTrue(is_int($post_id)); |
26 | 26 | |
27 | - $this->go_to( get_permalink($post_id) ); |
|
27 | + $this->go_to(get_permalink($post_id)); |
|
28 | 28 | |
29 | 29 | ob_start(); |
30 | 30 | geodir_breadcrumb(); |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | // 'before_title' => '<ul>', |
120 | 120 | // 'after_title' => '<ul>' |
121 | 121 | // ); |
122 | - include_once geodir_plugin_path() . "/geodirectory-widgets/geodirectory_cpt_categories_widget.php"; |
|
122 | + include_once geodir_plugin_path()."/geodirectory-widgets/geodirectory_cpt_categories_widget.php"; |
|
123 | 123 | $params = array( |
124 | 124 | 'title' => '', |
125 | 125 | 'post_type' => array(), // NULL for all |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | public function testRegTemplate() { |
178 | 178 | // var_dump(geodir_login_page_id()); |
179 | 179 | wp_set_current_user(0); |
180 | - $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php'; |
|
180 | + $template = geodir_plugin_path().'/geodirectory-templates/geodir-signup.php'; |
|
181 | 181 | |
182 | 182 | ob_start(); |
183 | 183 | include($template); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | global $information; |
192 | 192 | $information = "hello world"; |
193 | 193 | |
194 | - $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
194 | + $template = geodir_plugin_path().'/geodirectory-templates/geodir-information.php'; |
|
195 | 195 | |
196 | 196 | ob_start(); |
197 | 197 | include($template); |
@@ -209,9 +209,9 @@ discard block |
||
209 | 209 | 'posts_per_page' => 1, |
210 | 210 | ); |
211 | 211 | |
212 | - $all_posts = new WP_Query( $query_args ); |
|
212 | + $all_posts = new WP_Query($query_args); |
|
213 | 213 | $post_id = null; |
214 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
214 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
215 | 215 | $post_id = get_the_ID(); |
216 | 216 | endwhile; |
217 | 217 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $_REQUEST['listing_type'] = 'gd_place'; |
221 | 221 | $_REQUEST['pid'] = $post_id; |
222 | 222 | ob_start(); |
223 | - $this->go_to( get_permalink(geodir_success_page_id()) ); |
|
223 | + $this->go_to(get_permalink(geodir_success_page_id())); |
|
224 | 224 | $this->load_template(); |
225 | 225 | $output = ob_get_contents(); |
226 | 226 | ob_end_clean(); |
@@ -236,9 +236,9 @@ discard block |
||
236 | 236 | 'posts_per_page' => 1, |
237 | 237 | ); |
238 | 238 | |
239 | - $all_posts = new WP_Query( $query_args ); |
|
239 | + $all_posts = new WP_Query($query_args); |
|
240 | 240 | $post_id = null; |
241 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
241 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
242 | 242 | $post_id = get_the_ID(); |
243 | 243 | endwhile; |
244 | 244 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | ); |
271 | 271 | |
272 | 272 | ob_start(); |
273 | - $this->go_to( get_permalink(geodir_preview_page_id()) ); |
|
273 | + $this->go_to(get_permalink(geodir_preview_page_id())); |
|
274 | 274 | $this->load_template(); |
275 | 275 | $output = ob_get_contents(); |
276 | 276 | ob_end_clean(); |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | wp_set_current_user(1); |
282 | 282 | |
283 | 283 | ob_start(); |
284 | - $this->go_to( get_permalink(geodir_add_listing_page_id()) ); |
|
284 | + $this->go_to(get_permalink(geodir_add_listing_page_id())); |
|
285 | 285 | $this->load_template(); |
286 | 286 | $output = ob_get_contents(); |
287 | 287 | ob_end_clean(); |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | wp_set_current_user(1); |
293 | 293 | |
294 | 294 | ob_start(); |
295 | - $this->go_to( get_permalink(geodir_location_page_id()) ); |
|
295 | + $this->go_to(get_permalink(geodir_location_page_id())); |
|
296 | 296 | $this->load_template(); |
297 | 297 | $output = ob_get_contents(); |
298 | 298 | ob_end_clean(); |
@@ -307,15 +307,15 @@ discard block |
||
307 | 307 | |
308 | 308 | $this->setPermalinkStructure(); |
309 | 309 | |
310 | - $homepage = get_page_by_title( 'GD Home page' ); |
|
311 | - if ( $homepage ) |
|
310 | + $homepage = get_page_by_title('GD Home page'); |
|
311 | + if ($homepage) |
|
312 | 312 | { |
313 | - update_option( 'page_on_front', $homepage->ID ); |
|
314 | - update_option( 'show_on_front', 'page' ); |
|
313 | + update_option('page_on_front', $homepage->ID); |
|
314 | + update_option('show_on_front', 'page'); |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | ob_start(); |
318 | - $this->go_to( home_url('/') ); |
|
318 | + $this->go_to(home_url('/')); |
|
319 | 319 | $this->load_template(); |
320 | 320 | $output = ob_get_contents(); |
321 | 321 | ob_end_clean(); |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | |
324 | 324 | |
325 | 325 | ob_start(); |
326 | - $this->go_to( home_url('/?post_type=gd_place') ); |
|
326 | + $this->go_to(home_url('/?post_type=gd_place')); |
|
327 | 327 | $this->load_template(); |
328 | 328 | $output = ob_get_contents(); |
329 | 329 | ob_end_clean(); |
@@ -335,9 +335,9 @@ discard block |
||
335 | 335 | 'posts_per_page' => 1, |
336 | 336 | ); |
337 | 337 | |
338 | - $all_posts = new WP_Query( $query_args ); |
|
338 | + $all_posts = new WP_Query($query_args); |
|
339 | 339 | $post_id = null; |
340 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
340 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
341 | 341 | $post_id = get_the_ID(); |
342 | 342 | endwhile; |
343 | 343 | |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | global $preview; |
347 | 347 | $preview = false; |
348 | 348 | ob_start(); |
349 | - $this->go_to( get_permalink($post_id) ); |
|
349 | + $this->go_to(get_permalink($post_id)); |
|
350 | 350 | $this->load_template(); |
351 | 351 | $output = ob_get_contents(); |
352 | 352 | ob_end_clean(); |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | ob_start(); |
356 | 356 | $_REQUEST['stype'] = 'gd_place'; |
357 | 357 | $_REQUEST['geodir_dashbord'] = true; |
358 | - $this->go_to( get_author_posts_url($user_id) ); |
|
358 | + $this->go_to(get_author_posts_url($user_id)); |
|
359 | 359 | $this->load_template(); |
360 | 360 | $output = ob_get_contents(); |
361 | 361 | ob_end_clean(); |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | ob_start(); |
368 | 368 | $_REQUEST['geodir_search'] = "1"; |
369 | 369 | $_REQUEST['stype'] = 'gd_place'; |
370 | - $this->go_to( home_url('/?geodir_search=1&stype=gd_place&s=test&snear=&sgeo_lat=&sgeo_lon=') ); |
|
370 | + $this->go_to(home_url('/?geodir_search=1&stype=gd_place&s=test&snear=&sgeo_lat=&sgeo_lon=')); |
|
371 | 371 | $this->load_template(); |
372 | 372 | $output = ob_get_contents(); |
373 | 373 | ob_end_clean(); |
@@ -383,9 +383,9 @@ discard block |
||
383 | 383 | 'posts_per_page' => 1, |
384 | 384 | ); |
385 | 385 | |
386 | - $all_posts = new WP_Query( $query_args ); |
|
386 | + $all_posts = new WP_Query($query_args); |
|
387 | 387 | $post_id = null; |
388 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
388 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
389 | 389 | $post_id = get_the_ID(); |
390 | 390 | endwhile; |
391 | 391 | |
@@ -413,9 +413,9 @@ discard block |
||
413 | 413 | 'posts_per_page' => 1, |
414 | 414 | ); |
415 | 415 | |
416 | - $all_posts = new WP_Query( $query_args ); |
|
416 | + $all_posts = new WP_Query($query_args); |
|
417 | 417 | $post_id = null; |
418 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
418 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
419 | 419 | $post_id = get_the_ID(); |
420 | 420 | endwhile; |
421 | 421 | |
@@ -436,23 +436,23 @@ discard block |
||
436 | 436 | $menuname = 'Primary Menu'; |
437 | 437 | $menulocation = 'primary'; |
438 | 438 | // Does the menu exist already? |
439 | - $menu_exists = wp_get_nav_menu_object( $menuname ); |
|
439 | + $menu_exists = wp_get_nav_menu_object($menuname); |
|
440 | 440 | |
441 | 441 | // If it doesn't exist, let's create it. |
442 | - if( !$menu_exists){ |
|
442 | + if (!$menu_exists) { |
|
443 | 443 | $menu_id = wp_create_nav_menu($menuname); |
444 | 444 | |
445 | 445 | // Set up default BuddyPress links and add them to the menu. |
446 | 446 | wp_update_nav_menu_item($menu_id, 0, array( |
447 | 447 | 'menu-item-title' => __('Home'), |
448 | 448 | 'menu-item-classes' => 'home', |
449 | - 'menu-item-url' => home_url( '/' ), |
|
449 | + 'menu-item-url' => home_url('/'), |
|
450 | 450 | 'menu-item-status' => 'publish')); |
451 | 451 | |
452 | - if( !has_nav_menu( $menulocation ) ){ |
|
452 | + if (!has_nav_menu($menulocation)) { |
|
453 | 453 | $locations = get_theme_mod('nav_menu_locations'); |
454 | 454 | $locations[$menulocation] = $menu_id; |
455 | - set_theme_mod( 'nav_menu_locations', $locations ); |
|
455 | + set_theme_mod('nav_menu_locations', $locations); |
|
456 | 456 | } |
457 | 457 | |
458 | 458 | update_option('geodir_theme_location_nav', array('primary')); |
@@ -469,20 +469,20 @@ discard block |
||
469 | 469 | } |
470 | 470 | |
471 | 471 | public function testBestOfWidget() { |
472 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
472 | + $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
473 | 473 | include_once($template); |
474 | 474 | |
475 | 475 | ob_start(); |
476 | 476 | $instance = array(); |
477 | 477 | $instance['use_viewing_post_type'] = '1'; |
478 | 478 | $instance['excerpt_type'] = 'show-reviews'; |
479 | - the_widget( 'geodir_bestof_widget' ); |
|
479 | + the_widget('geodir_bestof_widget'); |
|
480 | 480 | $output = ob_get_contents(); |
481 | 481 | ob_end_clean(); |
482 | 482 | $this->assertContains('bestof-widget-tab-layout', $output); |
483 | 483 | |
484 | 484 | ob_start(); |
485 | - $this->the_widget_form( 'geodir_bestof_widget' ); |
|
485 | + $this->the_widget_form('geodir_bestof_widget'); |
|
486 | 486 | $output = ob_get_contents(); |
487 | 487 | ob_end_clean(); |
488 | 488 | $this->assertContains('Number of categories', $output); |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | 'excerpt_type' => 'show-desc', |
499 | 499 | 'use_viewing_post_type' => '1' |
500 | 500 | ); |
501 | - $output = $this->the_widget_form_update( 'geodir_bestof_widget', $new_instance ); |
|
501 | + $output = $this->the_widget_form_update('geodir_bestof_widget', $new_instance); |
|
502 | 502 | $this->assertContains('20', $output['character_count']); |
503 | 503 | |
504 | 504 | ob_start(); |
@@ -510,17 +510,17 @@ discard block |
||
510 | 510 | } |
511 | 511 | |
512 | 512 | public function testCptCatsWidget() { |
513 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_cpt_categories_widget.php'; |
|
513 | + $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_cpt_categories_widget.php'; |
|
514 | 514 | include_once($template); |
515 | 515 | |
516 | 516 | ob_start(); |
517 | - the_widget( 'geodir_cpt_categories_widget' ); |
|
517 | + the_widget('geodir_cpt_categories_widget'); |
|
518 | 518 | $output = ob_get_contents(); |
519 | 519 | ob_end_clean(); |
520 | 520 | $this->assertContains('geodir_cpt_categories_widget', $output); |
521 | 521 | |
522 | 522 | ob_start(); |
523 | - $this->the_widget_form( 'geodir_cpt_categories_widget' ); |
|
523 | + $this->the_widget_form('geodir_cpt_categories_widget'); |
|
524 | 524 | $output = ob_get_contents(); |
525 | 525 | ob_end_clean(); |
526 | 526 | $this->assertContains('Select CPT', $output); |
@@ -536,13 +536,13 @@ discard block |
||
536 | 536 | 'max_count' => 'all', |
537 | 537 | 'max_level' => '1' |
538 | 538 | ); |
539 | - $output = $this->the_widget_form_update( 'geodir_cpt_categories_widget', $new_instance ); |
|
539 | + $output = $this->the_widget_form_update('geodir_cpt_categories_widget', $new_instance); |
|
540 | 540 | $this->assertContains('count', $output['sort_by']); |
541 | 541 | |
542 | 542 | } |
543 | 543 | |
544 | 544 | public function testFeaturesWidget() { |
545 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_features_widget.php'; |
|
545 | + $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_features_widget.php'; |
|
546 | 546 | include_once($template); |
547 | 547 | |
548 | 548 | $instance = array( |
@@ -554,13 +554,13 @@ discard block |
||
554 | 554 | ); |
555 | 555 | |
556 | 556 | ob_start(); |
557 | - the_widget( 'Geodir_Features_Widget', $instance); |
|
557 | + the_widget('Geodir_Features_Widget', $instance); |
|
558 | 558 | $output = ob_get_contents(); |
559 | 559 | ob_end_clean(); |
560 | 560 | $this->assertContains('widget_gd_features', $output); |
561 | 561 | |
562 | 562 | ob_start(); |
563 | - $this->the_widget_form( 'Geodir_Features_Widget', $instance ); |
|
563 | + $this->the_widget_form('Geodir_Features_Widget', $instance); |
|
564 | 564 | $output = ob_get_contents(); |
565 | 565 | ob_end_clean(); |
566 | 566 | $this->assertContains('Font Awesome Icon Color', $output); |
@@ -572,23 +572,23 @@ discard block |
||
572 | 572 | 'image1' => 'fa-recycle', |
573 | 573 | 'desc1' => 'cool', |
574 | 574 | ); |
575 | - $output = $this->the_widget_form_update( 'Geodir_Features_Widget', $new_instance ); |
|
575 | + $output = $this->the_widget_form_update('Geodir_Features_Widget', $new_instance); |
|
576 | 576 | $this->assertContains('Features', $output['title']); |
577 | 577 | |
578 | 578 | } |
579 | 579 | |
580 | 580 | public function testSliderWidget() { |
581 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_listing_slider_widget.php'; |
|
581 | + $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_listing_slider_widget.php'; |
|
582 | 582 | include_once($template); |
583 | 583 | |
584 | 584 | ob_start(); |
585 | - the_widget( 'geodir_listing_slider_widget' ); |
|
585 | + the_widget('geodir_listing_slider_widget'); |
|
586 | 586 | $output = ob_get_contents(); |
587 | 587 | ob_end_clean(); |
588 | 588 | $this->assertContains('geodir_listing_slider_view', $output); |
589 | 589 | |
590 | 590 | ob_start(); |
591 | - $this->the_widget_form( 'geodir_listing_slider_widget' ); |
|
591 | + $this->the_widget_form('geodir_listing_slider_widget'); |
|
592 | 592 | $output = ob_get_contents(); |
593 | 593 | ob_end_clean(); |
594 | 594 | $this->assertContains('Slide Show Speed', $output); |
@@ -610,23 +610,23 @@ discard block |
||
610 | 610 | 'list_sort' => 'latest', |
611 | 611 | 'show_featured_only' => '', |
612 | 612 | ); |
613 | - $output = $this->the_widget_form_update( 'geodir_listing_slider_widget', $new_instance ); |
|
613 | + $output = $this->the_widget_form_update('geodir_listing_slider_widget', $new_instance); |
|
614 | 614 | $this->assertContains('latest', $output['list_sort']); |
615 | 615 | |
616 | 616 | } |
617 | 617 | |
618 | 618 | public function testPopularWidget() { |
619 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_popular_widget.php'; |
|
619 | + $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_popular_widget.php'; |
|
620 | 620 | include_once($template); |
621 | 621 | |
622 | 622 | ob_start(); |
623 | - the_widget( 'geodir_popular_post_category' ); |
|
623 | + the_widget('geodir_popular_post_category'); |
|
624 | 624 | $output = ob_get_contents(); |
625 | 625 | ob_end_clean(); |
626 | 626 | $this->assertContains('geodir_popular_post_category', $output); |
627 | 627 | |
628 | 628 | ob_start(); |
629 | - $this->the_widget_form( 'geodir_popular_post_category' ); |
|
629 | + $this->the_widget_form('geodir_popular_post_category'); |
|
630 | 630 | $output = ob_get_contents(); |
631 | 631 | ob_end_clean(); |
632 | 632 | $this->assertContains('Default post type to use', $output); |
@@ -636,19 +636,19 @@ discard block |
||
636 | 636 | 'category_limit' => 15, |
637 | 637 | 'default_post_type' => '' |
638 | 638 | ); |
639 | - $output = $this->the_widget_form_update( 'geodir_popular_post_category', $new_instance ); |
|
639 | + $output = $this->the_widget_form_update('geodir_popular_post_category', $new_instance); |
|
640 | 640 | $this->assertEquals(15, $output['category_limit']); |
641 | 641 | |
642 | 642 | ob_start(); |
643 | 643 | $instance = array(); |
644 | 644 | $instance['category_title'] = ''; |
645 | - the_widget( 'geodir_popular_postview', $instance ); |
|
645 | + the_widget('geodir_popular_postview', $instance); |
|
646 | 646 | $output = ob_get_contents(); |
647 | 647 | ob_end_clean(); |
648 | 648 | $this->assertContains('geodir_popular_post_view', $output); |
649 | 649 | |
650 | 650 | ob_start(); |
651 | - $this->the_widget_form( 'geodir_popular_postview' ); |
|
651 | + $this->the_widget_form('geodir_popular_postview'); |
|
652 | 652 | $output = ob_get_contents(); |
653 | 653 | ob_end_clean(); |
654 | 654 | $this->assertContains('Post Category', $output); |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | 'with_videos_only' => '', |
672 | 672 | 'use_viewing_post_type' => '' |
673 | 673 | ); |
674 | - $output = $this->the_widget_form_update( 'geodir_popular_postview', $new_instance ); |
|
674 | + $output = $this->the_widget_form_update('geodir_popular_postview', $new_instance); |
|
675 | 675 | $this->assertContains('gridview_onehalf', $output['layout']); |
676 | 676 | |
677 | 677 | } |
@@ -683,9 +683,9 @@ discard block |
||
683 | 683 | 'posts_per_page' => 1, |
684 | 684 | ); |
685 | 685 | |
686 | - $all_posts = new WP_Query( $query_args ); |
|
686 | + $all_posts = new WP_Query($query_args); |
|
687 | 687 | $post_id = null; |
688 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
688 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
689 | 689 | global $post; |
690 | 690 | $post_id = get_the_ID(); |
691 | 691 | $post = geodir_get_post_info($post->ID); |
@@ -693,17 +693,17 @@ discard block |
||
693 | 693 | // $term_list = wp_get_post_terms($post->ID, 'gd_placecategory'); |
694 | 694 | // $post->gd_placecategory = (string) $term_list[0]->term_id; |
695 | 695 | |
696 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_related_listing_widget.php'; |
|
696 | + $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_related_listing_widget.php'; |
|
697 | 697 | include_once($template); |
698 | 698 | |
699 | 699 | ob_start(); |
700 | - the_widget( 'geodir_related_listing_postview' ); |
|
700 | + the_widget('geodir_related_listing_postview'); |
|
701 | 701 | $output = ob_get_contents(); |
702 | 702 | ob_end_clean(); |
703 | 703 | $this->assertContains('Related Listing', $output); |
704 | 704 | |
705 | 705 | ob_start(); |
706 | - $this->the_widget_form( 'geodir_related_listing_postview' ); |
|
706 | + $this->the_widget_form('geodir_related_listing_postview'); |
|
707 | 707 | $output = ob_get_contents(); |
708 | 708 | ob_end_clean(); |
709 | 709 | $this->assertContains('Relate to', $output); |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | 'add_location_filter' => '1', |
720 | 720 | 'character_count' => '20' |
721 | 721 | ); |
722 | - $output = $this->the_widget_form_update( 'geodir_related_listing_postview', $new_instance ); |
|
722 | + $output = $this->the_widget_form_update('geodir_related_listing_postview', $new_instance); |
|
723 | 723 | $this->assertContains('gridview_onehalf', $output['layout']); |
724 | 724 | endwhile; |
725 | 725 | |
@@ -775,17 +775,17 @@ discard block |
||
775 | 775 | |
776 | 776 | $this->assertTrue(is_int($comment_id)); |
777 | 777 | |
778 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_reviews_widget.php'; |
|
778 | + $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_reviews_widget.php'; |
|
779 | 779 | include_once($template); |
780 | 780 | |
781 | 781 | ob_start(); |
782 | - the_widget( 'geodir_recent_reviews_widget' ); |
|
782 | + the_widget('geodir_recent_reviews_widget'); |
|
783 | 783 | $output = ob_get_contents(); |
784 | 784 | ob_end_clean(); |
785 | 785 | $this->assertContains('geodir_recent_reviews', $output); |
786 | 786 | |
787 | 787 | ob_start(); |
788 | - $this->the_widget_form( 'geodir_recent_reviews_widget' ); |
|
788 | + $this->the_widget_form('geodir_recent_reviews_widget'); |
|
789 | 789 | $output = ob_get_contents(); |
790 | 790 | ob_end_clean(); |
791 | 791 | $this->assertContains('Number of Reviews', $output); |
@@ -798,25 +798,25 @@ discard block |
||
798 | 798 | 'img1' => '', |
799 | 799 | 'count' => '' |
800 | 800 | ); |
801 | - $output = $this->the_widget_form_update( 'geodir_recent_reviews_widget', $new_instance ); |
|
801 | + $output = $this->the_widget_form_update('geodir_recent_reviews_widget', $new_instance); |
|
802 | 802 | $this->assertTrue(empty($output['count'])); |
803 | 803 | } |
804 | 804 | |
805 | 805 | public function testHomeMapWidget() { |
806 | - $template = geodir_plugin_path() . '/geodirectory-widgets/home_map_widget.php'; |
|
806 | + $template = geodir_plugin_path().'/geodirectory-widgets/home_map_widget.php'; |
|
807 | 807 | include_once($template); |
808 | 808 | |
809 | 809 | ob_start(); |
810 | 810 | $instance = array(); |
811 | 811 | $args = array(); |
812 | 812 | $args["widget_id"] = "geodir_map_v3_home_map-2"; |
813 | - the_widget( 'geodir_homepage_map', $instance, $args ); |
|
813 | + the_widget('geodir_homepage_map', $instance, $args); |
|
814 | 814 | $output = ob_get_contents(); |
815 | 815 | ob_end_clean(); |
816 | 816 | $this->assertContains('geodir-map-home-page', $output); |
817 | 817 | |
818 | 818 | ob_start(); |
819 | - $this->the_widget_form( 'geodir_homepage_map' ); |
|
819 | + $this->the_widget_form('geodir_homepage_map'); |
|
820 | 820 | $output = ob_get_contents(); |
821 | 821 | ob_end_clean(); |
822 | 822 | $this->assertContains('Map Zoom level', $output); |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | 'child_collapse' => '0', |
831 | 831 | 'scrollwheel' => '0' |
832 | 832 | ); |
833 | - $output = $this->the_widget_form_update( 'geodir_homepage_map', $new_instance ); |
|
833 | + $output = $this->the_widget_form_update('geodir_homepage_map', $new_instance); |
|
834 | 834 | $this->assertContains('0', $output['scrollwheel']); |
835 | 835 | |
836 | 836 | } |
@@ -840,13 +840,13 @@ discard block |
||
840 | 840 | register_geodir_widgets(); |
841 | 841 | |
842 | 842 | ob_start(); |
843 | - the_widget( 'geodir_loginwidget' ); |
|
843 | + the_widget('geodir_loginwidget'); |
|
844 | 844 | $output = ob_get_contents(); |
845 | 845 | ob_end_clean(); |
846 | 846 | $this->assertContains('geodir_loginbox', $output); |
847 | 847 | |
848 | 848 | ob_start(); |
849 | - $this->the_widget_form( 'geodir_loginwidget' ); |
|
849 | + $this->the_widget_form('geodir_loginwidget'); |
|
850 | 850 | $output = ob_get_contents(); |
851 | 851 | ob_end_clean(); |
852 | 852 | $this->assertContains('Widget Title', $output); |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | 'img1' => '', |
860 | 860 | 'desc1' => '' |
861 | 861 | ); |
862 | - $output = $this->the_widget_form_update( 'geodir_loginwidget', $new_instance ); |
|
862 | + $output = $this->the_widget_form_update('geodir_loginwidget', $new_instance); |
|
863 | 863 | $this->assertContains('Login', $output['title']); |
864 | 864 | |
865 | 865 | } |
@@ -867,13 +867,13 @@ discard block |
||
867 | 867 | public function testSocialWidget() { |
868 | 868 | |
869 | 869 | ob_start(); |
870 | - the_widget( 'geodir_social_like_widget' ); |
|
870 | + the_widget('geodir_social_like_widget'); |
|
871 | 871 | $output = ob_get_contents(); |
872 | 872 | ob_end_clean(); |
873 | 873 | $this->assertContains('twitter.com', $output); |
874 | 874 | |
875 | 875 | ob_start(); |
876 | - $this->the_widget_form( 'geodir_social_like_widget' ); |
|
876 | + $this->the_widget_form('geodir_social_like_widget'); |
|
877 | 877 | $output = ob_get_contents(); |
878 | 878 | ob_end_clean(); |
879 | 879 | $this->assertContains('No settings for this widget', $output); |
@@ -881,7 +881,7 @@ discard block |
||
881 | 881 | $new_instance = array( |
882 | 882 | 'title' => 'Social', |
883 | 883 | ); |
884 | - $output = $this->the_widget_form_update( 'geodir_social_like_widget', $new_instance ); |
|
884 | + $output = $this->the_widget_form_update('geodir_social_like_widget', $new_instance); |
|
885 | 885 | $this->assertContains('Social', $output['title']); |
886 | 886 | |
887 | 887 | } |
@@ -889,13 +889,13 @@ discard block |
||
889 | 889 | public function testSubscribeWidget() { |
890 | 890 | |
891 | 891 | ob_start(); |
892 | - the_widget( 'geodirsubscribeWidget' ); |
|
892 | + the_widget('geodirsubscribeWidget'); |
|
893 | 893 | $output = ob_get_contents(); |
894 | 894 | ob_end_clean(); |
895 | 895 | $this->assertContains('geodir-subscribe-form', $output); |
896 | 896 | |
897 | 897 | ob_start(); |
898 | - $this->the_widget_form( 'geodirsubscribeWidget' ); |
|
898 | + $this->the_widget_form('geodirsubscribeWidget'); |
|
899 | 899 | $output = ob_get_contents(); |
900 | 900 | ob_end_clean(); |
901 | 901 | $this->assertContains('Feedburner ID', $output); |
@@ -910,7 +910,7 @@ discard block |
||
910 | 910 | 'digg' => '', |
911 | 911 | 'myspace' => '' |
912 | 912 | ); |
913 | - $output = $this->the_widget_form_update( 'geodirsubscribeWidget', $new_instance ); |
|
913 | + $output = $this->the_widget_form_update('geodirsubscribeWidget', $new_instance); |
|
914 | 914 | $this->assertContains('Subscribe', $output['title']); |
915 | 915 | |
916 | 916 | } |
@@ -920,13 +920,13 @@ discard block |
||
920 | 920 | ob_start(); |
921 | 921 | $instance = array(); |
922 | 922 | $instance['desc1'] = 'hello'; |
923 | - the_widget( 'geodiradvtwidget', $instance ); |
|
923 | + the_widget('geodiradvtwidget', $instance); |
|
924 | 924 | $output = ob_get_contents(); |
925 | 925 | ob_end_clean(); |
926 | 926 | $this->assertContains('hello', $output); |
927 | 927 | |
928 | 928 | ob_start(); |
929 | - $this->the_widget_form( 'geodiradvtwidget' ); |
|
929 | + $this->the_widget_form('geodiradvtwidget'); |
|
930 | 930 | $output = ob_get_contents(); |
931 | 931 | ob_end_clean(); |
932 | 932 | $this->assertContains('Your Advt code', $output); |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | $new_instance = array( |
935 | 935 | 'desc1' => 'Advertise' |
936 | 936 | ); |
937 | - $output = $this->the_widget_form_update( 'geodiradvtwidget', $new_instance ); |
|
937 | + $output = $this->the_widget_form_update('geodiradvtwidget', $new_instance); |
|
938 | 938 | $this->assertContains('Advertise', $output['desc1']); |
939 | 939 | |
940 | 940 | } |
@@ -942,13 +942,13 @@ discard block |
||
942 | 942 | public function testFlickrWidget() { |
943 | 943 | |
944 | 944 | ob_start(); |
945 | - the_widget( 'GeodirFlickrWidget' ); |
|
945 | + the_widget('GeodirFlickrWidget'); |
|
946 | 946 | $output = ob_get_contents(); |
947 | 947 | ob_end_clean(); |
948 | 948 | $this->assertContains('geodir-flickr', $output); |
949 | 949 | |
950 | 950 | ob_start(); |
951 | - $this->the_widget_form( 'GeodirFlickrWidget' ); |
|
951 | + $this->the_widget_form('GeodirFlickrWidget'); |
|
952 | 952 | $output = ob_get_contents(); |
953 | 953 | ob_end_clean(); |
954 | 954 | $this->assertContains('Flickr ID', $output); |
@@ -957,7 +957,7 @@ discard block |
||
957 | 957 | 'id' => '', |
958 | 958 | 'number' => '34' |
959 | 959 | ); |
960 | - $output = $this->the_widget_form_update( 'GeodirFlickrWidget', $new_instance ); |
|
960 | + $output = $this->the_widget_form_update('GeodirFlickrWidget', $new_instance); |
|
961 | 961 | $this->assertContains('34', $output['number']); |
962 | 962 | |
963 | 963 | } |
@@ -967,13 +967,13 @@ discard block |
||
967 | 967 | ob_start(); |
968 | 968 | $instance = array(); |
969 | 969 | $instance['gd_tw_desc1'] = 'hello'; |
970 | - the_widget( 'geodir_twitter', $instance ); |
|
970 | + the_widget('geodir_twitter', $instance); |
|
971 | 971 | $output = ob_get_contents(); |
972 | 972 | ob_end_clean(); |
973 | 973 | $this->assertContains('hello', $output); |
974 | 974 | |
975 | 975 | ob_start(); |
976 | - $this->the_widget_form( 'geodir_twitter' ); |
|
976 | + $this->the_widget_form('geodir_twitter'); |
|
977 | 977 | $output = ob_get_contents(); |
978 | 978 | ob_end_clean(); |
979 | 979 | $this->assertContains('Your twitter code', $output); |
@@ -981,7 +981,7 @@ discard block |
||
981 | 981 | $new_instance = array( |
982 | 982 | 'gd_tw_desc1' => 'hello' |
983 | 983 | ); |
984 | - $output = $this->the_widget_form_update( 'geodir_twitter', $new_instance ); |
|
984 | + $output = $this->the_widget_form_update('geodir_twitter', $new_instance); |
|
985 | 985 | $this->assertContains('hello', $output['gd_tw_desc1']); |
986 | 986 | |
987 | 987 | } |
@@ -989,13 +989,13 @@ discard block |
||
989 | 989 | public function testAdvSearchWidget() { |
990 | 990 | |
991 | 991 | ob_start(); |
992 | - the_widget( 'geodir_advance_search_widget' ); |
|
992 | + the_widget('geodir_advance_search_widget'); |
|
993 | 993 | $output = ob_get_contents(); |
994 | 994 | ob_end_clean(); |
995 | 995 | $this->assertContains('geodir-loc-bar', $output); |
996 | 996 | |
997 | 997 | ob_start(); |
998 | - $this->the_widget_form( 'geodir_advance_search_widget' ); |
|
998 | + $this->the_widget_form('geodir_advance_search_widget'); |
|
999 | 999 | $output = ob_get_contents(); |
1000 | 1000 | ob_end_clean(); |
1001 | 1001 | $this->assertContains('This is a search widget', $output); |
@@ -1009,17 +1009,17 @@ discard block |
||
1009 | 1009 | |
1010 | 1010 | public function testListingMapWidget() { |
1011 | 1011 | |
1012 | - $template = geodir_plugin_path() . '/geodirectory-widgets/listing_map_widget.php'; |
|
1012 | + $template = geodir_plugin_path().'/geodirectory-widgets/listing_map_widget.php'; |
|
1013 | 1013 | include_once($template); |
1014 | 1014 | |
1015 | 1015 | //listing page |
1016 | - $this->go_to( home_url('/?post_type=gd_place') ); |
|
1016 | + $this->go_to(home_url('/?post_type=gd_place')); |
|
1017 | 1017 | |
1018 | 1018 | ob_start(); |
1019 | 1019 | $instance = array(); |
1020 | 1020 | $args = array(); |
1021 | 1021 | $args["widget_id"] = "geodir_map_v3_listing_map-2"; |
1022 | - the_widget( 'geodir_map_listingpage', $instance, $args ); |
|
1022 | + the_widget('geodir_map_listingpage', $instance, $args); |
|
1023 | 1023 | $output = ob_get_contents(); |
1024 | 1024 | ob_end_clean(); |
1025 | 1025 | $this->assertContains('geodir-map-listing-page', $output); |
@@ -1031,27 +1031,27 @@ discard block |
||
1031 | 1031 | 'posts_per_page' => 1, |
1032 | 1032 | ); |
1033 | 1033 | |
1034 | - $all_posts = new WP_Query( $query_args ); |
|
1034 | + $all_posts = new WP_Query($query_args); |
|
1035 | 1035 | $post_id = null; |
1036 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
1036 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
1037 | 1037 | $post_id = get_the_ID(); |
1038 | 1038 | endwhile; |
1039 | 1039 | |
1040 | 1040 | $this->assertTrue(is_int($post_id)); |
1041 | 1041 | |
1042 | - $this->go_to( get_permalink($post_id) ); |
|
1042 | + $this->go_to(get_permalink($post_id)); |
|
1043 | 1043 | |
1044 | 1044 | ob_start(); |
1045 | 1045 | $instance = array(); |
1046 | 1046 | $args = array(); |
1047 | 1047 | $args["widget_id"] = "geodir_map_v3_listing_map-2"; |
1048 | - the_widget( 'geodir_map_listingpage', $instance, $args ); |
|
1048 | + the_widget('geodir_map_listingpage', $instance, $args); |
|
1049 | 1049 | $output = ob_get_contents(); |
1050 | 1050 | ob_end_clean(); |
1051 | 1051 | $this->assertContains('geodir-map-listing-page', $output); |
1052 | 1052 | |
1053 | 1053 | ob_start(); |
1054 | - $this->the_widget_form( 'geodir_map_listingpage' ); |
|
1054 | + $this->the_widget_form('geodir_map_listingpage'); |
|
1055 | 1055 | $output = ob_get_contents(); |
1056 | 1056 | ob_end_clean(); |
1057 | 1057 | $this->assertContains('Select Map View', $output); |
@@ -1066,31 +1066,31 @@ discard block |
||
1066 | 1066 | 'scrollwheel' => '0', |
1067 | 1067 | 'showall' => '0' |
1068 | 1068 | ); |
1069 | - $output = $this->the_widget_form_update( 'geodir_map_listingpage', $new_instance ); |
|
1069 | + $output = $this->the_widget_form_update('geodir_map_listingpage', $new_instance); |
|
1070 | 1070 | $this->assertContains('0', $output['scrollwheel']); |
1071 | 1071 | |
1072 | 1072 | |
1073 | 1073 | } |
1074 | 1074 | |
1075 | 1075 | private function load_template() { |
1076 | - do_action( 'template_redirect' ); |
|
1076 | + do_action('template_redirect'); |
|
1077 | 1077 | $template = false; |
1078 | - if ( is_404() && $template = get_404_template() ) : |
|
1079 | - elseif ( is_search() && $template = get_search_template() ) : |
|
1080 | - elseif ( is_front_page() && $template = get_front_page_template() ) : |
|
1081 | - elseif ( is_home() && $template = get_home_template() ) : |
|
1082 | - elseif ( is_post_type_archive() && $template = get_post_type_archive_template() ) : |
|
1083 | - elseif ( is_tax() && $template = get_taxonomy_template() ) : |
|
1084 | - elseif ( is_attachment() && $template = get_attachment_template() ) : |
|
1078 | + if (is_404() && $template = get_404_template()) : |
|
1079 | + elseif (is_search() && $template = get_search_template()) : |
|
1080 | + elseif (is_front_page() && $template = get_front_page_template()) : |
|
1081 | + elseif (is_home() && $template = get_home_template()) : |
|
1082 | + elseif (is_post_type_archive() && $template = get_post_type_archive_template()) : |
|
1083 | + elseif (is_tax() && $template = get_taxonomy_template()) : |
|
1084 | + elseif (is_attachment() && $template = get_attachment_template()) : |
|
1085 | 1085 | remove_filter('the_content', 'prepend_attachment'); |
1086 | - elseif ( is_single() && $template = get_single_template() ) : |
|
1087 | - elseif ( is_page() && $template = get_page_template() ) : |
|
1088 | - elseif ( is_category() && $template = get_category_template() ) : |
|
1089 | - elseif ( is_tag() && $template = get_tag_template() ) : |
|
1090 | - elseif ( is_author() && $template = get_author_template() ) : |
|
1091 | - elseif ( is_date() && $template = get_date_template() ) : |
|
1092 | - elseif ( is_archive() && $template = get_archive_template() ) : |
|
1093 | - elseif ( is_paged() && $template = get_paged_template() ) : |
|
1086 | + elseif (is_single() && $template = get_single_template()) : |
|
1087 | + elseif (is_page() && $template = get_page_template()) : |
|
1088 | + elseif (is_category() && $template = get_category_template()) : |
|
1089 | + elseif (is_tag() && $template = get_tag_template()) : |
|
1090 | + elseif (is_author() && $template = get_author_template()) : |
|
1091 | + elseif (is_date() && $template = get_date_template()) : |
|
1092 | + elseif (is_archive() && $template = get_archive_template()) : |
|
1093 | + elseif (is_paged() && $template = get_paged_template()) : |
|
1094 | 1094 | else : |
1095 | 1095 | $template = get_index_template(); |
1096 | 1096 | endif; |
@@ -1101,21 +1101,21 @@ discard block |
||
1101 | 1101 | * |
1102 | 1102 | * @param string $template The path of the template to include. |
1103 | 1103 | */ |
1104 | - if ( $template = apply_filters( 'template_include', $template ) ) { |
|
1105 | - $template_contents = file_get_contents( $template ); |
|
1104 | + if ($template = apply_filters('template_include', $template)) { |
|
1105 | + $template_contents = file_get_contents($template); |
|
1106 | 1106 | $included_header = $included_footer = false; |
1107 | - if ( false !== stripos( $template_contents, 'get_header();' ) ) { |
|
1108 | - do_action( 'get_header', null ); |
|
1109 | - locate_template( 'header.php', true, false ); |
|
1107 | + if (false !== stripos($template_contents, 'get_header();')) { |
|
1108 | + do_action('get_header', null); |
|
1109 | + locate_template('header.php', true, false); |
|
1110 | 1110 | $included_header = true; |
1111 | 1111 | } |
1112 | - include( $template ); |
|
1113 | - if ( false !== stripos( $template_contents, 'get_footer();' ) ) { |
|
1114 | - do_action( 'get_footer', null ); |
|
1115 | - locate_template( 'footer.php', true, false ); |
|
1112 | + include($template); |
|
1113 | + if (false !== stripos($template_contents, 'get_footer();')) { |
|
1114 | + do_action('get_footer', null); |
|
1115 | + locate_template('footer.php', true, false); |
|
1116 | 1116 | $included_footer = true; |
1117 | 1117 | } |
1118 | - if ( $included_header && $included_footer ) { |
|
1118 | + if ($included_header && $included_footer) { |
|
1119 | 1119 | global $wp_scripts; |
1120 | 1120 | $wp_scripts->done = array(); |
1121 | 1121 | } |
@@ -1123,19 +1123,19 @@ discard block |
||
1123 | 1123 | return; |
1124 | 1124 | } |
1125 | 1125 | |
1126 | - public static function setPermalinkStructure( $struc = '/%postname%/' ) { |
|
1126 | + public static function setPermalinkStructure($struc = '/%postname%/') { |
|
1127 | 1127 | global $wp_rewrite; |
1128 | - $wp_rewrite->set_permalink_structure( $struc ); |
|
1128 | + $wp_rewrite->set_permalink_structure($struc); |
|
1129 | 1129 | $wp_rewrite->flush_rules(); |
1130 | - update_option( 'permalink_structure', $struc ); |
|
1131 | - flush_rewrite_rules( true ); |
|
1130 | + update_option('permalink_structure', $struc); |
|
1131 | + flush_rewrite_rules(true); |
|
1132 | 1132 | } |
1133 | 1133 | |
1134 | - function the_widget_form( $widget, $instance = array() ) { |
|
1134 | + function the_widget_form($widget, $instance = array()) { |
|
1135 | 1135 | global $wp_widget_factory; |
1136 | 1136 | |
1137 | 1137 | $widget_obj = $wp_widget_factory->widgets[$widget]; |
1138 | - if ( ! ( $widget_obj instanceof WP_Widget ) ) { |
|
1138 | + if (!($widget_obj instanceof WP_Widget)) { |
|
1139 | 1139 | return; |
1140 | 1140 | } |
1141 | 1141 | |
@@ -1143,11 +1143,11 @@ discard block |
||
1143 | 1143 | $widget_obj->form($instance); |
1144 | 1144 | } |
1145 | 1145 | |
1146 | - function the_widget_form_update( $widget, $new_instance = array(), $old_instance = array() ) { |
|
1146 | + function the_widget_form_update($widget, $new_instance = array(), $old_instance = array()) { |
|
1147 | 1147 | global $wp_widget_factory; |
1148 | 1148 | |
1149 | 1149 | $widget_obj = $wp_widget_factory->widgets[$widget]; |
1150 | - if ( ! ( $widget_obj instanceof WP_Widget ) ) { |
|
1150 | + if (!($widget_obj instanceof WP_Widget)) { |
|
1151 | 1151 | return; |
1152 | 1152 | } |
1153 | 1153 |
@@ -1,1164 +1,1164 @@ |
||
1 | 1 | <?php |
2 | 2 | class GeoDirectoryTests extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(1); |
|
8 | - |
|
9 | - geodir_register_sidebar(); |
|
10 | - } |
|
11 | - |
|
12 | - public function testBreadcrumbs() { |
|
13 | - $query_args = array( |
|
14 | - 'post_status' => 'publish', |
|
15 | - 'post_type' => 'gd_place', |
|
16 | - 'posts_per_page' => 1, |
|
17 | - ); |
|
18 | - |
|
19 | - $all_posts = new WP_Query( $query_args ); |
|
20 | - $post_id = null; |
|
21 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
22 | - $post_id = get_the_ID(); |
|
23 | - endwhile; |
|
24 | - |
|
25 | - $this->assertTrue(is_int($post_id)); |
|
26 | - |
|
27 | - $this->go_to( get_permalink($post_id) ); |
|
28 | - |
|
29 | - ob_start(); |
|
30 | - geodir_breadcrumb(); |
|
31 | - $output = ob_get_contents(); |
|
32 | - ob_end_clean(); |
|
33 | - $this->assertContains('Places', $output); |
|
34 | - } |
|
35 | - |
|
36 | - public function testAdminSettingForms() { |
|
37 | - $_REQUEST['listing_type'] = 'gd_place'; |
|
38 | - ob_start(); |
|
39 | - geodir_admin_option_form('general_settings'); |
|
40 | - $output = ob_get_contents(); |
|
41 | - ob_end_clean(); |
|
42 | - $this->assertContains('General Options', $output); |
|
43 | - |
|
44 | - ob_start(); |
|
45 | - geodir_admin_option_form('design_settings'); |
|
46 | - $output = ob_get_contents(); |
|
47 | - ob_end_clean(); |
|
48 | - $this->assertContains('Home Top Section Settings', $output); |
|
49 | - |
|
50 | - ob_start(); |
|
51 | - geodir_admin_option_form('permalink_settings'); |
|
52 | - $output = ob_get_contents(); |
|
53 | - ob_end_clean(); |
|
54 | - $this->assertContains('Listing Detail Permalink Settings', $output); |
|
55 | - |
|
56 | - ob_start(); |
|
57 | - geodir_admin_option_form('title_meta_settings'); |
|
58 | - $output = ob_get_contents(); |
|
59 | - ob_end_clean(); |
|
60 | - $this->assertContains('Homepage Meta Settings', $output); |
|
61 | - |
|
62 | - ob_start(); |
|
63 | - geodir_admin_option_form('notifications_settings'); |
|
64 | - $output = ob_get_contents(); |
|
65 | - ob_end_clean(); |
|
66 | - $this->assertContains('Notification Options', $output); |
|
67 | - |
|
68 | - ob_start(); |
|
69 | - geodir_admin_option_form('default_location_settings'); |
|
70 | - $output = ob_get_contents(); |
|
71 | - ob_end_clean(); |
|
72 | - $this->assertContains('Set Default Location', $output); |
|
73 | - |
|
74 | - ob_start(); |
|
75 | - geodir_admin_option_form('tools_settings'); |
|
76 | - $output = ob_get_contents(); |
|
77 | - ob_end_clean(); |
|
78 | - $this->assertContains('GD Diagnostic Tools', $output); |
|
79 | - |
|
80 | - ob_start(); |
|
81 | - geodir_admin_option_form('compatibility_settings'); |
|
82 | - $output = ob_get_contents(); |
|
83 | - ob_end_clean(); |
|
84 | - $this->assertContains('Theme Compatibility Settings', $output); |
|
85 | - |
|
86 | - ob_start(); |
|
87 | - geodir_admin_option_form('import_export'); |
|
88 | - $output = ob_get_contents(); |
|
89 | - ob_end_clean(); |
|
90 | - $this->assertContains('GD Import & Export CSV', $output); |
|
91 | - |
|
92 | - $_REQUEST['subtab'] = 'custom_fields'; |
|
93 | - ob_start(); |
|
94 | - geodir_admin_option_form('gd_place_fields_settings'); |
|
95 | - $output = ob_get_contents(); |
|
96 | - ob_end_clean(); |
|
97 | - $this->assertContains('general-form-builder-frame', $output); |
|
98 | - |
|
99 | - } |
|
100 | - |
|
101 | - public function testPopPostWidget() { |
|
102 | - $args = array( |
|
103 | - 'before_widget' => '<ul>', |
|
104 | - 'after_widget' => '<ul>', |
|
105 | - 'before_title' => '<ul>', |
|
106 | - 'after_title' => '<ul>' |
|
107 | - ); |
|
108 | - ob_start(); |
|
109 | - geodir_popular_post_category_output($args); |
|
110 | - $output = ob_get_contents(); |
|
111 | - ob_end_clean(); |
|
112 | - $this->assertContains('Popular Categories', $output); |
|
113 | - } |
|
114 | - |
|
115 | - public function texstBestOfWidget() { |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(1); |
|
8 | + |
|
9 | + geodir_register_sidebar(); |
|
10 | + } |
|
11 | + |
|
12 | + public function testBreadcrumbs() { |
|
13 | + $query_args = array( |
|
14 | + 'post_status' => 'publish', |
|
15 | + 'post_type' => 'gd_place', |
|
16 | + 'posts_per_page' => 1, |
|
17 | + ); |
|
18 | + |
|
19 | + $all_posts = new WP_Query( $query_args ); |
|
20 | + $post_id = null; |
|
21 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
22 | + $post_id = get_the_ID(); |
|
23 | + endwhile; |
|
24 | + |
|
25 | + $this->assertTrue(is_int($post_id)); |
|
26 | + |
|
27 | + $this->go_to( get_permalink($post_id) ); |
|
28 | + |
|
29 | + ob_start(); |
|
30 | + geodir_breadcrumb(); |
|
31 | + $output = ob_get_contents(); |
|
32 | + ob_end_clean(); |
|
33 | + $this->assertContains('Places', $output); |
|
34 | + } |
|
35 | + |
|
36 | + public function testAdminSettingForms() { |
|
37 | + $_REQUEST['listing_type'] = 'gd_place'; |
|
38 | + ob_start(); |
|
39 | + geodir_admin_option_form('general_settings'); |
|
40 | + $output = ob_get_contents(); |
|
41 | + ob_end_clean(); |
|
42 | + $this->assertContains('General Options', $output); |
|
43 | + |
|
44 | + ob_start(); |
|
45 | + geodir_admin_option_form('design_settings'); |
|
46 | + $output = ob_get_contents(); |
|
47 | + ob_end_clean(); |
|
48 | + $this->assertContains('Home Top Section Settings', $output); |
|
49 | + |
|
50 | + ob_start(); |
|
51 | + geodir_admin_option_form('permalink_settings'); |
|
52 | + $output = ob_get_contents(); |
|
53 | + ob_end_clean(); |
|
54 | + $this->assertContains('Listing Detail Permalink Settings', $output); |
|
55 | + |
|
56 | + ob_start(); |
|
57 | + geodir_admin_option_form('title_meta_settings'); |
|
58 | + $output = ob_get_contents(); |
|
59 | + ob_end_clean(); |
|
60 | + $this->assertContains('Homepage Meta Settings', $output); |
|
61 | + |
|
62 | + ob_start(); |
|
63 | + geodir_admin_option_form('notifications_settings'); |
|
64 | + $output = ob_get_contents(); |
|
65 | + ob_end_clean(); |
|
66 | + $this->assertContains('Notification Options', $output); |
|
67 | + |
|
68 | + ob_start(); |
|
69 | + geodir_admin_option_form('default_location_settings'); |
|
70 | + $output = ob_get_contents(); |
|
71 | + ob_end_clean(); |
|
72 | + $this->assertContains('Set Default Location', $output); |
|
73 | + |
|
74 | + ob_start(); |
|
75 | + geodir_admin_option_form('tools_settings'); |
|
76 | + $output = ob_get_contents(); |
|
77 | + ob_end_clean(); |
|
78 | + $this->assertContains('GD Diagnostic Tools', $output); |
|
79 | + |
|
80 | + ob_start(); |
|
81 | + geodir_admin_option_form('compatibility_settings'); |
|
82 | + $output = ob_get_contents(); |
|
83 | + ob_end_clean(); |
|
84 | + $this->assertContains('Theme Compatibility Settings', $output); |
|
85 | + |
|
86 | + ob_start(); |
|
87 | + geodir_admin_option_form('import_export'); |
|
88 | + $output = ob_get_contents(); |
|
89 | + ob_end_clean(); |
|
90 | + $this->assertContains('GD Import & Export CSV', $output); |
|
91 | + |
|
92 | + $_REQUEST['subtab'] = 'custom_fields'; |
|
93 | + ob_start(); |
|
94 | + geodir_admin_option_form('gd_place_fields_settings'); |
|
95 | + $output = ob_get_contents(); |
|
96 | + ob_end_clean(); |
|
97 | + $this->assertContains('general-form-builder-frame', $output); |
|
98 | + |
|
99 | + } |
|
100 | + |
|
101 | + public function testPopPostWidget() { |
|
102 | + $args = array( |
|
103 | + 'before_widget' => '<ul>', |
|
104 | + 'after_widget' => '<ul>', |
|
105 | + 'before_title' => '<ul>', |
|
106 | + 'after_title' => '<ul>' |
|
107 | + ); |
|
108 | + ob_start(); |
|
109 | + geodir_popular_post_category_output($args); |
|
110 | + $output = ob_get_contents(); |
|
111 | + ob_end_clean(); |
|
112 | + $this->assertContains('Popular Categories', $output); |
|
113 | + } |
|
114 | + |
|
115 | + public function texstBestOfWidget() { |
|
116 | 116 | // $args = array( |
117 | 117 | // 'before_widget' => '<ul>', |
118 | 118 | // 'after_widget' => '<ul>', |
119 | 119 | // 'before_title' => '<ul>', |
120 | 120 | // 'after_title' => '<ul>' |
121 | 121 | // ); |
122 | - include_once geodir_plugin_path() . "/geodirectory-widgets/geodirectory_cpt_categories_widget.php"; |
|
123 | - $params = array( |
|
124 | - 'title' => '', |
|
125 | - 'post_type' => array(), // NULL for all |
|
126 | - 'hide_empty' => '', |
|
127 | - 'show_count' => '', |
|
128 | - 'hide_icon' => '', |
|
129 | - 'cpt_left' => '', |
|
130 | - 'sort_by' => 'count', |
|
131 | - 'max_count' => 'all', |
|
132 | - 'max_level' => '1' |
|
133 | - ); |
|
134 | - ob_start(); |
|
135 | - geodir_cpt_categories_output($params); |
|
136 | - $output = ob_get_contents(); |
|
137 | - ob_end_clean(); |
|
138 | - $this->assertContains('gd-cptcat-title', $output); |
|
139 | - } |
|
140 | - |
|
141 | - public function testGDWidgetListView() { |
|
142 | - global $gridview_columns_widget, $geodir_is_widget_listing; |
|
143 | - |
|
144 | - $_REQUEST['sgeo_lat'] = '40.7127837'; |
|
145 | - $_REQUEST['sgeo_lon'] = '-74.00594130000002'; |
|
146 | - $query_args = array( |
|
147 | - 'posts_per_page' => 1, |
|
148 | - 'is_geodir_loop' => true, |
|
149 | - 'gd_location' => false, |
|
150 | - 'post_type' => 'gd_place', |
|
151 | - ); |
|
152 | - $widget_listings = geodir_get_widget_listings($query_args); |
|
153 | - $template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview')); |
|
154 | - global $post, $map_jason, $map_canvas_arr; |
|
155 | - |
|
156 | - $current_post = $post; |
|
157 | - $current_map_jason = $map_jason; |
|
158 | - $current_map_canvas_arr = $map_canvas_arr; |
|
159 | - $geodir_is_widget_listing = true; |
|
160 | - |
|
161 | - ob_start(); |
|
162 | - include($template); |
|
163 | - $output = ob_get_contents(); |
|
164 | - ob_end_clean(); |
|
165 | - $this->assertContains('geodir-entry-content', $output); |
|
166 | - |
|
167 | - $geodir_is_widget_listing = false; |
|
168 | - |
|
169 | - $GLOBALS['post'] = $current_post; |
|
170 | - if (!empty($current_post)) |
|
171 | - setup_postdata($current_post); |
|
172 | - $map_jason = $current_map_jason; |
|
173 | - $map_canvas_arr = $current_map_canvas_arr; |
|
174 | - |
|
175 | - } |
|
176 | - |
|
177 | - public function testRegTemplate() { |
|
122 | + include_once geodir_plugin_path() . "/geodirectory-widgets/geodirectory_cpt_categories_widget.php"; |
|
123 | + $params = array( |
|
124 | + 'title' => '', |
|
125 | + 'post_type' => array(), // NULL for all |
|
126 | + 'hide_empty' => '', |
|
127 | + 'show_count' => '', |
|
128 | + 'hide_icon' => '', |
|
129 | + 'cpt_left' => '', |
|
130 | + 'sort_by' => 'count', |
|
131 | + 'max_count' => 'all', |
|
132 | + 'max_level' => '1' |
|
133 | + ); |
|
134 | + ob_start(); |
|
135 | + geodir_cpt_categories_output($params); |
|
136 | + $output = ob_get_contents(); |
|
137 | + ob_end_clean(); |
|
138 | + $this->assertContains('gd-cptcat-title', $output); |
|
139 | + } |
|
140 | + |
|
141 | + public function testGDWidgetListView() { |
|
142 | + global $gridview_columns_widget, $geodir_is_widget_listing; |
|
143 | + |
|
144 | + $_REQUEST['sgeo_lat'] = '40.7127837'; |
|
145 | + $_REQUEST['sgeo_lon'] = '-74.00594130000002'; |
|
146 | + $query_args = array( |
|
147 | + 'posts_per_page' => 1, |
|
148 | + 'is_geodir_loop' => true, |
|
149 | + 'gd_location' => false, |
|
150 | + 'post_type' => 'gd_place', |
|
151 | + ); |
|
152 | + $widget_listings = geodir_get_widget_listings($query_args); |
|
153 | + $template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview')); |
|
154 | + global $post, $map_jason, $map_canvas_arr; |
|
155 | + |
|
156 | + $current_post = $post; |
|
157 | + $current_map_jason = $map_jason; |
|
158 | + $current_map_canvas_arr = $map_canvas_arr; |
|
159 | + $geodir_is_widget_listing = true; |
|
160 | + |
|
161 | + ob_start(); |
|
162 | + include($template); |
|
163 | + $output = ob_get_contents(); |
|
164 | + ob_end_clean(); |
|
165 | + $this->assertContains('geodir-entry-content', $output); |
|
166 | + |
|
167 | + $geodir_is_widget_listing = false; |
|
168 | + |
|
169 | + $GLOBALS['post'] = $current_post; |
|
170 | + if (!empty($current_post)) |
|
171 | + setup_postdata($current_post); |
|
172 | + $map_jason = $current_map_jason; |
|
173 | + $map_canvas_arr = $current_map_canvas_arr; |
|
174 | + |
|
175 | + } |
|
176 | + |
|
177 | + public function testRegTemplate() { |
|
178 | 178 | // var_dump(geodir_login_page_id()); |
179 | - wp_set_current_user(0); |
|
180 | - $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php'; |
|
181 | - |
|
182 | - ob_start(); |
|
183 | - include($template); |
|
184 | - $output = ob_get_contents(); |
|
185 | - ob_end_clean(); |
|
186 | - $this->assertContains('Sign In', $output); |
|
187 | - } |
|
188 | - |
|
189 | - public function testInfoTemplate() { |
|
190 | - wp_set_current_user(1); |
|
191 | - global $information; |
|
192 | - $information = "hello world"; |
|
193 | - |
|
194 | - $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
195 | - |
|
196 | - ob_start(); |
|
197 | - include($template); |
|
198 | - $output = ob_get_contents(); |
|
199 | - ob_end_clean(); |
|
200 | - $this->assertContains('hello world', $output); |
|
201 | - } |
|
202 | - |
|
203 | - public function testSuccessPage() { |
|
204 | - wp_set_current_user(1); |
|
205 | - |
|
206 | - $query_args = array( |
|
207 | - 'post_status' => 'publish', |
|
208 | - 'post_type' => 'gd_place', |
|
209 | - 'posts_per_page' => 1, |
|
210 | - ); |
|
211 | - |
|
212 | - $all_posts = new WP_Query( $query_args ); |
|
213 | - $post_id = null; |
|
214 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
215 | - $post_id = get_the_ID(); |
|
216 | - endwhile; |
|
217 | - |
|
218 | - $this->assertTrue(is_int($post_id)); |
|
219 | - |
|
220 | - $_REQUEST['listing_type'] = 'gd_place'; |
|
221 | - $_REQUEST['pid'] = $post_id; |
|
222 | - ob_start(); |
|
223 | - $this->go_to( get_permalink(geodir_success_page_id()) ); |
|
224 | - $this->load_template(); |
|
225 | - $output = ob_get_contents(); |
|
226 | - ob_end_clean(); |
|
227 | - $this->assertContains('View your submitted information', $output); |
|
228 | - } |
|
229 | - |
|
230 | - public function testPreviewPage() { |
|
231 | - wp_set_current_user(1); |
|
232 | - |
|
233 | - $query_args = array( |
|
234 | - 'post_status' => 'publish', |
|
235 | - 'post_type' => 'gd_place', |
|
236 | - 'posts_per_page' => 1, |
|
237 | - ); |
|
238 | - |
|
239 | - $all_posts = new WP_Query( $query_args ); |
|
240 | - $post_id = null; |
|
241 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
242 | - $post_id = get_the_ID(); |
|
243 | - endwhile; |
|
244 | - |
|
245 | - $this->assertTrue(is_int($post_id)); |
|
246 | - |
|
247 | - $_REQUEST = array( |
|
248 | - 'pid' => $post_id, |
|
249 | - 'listing_type' => 'gd_place', |
|
250 | - 'post_title' => 'Test Listing Title Modified', |
|
251 | - 'post_desc' => 'Test Desc', |
|
252 | - 'post_tags' => 'test1,test2', |
|
253 | - 'post_address' => 'New York City Hall', |
|
254 | - 'post_zip' => '10007', |
|
255 | - 'post_latitude' => '40.7127837', |
|
256 | - 'post_longitude' => '-74.00594130000002', |
|
257 | - 'post_mapview' => 'ROADMAP', |
|
258 | - 'post_mapzoom' => '10', |
|
259 | - 'geodir_timing' => '10.00 am to 6 pm every day', |
|
260 | - 'geodir_contact' => '1234567890', |
|
261 | - 'geodir_email' => '[email protected]', |
|
262 | - 'geodir_website' => 'http://test.com', |
|
263 | - 'geodir_twitter' => 'http://twitter.com/test', |
|
264 | - 'geodir_facebook' => 'http://facebook.com/test', |
|
265 | - 'geodir_special_offers' => 'Test offer', |
|
266 | - 'preview' => true, |
|
267 | - 'post_category' => array( |
|
268 | - 'gd_placecategory' => '' |
|
269 | - ) |
|
270 | - ); |
|
271 | - |
|
272 | - ob_start(); |
|
273 | - $this->go_to( get_permalink(geodir_preview_page_id()) ); |
|
274 | - $this->load_template(); |
|
275 | - $output = ob_get_contents(); |
|
276 | - ob_end_clean(); |
|
277 | - $this->assertContains('This is a preview of your listing', $output); |
|
278 | - } |
|
279 | - |
|
280 | - public function testAddListingPage() { |
|
281 | - wp_set_current_user(1); |
|
282 | - |
|
283 | - ob_start(); |
|
284 | - $this->go_to( get_permalink(geodir_add_listing_page_id()) ); |
|
285 | - $this->load_template(); |
|
286 | - $output = ob_get_contents(); |
|
287 | - ob_end_clean(); |
|
288 | - $this->assertContains('Enter Listing Details', $output); |
|
289 | - } |
|
290 | - |
|
291 | - public function testLocationPage() { |
|
292 | - wp_set_current_user(1); |
|
293 | - |
|
294 | - ob_start(); |
|
295 | - $this->go_to( get_permalink(geodir_location_page_id()) ); |
|
296 | - $this->load_template(); |
|
297 | - $output = ob_get_contents(); |
|
298 | - ob_end_clean(); |
|
299 | - $this->assertContains('Location', $output); |
|
300 | - } |
|
301 | - |
|
302 | - public function testTemplates() { |
|
303 | - |
|
304 | - global $current_user; |
|
305 | - |
|
306 | - $user_id = $current_user->ID; |
|
307 | - |
|
308 | - $this->setPermalinkStructure(); |
|
309 | - |
|
310 | - $homepage = get_page_by_title( 'GD Home page' ); |
|
311 | - if ( $homepage ) |
|
312 | - { |
|
313 | - update_option( 'page_on_front', $homepage->ID ); |
|
314 | - update_option( 'show_on_front', 'page' ); |
|
315 | - } |
|
316 | - |
|
317 | - ob_start(); |
|
318 | - $this->go_to( home_url('/') ); |
|
319 | - $this->load_template(); |
|
320 | - $output = ob_get_contents(); |
|
321 | - ob_end_clean(); |
|
322 | - $this->assertContains('body class="home', $output); |
|
323 | - |
|
324 | - |
|
325 | - ob_start(); |
|
326 | - $this->go_to( home_url('/?post_type=gd_place') ); |
|
327 | - $this->load_template(); |
|
328 | - $output = ob_get_contents(); |
|
329 | - ob_end_clean(); |
|
330 | - $this->assertContains('All Places', $output); |
|
331 | - |
|
332 | - $query_args = array( |
|
333 | - 'post_status' => 'publish', |
|
334 | - 'post_type' => 'gd_place', |
|
335 | - 'posts_per_page' => 1, |
|
336 | - ); |
|
337 | - |
|
338 | - $all_posts = new WP_Query( $query_args ); |
|
339 | - $post_id = null; |
|
340 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
341 | - $post_id = get_the_ID(); |
|
342 | - endwhile; |
|
343 | - |
|
344 | - $this->assertTrue(is_int($post_id)); |
|
345 | - |
|
346 | - global $preview; |
|
347 | - $preview = false; |
|
348 | - ob_start(); |
|
349 | - $this->go_to( get_permalink($post_id) ); |
|
350 | - $this->load_template(); |
|
351 | - $output = ob_get_contents(); |
|
352 | - ob_end_clean(); |
|
353 | - $this->assertContains('post_profileTab', $output); |
|
354 | - |
|
355 | - ob_start(); |
|
356 | - $_REQUEST['stype'] = 'gd_place'; |
|
357 | - $_REQUEST['geodir_dashbord'] = true; |
|
358 | - $this->go_to( get_author_posts_url($user_id) ); |
|
359 | - $this->load_template(); |
|
360 | - $output = ob_get_contents(); |
|
361 | - ob_end_clean(); |
|
362 | - $this->assertContains('gd_list_view', $output); |
|
363 | - |
|
364 | - } |
|
365 | - |
|
366 | - public function testSearchPage() { |
|
367 | - ob_start(); |
|
368 | - $_REQUEST['geodir_search'] = "1"; |
|
369 | - $_REQUEST['stype'] = 'gd_place'; |
|
370 | - $this->go_to( home_url('/?geodir_search=1&stype=gd_place&s=test&snear=&sgeo_lat=&sgeo_lon=') ); |
|
371 | - $this->load_template(); |
|
372 | - $output = ob_get_contents(); |
|
373 | - ob_end_clean(); |
|
374 | - $this->assertContains('Search Results for', $output); |
|
375 | - |
|
376 | - } |
|
377 | - |
|
378 | - public function testPopupSendEnquiryTemplate() { |
|
379 | - |
|
380 | - $query_args = array( |
|
381 | - 'post_status' => 'publish', |
|
382 | - 'post_type' => 'gd_place', |
|
383 | - 'posts_per_page' => 1, |
|
384 | - ); |
|
385 | - |
|
386 | - $all_posts = new WP_Query( $query_args ); |
|
387 | - $post_id = null; |
|
388 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
389 | - $post_id = get_the_ID(); |
|
390 | - endwhile; |
|
391 | - |
|
392 | - $this->assertTrue(is_int($post_id)); |
|
393 | - |
|
394 | - $_REQUEST['popuptype'] = 'b_send_inquiry'; |
|
395 | - $_REQUEST['post_id'] = $post_id; |
|
396 | - add_filter('wp_redirect', '__return_false'); |
|
397 | - ob_start(); |
|
398 | - geodir_ajax_handler(); |
|
399 | - $output = ob_get_contents(); |
|
400 | - ob_end_clean(); |
|
401 | - $this->assertContains('send_inqury', $output); |
|
402 | - remove_filter('wp_redirect', '__return_false'); |
|
403 | - |
|
404 | - } |
|
405 | - |
|
406 | - public function texstPopupSendToFrndTemplate() { |
|
407 | - |
|
408 | - //include template problem. its already loaded. find a way to fix this |
|
409 | - |
|
410 | - $query_args = array( |
|
411 | - 'post_status' => 'publish', |
|
412 | - 'post_type' => 'gd_place', |
|
413 | - 'posts_per_page' => 1, |
|
414 | - ); |
|
415 | - |
|
416 | - $all_posts = new WP_Query( $query_args ); |
|
417 | - $post_id = null; |
|
418 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
419 | - $post_id = get_the_ID(); |
|
420 | - endwhile; |
|
421 | - |
|
422 | - $this->assertTrue(is_int($post_id)); |
|
423 | - |
|
424 | - $_REQUEST['popuptype'] = 'b_sendtofriend'; |
|
425 | - $_REQUEST['post_id'] = $post_id; |
|
426 | - add_filter('wp_redirect', '__return_false'); |
|
427 | - ob_start(); |
|
428 | - geodir_ajax_handler(); |
|
429 | - $output = ob_get_contents(); |
|
430 | - ob_end_clean(); |
|
431 | - $this->assertContains('send_inqury', $output); |
|
432 | - remove_filter('wp_redirect', '__return_false'); |
|
433 | - } |
|
434 | - |
|
435 | - public function testNavMenus() { |
|
436 | - $menuname = 'Primary Menu'; |
|
437 | - $menulocation = 'primary'; |
|
438 | - // Does the menu exist already? |
|
439 | - $menu_exists = wp_get_nav_menu_object( $menuname ); |
|
440 | - |
|
441 | - // If it doesn't exist, let's create it. |
|
442 | - if( !$menu_exists){ |
|
443 | - $menu_id = wp_create_nav_menu($menuname); |
|
444 | - |
|
445 | - // Set up default BuddyPress links and add them to the menu. |
|
446 | - wp_update_nav_menu_item($menu_id, 0, array( |
|
447 | - 'menu-item-title' => __('Home'), |
|
448 | - 'menu-item-classes' => 'home', |
|
449 | - 'menu-item-url' => home_url( '/' ), |
|
450 | - 'menu-item-status' => 'publish')); |
|
451 | - |
|
452 | - if( !has_nav_menu( $menulocation ) ){ |
|
453 | - $locations = get_theme_mod('nav_menu_locations'); |
|
454 | - $locations[$menulocation] = $menu_id; |
|
455 | - set_theme_mod( 'nav_menu_locations', $locations ); |
|
456 | - } |
|
457 | - |
|
458 | - update_option('geodir_theme_location_nav', array('primary')); |
|
459 | - |
|
460 | - $menu = wp_nav_menu(array( |
|
461 | - 'theme_location' => 'primary', |
|
462 | - 'echo' => false, |
|
463 | - )); |
|
464 | - |
|
465 | - $this->assertContains('Add Listing', $menu); |
|
466 | - |
|
467 | - |
|
468 | - } |
|
469 | - } |
|
470 | - |
|
471 | - public function testBestOfWidget() { |
|
472 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
473 | - include_once($template); |
|
474 | - |
|
475 | - ob_start(); |
|
476 | - $instance = array(); |
|
477 | - $instance['use_viewing_post_type'] = '1'; |
|
478 | - $instance['excerpt_type'] = 'show-reviews'; |
|
479 | - the_widget( 'geodir_bestof_widget' ); |
|
480 | - $output = ob_get_contents(); |
|
481 | - ob_end_clean(); |
|
482 | - $this->assertContains('bestof-widget-tab-layout', $output); |
|
483 | - |
|
484 | - ob_start(); |
|
485 | - $this->the_widget_form( 'geodir_bestof_widget' ); |
|
486 | - $output = ob_get_contents(); |
|
487 | - ob_end_clean(); |
|
488 | - $this->assertContains('Number of categories', $output); |
|
489 | - |
|
490 | - $new_instance = array( |
|
491 | - 'title' => '', |
|
492 | - 'post_type' => '', |
|
493 | - 'post_limit' => '5', |
|
494 | - 'categ_limit' => '3', |
|
495 | - 'character_count' => '20', |
|
496 | - 'add_location_filter' => '1', |
|
497 | - 'tab_layout' => 'bestof-tabs-on-top', |
|
498 | - 'excerpt_type' => 'show-desc', |
|
499 | - 'use_viewing_post_type' => '1' |
|
500 | - ); |
|
501 | - $output = $this->the_widget_form_update( 'geodir_bestof_widget', $new_instance ); |
|
502 | - $this->assertContains('20', $output['character_count']); |
|
503 | - |
|
504 | - ob_start(); |
|
505 | - geodir_bestof_js(); |
|
506 | - $output = ob_get_contents(); |
|
507 | - ob_end_clean(); |
|
508 | - $this->assertContains('bestof-widget-tab-layout', $output); |
|
509 | - |
|
510 | - } |
|
511 | - |
|
512 | - public function testCptCatsWidget() { |
|
513 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_cpt_categories_widget.php'; |
|
514 | - include_once($template); |
|
515 | - |
|
516 | - ob_start(); |
|
517 | - the_widget( 'geodir_cpt_categories_widget' ); |
|
518 | - $output = ob_get_contents(); |
|
519 | - ob_end_clean(); |
|
520 | - $this->assertContains('geodir_cpt_categories_widget', $output); |
|
521 | - |
|
522 | - ob_start(); |
|
523 | - $this->the_widget_form( 'geodir_cpt_categories_widget' ); |
|
524 | - $output = ob_get_contents(); |
|
525 | - ob_end_clean(); |
|
526 | - $this->assertContains('Select CPT', $output); |
|
527 | - |
|
528 | - $new_instance = array( |
|
529 | - 'title' => '', |
|
530 | - 'post_type' => array(), // NULL for all |
|
531 | - 'hide_empty' => '', |
|
532 | - 'show_count' => '', |
|
533 | - 'hide_icon' => '', |
|
534 | - 'cpt_left' => '', |
|
535 | - 'sort_by' => 'count', |
|
536 | - 'max_count' => 'all', |
|
537 | - 'max_level' => '1' |
|
538 | - ); |
|
539 | - $output = $this->the_widget_form_update( 'geodir_cpt_categories_widget', $new_instance ); |
|
540 | - $this->assertContains('count', $output['sort_by']); |
|
541 | - |
|
542 | - } |
|
543 | - |
|
544 | - public function testFeaturesWidget() { |
|
545 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_features_widget.php'; |
|
546 | - include_once($template); |
|
547 | - |
|
548 | - $instance = array( |
|
549 | - 'title' => 'Features', |
|
550 | - 'icon_color' => '', |
|
551 | - 'title1' => 'Hello World', |
|
552 | - 'image1' => 'fa-recycle', |
|
553 | - 'desc1' => 'cool', |
|
554 | - ); |
|
555 | - |
|
556 | - ob_start(); |
|
557 | - the_widget( 'Geodir_Features_Widget', $instance); |
|
558 | - $output = ob_get_contents(); |
|
559 | - ob_end_clean(); |
|
560 | - $this->assertContains('widget_gd_features', $output); |
|
561 | - |
|
562 | - ob_start(); |
|
563 | - $this->the_widget_form( 'Geodir_Features_Widget', $instance ); |
|
564 | - $output = ob_get_contents(); |
|
565 | - ob_end_clean(); |
|
566 | - $this->assertContains('Font Awesome Icon Color', $output); |
|
567 | - |
|
568 | - $new_instance = array( |
|
569 | - 'title' => 'Features', |
|
570 | - 'icon_color' => '', |
|
571 | - 'title1' => 'Hello World', |
|
572 | - 'image1' => 'fa-recycle', |
|
573 | - 'desc1' => 'cool', |
|
574 | - ); |
|
575 | - $output = $this->the_widget_form_update( 'Geodir_Features_Widget', $new_instance ); |
|
576 | - $this->assertContains('Features', $output['title']); |
|
577 | - |
|
578 | - } |
|
579 | - |
|
580 | - public function testSliderWidget() { |
|
581 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_listing_slider_widget.php'; |
|
582 | - include_once($template); |
|
583 | - |
|
584 | - ob_start(); |
|
585 | - the_widget( 'geodir_listing_slider_widget' ); |
|
586 | - $output = ob_get_contents(); |
|
587 | - ob_end_clean(); |
|
588 | - $this->assertContains('geodir_listing_slider_view', $output); |
|
589 | - |
|
590 | - ob_start(); |
|
591 | - $this->the_widget_form( 'geodir_listing_slider_widget' ); |
|
592 | - $output = ob_get_contents(); |
|
593 | - ob_end_clean(); |
|
594 | - $this->assertContains('Slide Show Speed', $output); |
|
595 | - |
|
596 | - $new_instance = array( |
|
597 | - 'title' => '', |
|
598 | - 'post_type' => '', |
|
599 | - 'category' => '', |
|
600 | - 'post_number' => '5', |
|
601 | - 'max_show' => '1', |
|
602 | - 'slide_width' => '', |
|
603 | - 'show_title' => '', |
|
604 | - 'slideshow' => '', |
|
605 | - 'animationLoop' => '', |
|
606 | - 'directionNav' => '', |
|
607 | - 'slideshowSpeed' => 5000, |
|
608 | - 'animationSpeed' => 600, |
|
609 | - 'animation' => '', |
|
610 | - 'list_sort' => 'latest', |
|
611 | - 'show_featured_only' => '', |
|
612 | - ); |
|
613 | - $output = $this->the_widget_form_update( 'geodir_listing_slider_widget', $new_instance ); |
|
614 | - $this->assertContains('latest', $output['list_sort']); |
|
615 | - |
|
616 | - } |
|
617 | - |
|
618 | - public function testPopularWidget() { |
|
619 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_popular_widget.php'; |
|
620 | - include_once($template); |
|
621 | - |
|
622 | - ob_start(); |
|
623 | - the_widget( 'geodir_popular_post_category' ); |
|
624 | - $output = ob_get_contents(); |
|
625 | - ob_end_clean(); |
|
626 | - $this->assertContains('geodir_popular_post_category', $output); |
|
627 | - |
|
628 | - ob_start(); |
|
629 | - $this->the_widget_form( 'geodir_popular_post_category' ); |
|
630 | - $output = ob_get_contents(); |
|
631 | - ob_end_clean(); |
|
632 | - $this->assertContains('Default post type to use', $output); |
|
633 | - |
|
634 | - $new_instance = array( |
|
635 | - 'title' => '', |
|
636 | - 'category_limit' => 15, |
|
637 | - 'default_post_type' => '' |
|
638 | - ); |
|
639 | - $output = $this->the_widget_form_update( 'geodir_popular_post_category', $new_instance ); |
|
640 | - $this->assertEquals(15, $output['category_limit']); |
|
641 | - |
|
642 | - ob_start(); |
|
643 | - $instance = array(); |
|
644 | - $instance['category_title'] = ''; |
|
645 | - the_widget( 'geodir_popular_postview', $instance ); |
|
646 | - $output = ob_get_contents(); |
|
647 | - ob_end_clean(); |
|
648 | - $this->assertContains('geodir_popular_post_view', $output); |
|
649 | - |
|
650 | - ob_start(); |
|
651 | - $this->the_widget_form( 'geodir_popular_postview' ); |
|
652 | - $output = ob_get_contents(); |
|
653 | - ob_end_clean(); |
|
654 | - $this->assertContains('Post Category', $output); |
|
655 | - |
|
656 | - $new_instance = array( |
|
657 | - 'title' => '', |
|
658 | - 'post_type' => '', |
|
659 | - 'category' => array(), |
|
660 | - 'category_title' => '', |
|
661 | - 'list_sort' => '', |
|
662 | - 'list_order' => '', |
|
663 | - 'post_number' => '5', |
|
664 | - 'layout' => 'gridview_onehalf', |
|
665 | - 'listing_width' => '', |
|
666 | - 'add_location_filter' => '1', |
|
667 | - 'character_count' => '20', |
|
668 | - 'show_featured_only' => '', |
|
669 | - 'show_special_only' => '', |
|
670 | - 'with_pics_only' => '', |
|
671 | - 'with_videos_only' => '', |
|
672 | - 'use_viewing_post_type' => '' |
|
673 | - ); |
|
674 | - $output = $this->the_widget_form_update( 'geodir_popular_postview', $new_instance ); |
|
675 | - $this->assertContains('gridview_onehalf', $output['layout']); |
|
676 | - |
|
677 | - } |
|
678 | - |
|
679 | - public function testRelatedWidget() { |
|
680 | - $query_args = array( |
|
681 | - 'post_status' => 'publish', |
|
682 | - 'post_type' => 'gd_place', |
|
683 | - 'posts_per_page' => 1, |
|
684 | - ); |
|
685 | - |
|
686 | - $all_posts = new WP_Query( $query_args ); |
|
687 | - $post_id = null; |
|
688 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
689 | - global $post; |
|
690 | - $post_id = get_the_ID(); |
|
691 | - $post = geodir_get_post_info($post->ID); |
|
179 | + wp_set_current_user(0); |
|
180 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php'; |
|
181 | + |
|
182 | + ob_start(); |
|
183 | + include($template); |
|
184 | + $output = ob_get_contents(); |
|
185 | + ob_end_clean(); |
|
186 | + $this->assertContains('Sign In', $output); |
|
187 | + } |
|
188 | + |
|
189 | + public function testInfoTemplate() { |
|
190 | + wp_set_current_user(1); |
|
191 | + global $information; |
|
192 | + $information = "hello world"; |
|
193 | + |
|
194 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
195 | + |
|
196 | + ob_start(); |
|
197 | + include($template); |
|
198 | + $output = ob_get_contents(); |
|
199 | + ob_end_clean(); |
|
200 | + $this->assertContains('hello world', $output); |
|
201 | + } |
|
202 | + |
|
203 | + public function testSuccessPage() { |
|
204 | + wp_set_current_user(1); |
|
205 | + |
|
206 | + $query_args = array( |
|
207 | + 'post_status' => 'publish', |
|
208 | + 'post_type' => 'gd_place', |
|
209 | + 'posts_per_page' => 1, |
|
210 | + ); |
|
211 | + |
|
212 | + $all_posts = new WP_Query( $query_args ); |
|
213 | + $post_id = null; |
|
214 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
215 | + $post_id = get_the_ID(); |
|
216 | + endwhile; |
|
217 | + |
|
218 | + $this->assertTrue(is_int($post_id)); |
|
219 | + |
|
220 | + $_REQUEST['listing_type'] = 'gd_place'; |
|
221 | + $_REQUEST['pid'] = $post_id; |
|
222 | + ob_start(); |
|
223 | + $this->go_to( get_permalink(geodir_success_page_id()) ); |
|
224 | + $this->load_template(); |
|
225 | + $output = ob_get_contents(); |
|
226 | + ob_end_clean(); |
|
227 | + $this->assertContains('View your submitted information', $output); |
|
228 | + } |
|
229 | + |
|
230 | + public function testPreviewPage() { |
|
231 | + wp_set_current_user(1); |
|
232 | + |
|
233 | + $query_args = array( |
|
234 | + 'post_status' => 'publish', |
|
235 | + 'post_type' => 'gd_place', |
|
236 | + 'posts_per_page' => 1, |
|
237 | + ); |
|
238 | + |
|
239 | + $all_posts = new WP_Query( $query_args ); |
|
240 | + $post_id = null; |
|
241 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
242 | + $post_id = get_the_ID(); |
|
243 | + endwhile; |
|
244 | + |
|
245 | + $this->assertTrue(is_int($post_id)); |
|
246 | + |
|
247 | + $_REQUEST = array( |
|
248 | + 'pid' => $post_id, |
|
249 | + 'listing_type' => 'gd_place', |
|
250 | + 'post_title' => 'Test Listing Title Modified', |
|
251 | + 'post_desc' => 'Test Desc', |
|
252 | + 'post_tags' => 'test1,test2', |
|
253 | + 'post_address' => 'New York City Hall', |
|
254 | + 'post_zip' => '10007', |
|
255 | + 'post_latitude' => '40.7127837', |
|
256 | + 'post_longitude' => '-74.00594130000002', |
|
257 | + 'post_mapview' => 'ROADMAP', |
|
258 | + 'post_mapzoom' => '10', |
|
259 | + 'geodir_timing' => '10.00 am to 6 pm every day', |
|
260 | + 'geodir_contact' => '1234567890', |
|
261 | + 'geodir_email' => '[email protected]', |
|
262 | + 'geodir_website' => 'http://test.com', |
|
263 | + 'geodir_twitter' => 'http://twitter.com/test', |
|
264 | + 'geodir_facebook' => 'http://facebook.com/test', |
|
265 | + 'geodir_special_offers' => 'Test offer', |
|
266 | + 'preview' => true, |
|
267 | + 'post_category' => array( |
|
268 | + 'gd_placecategory' => '' |
|
269 | + ) |
|
270 | + ); |
|
271 | + |
|
272 | + ob_start(); |
|
273 | + $this->go_to( get_permalink(geodir_preview_page_id()) ); |
|
274 | + $this->load_template(); |
|
275 | + $output = ob_get_contents(); |
|
276 | + ob_end_clean(); |
|
277 | + $this->assertContains('This is a preview of your listing', $output); |
|
278 | + } |
|
279 | + |
|
280 | + public function testAddListingPage() { |
|
281 | + wp_set_current_user(1); |
|
282 | + |
|
283 | + ob_start(); |
|
284 | + $this->go_to( get_permalink(geodir_add_listing_page_id()) ); |
|
285 | + $this->load_template(); |
|
286 | + $output = ob_get_contents(); |
|
287 | + ob_end_clean(); |
|
288 | + $this->assertContains('Enter Listing Details', $output); |
|
289 | + } |
|
290 | + |
|
291 | + public function testLocationPage() { |
|
292 | + wp_set_current_user(1); |
|
293 | + |
|
294 | + ob_start(); |
|
295 | + $this->go_to( get_permalink(geodir_location_page_id()) ); |
|
296 | + $this->load_template(); |
|
297 | + $output = ob_get_contents(); |
|
298 | + ob_end_clean(); |
|
299 | + $this->assertContains('Location', $output); |
|
300 | + } |
|
301 | + |
|
302 | + public function testTemplates() { |
|
303 | + |
|
304 | + global $current_user; |
|
305 | + |
|
306 | + $user_id = $current_user->ID; |
|
307 | + |
|
308 | + $this->setPermalinkStructure(); |
|
309 | + |
|
310 | + $homepage = get_page_by_title( 'GD Home page' ); |
|
311 | + if ( $homepage ) |
|
312 | + { |
|
313 | + update_option( 'page_on_front', $homepage->ID ); |
|
314 | + update_option( 'show_on_front', 'page' ); |
|
315 | + } |
|
316 | + |
|
317 | + ob_start(); |
|
318 | + $this->go_to( home_url('/') ); |
|
319 | + $this->load_template(); |
|
320 | + $output = ob_get_contents(); |
|
321 | + ob_end_clean(); |
|
322 | + $this->assertContains('body class="home', $output); |
|
323 | + |
|
324 | + |
|
325 | + ob_start(); |
|
326 | + $this->go_to( home_url('/?post_type=gd_place') ); |
|
327 | + $this->load_template(); |
|
328 | + $output = ob_get_contents(); |
|
329 | + ob_end_clean(); |
|
330 | + $this->assertContains('All Places', $output); |
|
331 | + |
|
332 | + $query_args = array( |
|
333 | + 'post_status' => 'publish', |
|
334 | + 'post_type' => 'gd_place', |
|
335 | + 'posts_per_page' => 1, |
|
336 | + ); |
|
337 | + |
|
338 | + $all_posts = new WP_Query( $query_args ); |
|
339 | + $post_id = null; |
|
340 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
341 | + $post_id = get_the_ID(); |
|
342 | + endwhile; |
|
343 | + |
|
344 | + $this->assertTrue(is_int($post_id)); |
|
345 | + |
|
346 | + global $preview; |
|
347 | + $preview = false; |
|
348 | + ob_start(); |
|
349 | + $this->go_to( get_permalink($post_id) ); |
|
350 | + $this->load_template(); |
|
351 | + $output = ob_get_contents(); |
|
352 | + ob_end_clean(); |
|
353 | + $this->assertContains('post_profileTab', $output); |
|
354 | + |
|
355 | + ob_start(); |
|
356 | + $_REQUEST['stype'] = 'gd_place'; |
|
357 | + $_REQUEST['geodir_dashbord'] = true; |
|
358 | + $this->go_to( get_author_posts_url($user_id) ); |
|
359 | + $this->load_template(); |
|
360 | + $output = ob_get_contents(); |
|
361 | + ob_end_clean(); |
|
362 | + $this->assertContains('gd_list_view', $output); |
|
363 | + |
|
364 | + } |
|
365 | + |
|
366 | + public function testSearchPage() { |
|
367 | + ob_start(); |
|
368 | + $_REQUEST['geodir_search'] = "1"; |
|
369 | + $_REQUEST['stype'] = 'gd_place'; |
|
370 | + $this->go_to( home_url('/?geodir_search=1&stype=gd_place&s=test&snear=&sgeo_lat=&sgeo_lon=') ); |
|
371 | + $this->load_template(); |
|
372 | + $output = ob_get_contents(); |
|
373 | + ob_end_clean(); |
|
374 | + $this->assertContains('Search Results for', $output); |
|
375 | + |
|
376 | + } |
|
377 | + |
|
378 | + public function testPopupSendEnquiryTemplate() { |
|
379 | + |
|
380 | + $query_args = array( |
|
381 | + 'post_status' => 'publish', |
|
382 | + 'post_type' => 'gd_place', |
|
383 | + 'posts_per_page' => 1, |
|
384 | + ); |
|
385 | + |
|
386 | + $all_posts = new WP_Query( $query_args ); |
|
387 | + $post_id = null; |
|
388 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
389 | + $post_id = get_the_ID(); |
|
390 | + endwhile; |
|
391 | + |
|
392 | + $this->assertTrue(is_int($post_id)); |
|
393 | + |
|
394 | + $_REQUEST['popuptype'] = 'b_send_inquiry'; |
|
395 | + $_REQUEST['post_id'] = $post_id; |
|
396 | + add_filter('wp_redirect', '__return_false'); |
|
397 | + ob_start(); |
|
398 | + geodir_ajax_handler(); |
|
399 | + $output = ob_get_contents(); |
|
400 | + ob_end_clean(); |
|
401 | + $this->assertContains('send_inqury', $output); |
|
402 | + remove_filter('wp_redirect', '__return_false'); |
|
403 | + |
|
404 | + } |
|
405 | + |
|
406 | + public function texstPopupSendToFrndTemplate() { |
|
407 | + |
|
408 | + //include template problem. its already loaded. find a way to fix this |
|
409 | + |
|
410 | + $query_args = array( |
|
411 | + 'post_status' => 'publish', |
|
412 | + 'post_type' => 'gd_place', |
|
413 | + 'posts_per_page' => 1, |
|
414 | + ); |
|
415 | + |
|
416 | + $all_posts = new WP_Query( $query_args ); |
|
417 | + $post_id = null; |
|
418 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
419 | + $post_id = get_the_ID(); |
|
420 | + endwhile; |
|
421 | + |
|
422 | + $this->assertTrue(is_int($post_id)); |
|
423 | + |
|
424 | + $_REQUEST['popuptype'] = 'b_sendtofriend'; |
|
425 | + $_REQUEST['post_id'] = $post_id; |
|
426 | + add_filter('wp_redirect', '__return_false'); |
|
427 | + ob_start(); |
|
428 | + geodir_ajax_handler(); |
|
429 | + $output = ob_get_contents(); |
|
430 | + ob_end_clean(); |
|
431 | + $this->assertContains('send_inqury', $output); |
|
432 | + remove_filter('wp_redirect', '__return_false'); |
|
433 | + } |
|
434 | + |
|
435 | + public function testNavMenus() { |
|
436 | + $menuname = 'Primary Menu'; |
|
437 | + $menulocation = 'primary'; |
|
438 | + // Does the menu exist already? |
|
439 | + $menu_exists = wp_get_nav_menu_object( $menuname ); |
|
440 | + |
|
441 | + // If it doesn't exist, let's create it. |
|
442 | + if( !$menu_exists){ |
|
443 | + $menu_id = wp_create_nav_menu($menuname); |
|
444 | + |
|
445 | + // Set up default BuddyPress links and add them to the menu. |
|
446 | + wp_update_nav_menu_item($menu_id, 0, array( |
|
447 | + 'menu-item-title' => __('Home'), |
|
448 | + 'menu-item-classes' => 'home', |
|
449 | + 'menu-item-url' => home_url( '/' ), |
|
450 | + 'menu-item-status' => 'publish')); |
|
451 | + |
|
452 | + if( !has_nav_menu( $menulocation ) ){ |
|
453 | + $locations = get_theme_mod('nav_menu_locations'); |
|
454 | + $locations[$menulocation] = $menu_id; |
|
455 | + set_theme_mod( 'nav_menu_locations', $locations ); |
|
456 | + } |
|
457 | + |
|
458 | + update_option('geodir_theme_location_nav', array('primary')); |
|
459 | + |
|
460 | + $menu = wp_nav_menu(array( |
|
461 | + 'theme_location' => 'primary', |
|
462 | + 'echo' => false, |
|
463 | + )); |
|
464 | + |
|
465 | + $this->assertContains('Add Listing', $menu); |
|
466 | + |
|
467 | + |
|
468 | + } |
|
469 | + } |
|
470 | + |
|
471 | + public function testBestOfWidget() { |
|
472 | + $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
473 | + include_once($template); |
|
474 | + |
|
475 | + ob_start(); |
|
476 | + $instance = array(); |
|
477 | + $instance['use_viewing_post_type'] = '1'; |
|
478 | + $instance['excerpt_type'] = 'show-reviews'; |
|
479 | + the_widget( 'geodir_bestof_widget' ); |
|
480 | + $output = ob_get_contents(); |
|
481 | + ob_end_clean(); |
|
482 | + $this->assertContains('bestof-widget-tab-layout', $output); |
|
483 | + |
|
484 | + ob_start(); |
|
485 | + $this->the_widget_form( 'geodir_bestof_widget' ); |
|
486 | + $output = ob_get_contents(); |
|
487 | + ob_end_clean(); |
|
488 | + $this->assertContains('Number of categories', $output); |
|
489 | + |
|
490 | + $new_instance = array( |
|
491 | + 'title' => '', |
|
492 | + 'post_type' => '', |
|
493 | + 'post_limit' => '5', |
|
494 | + 'categ_limit' => '3', |
|
495 | + 'character_count' => '20', |
|
496 | + 'add_location_filter' => '1', |
|
497 | + 'tab_layout' => 'bestof-tabs-on-top', |
|
498 | + 'excerpt_type' => 'show-desc', |
|
499 | + 'use_viewing_post_type' => '1' |
|
500 | + ); |
|
501 | + $output = $this->the_widget_form_update( 'geodir_bestof_widget', $new_instance ); |
|
502 | + $this->assertContains('20', $output['character_count']); |
|
503 | + |
|
504 | + ob_start(); |
|
505 | + geodir_bestof_js(); |
|
506 | + $output = ob_get_contents(); |
|
507 | + ob_end_clean(); |
|
508 | + $this->assertContains('bestof-widget-tab-layout', $output); |
|
509 | + |
|
510 | + } |
|
511 | + |
|
512 | + public function testCptCatsWidget() { |
|
513 | + $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_cpt_categories_widget.php'; |
|
514 | + include_once($template); |
|
515 | + |
|
516 | + ob_start(); |
|
517 | + the_widget( 'geodir_cpt_categories_widget' ); |
|
518 | + $output = ob_get_contents(); |
|
519 | + ob_end_clean(); |
|
520 | + $this->assertContains('geodir_cpt_categories_widget', $output); |
|
521 | + |
|
522 | + ob_start(); |
|
523 | + $this->the_widget_form( 'geodir_cpt_categories_widget' ); |
|
524 | + $output = ob_get_contents(); |
|
525 | + ob_end_clean(); |
|
526 | + $this->assertContains('Select CPT', $output); |
|
527 | + |
|
528 | + $new_instance = array( |
|
529 | + 'title' => '', |
|
530 | + 'post_type' => array(), // NULL for all |
|
531 | + 'hide_empty' => '', |
|
532 | + 'show_count' => '', |
|
533 | + 'hide_icon' => '', |
|
534 | + 'cpt_left' => '', |
|
535 | + 'sort_by' => 'count', |
|
536 | + 'max_count' => 'all', |
|
537 | + 'max_level' => '1' |
|
538 | + ); |
|
539 | + $output = $this->the_widget_form_update( 'geodir_cpt_categories_widget', $new_instance ); |
|
540 | + $this->assertContains('count', $output['sort_by']); |
|
541 | + |
|
542 | + } |
|
543 | + |
|
544 | + public function testFeaturesWidget() { |
|
545 | + $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_features_widget.php'; |
|
546 | + include_once($template); |
|
547 | + |
|
548 | + $instance = array( |
|
549 | + 'title' => 'Features', |
|
550 | + 'icon_color' => '', |
|
551 | + 'title1' => 'Hello World', |
|
552 | + 'image1' => 'fa-recycle', |
|
553 | + 'desc1' => 'cool', |
|
554 | + ); |
|
555 | + |
|
556 | + ob_start(); |
|
557 | + the_widget( 'Geodir_Features_Widget', $instance); |
|
558 | + $output = ob_get_contents(); |
|
559 | + ob_end_clean(); |
|
560 | + $this->assertContains('widget_gd_features', $output); |
|
561 | + |
|
562 | + ob_start(); |
|
563 | + $this->the_widget_form( 'Geodir_Features_Widget', $instance ); |
|
564 | + $output = ob_get_contents(); |
|
565 | + ob_end_clean(); |
|
566 | + $this->assertContains('Font Awesome Icon Color', $output); |
|
567 | + |
|
568 | + $new_instance = array( |
|
569 | + 'title' => 'Features', |
|
570 | + 'icon_color' => '', |
|
571 | + 'title1' => 'Hello World', |
|
572 | + 'image1' => 'fa-recycle', |
|
573 | + 'desc1' => 'cool', |
|
574 | + ); |
|
575 | + $output = $this->the_widget_form_update( 'Geodir_Features_Widget', $new_instance ); |
|
576 | + $this->assertContains('Features', $output['title']); |
|
577 | + |
|
578 | + } |
|
579 | + |
|
580 | + public function testSliderWidget() { |
|
581 | + $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_listing_slider_widget.php'; |
|
582 | + include_once($template); |
|
583 | + |
|
584 | + ob_start(); |
|
585 | + the_widget( 'geodir_listing_slider_widget' ); |
|
586 | + $output = ob_get_contents(); |
|
587 | + ob_end_clean(); |
|
588 | + $this->assertContains('geodir_listing_slider_view', $output); |
|
589 | + |
|
590 | + ob_start(); |
|
591 | + $this->the_widget_form( 'geodir_listing_slider_widget' ); |
|
592 | + $output = ob_get_contents(); |
|
593 | + ob_end_clean(); |
|
594 | + $this->assertContains('Slide Show Speed', $output); |
|
595 | + |
|
596 | + $new_instance = array( |
|
597 | + 'title' => '', |
|
598 | + 'post_type' => '', |
|
599 | + 'category' => '', |
|
600 | + 'post_number' => '5', |
|
601 | + 'max_show' => '1', |
|
602 | + 'slide_width' => '', |
|
603 | + 'show_title' => '', |
|
604 | + 'slideshow' => '', |
|
605 | + 'animationLoop' => '', |
|
606 | + 'directionNav' => '', |
|
607 | + 'slideshowSpeed' => 5000, |
|
608 | + 'animationSpeed' => 600, |
|
609 | + 'animation' => '', |
|
610 | + 'list_sort' => 'latest', |
|
611 | + 'show_featured_only' => '', |
|
612 | + ); |
|
613 | + $output = $this->the_widget_form_update( 'geodir_listing_slider_widget', $new_instance ); |
|
614 | + $this->assertContains('latest', $output['list_sort']); |
|
615 | + |
|
616 | + } |
|
617 | + |
|
618 | + public function testPopularWidget() { |
|
619 | + $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_popular_widget.php'; |
|
620 | + include_once($template); |
|
621 | + |
|
622 | + ob_start(); |
|
623 | + the_widget( 'geodir_popular_post_category' ); |
|
624 | + $output = ob_get_contents(); |
|
625 | + ob_end_clean(); |
|
626 | + $this->assertContains('geodir_popular_post_category', $output); |
|
627 | + |
|
628 | + ob_start(); |
|
629 | + $this->the_widget_form( 'geodir_popular_post_category' ); |
|
630 | + $output = ob_get_contents(); |
|
631 | + ob_end_clean(); |
|
632 | + $this->assertContains('Default post type to use', $output); |
|
633 | + |
|
634 | + $new_instance = array( |
|
635 | + 'title' => '', |
|
636 | + 'category_limit' => 15, |
|
637 | + 'default_post_type' => '' |
|
638 | + ); |
|
639 | + $output = $this->the_widget_form_update( 'geodir_popular_post_category', $new_instance ); |
|
640 | + $this->assertEquals(15, $output['category_limit']); |
|
641 | + |
|
642 | + ob_start(); |
|
643 | + $instance = array(); |
|
644 | + $instance['category_title'] = ''; |
|
645 | + the_widget( 'geodir_popular_postview', $instance ); |
|
646 | + $output = ob_get_contents(); |
|
647 | + ob_end_clean(); |
|
648 | + $this->assertContains('geodir_popular_post_view', $output); |
|
649 | + |
|
650 | + ob_start(); |
|
651 | + $this->the_widget_form( 'geodir_popular_postview' ); |
|
652 | + $output = ob_get_contents(); |
|
653 | + ob_end_clean(); |
|
654 | + $this->assertContains('Post Category', $output); |
|
655 | + |
|
656 | + $new_instance = array( |
|
657 | + 'title' => '', |
|
658 | + 'post_type' => '', |
|
659 | + 'category' => array(), |
|
660 | + 'category_title' => '', |
|
661 | + 'list_sort' => '', |
|
662 | + 'list_order' => '', |
|
663 | + 'post_number' => '5', |
|
664 | + 'layout' => 'gridview_onehalf', |
|
665 | + 'listing_width' => '', |
|
666 | + 'add_location_filter' => '1', |
|
667 | + 'character_count' => '20', |
|
668 | + 'show_featured_only' => '', |
|
669 | + 'show_special_only' => '', |
|
670 | + 'with_pics_only' => '', |
|
671 | + 'with_videos_only' => '', |
|
672 | + 'use_viewing_post_type' => '' |
|
673 | + ); |
|
674 | + $output = $this->the_widget_form_update( 'geodir_popular_postview', $new_instance ); |
|
675 | + $this->assertContains('gridview_onehalf', $output['layout']); |
|
676 | + |
|
677 | + } |
|
678 | + |
|
679 | + public function testRelatedWidget() { |
|
680 | + $query_args = array( |
|
681 | + 'post_status' => 'publish', |
|
682 | + 'post_type' => 'gd_place', |
|
683 | + 'posts_per_page' => 1, |
|
684 | + ); |
|
685 | + |
|
686 | + $all_posts = new WP_Query( $query_args ); |
|
687 | + $post_id = null; |
|
688 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
689 | + global $post; |
|
690 | + $post_id = get_the_ID(); |
|
691 | + $post = geodir_get_post_info($post->ID); |
|
692 | 692 | |
693 | 693 | // $term_list = wp_get_post_terms($post->ID, 'gd_placecategory'); |
694 | 694 | // $post->gd_placecategory = (string) $term_list[0]->term_id; |
695 | 695 | |
696 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_related_listing_widget.php'; |
|
697 | - include_once($template); |
|
698 | - |
|
699 | - ob_start(); |
|
700 | - the_widget( 'geodir_related_listing_postview' ); |
|
701 | - $output = ob_get_contents(); |
|
702 | - ob_end_clean(); |
|
703 | - $this->assertContains('Related Listing', $output); |
|
704 | - |
|
705 | - ob_start(); |
|
706 | - $this->the_widget_form( 'geodir_related_listing_postview' ); |
|
707 | - $output = ob_get_contents(); |
|
708 | - ob_end_clean(); |
|
709 | - $this->assertContains('Relate to', $output); |
|
710 | - |
|
711 | - $new_instance = array( |
|
712 | - 'title' => '', |
|
713 | - 'list_sort' => '', |
|
714 | - 'list_order' => '', |
|
715 | - 'post_number' => '5', |
|
716 | - 'relate_to' => '', |
|
717 | - 'layout' => 'gridview_onehalf', |
|
718 | - 'listing_width' => '', |
|
719 | - 'add_location_filter' => '1', |
|
720 | - 'character_count' => '20' |
|
721 | - ); |
|
722 | - $output = $this->the_widget_form_update( 'geodir_related_listing_postview', $new_instance ); |
|
723 | - $this->assertContains('gridview_onehalf', $output['layout']); |
|
724 | - endwhile; |
|
725 | - |
|
726 | - $this->assertTrue(is_int($post_id)); |
|
727 | - |
|
728 | - |
|
729 | - } |
|
730 | - |
|
731 | - public function testReviewsWidget() { |
|
732 | - |
|
733 | - $time = current_time('mysql'); |
|
734 | - |
|
735 | - $args = array( |
|
736 | - 'listing_type' => 'gd_place', |
|
737 | - 'post_title' => 'Test Listing Title', |
|
738 | - 'post_desc' => 'Test Desc', |
|
739 | - 'post_tags' => 'test1,test2', |
|
740 | - 'post_address' => 'New York City Hall', |
|
741 | - 'post_zip' => '10007', |
|
742 | - 'post_latitude' => '40.7127837', |
|
743 | - 'post_longitude' => '-74.00594130000002', |
|
744 | - 'post_mapview' => 'ROADMAP', |
|
745 | - 'post_mapzoom' => '10', |
|
746 | - 'geodir_timing' => '10.00 am to 6 pm every day', |
|
747 | - 'geodir_contact' => '1234567890', |
|
748 | - 'geodir_email' => '[email protected]', |
|
749 | - 'geodir_website' => 'http://test.com', |
|
750 | - 'geodir_twitter' => 'http://twitter.com/test', |
|
751 | - 'geodir_facebook' => 'http://facebook.com/test', |
|
752 | - 'geodir_special_offers' => 'Test offer' |
|
753 | - ); |
|
754 | - $post_id = geodir_save_listing($args, true); |
|
755 | - |
|
756 | - $data = array( |
|
757 | - 'comment_post_ID' => $post_id, |
|
758 | - 'comment_author' => 'admin', |
|
759 | - 'comment_author_email' => '[email protected]', |
|
760 | - 'comment_author_url' => 'http://wpgeodirectory.com', |
|
761 | - 'comment_content' => 'content here', |
|
762 | - 'comment_type' => '', |
|
763 | - 'comment_parent' => 0, |
|
764 | - 'user_id' => 1, |
|
765 | - 'comment_author_IP' => '127.0.0.1', |
|
766 | - 'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)', |
|
767 | - 'comment_date' => $time, |
|
768 | - 'comment_approved' => 1, |
|
769 | - ); |
|
770 | - |
|
771 | - $comment_id = wp_insert_comment($data); |
|
772 | - |
|
773 | - $_REQUEST['geodir_overallrating'] = 5.0; |
|
774 | - geodir_save_rating($comment_id); |
|
775 | - |
|
776 | - $this->assertTrue(is_int($comment_id)); |
|
777 | - |
|
778 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_reviews_widget.php'; |
|
779 | - include_once($template); |
|
780 | - |
|
781 | - ob_start(); |
|
782 | - the_widget( 'geodir_recent_reviews_widget' ); |
|
783 | - $output = ob_get_contents(); |
|
784 | - ob_end_clean(); |
|
785 | - $this->assertContains('geodir_recent_reviews', $output); |
|
786 | - |
|
787 | - ob_start(); |
|
788 | - $this->the_widget_form( 'geodir_recent_reviews_widget' ); |
|
789 | - $output = ob_get_contents(); |
|
790 | - ob_end_clean(); |
|
791 | - $this->assertContains('Number of Reviews', $output); |
|
792 | - |
|
793 | - $new_instance = array( |
|
794 | - 'title' => '', |
|
795 | - 't1' => '', |
|
796 | - 't2' => '', |
|
797 | - 't3' => '', |
|
798 | - 'img1' => '', |
|
799 | - 'count' => '' |
|
800 | - ); |
|
801 | - $output = $this->the_widget_form_update( 'geodir_recent_reviews_widget', $new_instance ); |
|
802 | - $this->assertTrue(empty($output['count'])); |
|
803 | - } |
|
804 | - |
|
805 | - public function testHomeMapWidget() { |
|
806 | - $template = geodir_plugin_path() . '/geodirectory-widgets/home_map_widget.php'; |
|
807 | - include_once($template); |
|
808 | - |
|
809 | - ob_start(); |
|
810 | - $instance = array(); |
|
811 | - $args = array(); |
|
812 | - $args["widget_id"] = "geodir_map_v3_home_map-2"; |
|
813 | - the_widget( 'geodir_homepage_map', $instance, $args ); |
|
814 | - $output = ob_get_contents(); |
|
815 | - ob_end_clean(); |
|
816 | - $this->assertContains('geodir-map-home-page', $output); |
|
817 | - |
|
818 | - ob_start(); |
|
819 | - $this->the_widget_form( 'geodir_homepage_map' ); |
|
820 | - $output = ob_get_contents(); |
|
821 | - ob_end_clean(); |
|
822 | - $this->assertContains('Map Zoom level', $output); |
|
823 | - |
|
824 | - $new_instance = array( |
|
825 | - 'width' => '', |
|
826 | - 'heigh' => '', |
|
827 | - 'maptype' => '', |
|
828 | - 'zoom' => '', |
|
829 | - 'autozoom' => '', |
|
830 | - 'child_collapse' => '0', |
|
831 | - 'scrollwheel' => '0' |
|
832 | - ); |
|
833 | - $output = $this->the_widget_form_update( 'geodir_homepage_map', $new_instance ); |
|
834 | - $this->assertContains('0', $output['scrollwheel']); |
|
835 | - |
|
836 | - } |
|
837 | - |
|
838 | - public function testLoginWidget() { |
|
839 | - |
|
840 | - register_geodir_widgets(); |
|
841 | - |
|
842 | - ob_start(); |
|
843 | - the_widget( 'geodir_loginwidget' ); |
|
844 | - $output = ob_get_contents(); |
|
845 | - ob_end_clean(); |
|
846 | - $this->assertContains('geodir_loginbox', $output); |
|
847 | - |
|
848 | - ob_start(); |
|
849 | - $this->the_widget_form( 'geodir_loginwidget' ); |
|
850 | - $output = ob_get_contents(); |
|
851 | - ob_end_clean(); |
|
852 | - $this->assertContains('Widget Title', $output); |
|
853 | - |
|
854 | - $new_instance = array( |
|
855 | - 'title' => 'Login', |
|
856 | - 't1' => '', |
|
857 | - 't2' => '', |
|
858 | - 't3' => '', |
|
859 | - 'img1' => '', |
|
860 | - 'desc1' => '' |
|
861 | - ); |
|
862 | - $output = $this->the_widget_form_update( 'geodir_loginwidget', $new_instance ); |
|
863 | - $this->assertContains('Login', $output['title']); |
|
864 | - |
|
865 | - } |
|
866 | - |
|
867 | - public function testSocialWidget() { |
|
868 | - |
|
869 | - ob_start(); |
|
870 | - the_widget( 'geodir_social_like_widget' ); |
|
871 | - $output = ob_get_contents(); |
|
872 | - ob_end_clean(); |
|
873 | - $this->assertContains('twitter.com', $output); |
|
874 | - |
|
875 | - ob_start(); |
|
876 | - $this->the_widget_form( 'geodir_social_like_widget' ); |
|
877 | - $output = ob_get_contents(); |
|
878 | - ob_end_clean(); |
|
879 | - $this->assertContains('No settings for this widget', $output); |
|
880 | - |
|
881 | - $new_instance = array( |
|
882 | - 'title' => 'Social', |
|
883 | - ); |
|
884 | - $output = $this->the_widget_form_update( 'geodir_social_like_widget', $new_instance ); |
|
885 | - $this->assertContains('Social', $output['title']); |
|
886 | - |
|
887 | - } |
|
888 | - |
|
889 | - public function testSubscribeWidget() { |
|
890 | - |
|
891 | - ob_start(); |
|
892 | - the_widget( 'geodirsubscribeWidget' ); |
|
893 | - $output = ob_get_contents(); |
|
894 | - ob_end_clean(); |
|
895 | - $this->assertContains('geodir-subscribe-form', $output); |
|
896 | - |
|
897 | - ob_start(); |
|
898 | - $this->the_widget_form( 'geodirsubscribeWidget' ); |
|
899 | - $output = ob_get_contents(); |
|
900 | - ob_end_clean(); |
|
901 | - $this->assertContains('Feedburner ID', $output); |
|
902 | - |
|
903 | - $new_instance = array( |
|
904 | - 'title' => 'Subscribe', |
|
905 | - 'id' => '', |
|
906 | - 'advt1' => '', |
|
907 | - 'text' => '', |
|
908 | - 'twitter' => '', |
|
909 | - 'facebook' => '', |
|
910 | - 'digg' => '', |
|
911 | - 'myspace' => '' |
|
912 | - ); |
|
913 | - $output = $this->the_widget_form_update( 'geodirsubscribeWidget', $new_instance ); |
|
914 | - $this->assertContains('Subscribe', $output['title']); |
|
915 | - |
|
916 | - } |
|
917 | - |
|
918 | - public function testAdvWidget() { |
|
919 | - |
|
920 | - ob_start(); |
|
921 | - $instance = array(); |
|
922 | - $instance['desc1'] = 'hello'; |
|
923 | - the_widget( 'geodiradvtwidget', $instance ); |
|
924 | - $output = ob_get_contents(); |
|
925 | - ob_end_clean(); |
|
926 | - $this->assertContains('hello', $output); |
|
927 | - |
|
928 | - ob_start(); |
|
929 | - $this->the_widget_form( 'geodiradvtwidget' ); |
|
930 | - $output = ob_get_contents(); |
|
931 | - ob_end_clean(); |
|
932 | - $this->assertContains('Your Advt code', $output); |
|
933 | - |
|
934 | - $new_instance = array( |
|
935 | - 'desc1' => 'Advertise' |
|
936 | - ); |
|
937 | - $output = $this->the_widget_form_update( 'geodiradvtwidget', $new_instance ); |
|
938 | - $this->assertContains('Advertise', $output['desc1']); |
|
939 | - |
|
940 | - } |
|
941 | - |
|
942 | - public function testFlickrWidget() { |
|
943 | - |
|
944 | - ob_start(); |
|
945 | - the_widget( 'GeodirFlickrWidget' ); |
|
946 | - $output = ob_get_contents(); |
|
947 | - ob_end_clean(); |
|
948 | - $this->assertContains('geodir-flickr', $output); |
|
949 | - |
|
950 | - ob_start(); |
|
951 | - $this->the_widget_form( 'GeodirFlickrWidget' ); |
|
952 | - $output = ob_get_contents(); |
|
953 | - ob_end_clean(); |
|
954 | - $this->assertContains('Flickr ID', $output); |
|
955 | - |
|
956 | - $new_instance = array( |
|
957 | - 'id' => '', |
|
958 | - 'number' => '34' |
|
959 | - ); |
|
960 | - $output = $this->the_widget_form_update( 'GeodirFlickrWidget', $new_instance ); |
|
961 | - $this->assertContains('34', $output['number']); |
|
962 | - |
|
963 | - } |
|
964 | - |
|
965 | - public function testTwitterWidget() { |
|
966 | - |
|
967 | - ob_start(); |
|
968 | - $instance = array(); |
|
969 | - $instance['gd_tw_desc1'] = 'hello'; |
|
970 | - the_widget( 'geodir_twitter', $instance ); |
|
971 | - $output = ob_get_contents(); |
|
972 | - ob_end_clean(); |
|
973 | - $this->assertContains('hello', $output); |
|
974 | - |
|
975 | - ob_start(); |
|
976 | - $this->the_widget_form( 'geodir_twitter' ); |
|
977 | - $output = ob_get_contents(); |
|
978 | - ob_end_clean(); |
|
979 | - $this->assertContains('Your twitter code', $output); |
|
980 | - |
|
981 | - $new_instance = array( |
|
982 | - 'gd_tw_desc1' => 'hello' |
|
983 | - ); |
|
984 | - $output = $this->the_widget_form_update( 'geodir_twitter', $new_instance ); |
|
985 | - $this->assertContains('hello', $output['gd_tw_desc1']); |
|
986 | - |
|
987 | - } |
|
988 | - |
|
989 | - public function testAdvSearchWidget() { |
|
990 | - |
|
991 | - ob_start(); |
|
992 | - the_widget( 'geodir_advance_search_widget' ); |
|
993 | - $output = ob_get_contents(); |
|
994 | - ob_end_clean(); |
|
995 | - $this->assertContains('geodir-loc-bar', $output); |
|
996 | - |
|
997 | - ob_start(); |
|
998 | - $this->the_widget_form( 'geodir_advance_search_widget' ); |
|
999 | - $output = ob_get_contents(); |
|
1000 | - ob_end_clean(); |
|
1001 | - $this->assertContains('This is a search widget', $output); |
|
696 | + $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_related_listing_widget.php'; |
|
697 | + include_once($template); |
|
698 | + |
|
699 | + ob_start(); |
|
700 | + the_widget( 'geodir_related_listing_postview' ); |
|
701 | + $output = ob_get_contents(); |
|
702 | + ob_end_clean(); |
|
703 | + $this->assertContains('Related Listing', $output); |
|
704 | + |
|
705 | + ob_start(); |
|
706 | + $this->the_widget_form( 'geodir_related_listing_postview' ); |
|
707 | + $output = ob_get_contents(); |
|
708 | + ob_end_clean(); |
|
709 | + $this->assertContains('Relate to', $output); |
|
710 | + |
|
711 | + $new_instance = array( |
|
712 | + 'title' => '', |
|
713 | + 'list_sort' => '', |
|
714 | + 'list_order' => '', |
|
715 | + 'post_number' => '5', |
|
716 | + 'relate_to' => '', |
|
717 | + 'layout' => 'gridview_onehalf', |
|
718 | + 'listing_width' => '', |
|
719 | + 'add_location_filter' => '1', |
|
720 | + 'character_count' => '20' |
|
721 | + ); |
|
722 | + $output = $this->the_widget_form_update( 'geodir_related_listing_postview', $new_instance ); |
|
723 | + $this->assertContains('gridview_onehalf', $output['layout']); |
|
724 | + endwhile; |
|
725 | + |
|
726 | + $this->assertTrue(is_int($post_id)); |
|
727 | + |
|
728 | + |
|
729 | + } |
|
730 | + |
|
731 | + public function testReviewsWidget() { |
|
732 | + |
|
733 | + $time = current_time('mysql'); |
|
734 | + |
|
735 | + $args = array( |
|
736 | + 'listing_type' => 'gd_place', |
|
737 | + 'post_title' => 'Test Listing Title', |
|
738 | + 'post_desc' => 'Test Desc', |
|
739 | + 'post_tags' => 'test1,test2', |
|
740 | + 'post_address' => 'New York City Hall', |
|
741 | + 'post_zip' => '10007', |
|
742 | + 'post_latitude' => '40.7127837', |
|
743 | + 'post_longitude' => '-74.00594130000002', |
|
744 | + 'post_mapview' => 'ROADMAP', |
|
745 | + 'post_mapzoom' => '10', |
|
746 | + 'geodir_timing' => '10.00 am to 6 pm every day', |
|
747 | + 'geodir_contact' => '1234567890', |
|
748 | + 'geodir_email' => '[email protected]', |
|
749 | + 'geodir_website' => 'http://test.com', |
|
750 | + 'geodir_twitter' => 'http://twitter.com/test', |
|
751 | + 'geodir_facebook' => 'http://facebook.com/test', |
|
752 | + 'geodir_special_offers' => 'Test offer' |
|
753 | + ); |
|
754 | + $post_id = geodir_save_listing($args, true); |
|
755 | + |
|
756 | + $data = array( |
|
757 | + 'comment_post_ID' => $post_id, |
|
758 | + 'comment_author' => 'admin', |
|
759 | + 'comment_author_email' => '[email protected]', |
|
760 | + 'comment_author_url' => 'http://wpgeodirectory.com', |
|
761 | + 'comment_content' => 'content here', |
|
762 | + 'comment_type' => '', |
|
763 | + 'comment_parent' => 0, |
|
764 | + 'user_id' => 1, |
|
765 | + 'comment_author_IP' => '127.0.0.1', |
|
766 | + 'comment_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)', |
|
767 | + 'comment_date' => $time, |
|
768 | + 'comment_approved' => 1, |
|
769 | + ); |
|
770 | + |
|
771 | + $comment_id = wp_insert_comment($data); |
|
772 | + |
|
773 | + $_REQUEST['geodir_overallrating'] = 5.0; |
|
774 | + geodir_save_rating($comment_id); |
|
775 | + |
|
776 | + $this->assertTrue(is_int($comment_id)); |
|
777 | + |
|
778 | + $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_reviews_widget.php'; |
|
779 | + include_once($template); |
|
780 | + |
|
781 | + ob_start(); |
|
782 | + the_widget( 'geodir_recent_reviews_widget' ); |
|
783 | + $output = ob_get_contents(); |
|
784 | + ob_end_clean(); |
|
785 | + $this->assertContains('geodir_recent_reviews', $output); |
|
786 | + |
|
787 | + ob_start(); |
|
788 | + $this->the_widget_form( 'geodir_recent_reviews_widget' ); |
|
789 | + $output = ob_get_contents(); |
|
790 | + ob_end_clean(); |
|
791 | + $this->assertContains('Number of Reviews', $output); |
|
792 | + |
|
793 | + $new_instance = array( |
|
794 | + 'title' => '', |
|
795 | + 't1' => '', |
|
796 | + 't2' => '', |
|
797 | + 't3' => '', |
|
798 | + 'img1' => '', |
|
799 | + 'count' => '' |
|
800 | + ); |
|
801 | + $output = $this->the_widget_form_update( 'geodir_recent_reviews_widget', $new_instance ); |
|
802 | + $this->assertTrue(empty($output['count'])); |
|
803 | + } |
|
804 | + |
|
805 | + public function testHomeMapWidget() { |
|
806 | + $template = geodir_plugin_path() . '/geodirectory-widgets/home_map_widget.php'; |
|
807 | + include_once($template); |
|
808 | + |
|
809 | + ob_start(); |
|
810 | + $instance = array(); |
|
811 | + $args = array(); |
|
812 | + $args["widget_id"] = "geodir_map_v3_home_map-2"; |
|
813 | + the_widget( 'geodir_homepage_map', $instance, $args ); |
|
814 | + $output = ob_get_contents(); |
|
815 | + ob_end_clean(); |
|
816 | + $this->assertContains('geodir-map-home-page', $output); |
|
817 | + |
|
818 | + ob_start(); |
|
819 | + $this->the_widget_form( 'geodir_homepage_map' ); |
|
820 | + $output = ob_get_contents(); |
|
821 | + ob_end_clean(); |
|
822 | + $this->assertContains('Map Zoom level', $output); |
|
823 | + |
|
824 | + $new_instance = array( |
|
825 | + 'width' => '', |
|
826 | + 'heigh' => '', |
|
827 | + 'maptype' => '', |
|
828 | + 'zoom' => '', |
|
829 | + 'autozoom' => '', |
|
830 | + 'child_collapse' => '0', |
|
831 | + 'scrollwheel' => '0' |
|
832 | + ); |
|
833 | + $output = $this->the_widget_form_update( 'geodir_homepage_map', $new_instance ); |
|
834 | + $this->assertContains('0', $output['scrollwheel']); |
|
835 | + |
|
836 | + } |
|
837 | + |
|
838 | + public function testLoginWidget() { |
|
839 | + |
|
840 | + register_geodir_widgets(); |
|
841 | + |
|
842 | + ob_start(); |
|
843 | + the_widget( 'geodir_loginwidget' ); |
|
844 | + $output = ob_get_contents(); |
|
845 | + ob_end_clean(); |
|
846 | + $this->assertContains('geodir_loginbox', $output); |
|
847 | + |
|
848 | + ob_start(); |
|
849 | + $this->the_widget_form( 'geodir_loginwidget' ); |
|
850 | + $output = ob_get_contents(); |
|
851 | + ob_end_clean(); |
|
852 | + $this->assertContains('Widget Title', $output); |
|
853 | + |
|
854 | + $new_instance = array( |
|
855 | + 'title' => 'Login', |
|
856 | + 't1' => '', |
|
857 | + 't2' => '', |
|
858 | + 't3' => '', |
|
859 | + 'img1' => '', |
|
860 | + 'desc1' => '' |
|
861 | + ); |
|
862 | + $output = $this->the_widget_form_update( 'geodir_loginwidget', $new_instance ); |
|
863 | + $this->assertContains('Login', $output['title']); |
|
864 | + |
|
865 | + } |
|
866 | + |
|
867 | + public function testSocialWidget() { |
|
868 | + |
|
869 | + ob_start(); |
|
870 | + the_widget( 'geodir_social_like_widget' ); |
|
871 | + $output = ob_get_contents(); |
|
872 | + ob_end_clean(); |
|
873 | + $this->assertContains('twitter.com', $output); |
|
874 | + |
|
875 | + ob_start(); |
|
876 | + $this->the_widget_form( 'geodir_social_like_widget' ); |
|
877 | + $output = ob_get_contents(); |
|
878 | + ob_end_clean(); |
|
879 | + $this->assertContains('No settings for this widget', $output); |
|
880 | + |
|
881 | + $new_instance = array( |
|
882 | + 'title' => 'Social', |
|
883 | + ); |
|
884 | + $output = $this->the_widget_form_update( 'geodir_social_like_widget', $new_instance ); |
|
885 | + $this->assertContains('Social', $output['title']); |
|
886 | + |
|
887 | + } |
|
888 | + |
|
889 | + public function testSubscribeWidget() { |
|
890 | + |
|
891 | + ob_start(); |
|
892 | + the_widget( 'geodirsubscribeWidget' ); |
|
893 | + $output = ob_get_contents(); |
|
894 | + ob_end_clean(); |
|
895 | + $this->assertContains('geodir-subscribe-form', $output); |
|
896 | + |
|
897 | + ob_start(); |
|
898 | + $this->the_widget_form( 'geodirsubscribeWidget' ); |
|
899 | + $output = ob_get_contents(); |
|
900 | + ob_end_clean(); |
|
901 | + $this->assertContains('Feedburner ID', $output); |
|
902 | + |
|
903 | + $new_instance = array( |
|
904 | + 'title' => 'Subscribe', |
|
905 | + 'id' => '', |
|
906 | + 'advt1' => '', |
|
907 | + 'text' => '', |
|
908 | + 'twitter' => '', |
|
909 | + 'facebook' => '', |
|
910 | + 'digg' => '', |
|
911 | + 'myspace' => '' |
|
912 | + ); |
|
913 | + $output = $this->the_widget_form_update( 'geodirsubscribeWidget', $new_instance ); |
|
914 | + $this->assertContains('Subscribe', $output['title']); |
|
915 | + |
|
916 | + } |
|
917 | + |
|
918 | + public function testAdvWidget() { |
|
919 | + |
|
920 | + ob_start(); |
|
921 | + $instance = array(); |
|
922 | + $instance['desc1'] = 'hello'; |
|
923 | + the_widget( 'geodiradvtwidget', $instance ); |
|
924 | + $output = ob_get_contents(); |
|
925 | + ob_end_clean(); |
|
926 | + $this->assertContains('hello', $output); |
|
927 | + |
|
928 | + ob_start(); |
|
929 | + $this->the_widget_form( 'geodiradvtwidget' ); |
|
930 | + $output = ob_get_contents(); |
|
931 | + ob_end_clean(); |
|
932 | + $this->assertContains('Your Advt code', $output); |
|
933 | + |
|
934 | + $new_instance = array( |
|
935 | + 'desc1' => 'Advertise' |
|
936 | + ); |
|
937 | + $output = $this->the_widget_form_update( 'geodiradvtwidget', $new_instance ); |
|
938 | + $this->assertContains('Advertise', $output['desc1']); |
|
939 | + |
|
940 | + } |
|
941 | + |
|
942 | + public function testFlickrWidget() { |
|
943 | + |
|
944 | + ob_start(); |
|
945 | + the_widget( 'GeodirFlickrWidget' ); |
|
946 | + $output = ob_get_contents(); |
|
947 | + ob_end_clean(); |
|
948 | + $this->assertContains('geodir-flickr', $output); |
|
949 | + |
|
950 | + ob_start(); |
|
951 | + $this->the_widget_form( 'GeodirFlickrWidget' ); |
|
952 | + $output = ob_get_contents(); |
|
953 | + ob_end_clean(); |
|
954 | + $this->assertContains('Flickr ID', $output); |
|
955 | + |
|
956 | + $new_instance = array( |
|
957 | + 'id' => '', |
|
958 | + 'number' => '34' |
|
959 | + ); |
|
960 | + $output = $this->the_widget_form_update( 'GeodirFlickrWidget', $new_instance ); |
|
961 | + $this->assertContains('34', $output['number']); |
|
962 | + |
|
963 | + } |
|
964 | + |
|
965 | + public function testTwitterWidget() { |
|
966 | + |
|
967 | + ob_start(); |
|
968 | + $instance = array(); |
|
969 | + $instance['gd_tw_desc1'] = 'hello'; |
|
970 | + the_widget( 'geodir_twitter', $instance ); |
|
971 | + $output = ob_get_contents(); |
|
972 | + ob_end_clean(); |
|
973 | + $this->assertContains('hello', $output); |
|
974 | + |
|
975 | + ob_start(); |
|
976 | + $this->the_widget_form( 'geodir_twitter' ); |
|
977 | + $output = ob_get_contents(); |
|
978 | + ob_end_clean(); |
|
979 | + $this->assertContains('Your twitter code', $output); |
|
980 | + |
|
981 | + $new_instance = array( |
|
982 | + 'gd_tw_desc1' => 'hello' |
|
983 | + ); |
|
984 | + $output = $this->the_widget_form_update( 'geodir_twitter', $new_instance ); |
|
985 | + $this->assertContains('hello', $output['gd_tw_desc1']); |
|
986 | + |
|
987 | + } |
|
988 | + |
|
989 | + public function testAdvSearchWidget() { |
|
990 | + |
|
991 | + ob_start(); |
|
992 | + the_widget( 'geodir_advance_search_widget' ); |
|
993 | + $output = ob_get_contents(); |
|
994 | + ob_end_clean(); |
|
995 | + $this->assertContains('geodir-loc-bar', $output); |
|
996 | + |
|
997 | + ob_start(); |
|
998 | + $this->the_widget_form( 'geodir_advance_search_widget' ); |
|
999 | + $output = ob_get_contents(); |
|
1000 | + ob_end_clean(); |
|
1001 | + $this->assertContains('This is a search widget', $output); |
|
1002 | 1002 | |
1003 | 1003 | // $new_instance = array( |
1004 | 1004 | // ); |
1005 | 1005 | // $output = $this->the_widget_form_update( 'geodir_advance_search_widget', $new_instance ); |
1006 | 1006 | // $this->assertContains('Subscribe', $output['title']); |
1007 | 1007 | |
1008 | - } |
|
1009 | - |
|
1010 | - public function testListingMapWidget() { |
|
1011 | - |
|
1012 | - $template = geodir_plugin_path() . '/geodirectory-widgets/listing_map_widget.php'; |
|
1013 | - include_once($template); |
|
1014 | - |
|
1015 | - //listing page |
|
1016 | - $this->go_to( home_url('/?post_type=gd_place') ); |
|
1017 | - |
|
1018 | - ob_start(); |
|
1019 | - $instance = array(); |
|
1020 | - $args = array(); |
|
1021 | - $args["widget_id"] = "geodir_map_v3_listing_map-2"; |
|
1022 | - the_widget( 'geodir_map_listingpage', $instance, $args ); |
|
1023 | - $output = ob_get_contents(); |
|
1024 | - ob_end_clean(); |
|
1025 | - $this->assertContains('geodir-map-listing-page', $output); |
|
1026 | - |
|
1027 | - // detail page |
|
1028 | - $query_args = array( |
|
1029 | - 'post_status' => 'publish', |
|
1030 | - 'post_type' => 'gd_place', |
|
1031 | - 'posts_per_page' => 1, |
|
1032 | - ); |
|
1033 | - |
|
1034 | - $all_posts = new WP_Query( $query_args ); |
|
1035 | - $post_id = null; |
|
1036 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
1037 | - $post_id = get_the_ID(); |
|
1038 | - endwhile; |
|
1039 | - |
|
1040 | - $this->assertTrue(is_int($post_id)); |
|
1041 | - |
|
1042 | - $this->go_to( get_permalink($post_id) ); |
|
1043 | - |
|
1044 | - ob_start(); |
|
1045 | - $instance = array(); |
|
1046 | - $args = array(); |
|
1047 | - $args["widget_id"] = "geodir_map_v3_listing_map-2"; |
|
1048 | - the_widget( 'geodir_map_listingpage', $instance, $args ); |
|
1049 | - $output = ob_get_contents(); |
|
1050 | - ob_end_clean(); |
|
1051 | - $this->assertContains('geodir-map-listing-page', $output); |
|
1052 | - |
|
1053 | - ob_start(); |
|
1054 | - $this->the_widget_form( 'geodir_map_listingpage' ); |
|
1055 | - $output = ob_get_contents(); |
|
1056 | - ob_end_clean(); |
|
1057 | - $this->assertContains('Select Map View', $output); |
|
1058 | - |
|
1059 | - $new_instance = array( |
|
1060 | - 'width' => '', |
|
1061 | - 'heigh' => '', |
|
1062 | - 'maptype' => '', |
|
1063 | - 'zoom' => '', |
|
1064 | - 'autozoom' => '', |
|
1065 | - 'sticky' => '', |
|
1066 | - 'scrollwheel' => '0', |
|
1067 | - 'showall' => '0' |
|
1068 | - ); |
|
1069 | - $output = $this->the_widget_form_update( 'geodir_map_listingpage', $new_instance ); |
|
1070 | - $this->assertContains('0', $output['scrollwheel']); |
|
1071 | - |
|
1072 | - |
|
1073 | - } |
|
1074 | - |
|
1075 | - private function load_template() { |
|
1076 | - do_action( 'template_redirect' ); |
|
1077 | - $template = false; |
|
1078 | - if ( is_404() && $template = get_404_template() ) : |
|
1079 | - elseif ( is_search() && $template = get_search_template() ) : |
|
1080 | - elseif ( is_front_page() && $template = get_front_page_template() ) : |
|
1081 | - elseif ( is_home() && $template = get_home_template() ) : |
|
1082 | - elseif ( is_post_type_archive() && $template = get_post_type_archive_template() ) : |
|
1083 | - elseif ( is_tax() && $template = get_taxonomy_template() ) : |
|
1084 | - elseif ( is_attachment() && $template = get_attachment_template() ) : |
|
1085 | - remove_filter('the_content', 'prepend_attachment'); |
|
1086 | - elseif ( is_single() && $template = get_single_template() ) : |
|
1087 | - elseif ( is_page() && $template = get_page_template() ) : |
|
1088 | - elseif ( is_category() && $template = get_category_template() ) : |
|
1089 | - elseif ( is_tag() && $template = get_tag_template() ) : |
|
1090 | - elseif ( is_author() && $template = get_author_template() ) : |
|
1091 | - elseif ( is_date() && $template = get_date_template() ) : |
|
1092 | - elseif ( is_archive() && $template = get_archive_template() ) : |
|
1093 | - elseif ( is_paged() && $template = get_paged_template() ) : |
|
1094 | - else : |
|
1095 | - $template = get_index_template(); |
|
1096 | - endif; |
|
1097 | - /** |
|
1098 | - * Filter the path of the current template before including it. |
|
1099 | - * |
|
1100 | - * @since 3.0.0 |
|
1101 | - * |
|
1102 | - * @param string $template The path of the template to include. |
|
1103 | - */ |
|
1104 | - if ( $template = apply_filters( 'template_include', $template ) ) { |
|
1105 | - $template_contents = file_get_contents( $template ); |
|
1106 | - $included_header = $included_footer = false; |
|
1107 | - if ( false !== stripos( $template_contents, 'get_header();' ) ) { |
|
1108 | - do_action( 'get_header', null ); |
|
1109 | - locate_template( 'header.php', true, false ); |
|
1110 | - $included_header = true; |
|
1111 | - } |
|
1112 | - include( $template ); |
|
1113 | - if ( false !== stripos( $template_contents, 'get_footer();' ) ) { |
|
1114 | - do_action( 'get_footer', null ); |
|
1115 | - locate_template( 'footer.php', true, false ); |
|
1116 | - $included_footer = true; |
|
1117 | - } |
|
1118 | - if ( $included_header && $included_footer ) { |
|
1119 | - global $wp_scripts; |
|
1120 | - $wp_scripts->done = array(); |
|
1121 | - } |
|
1122 | - } |
|
1123 | - return; |
|
1124 | - } |
|
1125 | - |
|
1126 | - public static function setPermalinkStructure( $struc = '/%postname%/' ) { |
|
1127 | - global $wp_rewrite; |
|
1128 | - $wp_rewrite->set_permalink_structure( $struc ); |
|
1129 | - $wp_rewrite->flush_rules(); |
|
1130 | - update_option( 'permalink_structure', $struc ); |
|
1131 | - flush_rewrite_rules( true ); |
|
1132 | - } |
|
1133 | - |
|
1134 | - function the_widget_form( $widget, $instance = array() ) { |
|
1135 | - global $wp_widget_factory; |
|
1136 | - |
|
1137 | - $widget_obj = $wp_widget_factory->widgets[$widget]; |
|
1138 | - if ( ! ( $widget_obj instanceof WP_Widget ) ) { |
|
1139 | - return; |
|
1140 | - } |
|
1141 | - |
|
1142 | - $widget_obj->_set(-1); |
|
1143 | - $widget_obj->form($instance); |
|
1144 | - } |
|
1145 | - |
|
1146 | - function the_widget_form_update( $widget, $new_instance = array(), $old_instance = array() ) { |
|
1147 | - global $wp_widget_factory; |
|
1148 | - |
|
1149 | - $widget_obj = $wp_widget_factory->widgets[$widget]; |
|
1150 | - if ( ! ( $widget_obj instanceof WP_Widget ) ) { |
|
1151 | - return; |
|
1152 | - } |
|
1153 | - |
|
1154 | - $widget_obj->_set(-1); |
|
1155 | - return $widget_obj->update($new_instance, $old_instance); |
|
1156 | - } |
|
1157 | - |
|
1158 | - |
|
1159 | - public function tearDown() |
|
1160 | - { |
|
1161 | - parent::tearDown(); |
|
1162 | - } |
|
1008 | + } |
|
1009 | + |
|
1010 | + public function testListingMapWidget() { |
|
1011 | + |
|
1012 | + $template = geodir_plugin_path() . '/geodirectory-widgets/listing_map_widget.php'; |
|
1013 | + include_once($template); |
|
1014 | + |
|
1015 | + //listing page |
|
1016 | + $this->go_to( home_url('/?post_type=gd_place') ); |
|
1017 | + |
|
1018 | + ob_start(); |
|
1019 | + $instance = array(); |
|
1020 | + $args = array(); |
|
1021 | + $args["widget_id"] = "geodir_map_v3_listing_map-2"; |
|
1022 | + the_widget( 'geodir_map_listingpage', $instance, $args ); |
|
1023 | + $output = ob_get_contents(); |
|
1024 | + ob_end_clean(); |
|
1025 | + $this->assertContains('geodir-map-listing-page', $output); |
|
1026 | + |
|
1027 | + // detail page |
|
1028 | + $query_args = array( |
|
1029 | + 'post_status' => 'publish', |
|
1030 | + 'post_type' => 'gd_place', |
|
1031 | + 'posts_per_page' => 1, |
|
1032 | + ); |
|
1033 | + |
|
1034 | + $all_posts = new WP_Query( $query_args ); |
|
1035 | + $post_id = null; |
|
1036 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
1037 | + $post_id = get_the_ID(); |
|
1038 | + endwhile; |
|
1039 | + |
|
1040 | + $this->assertTrue(is_int($post_id)); |
|
1041 | + |
|
1042 | + $this->go_to( get_permalink($post_id) ); |
|
1043 | + |
|
1044 | + ob_start(); |
|
1045 | + $instance = array(); |
|
1046 | + $args = array(); |
|
1047 | + $args["widget_id"] = "geodir_map_v3_listing_map-2"; |
|
1048 | + the_widget( 'geodir_map_listingpage', $instance, $args ); |
|
1049 | + $output = ob_get_contents(); |
|
1050 | + ob_end_clean(); |
|
1051 | + $this->assertContains('geodir-map-listing-page', $output); |
|
1052 | + |
|
1053 | + ob_start(); |
|
1054 | + $this->the_widget_form( 'geodir_map_listingpage' ); |
|
1055 | + $output = ob_get_contents(); |
|
1056 | + ob_end_clean(); |
|
1057 | + $this->assertContains('Select Map View', $output); |
|
1058 | + |
|
1059 | + $new_instance = array( |
|
1060 | + 'width' => '', |
|
1061 | + 'heigh' => '', |
|
1062 | + 'maptype' => '', |
|
1063 | + 'zoom' => '', |
|
1064 | + 'autozoom' => '', |
|
1065 | + 'sticky' => '', |
|
1066 | + 'scrollwheel' => '0', |
|
1067 | + 'showall' => '0' |
|
1068 | + ); |
|
1069 | + $output = $this->the_widget_form_update( 'geodir_map_listingpage', $new_instance ); |
|
1070 | + $this->assertContains('0', $output['scrollwheel']); |
|
1071 | + |
|
1072 | + |
|
1073 | + } |
|
1074 | + |
|
1075 | + private function load_template() { |
|
1076 | + do_action( 'template_redirect' ); |
|
1077 | + $template = false; |
|
1078 | + if ( is_404() && $template = get_404_template() ) : |
|
1079 | + elseif ( is_search() && $template = get_search_template() ) : |
|
1080 | + elseif ( is_front_page() && $template = get_front_page_template() ) : |
|
1081 | + elseif ( is_home() && $template = get_home_template() ) : |
|
1082 | + elseif ( is_post_type_archive() && $template = get_post_type_archive_template() ) : |
|
1083 | + elseif ( is_tax() && $template = get_taxonomy_template() ) : |
|
1084 | + elseif ( is_attachment() && $template = get_attachment_template() ) : |
|
1085 | + remove_filter('the_content', 'prepend_attachment'); |
|
1086 | + elseif ( is_single() && $template = get_single_template() ) : |
|
1087 | + elseif ( is_page() && $template = get_page_template() ) : |
|
1088 | + elseif ( is_category() && $template = get_category_template() ) : |
|
1089 | + elseif ( is_tag() && $template = get_tag_template() ) : |
|
1090 | + elseif ( is_author() && $template = get_author_template() ) : |
|
1091 | + elseif ( is_date() && $template = get_date_template() ) : |
|
1092 | + elseif ( is_archive() && $template = get_archive_template() ) : |
|
1093 | + elseif ( is_paged() && $template = get_paged_template() ) : |
|
1094 | + else : |
|
1095 | + $template = get_index_template(); |
|
1096 | + endif; |
|
1097 | + /** |
|
1098 | + * Filter the path of the current template before including it. |
|
1099 | + * |
|
1100 | + * @since 3.0.0 |
|
1101 | + * |
|
1102 | + * @param string $template The path of the template to include. |
|
1103 | + */ |
|
1104 | + if ( $template = apply_filters( 'template_include', $template ) ) { |
|
1105 | + $template_contents = file_get_contents( $template ); |
|
1106 | + $included_header = $included_footer = false; |
|
1107 | + if ( false !== stripos( $template_contents, 'get_header();' ) ) { |
|
1108 | + do_action( 'get_header', null ); |
|
1109 | + locate_template( 'header.php', true, false ); |
|
1110 | + $included_header = true; |
|
1111 | + } |
|
1112 | + include( $template ); |
|
1113 | + if ( false !== stripos( $template_contents, 'get_footer();' ) ) { |
|
1114 | + do_action( 'get_footer', null ); |
|
1115 | + locate_template( 'footer.php', true, false ); |
|
1116 | + $included_footer = true; |
|
1117 | + } |
|
1118 | + if ( $included_header && $included_footer ) { |
|
1119 | + global $wp_scripts; |
|
1120 | + $wp_scripts->done = array(); |
|
1121 | + } |
|
1122 | + } |
|
1123 | + return; |
|
1124 | + } |
|
1125 | + |
|
1126 | + public static function setPermalinkStructure( $struc = '/%postname%/' ) { |
|
1127 | + global $wp_rewrite; |
|
1128 | + $wp_rewrite->set_permalink_structure( $struc ); |
|
1129 | + $wp_rewrite->flush_rules(); |
|
1130 | + update_option( 'permalink_structure', $struc ); |
|
1131 | + flush_rewrite_rules( true ); |
|
1132 | + } |
|
1133 | + |
|
1134 | + function the_widget_form( $widget, $instance = array() ) { |
|
1135 | + global $wp_widget_factory; |
|
1136 | + |
|
1137 | + $widget_obj = $wp_widget_factory->widgets[$widget]; |
|
1138 | + if ( ! ( $widget_obj instanceof WP_Widget ) ) { |
|
1139 | + return; |
|
1140 | + } |
|
1141 | + |
|
1142 | + $widget_obj->_set(-1); |
|
1143 | + $widget_obj->form($instance); |
|
1144 | + } |
|
1145 | + |
|
1146 | + function the_widget_form_update( $widget, $new_instance = array(), $old_instance = array() ) { |
|
1147 | + global $wp_widget_factory; |
|
1148 | + |
|
1149 | + $widget_obj = $wp_widget_factory->widgets[$widget]; |
|
1150 | + if ( ! ( $widget_obj instanceof WP_Widget ) ) { |
|
1151 | + return; |
|
1152 | + } |
|
1153 | + |
|
1154 | + $widget_obj->_set(-1); |
|
1155 | + return $widget_obj->update($new_instance, $old_instance); |
|
1156 | + } |
|
1157 | + |
|
1158 | + |
|
1159 | + public function tearDown() |
|
1160 | + { |
|
1161 | + parent::tearDown(); |
|
1162 | + } |
|
1163 | 1163 | } |
1164 | 1164 | ?> |
1165 | 1165 | \ No newline at end of file |
@@ -13,14 +13,14 @@ |
||
13 | 13 | * @since 1.0.0 |
14 | 14 | */ |
15 | 15 | include_once(geodir_plugin_path() . '/geodirectory-admin/option-pages/create_field.php'); |
16 | - gd_die(); |
|
16 | + gd_die(); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | |
20 | 20 | if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] != '') { |
21 | - switch ($_REQUEST['ajax_action']): |
|
22 | - case 'get_cat_dl': |
|
23 | - geodir_get_categories_dl($_REQUEST['post_type'], $_REQUEST['selected'], false, true); |
|
24 | - break; |
|
25 | - endswitch; |
|
21 | + switch ($_REQUEST['ajax_action']): |
|
22 | + case 'get_cat_dl': |
|
23 | + geodir_get_categories_dl($_REQUEST['post_type'], $_REQUEST['selected'], false, true); |
|
24 | + break; |
|
25 | + endswitch; |
|
26 | 26 | } |
27 | 27 | \ No newline at end of file |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * |
13 | 13 | * @since 1.0.0 |
14 | 14 | */ |
15 | - include_once(geodir_plugin_path() . '/geodirectory-admin/option-pages/create_field.php'); |
|
15 | + include_once(geodir_plugin_path().'/geodirectory-admin/option-pages/create_field.php'); |
|
16 | 16 | gd_die(); |
17 | 17 | } |
18 | 18 |
@@ -1,309 +1,309 @@ |
||
1 | 1 | <?php |
2 | 2 | class AddCustomFields extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(1); |
|
8 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(1); |
|
8 | + } |
|
9 | 9 | |
10 | - public function testAddCustomFields() |
|
11 | - { |
|
12 | - $field = array( |
|
13 | - 'listing_type' => 'gd_place', |
|
14 | - 'data_type' => '', |
|
15 | - 'field_type' => 'select', |
|
16 | - 'admin_title' => __( 'Place Type', 'test' ), |
|
17 | - 'admin_desc' => __( 'Select the place type.', 'test' ), |
|
18 | - 'site_title' => __( 'Place Type', 'test' ), |
|
19 | - 'htmlvar_name' => 'test_place_type', |
|
20 | - 'default_value' => '', |
|
21 | - 'option_values' => 'Hotel,Bar,Restaurant,Pub', |
|
22 | - 'is_default' => '1', |
|
23 | - 'is_admin' => '1', |
|
24 | - 'clabels' => __( 'Place Type', 'test' ) |
|
25 | - ); |
|
10 | + public function testAddCustomFields() |
|
11 | + { |
|
12 | + $field = array( |
|
13 | + 'listing_type' => 'gd_place', |
|
14 | + 'data_type' => '', |
|
15 | + 'field_type' => 'select', |
|
16 | + 'admin_title' => __( 'Place Type', 'test' ), |
|
17 | + 'admin_desc' => __( 'Select the place type.', 'test' ), |
|
18 | + 'site_title' => __( 'Place Type', 'test' ), |
|
19 | + 'htmlvar_name' => 'test_place_type', |
|
20 | + 'default_value' => '', |
|
21 | + 'option_values' => 'Hotel,Bar,Restaurant,Pub', |
|
22 | + 'is_default' => '1', |
|
23 | + 'is_admin' => '1', |
|
24 | + 'clabels' => __( 'Place Type', 'test' ) |
|
25 | + ); |
|
26 | 26 | |
27 | - $lastid = geodir_custom_field_save( $field ); |
|
27 | + $lastid = geodir_custom_field_save( $field ); |
|
28 | 28 | |
29 | - $this->assertTrue(is_int($lastid)); |
|
29 | + $this->assertTrue(is_int($lastid)); |
|
30 | 30 | |
31 | 31 | |
32 | - $field2 = array( |
|
33 | - 'listing_type' => 'gd_place', |
|
34 | - 'data_type' => 'VARCHAR', |
|
35 | - 'field_type' => 'url', |
|
36 | - 'admin_title' => __( 'Website Link', 'test' ), |
|
37 | - 'admin_desc' => __( 'Enter the website link.', 'test' ), |
|
38 | - 'site_title' => __( 'Website Link', 'test' ), |
|
39 | - 'htmlvar_name' => 'test_ws_link', |
|
40 | - 'default_value' => '', |
|
41 | - 'option_values' => '', |
|
42 | - 'is_default' => '1', |
|
43 | - 'is_admin' => '1', |
|
44 | - 'clabels' => __( 'Website Link', 'test' ) |
|
45 | - ); |
|
32 | + $field2 = array( |
|
33 | + 'listing_type' => 'gd_place', |
|
34 | + 'data_type' => 'VARCHAR', |
|
35 | + 'field_type' => 'url', |
|
36 | + 'admin_title' => __( 'Website Link', 'test' ), |
|
37 | + 'admin_desc' => __( 'Enter the website link.', 'test' ), |
|
38 | + 'site_title' => __( 'Website Link', 'test' ), |
|
39 | + 'htmlvar_name' => 'test_ws_link', |
|
40 | + 'default_value' => '', |
|
41 | + 'option_values' => '', |
|
42 | + 'is_default' => '1', |
|
43 | + 'is_admin' => '1', |
|
44 | + 'clabels' => __( 'Website Link', 'test' ) |
|
45 | + ); |
|
46 | 46 | |
47 | - $lastid2 = geodir_custom_field_save( $field2 ); |
|
47 | + $lastid2 = geodir_custom_field_save( $field2 ); |
|
48 | 48 | |
49 | - $this->assertTrue(is_int($lastid2)); |
|
49 | + $this->assertTrue(is_int($lastid2)); |
|
50 | 50 | |
51 | - //test error |
|
52 | - $field3 = array( |
|
53 | - 'listing_type' => 'gd_place', |
|
54 | - 'data_type' => '', |
|
55 | - 'field_type' => 'select', |
|
56 | - 'admin_title' => __( 'Place Type', 'test' ), |
|
57 | - 'admin_desc' => __( 'Select the place type.', 'test' ), |
|
58 | - 'site_title' => __( 'Place Type', 'test' ), |
|
59 | - 'htmlvar_name' => 'test_place_type', |
|
60 | - 'default_value' => '', |
|
61 | - 'option_values' => 'Hotel,Bar,Restaurant,Pub', |
|
62 | - 'is_default' => '1', |
|
63 | - 'is_admin' => '1', |
|
64 | - 'clabels' => __( 'Place Type', 'test' ) |
|
65 | - ); |
|
51 | + //test error |
|
52 | + $field3 = array( |
|
53 | + 'listing_type' => 'gd_place', |
|
54 | + 'data_type' => '', |
|
55 | + 'field_type' => 'select', |
|
56 | + 'admin_title' => __( 'Place Type', 'test' ), |
|
57 | + 'admin_desc' => __( 'Select the place type.', 'test' ), |
|
58 | + 'site_title' => __( 'Place Type', 'test' ), |
|
59 | + 'htmlvar_name' => 'test_place_type', |
|
60 | + 'default_value' => '', |
|
61 | + 'option_values' => 'Hotel,Bar,Restaurant,Pub', |
|
62 | + 'is_default' => '1', |
|
63 | + 'is_admin' => '1', |
|
64 | + 'clabels' => __( 'Place Type', 'test' ) |
|
65 | + ); |
|
66 | 66 | |
67 | - $error = geodir_custom_field_save( $field3 ); |
|
67 | + $error = geodir_custom_field_save( $field3 ); |
|
68 | 68 | |
69 | - $this->assertContains( 'HTML Variable Name should be a unique name', $error ); |
|
70 | - } |
|
69 | + $this->assertContains( 'HTML Variable Name should be a unique name', $error ); |
|
70 | + } |
|
71 | 71 | |
72 | - public function testAddMoreCustomFields() { |
|
73 | - $fieldsets = array(); |
|
74 | - $fields = array(); |
|
75 | - $filters = array(); |
|
72 | + public function testAddMoreCustomFields() { |
|
73 | + $fieldsets = array(); |
|
74 | + $fields = array(); |
|
75 | + $filters = array(); |
|
76 | 76 | |
77 | - // Place Details |
|
78 | - $fieldsets[] = array( |
|
79 | - 'listing_type' => 'gd_place', |
|
80 | - 'data_type' => '', |
|
81 | - 'field_type' => 'fieldset', |
|
82 | - 'admin_title' => __( 'Place Details', 'directory_starter' ), |
|
83 | - 'admin_desc' => __( 'Place Details.', 'directory_starter' ), |
|
84 | - 'site_title' => __( 'Place Details', 'directory_starter' ), |
|
85 | - 'default_value' => '', |
|
86 | - 'option_values' => '', |
|
87 | - 'is_default' => '1', |
|
88 | - 'is_admin' => '1', |
|
89 | - 'clabels' => __( 'Place Details', 'directory_starter' ) |
|
90 | - ); |
|
77 | + // Place Details |
|
78 | + $fieldsets[] = array( |
|
79 | + 'listing_type' => 'gd_place', |
|
80 | + 'data_type' => '', |
|
81 | + 'field_type' => 'fieldset', |
|
82 | + 'admin_title' => __( 'Place Details', 'directory_starter' ), |
|
83 | + 'admin_desc' => __( 'Place Details.', 'directory_starter' ), |
|
84 | + 'site_title' => __( 'Place Details', 'directory_starter' ), |
|
85 | + 'default_value' => '', |
|
86 | + 'option_values' => '', |
|
87 | + 'is_default' => '1', |
|
88 | + 'is_admin' => '1', |
|
89 | + 'clabels' => __( 'Place Details', 'directory_starter' ) |
|
90 | + ); |
|
91 | 91 | |
92 | - // Salary |
|
93 | - $fields[] = array( |
|
94 | - 'listing_type' => 'gd_place', |
|
95 | - 'data_type' => 'INT', |
|
96 | - 'field_type' => 'text', |
|
97 | - 'admin_title' => __('Salary', 'directory_starter'), |
|
98 | - 'admin_desc' => __('Enter salary.', 'directory_starter'), |
|
99 | - 'site_title' => __('Salary', 'directory_starter'), |
|
100 | - 'htmlvar_name' => 'job_salary', |
|
101 | - 'default_value' => '', |
|
102 | - 'option_values' => '', |
|
103 | - 'is_default' => '1', |
|
104 | - 'is_admin' => '1', |
|
105 | - 'clabels' => __('Salary', 'directory_starter') |
|
106 | - ); |
|
92 | + // Salary |
|
93 | + $fields[] = array( |
|
94 | + 'listing_type' => 'gd_place', |
|
95 | + 'data_type' => 'INT', |
|
96 | + 'field_type' => 'text', |
|
97 | + 'admin_title' => __('Salary', 'directory_starter'), |
|
98 | + 'admin_desc' => __('Enter salary.', 'directory_starter'), |
|
99 | + 'site_title' => __('Salary', 'directory_starter'), |
|
100 | + 'htmlvar_name' => 'job_salary', |
|
101 | + 'default_value' => '', |
|
102 | + 'option_values' => '', |
|
103 | + 'is_default' => '1', |
|
104 | + 'is_admin' => '1', |
|
105 | + 'clabels' => __('Salary', 'directory_starter') |
|
106 | + ); |
|
107 | 107 | |
108 | - // Salary Filter |
|
109 | - $filters[] = array( |
|
110 | - 'create_field' => 'true', |
|
111 | - 'listing_type' => 'gd_place', |
|
112 | - 'field_id' => '', |
|
113 | - 'field_type' => 'text', |
|
114 | - 'data_type' => 'RANGE', |
|
115 | - 'is_active' => '1', |
|
116 | - 'site_field_title' => 'Salary', |
|
117 | - 'field_data_type' => 'INT', |
|
118 | - 'data_type_change' => 'TEXT', |
|
119 | - 'search_condition_select' => 'FROM', |
|
120 | - 'search_min_value' => '', |
|
121 | - 'search_max_value' => '', |
|
122 | - 'search_diff_value' => '', |
|
123 | - 'first_search_value' => '', |
|
124 | - 'first_search_text' => '', |
|
125 | - 'last_search_text' => '', |
|
126 | - 'search_condition' => 'FROM', |
|
127 | - 'site_htmlvar_name' => 'geodir_job_salary', |
|
128 | - 'field_title' => 'geodir_job_salary', |
|
129 | - 'expand_custom_value' => '', |
|
130 | - 'front_search_title' => 'Salary', |
|
131 | - 'field_desc' => '' |
|
132 | - ); |
|
108 | + // Salary Filter |
|
109 | + $filters[] = array( |
|
110 | + 'create_field' => 'true', |
|
111 | + 'listing_type' => 'gd_place', |
|
112 | + 'field_id' => '', |
|
113 | + 'field_type' => 'text', |
|
114 | + 'data_type' => 'RANGE', |
|
115 | + 'is_active' => '1', |
|
116 | + 'site_field_title' => 'Salary', |
|
117 | + 'field_data_type' => 'INT', |
|
118 | + 'data_type_change' => 'TEXT', |
|
119 | + 'search_condition_select' => 'FROM', |
|
120 | + 'search_min_value' => '', |
|
121 | + 'search_max_value' => '', |
|
122 | + 'search_diff_value' => '', |
|
123 | + 'first_search_value' => '', |
|
124 | + 'first_search_text' => '', |
|
125 | + 'last_search_text' => '', |
|
126 | + 'search_condition' => 'FROM', |
|
127 | + 'site_htmlvar_name' => 'geodir_job_salary', |
|
128 | + 'field_title' => 'geodir_job_salary', |
|
129 | + 'expand_custom_value' => '', |
|
130 | + 'front_search_title' => 'Salary', |
|
131 | + 'field_desc' => '' |
|
132 | + ); |
|
133 | 133 | |
134 | - // Field Set |
|
135 | - if (!empty($fieldsets)) { |
|
136 | - foreach ($fieldsets as $fieldset_index => $fieldset) { |
|
137 | - geodir_custom_field_save($fieldset); |
|
138 | - } |
|
139 | - } |
|
134 | + // Field Set |
|
135 | + if (!empty($fieldsets)) { |
|
136 | + foreach ($fieldsets as $fieldset_index => $fieldset) { |
|
137 | + geodir_custom_field_save($fieldset); |
|
138 | + } |
|
139 | + } |
|
140 | 140 | |
141 | - // Custom Fields |
|
142 | - if (!empty($fields)) { |
|
143 | - foreach ($fields as $field_index => $field) { |
|
144 | - $lastid = geodir_custom_field_save( $field ); |
|
145 | - $this->assertTrue(is_int($lastid)); |
|
146 | - } |
|
147 | - } |
|
141 | + // Custom Fields |
|
142 | + if (!empty($fields)) { |
|
143 | + foreach ($fields as $field_index => $field) { |
|
144 | + $lastid = geodir_custom_field_save( $field ); |
|
145 | + $this->assertTrue(is_int($lastid)); |
|
146 | + } |
|
147 | + } |
|
148 | 148 | |
149 | - } |
|
149 | + } |
|
150 | 150 | |
151 | - public function testTextCusField() { |
|
152 | - $_REQUEST = array ( |
|
153 | - 'action' => 'geodir_ajax_action', |
|
154 | - 'create_field' => 'true', |
|
155 | - 'field_ins_upd' => 'submit', |
|
156 | - '_wpnonce' => wp_create_nonce('custom_fields_text_field_99'), |
|
157 | - 'listing_type' => 'gd_place', |
|
158 | - 'field_type' => 'text', |
|
159 | - 'field_id' => 'text_field_99', |
|
160 | - 'data_type' => 'XVARCHAR', |
|
161 | - 'is_active' => '1', |
|
162 | - 'site_title' => "Text Field", |
|
163 | - 'admin_title' => "Text Field", |
|
164 | - 'admin_desc' => "Text Field", |
|
165 | - 'site_field_title' => 'Category', |
|
166 | - 'field_data_type' => 'VARCHAR', |
|
167 | - 'search_condition' => 'SINGLE', |
|
168 | - 'htmlvar_name' => 'text_field_99', |
|
169 | - 'for_admin_use' => '0', |
|
170 | - 'is_required' => '0', |
|
171 | - 'required_msg'=> '', |
|
172 | - 'validation_pattern' => '', |
|
173 | - 'validation_msg' => '', |
|
174 | - 'decimal_point' => '', |
|
175 | - 'clabels' => 'Text Field', |
|
176 | - 'is_default' => '1', |
|
177 | - 'field_title' => 'Text Field', |
|
178 | - 'expand_custom_value' => '', |
|
179 | - 'search_operator' => 'AND', |
|
180 | - 'front_search_title' => 'Category', |
|
181 | - 'field_desc' => 'Cat', |
|
182 | - 'geodir_ajax' => 'admin_ajax', |
|
183 | - 'manage_field_type' => 'custom_fields', |
|
184 | - 'default_value' => '' , |
|
185 | - 'sort_order' => '11' , |
|
186 | - 'show_on_listing' => '1' , |
|
187 | - 'show_on_detail' => '1' , |
|
188 | - 'show_as_tab' => '0' , |
|
189 | - 'field_icon' => '' , |
|
190 | - 'css_class' => '' , |
|
191 | - ); |
|
192 | - add_filter('wp_redirect', '__return_false'); |
|
193 | - ob_start(); |
|
194 | - geodir_ajax_handler(); |
|
195 | - $output = ob_get_contents(); |
|
196 | - ob_end_clean(); |
|
197 | - $this->assertContains('Double Click to toggle', $output); |
|
198 | - remove_filter('wp_redirect', '__return_false'); |
|
151 | + public function testTextCusField() { |
|
152 | + $_REQUEST = array ( |
|
153 | + 'action' => 'geodir_ajax_action', |
|
154 | + 'create_field' => 'true', |
|
155 | + 'field_ins_upd' => 'submit', |
|
156 | + '_wpnonce' => wp_create_nonce('custom_fields_text_field_99'), |
|
157 | + 'listing_type' => 'gd_place', |
|
158 | + 'field_type' => 'text', |
|
159 | + 'field_id' => 'text_field_99', |
|
160 | + 'data_type' => 'XVARCHAR', |
|
161 | + 'is_active' => '1', |
|
162 | + 'site_title' => "Text Field", |
|
163 | + 'admin_title' => "Text Field", |
|
164 | + 'admin_desc' => "Text Field", |
|
165 | + 'site_field_title' => 'Category', |
|
166 | + 'field_data_type' => 'VARCHAR', |
|
167 | + 'search_condition' => 'SINGLE', |
|
168 | + 'htmlvar_name' => 'text_field_99', |
|
169 | + 'for_admin_use' => '0', |
|
170 | + 'is_required' => '0', |
|
171 | + 'required_msg'=> '', |
|
172 | + 'validation_pattern' => '', |
|
173 | + 'validation_msg' => '', |
|
174 | + 'decimal_point' => '', |
|
175 | + 'clabels' => 'Text Field', |
|
176 | + 'is_default' => '1', |
|
177 | + 'field_title' => 'Text Field', |
|
178 | + 'expand_custom_value' => '', |
|
179 | + 'search_operator' => 'AND', |
|
180 | + 'front_search_title' => 'Category', |
|
181 | + 'field_desc' => 'Cat', |
|
182 | + 'geodir_ajax' => 'admin_ajax', |
|
183 | + 'manage_field_type' => 'custom_fields', |
|
184 | + 'default_value' => '' , |
|
185 | + 'sort_order' => '11' , |
|
186 | + 'show_on_listing' => '1' , |
|
187 | + 'show_on_detail' => '1' , |
|
188 | + 'show_as_tab' => '0' , |
|
189 | + 'field_icon' => '' , |
|
190 | + 'css_class' => '' , |
|
191 | + ); |
|
192 | + add_filter('wp_redirect', '__return_false'); |
|
193 | + ob_start(); |
|
194 | + geodir_ajax_handler(); |
|
195 | + $output = ob_get_contents(); |
|
196 | + ob_end_clean(); |
|
197 | + $this->assertContains('Double Click to toggle', $output); |
|
198 | + remove_filter('wp_redirect', '__return_false'); |
|
199 | 199 | |
200 | - } |
|
200 | + } |
|
201 | 201 | |
202 | - public function texstDateCusField() { |
|
203 | - $_REQUEST = array ( |
|
204 | - 'action' => 'geodir_ajax_action', |
|
205 | - 'create_field' => 'true', |
|
206 | - 'field_ins_upd' => 'submit', |
|
207 | - '_wpnonce' => wp_create_nonce('custom_fields_date_field'), |
|
208 | - 'listing_type' => 'gd_place', |
|
209 | - 'field_type' => 'datepicker', |
|
210 | - 'field_id' => 'date_field', |
|
211 | - 'data_type' => '', |
|
212 | - 'is_active' => '1', |
|
213 | - 'site_title' => "Text Field", |
|
214 | - 'admin_title' => "Text Field", |
|
215 | - 'admin_desc' => "Text Field", |
|
216 | - 'site_field_title' => 'Category', |
|
217 | - 'field_data_type' => 'VARCHAR', |
|
218 | - 'search_condition' => 'SINGLE', |
|
219 | - 'htmlvar_name' => 'date_field', |
|
220 | - 'for_admin_use' => '0', |
|
221 | - 'is_required' => '0', |
|
222 | - 'required_msg'=> '', |
|
223 | - 'validation_pattern' => '', |
|
224 | - 'validation_msg' => '', |
|
225 | - 'decimal_point' => '', |
|
226 | - 'clabels' => 'Text Field', |
|
227 | - 'is_default' => '0', |
|
228 | - 'field_title' => 'Text Field', |
|
229 | - 'expand_custom_value' => '', |
|
230 | - 'search_operator' => 'AND', |
|
231 | - 'front_search_title' => 'Category', |
|
232 | - 'field_desc' => 'Cat', |
|
233 | - 'geodir_ajax' => 'admin_ajax', |
|
234 | - 'manage_field_type' => 'custom_fields', |
|
235 | - 'default_value' => '' , |
|
236 | - 'sort_order' => '12' , |
|
237 | - 'show_on_listing' => '1' , |
|
238 | - 'show_on_detail' => '1' , |
|
239 | - 'show_as_tab' => '0' , |
|
240 | - 'field_icon' => '' , |
|
241 | - 'css_class' => '' , |
|
242 | - 'extra' => array( |
|
243 | - 'date_format' => 'mm/dd/yy' |
|
244 | - ) |
|
245 | - ); |
|
246 | - add_filter('wp_redirect', '__return_false'); |
|
247 | - ob_start(); |
|
248 | - geodir_ajax_handler(); |
|
249 | - $output = ob_get_contents(); |
|
250 | - ob_end_clean(); |
|
251 | - $this->assertContains('Double Click to toggle', $output); |
|
252 | - remove_filter('wp_redirect', '__return_false'); |
|
202 | + public function texstDateCusField() { |
|
203 | + $_REQUEST = array ( |
|
204 | + 'action' => 'geodir_ajax_action', |
|
205 | + 'create_field' => 'true', |
|
206 | + 'field_ins_upd' => 'submit', |
|
207 | + '_wpnonce' => wp_create_nonce('custom_fields_date_field'), |
|
208 | + 'listing_type' => 'gd_place', |
|
209 | + 'field_type' => 'datepicker', |
|
210 | + 'field_id' => 'date_field', |
|
211 | + 'data_type' => '', |
|
212 | + 'is_active' => '1', |
|
213 | + 'site_title' => "Text Field", |
|
214 | + 'admin_title' => "Text Field", |
|
215 | + 'admin_desc' => "Text Field", |
|
216 | + 'site_field_title' => 'Category', |
|
217 | + 'field_data_type' => 'VARCHAR', |
|
218 | + 'search_condition' => 'SINGLE', |
|
219 | + 'htmlvar_name' => 'date_field', |
|
220 | + 'for_admin_use' => '0', |
|
221 | + 'is_required' => '0', |
|
222 | + 'required_msg'=> '', |
|
223 | + 'validation_pattern' => '', |
|
224 | + 'validation_msg' => '', |
|
225 | + 'decimal_point' => '', |
|
226 | + 'clabels' => 'Text Field', |
|
227 | + 'is_default' => '0', |
|
228 | + 'field_title' => 'Text Field', |
|
229 | + 'expand_custom_value' => '', |
|
230 | + 'search_operator' => 'AND', |
|
231 | + 'front_search_title' => 'Category', |
|
232 | + 'field_desc' => 'Cat', |
|
233 | + 'geodir_ajax' => 'admin_ajax', |
|
234 | + 'manage_field_type' => 'custom_fields', |
|
235 | + 'default_value' => '' , |
|
236 | + 'sort_order' => '12' , |
|
237 | + 'show_on_listing' => '1' , |
|
238 | + 'show_on_detail' => '1' , |
|
239 | + 'show_as_tab' => '0' , |
|
240 | + 'field_icon' => '' , |
|
241 | + 'css_class' => '' , |
|
242 | + 'extra' => array( |
|
243 | + 'date_format' => 'mm/dd/yy' |
|
244 | + ) |
|
245 | + ); |
|
246 | + add_filter('wp_redirect', '__return_false'); |
|
247 | + ob_start(); |
|
248 | + geodir_ajax_handler(); |
|
249 | + $output = ob_get_contents(); |
|
250 | + ob_end_clean(); |
|
251 | + $this->assertContains('Double Click to toggle', $output); |
|
252 | + remove_filter('wp_redirect', '__return_false'); |
|
253 | 253 | |
254 | - } |
|
254 | + } |
|
255 | 255 | |
256 | - public function texstTextAreaCusField() { |
|
257 | - $_REQUEST = array ( |
|
258 | - 'action' => 'geodir_ajax_action', |
|
259 | - 'create_field' => 'true', |
|
260 | - 'field_ins_upd' => 'submit', |
|
261 | - '_wpnonce' => wp_create_nonce('custom_fields_textarea_field'), |
|
262 | - 'listing_type' => 'gd_place', |
|
263 | - 'field_type' => 'textarea', |
|
264 | - 'field_id' => 'textarea_field', |
|
265 | - 'data_type' => '', |
|
266 | - 'is_active' => '1', |
|
267 | - 'site_title' => "Text Field", |
|
268 | - 'admin_title' => "Text Field", |
|
269 | - 'admin_desc' => "Text Field", |
|
270 | - 'htmlvar_name' => 'textarea_field', |
|
271 | - 'for_admin_use' => '0', |
|
272 | - 'is_required' => '0', |
|
273 | - 'required_msg'=> '', |
|
274 | - 'validation_pattern' => '', |
|
275 | - 'validation_msg' => '', |
|
276 | - 'decimal_point' => '', |
|
277 | - 'clabels' => 'Text Field', |
|
278 | - 'is_default' => '1', |
|
279 | - 'field_title' => 'Text Field', |
|
280 | - 'expand_custom_value' => '', |
|
281 | - 'search_operator' => 'AND', |
|
282 | - 'front_search_title' => 'Category', |
|
283 | - 'field_desc' => 'Cat', |
|
284 | - 'geodir_ajax' => 'admin_ajax', |
|
285 | - 'manage_field_type' => 'custom_fields', |
|
286 | - 'default_value' => '' , |
|
287 | - 'sort_order' => '12' , |
|
288 | - 'show_on_listing' => '1' , |
|
289 | - 'show_on_detail' => '1' , |
|
290 | - 'show_as_tab' => '0' , |
|
291 | - 'field_icon' => '' , |
|
292 | - 'css_class' => '' , |
|
293 | - ); |
|
294 | - add_filter('wp_redirect', '__return_false'); |
|
295 | - ob_start(); |
|
296 | - geodir_ajax_handler(); |
|
297 | - $output = ob_get_contents(); |
|
298 | - ob_end_clean(); |
|
299 | - $this->assertContains('Double Click to toggle', $output); |
|
300 | - remove_filter('wp_redirect', '__return_false'); |
|
256 | + public function texstTextAreaCusField() { |
|
257 | + $_REQUEST = array ( |
|
258 | + 'action' => 'geodir_ajax_action', |
|
259 | + 'create_field' => 'true', |
|
260 | + 'field_ins_upd' => 'submit', |
|
261 | + '_wpnonce' => wp_create_nonce('custom_fields_textarea_field'), |
|
262 | + 'listing_type' => 'gd_place', |
|
263 | + 'field_type' => 'textarea', |
|
264 | + 'field_id' => 'textarea_field', |
|
265 | + 'data_type' => '', |
|
266 | + 'is_active' => '1', |
|
267 | + 'site_title' => "Text Field", |
|
268 | + 'admin_title' => "Text Field", |
|
269 | + 'admin_desc' => "Text Field", |
|
270 | + 'htmlvar_name' => 'textarea_field', |
|
271 | + 'for_admin_use' => '0', |
|
272 | + 'is_required' => '0', |
|
273 | + 'required_msg'=> '', |
|
274 | + 'validation_pattern' => '', |
|
275 | + 'validation_msg' => '', |
|
276 | + 'decimal_point' => '', |
|
277 | + 'clabels' => 'Text Field', |
|
278 | + 'is_default' => '1', |
|
279 | + 'field_title' => 'Text Field', |
|
280 | + 'expand_custom_value' => '', |
|
281 | + 'search_operator' => 'AND', |
|
282 | + 'front_search_title' => 'Category', |
|
283 | + 'field_desc' => 'Cat', |
|
284 | + 'geodir_ajax' => 'admin_ajax', |
|
285 | + 'manage_field_type' => 'custom_fields', |
|
286 | + 'default_value' => '' , |
|
287 | + 'sort_order' => '12' , |
|
288 | + 'show_on_listing' => '1' , |
|
289 | + 'show_on_detail' => '1' , |
|
290 | + 'show_as_tab' => '0' , |
|
291 | + 'field_icon' => '' , |
|
292 | + 'css_class' => '' , |
|
293 | + ); |
|
294 | + add_filter('wp_redirect', '__return_false'); |
|
295 | + ob_start(); |
|
296 | + geodir_ajax_handler(); |
|
297 | + $output = ob_get_contents(); |
|
298 | + ob_end_clean(); |
|
299 | + $this->assertContains('Double Click to toggle', $output); |
|
300 | + remove_filter('wp_redirect', '__return_false'); |
|
301 | 301 | |
302 | - } |
|
302 | + } |
|
303 | 303 | |
304 | - public function tearDown() |
|
305 | - { |
|
306 | - parent::tearDown(); |
|
307 | - } |
|
304 | + public function tearDown() |
|
305 | + { |
|
306 | + parent::tearDown(); |
|
307 | + } |
|
308 | 308 | } |
309 | 309 | ?> |
310 | 310 | \ No newline at end of file |
@@ -13,18 +13,18 @@ discard block |
||
13 | 13 | 'listing_type' => 'gd_place', |
14 | 14 | 'data_type' => '', |
15 | 15 | 'field_type' => 'select', |
16 | - 'admin_title' => __( 'Place Type', 'test' ), |
|
17 | - 'admin_desc' => __( 'Select the place type.', 'test' ), |
|
18 | - 'site_title' => __( 'Place Type', 'test' ), |
|
16 | + 'admin_title' => __('Place Type', 'test'), |
|
17 | + 'admin_desc' => __('Select the place type.', 'test'), |
|
18 | + 'site_title' => __('Place Type', 'test'), |
|
19 | 19 | 'htmlvar_name' => 'test_place_type', |
20 | 20 | 'default_value' => '', |
21 | 21 | 'option_values' => 'Hotel,Bar,Restaurant,Pub', |
22 | 22 | 'is_default' => '1', |
23 | 23 | 'is_admin' => '1', |
24 | - 'clabels' => __( 'Place Type', 'test' ) |
|
24 | + 'clabels' => __('Place Type', 'test') |
|
25 | 25 | ); |
26 | 26 | |
27 | - $lastid = geodir_custom_field_save( $field ); |
|
27 | + $lastid = geodir_custom_field_save($field); |
|
28 | 28 | |
29 | 29 | $this->assertTrue(is_int($lastid)); |
30 | 30 | |
@@ -33,18 +33,18 @@ discard block |
||
33 | 33 | 'listing_type' => 'gd_place', |
34 | 34 | 'data_type' => 'VARCHAR', |
35 | 35 | 'field_type' => 'url', |
36 | - 'admin_title' => __( 'Website Link', 'test' ), |
|
37 | - 'admin_desc' => __( 'Enter the website link.', 'test' ), |
|
38 | - 'site_title' => __( 'Website Link', 'test' ), |
|
36 | + 'admin_title' => __('Website Link', 'test'), |
|
37 | + 'admin_desc' => __('Enter the website link.', 'test'), |
|
38 | + 'site_title' => __('Website Link', 'test'), |
|
39 | 39 | 'htmlvar_name' => 'test_ws_link', |
40 | 40 | 'default_value' => '', |
41 | 41 | 'option_values' => '', |
42 | 42 | 'is_default' => '1', |
43 | 43 | 'is_admin' => '1', |
44 | - 'clabels' => __( 'Website Link', 'test' ) |
|
44 | + 'clabels' => __('Website Link', 'test') |
|
45 | 45 | ); |
46 | 46 | |
47 | - $lastid2 = geodir_custom_field_save( $field2 ); |
|
47 | + $lastid2 = geodir_custom_field_save($field2); |
|
48 | 48 | |
49 | 49 | $this->assertTrue(is_int($lastid2)); |
50 | 50 | |
@@ -53,24 +53,24 @@ discard block |
||
53 | 53 | 'listing_type' => 'gd_place', |
54 | 54 | 'data_type' => '', |
55 | 55 | 'field_type' => 'select', |
56 | - 'admin_title' => __( 'Place Type', 'test' ), |
|
57 | - 'admin_desc' => __( 'Select the place type.', 'test' ), |
|
58 | - 'site_title' => __( 'Place Type', 'test' ), |
|
56 | + 'admin_title' => __('Place Type', 'test'), |
|
57 | + 'admin_desc' => __('Select the place type.', 'test'), |
|
58 | + 'site_title' => __('Place Type', 'test'), |
|
59 | 59 | 'htmlvar_name' => 'test_place_type', |
60 | 60 | 'default_value' => '', |
61 | 61 | 'option_values' => 'Hotel,Bar,Restaurant,Pub', |
62 | 62 | 'is_default' => '1', |
63 | 63 | 'is_admin' => '1', |
64 | - 'clabels' => __( 'Place Type', 'test' ) |
|
64 | + 'clabels' => __('Place Type', 'test') |
|
65 | 65 | ); |
66 | 66 | |
67 | - $error = geodir_custom_field_save( $field3 ); |
|
67 | + $error = geodir_custom_field_save($field3); |
|
68 | 68 | |
69 | - $this->assertContains( 'HTML Variable Name should be a unique name', $error ); |
|
69 | + $this->assertContains('HTML Variable Name should be a unique name', $error); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | public function testAddMoreCustomFields() { |
73 | - $fieldsets = array(); |
|
73 | + $fieldsets = array(); |
|
74 | 74 | $fields = array(); |
75 | 75 | $filters = array(); |
76 | 76 | |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | 'listing_type' => 'gd_place', |
80 | 80 | 'data_type' => '', |
81 | 81 | 'field_type' => 'fieldset', |
82 | - 'admin_title' => __( 'Place Details', 'directory_starter' ), |
|
83 | - 'admin_desc' => __( 'Place Details.', 'directory_starter' ), |
|
84 | - 'site_title' => __( 'Place Details', 'directory_starter' ), |
|
82 | + 'admin_title' => __('Place Details', 'directory_starter'), |
|
83 | + 'admin_desc' => __('Place Details.', 'directory_starter'), |
|
84 | + 'site_title' => __('Place Details', 'directory_starter'), |
|
85 | 85 | 'default_value' => '', |
86 | 86 | 'option_values' => '', |
87 | 87 | 'is_default' => '1', |
88 | 88 | 'is_admin' => '1', |
89 | - 'clabels' => __( 'Place Details', 'directory_starter' ) |
|
89 | + 'clabels' => __('Place Details', 'directory_starter') |
|
90 | 90 | ); |
91 | 91 | |
92 | 92 | // Salary |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | // Custom Fields |
142 | 142 | if (!empty($fields)) { |
143 | 143 | foreach ($fields as $field_index => $field) { |
144 | - $lastid = geodir_custom_field_save( $field ); |
|
144 | + $lastid = geodir_custom_field_save($field); |
|
145 | 145 | $this->assertTrue(is_int($lastid)); |
146 | 146 | } |
147 | 147 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | } |
150 | 150 | |
151 | 151 | public function testTextCusField() { |
152 | - $_REQUEST = array ( |
|
152 | + $_REQUEST = array( |
|
153 | 153 | 'action' => 'geodir_ajax_action', |
154 | 154 | 'create_field' => 'true', |
155 | 155 | 'field_ins_upd' => 'submit', |
@@ -181,13 +181,13 @@ discard block |
||
181 | 181 | 'field_desc' => 'Cat', |
182 | 182 | 'geodir_ajax' => 'admin_ajax', |
183 | 183 | 'manage_field_type' => 'custom_fields', |
184 | - 'default_value' => '' , |
|
185 | - 'sort_order' => '11' , |
|
186 | - 'show_on_listing' => '1' , |
|
187 | - 'show_on_detail' => '1' , |
|
188 | - 'show_as_tab' => '0' , |
|
189 | - 'field_icon' => '' , |
|
190 | - 'css_class' => '' , |
|
184 | + 'default_value' => '', |
|
185 | + 'sort_order' => '11', |
|
186 | + 'show_on_listing' => '1', |
|
187 | + 'show_on_detail' => '1', |
|
188 | + 'show_as_tab' => '0', |
|
189 | + 'field_icon' => '', |
|
190 | + 'css_class' => '', |
|
191 | 191 | ); |
192 | 192 | add_filter('wp_redirect', '__return_false'); |
193 | 193 | ob_start(); |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | } |
201 | 201 | |
202 | 202 | public function texstDateCusField() { |
203 | - $_REQUEST = array ( |
|
203 | + $_REQUEST = array( |
|
204 | 204 | 'action' => 'geodir_ajax_action', |
205 | 205 | 'create_field' => 'true', |
206 | 206 | 'field_ins_upd' => 'submit', |
@@ -232,13 +232,13 @@ discard block |
||
232 | 232 | 'field_desc' => 'Cat', |
233 | 233 | 'geodir_ajax' => 'admin_ajax', |
234 | 234 | 'manage_field_type' => 'custom_fields', |
235 | - 'default_value' => '' , |
|
236 | - 'sort_order' => '12' , |
|
237 | - 'show_on_listing' => '1' , |
|
238 | - 'show_on_detail' => '1' , |
|
239 | - 'show_as_tab' => '0' , |
|
240 | - 'field_icon' => '' , |
|
241 | - 'css_class' => '' , |
|
235 | + 'default_value' => '', |
|
236 | + 'sort_order' => '12', |
|
237 | + 'show_on_listing' => '1', |
|
238 | + 'show_on_detail' => '1', |
|
239 | + 'show_as_tab' => '0', |
|
240 | + 'field_icon' => '', |
|
241 | + 'css_class' => '', |
|
242 | 242 | 'extra' => array( |
243 | 243 | 'date_format' => 'mm/dd/yy' |
244 | 244 | ) |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | } |
255 | 255 | |
256 | 256 | public function texstTextAreaCusField() { |
257 | - $_REQUEST = array ( |
|
257 | + $_REQUEST = array( |
|
258 | 258 | 'action' => 'geodir_ajax_action', |
259 | 259 | 'create_field' => 'true', |
260 | 260 | 'field_ins_upd' => 'submit', |
@@ -283,13 +283,13 @@ discard block |
||
283 | 283 | 'field_desc' => 'Cat', |
284 | 284 | 'geodir_ajax' => 'admin_ajax', |
285 | 285 | 'manage_field_type' => 'custom_fields', |
286 | - 'default_value' => '' , |
|
287 | - 'sort_order' => '12' , |
|
288 | - 'show_on_listing' => '1' , |
|
289 | - 'show_on_detail' => '1' , |
|
290 | - 'show_as_tab' => '0' , |
|
291 | - 'field_icon' => '' , |
|
292 | - 'css_class' => '' , |
|
286 | + 'default_value' => '', |
|
287 | + 'sort_order' => '12', |
|
288 | + 'show_on_listing' => '1', |
|
289 | + 'show_on_detail' => '1', |
|
290 | + 'show_as_tab' => '0', |
|
291 | + 'field_icon' => '', |
|
292 | + 'css_class' => '', |
|
293 | 293 | ); |
294 | 294 | add_filter('wp_redirect', '__return_false'); |
295 | 295 | ob_start(); |
@@ -3,32 +3,32 @@ discard block |
||
3 | 3 | $_SERVER['SERVER_NAME'] = ''; |
4 | 4 | $PHP_SELF = $GLOBALS['PHP_SELF'] = $_SERVER['PHP_SELF'] = '/index.php'; |
5 | 5 | |
6 | -define( 'GEODIR_USE_PHP_SESSIONS', false ); |
|
7 | -define( 'GD_TESTING_MODE', true ); |
|
6 | +define('GEODIR_USE_PHP_SESSIONS', false); |
|
7 | +define('GD_TESTING_MODE', true); |
|
8 | 8 | |
9 | -$_tests_dir = getenv( 'WP_TESTS_DIR' ); |
|
9 | +$_tests_dir = getenv('WP_TESTS_DIR'); |
|
10 | 10 | |
11 | -$is_selenium_test = getenv( 'IS_SELENIUM_TEST' ); |
|
11 | +$is_selenium_test = getenv('IS_SELENIUM_TEST'); |
|
12 | 12 | |
13 | -if ( ! $is_selenium_test ) { |
|
13 | +if (!$is_selenium_test) { |
|
14 | 14 | $is_selenium_test = false; |
15 | 15 | } else { |
16 | 16 | $is_selenium_test = true; |
17 | 17 | } |
18 | 18 | |
19 | -if ( ! $_tests_dir ) { |
|
20 | - $_tests_dir = dirname( __FILE__ ) . '/lib/wordpress-tests-lib'; |
|
19 | +if (!$_tests_dir) { |
|
20 | + $_tests_dir = dirname(__FILE__).'/lib/wordpress-tests-lib'; |
|
21 | 21 | } |
22 | 22 | |
23 | -require_once $_tests_dir . '/includes/functions.php'; |
|
24 | -require $_tests_dir . '/includes/bootstrap.php'; |
|
23 | +require_once $_tests_dir.'/includes/functions.php'; |
|
24 | +require $_tests_dir.'/includes/bootstrap.php'; |
|
25 | 25 | |
26 | -if ( $is_selenium_test ) { |
|
27 | - require dirname( __FILE__ ) . '/selenium/base.php'; |
|
26 | +if ($is_selenium_test) { |
|
27 | + require dirname(__FILE__).'/selenium/base.php'; |
|
28 | 28 | } |
29 | 29 | |
30 | -if ( ! $is_selenium_test ) { |
|
31 | - require dirname( __FILE__ ) . '/../geodirectory.php'; |
|
30 | +if (!$is_selenium_test) { |
|
31 | + require dirname(__FILE__).'/../geodirectory.php'; |
|
32 | 32 | tests_add_filter('place_dummy_image_url', 'place_dummy_image_url'); |
33 | 33 | tests_add_filter('place_dummy_cat_image_url', 'place_dummy_cat_image_url'); |
34 | 34 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | function test_create_dummy_posts($max = 10) { |
88 | 88 | $i = 1; |
89 | - while($i <= $max) { |
|
89 | + while ($i <= $max) { |
|
90 | 90 | global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2; |
91 | 91 | |
92 | 92 | $dummy_post_index = $i; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $city_bound_lat2 = 40.91525559999999; |
96 | 96 | $city_bound_lng2 = -73.7002721; |
97 | 97 | |
98 | - include dirname( __FILE__ ) . '/../geodirectory-admin/place_dummy_post.php'; |
|
98 | + include dirname(__FILE__).'/../geodirectory-admin/place_dummy_post.php'; |
|
99 | 99 | $i++; |
100 | 100 | } |
101 | 101 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | } |
112 | 112 | |
113 | 113 | function place_dummy_image_url($url) { |
114 | - $gd_dummy_base_url = getenv( 'GD_DUMMY_BASE_URL' ); |
|
114 | + $gd_dummy_base_url = getenv('GD_DUMMY_BASE_URL'); |
|
115 | 115 | if ($gd_dummy_base_url) { |
116 | 116 | return $gd_dummy_base_url; |
117 | 117 | } else { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | } |
121 | 121 | |
122 | 122 | function place_dummy_cat_image_url($url) { |
123 | - $gd_dummy_base_url = getenv( 'GD_DUMMY_BASE_URL' ); |
|
123 | + $gd_dummy_base_url = getenv('GD_DUMMY_BASE_URL'); |
|
124 | 124 | if ($gd_dummy_base_url) { |
125 | 125 | return $gd_dummy_base_url."/cat_icon"; |
126 | 126 | } else { |
@@ -1,38 +1,38 @@ |
||
1 | 1 | <?php |
2 | 2 | class DeleteListing extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(1); |
|
8 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(1); |
|
8 | + } |
|
9 | 9 | |
10 | - public function testDeleteListing() |
|
11 | - { |
|
12 | - $query_args = array( |
|
13 | - 'post_status' => 'publish', |
|
14 | - 'post_type' => 'gd_place', |
|
15 | - 'posts_per_page' => 1, |
|
16 | - 'author' => 1 |
|
17 | - ); |
|
10 | + public function testDeleteListing() |
|
11 | + { |
|
12 | + $query_args = array( |
|
13 | + 'post_status' => 'publish', |
|
14 | + 'post_type' => 'gd_place', |
|
15 | + 'posts_per_page' => 1, |
|
16 | + 'author' => 1 |
|
17 | + ); |
|
18 | 18 | |
19 | - $all_posts = new WP_Query( $query_args ); |
|
20 | - $post_id = null; |
|
21 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
22 | - $post_id = get_the_ID(); |
|
23 | - endwhile; |
|
19 | + $all_posts = new WP_Query( $query_args ); |
|
20 | + $post_id = null; |
|
21 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
22 | + $post_id = get_the_ID(); |
|
23 | + endwhile; |
|
24 | 24 | |
25 | - $this->assertTrue(is_int($post_id)); |
|
25 | + $this->assertTrue(is_int($post_id)); |
|
26 | 26 | |
27 | - $lastid = wp_delete_post($post_id); |
|
27 | + $lastid = wp_delete_post($post_id); |
|
28 | 28 | |
29 | - $this->assertTrue(is_int($lastid->ID)); |
|
29 | + $this->assertTrue(is_int($lastid->ID)); |
|
30 | 30 | |
31 | - } |
|
31 | + } |
|
32 | 32 | |
33 | - public function tearDown() |
|
34 | - { |
|
35 | - parent::tearDown(); |
|
36 | - } |
|
33 | + public function tearDown() |
|
34 | + { |
|
35 | + parent::tearDown(); |
|
36 | + } |
|
37 | 37 | } |
38 | 38 | ?> |
39 | 39 | \ No newline at end of file |
@@ -16,9 +16,9 @@ |
||
16 | 16 | 'author' => 1 |
17 | 17 | ); |
18 | 18 | |
19 | - $all_posts = new WP_Query( $query_args ); |
|
19 | + $all_posts = new WP_Query($query_args); |
|
20 | 20 | $post_id = null; |
21 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
21 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
22 | 22 | $post_id = get_the_ID(); |
23 | 23 | endwhile; |
24 | 24 |
@@ -1,101 +1,101 @@ |
||
1 | 1 | <?php |
2 | 2 | class GDAjaxTests extends WP_Ajax_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(1); |
|
8 | - } |
|
9 | - |
|
10 | - public function testBestOfWidgetAjax() { |
|
11 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
12 | - include_once($template); |
|
13 | - |
|
14 | - $time = current_time('mysql'); |
|
15 | - |
|
16 | - $query_args = array( |
|
17 | - 'post_status' => 'publish', |
|
18 | - 'post_type' => 'gd_place', |
|
19 | - 'posts_per_page' => 1, |
|
20 | - ); |
|
21 | - |
|
22 | - $all_posts = new WP_Query( $query_args ); |
|
23 | - $post_id = null; |
|
24 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
25 | - $post_id = get_the_ID(); |
|
26 | - endwhile; |
|
27 | - |
|
28 | - $this->assertTrue(is_int($post_id)); |
|
29 | - |
|
30 | - $data = array( |
|
31 | - 'comment_post_ID' => $post_id, |
|
32 | - 'comment_author' => 'admin', |
|
33 | - 'comment_author_email' => '[email protected]', |
|
34 | - 'comment_author_url' => 'http://wpgeodirectory.com', |
|
35 | - 'comment_content' => 'content here', |
|
36 | - 'comment_type' => '', |
|
37 | - 'comment_parent' => 0, |
|
38 | - 'user_id' => 1, |
|
39 | - 'comment_author_IP' => '127.0.0.1', |
|
40 | - '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)', |
|
41 | - 'comment_date' => $time, |
|
42 | - 'comment_approved' => 1, |
|
43 | - ); |
|
44 | - |
|
45 | - $comment_id = wp_insert_comment($data); |
|
46 | - |
|
47 | - $_REQUEST['geodir_overallrating'] = 5.0; |
|
48 | - geodir_save_rating($comment_id); |
|
49 | - |
|
50 | - $this->assertTrue(is_int($comment_id)); |
|
51 | - |
|
52 | - //ajax function test |
|
53 | - $ajax_nonce = wp_create_nonce("geodir-bestof-nonce"); |
|
54 | - |
|
55 | - $terms = get_terms( array( |
|
56 | - 'taxonomy' => 'gd_placecategory', |
|
57 | - 'hide_empty' => false, |
|
58 | - ) ); |
|
59 | - $term_id = $terms[0]->term_id; |
|
60 | - |
|
61 | - $_POST['post_type'] = 'gd_place'; |
|
62 | - $_POST['post_limit'] = '5'; |
|
63 | - $_POST['char_count'] = '20'; |
|
64 | - $_POST['taxonomy'] = 'gd_placecategory'; |
|
65 | - $_POST['add_location_filter'] = '1'; |
|
66 | - $_POST['term_id'] = (string) $term_id; |
|
67 | - $_POST['excerpt_type'] = 'show-reviews'; |
|
68 | - $_POST['geodir_bestof_nonce'] = $ajax_nonce; |
|
69 | - |
|
70 | - $this->_handleAjax('geodir_bestof'); |
|
71 | - $this->assertContains("bestof-cat-title", $this->_last_response); |
|
72 | - |
|
73 | - |
|
74 | - } |
|
75 | - |
|
76 | - public function texstImportExport() { |
|
77 | - $nonce = wp_create_nonce( 'geodir_import_export_nonce' ); |
|
78 | - |
|
79 | - $_POST['_nonce'] = $nonce; |
|
80 | - $_POST['_pt'] = 'gd_place'; |
|
81 | - $_POST['task'] = 'export_posts'; |
|
82 | - $_POST['_n'] = 5000; |
|
83 | - $_POST['_p'] = 1; |
|
84 | - |
|
85 | - $this->_handleAjax('geodir_import_export'); |
|
86 | - try { |
|
87 | - $this->assertContains("bestof-cat-title", $this->_last_response); |
|
88 | - } catch (WPAjaxDieStopException $e) { |
|
89 | - var_dump("WPAjaxDieStopException: " . $e ); |
|
90 | - } catch (WPAjaxDieContinueException $e) { |
|
91 | - var_dump("WPAjaxDieContinueException: " . $e ); |
|
92 | - } |
|
93 | - |
|
94 | - } |
|
95 | - |
|
96 | - public function tearDown() |
|
97 | - { |
|
98 | - parent::tearDown(); |
|
99 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(1); |
|
8 | + } |
|
9 | + |
|
10 | + public function testBestOfWidgetAjax() { |
|
11 | + $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
12 | + include_once($template); |
|
13 | + |
|
14 | + $time = current_time('mysql'); |
|
15 | + |
|
16 | + $query_args = array( |
|
17 | + 'post_status' => 'publish', |
|
18 | + 'post_type' => 'gd_place', |
|
19 | + 'posts_per_page' => 1, |
|
20 | + ); |
|
21 | + |
|
22 | + $all_posts = new WP_Query( $query_args ); |
|
23 | + $post_id = null; |
|
24 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
25 | + $post_id = get_the_ID(); |
|
26 | + endwhile; |
|
27 | + |
|
28 | + $this->assertTrue(is_int($post_id)); |
|
29 | + |
|
30 | + $data = array( |
|
31 | + 'comment_post_ID' => $post_id, |
|
32 | + 'comment_author' => 'admin', |
|
33 | + 'comment_author_email' => '[email protected]', |
|
34 | + 'comment_author_url' => 'http://wpgeodirectory.com', |
|
35 | + 'comment_content' => 'content here', |
|
36 | + 'comment_type' => '', |
|
37 | + 'comment_parent' => 0, |
|
38 | + 'user_id' => 1, |
|
39 | + 'comment_author_IP' => '127.0.0.1', |
|
40 | + '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)', |
|
41 | + 'comment_date' => $time, |
|
42 | + 'comment_approved' => 1, |
|
43 | + ); |
|
44 | + |
|
45 | + $comment_id = wp_insert_comment($data); |
|
46 | + |
|
47 | + $_REQUEST['geodir_overallrating'] = 5.0; |
|
48 | + geodir_save_rating($comment_id); |
|
49 | + |
|
50 | + $this->assertTrue(is_int($comment_id)); |
|
51 | + |
|
52 | + //ajax function test |
|
53 | + $ajax_nonce = wp_create_nonce("geodir-bestof-nonce"); |
|
54 | + |
|
55 | + $terms = get_terms( array( |
|
56 | + 'taxonomy' => 'gd_placecategory', |
|
57 | + 'hide_empty' => false, |
|
58 | + ) ); |
|
59 | + $term_id = $terms[0]->term_id; |
|
60 | + |
|
61 | + $_POST['post_type'] = 'gd_place'; |
|
62 | + $_POST['post_limit'] = '5'; |
|
63 | + $_POST['char_count'] = '20'; |
|
64 | + $_POST['taxonomy'] = 'gd_placecategory'; |
|
65 | + $_POST['add_location_filter'] = '1'; |
|
66 | + $_POST['term_id'] = (string) $term_id; |
|
67 | + $_POST['excerpt_type'] = 'show-reviews'; |
|
68 | + $_POST['geodir_bestof_nonce'] = $ajax_nonce; |
|
69 | + |
|
70 | + $this->_handleAjax('geodir_bestof'); |
|
71 | + $this->assertContains("bestof-cat-title", $this->_last_response); |
|
72 | + |
|
73 | + |
|
74 | + } |
|
75 | + |
|
76 | + public function texstImportExport() { |
|
77 | + $nonce = wp_create_nonce( 'geodir_import_export_nonce' ); |
|
78 | + |
|
79 | + $_POST['_nonce'] = $nonce; |
|
80 | + $_POST['_pt'] = 'gd_place'; |
|
81 | + $_POST['task'] = 'export_posts'; |
|
82 | + $_POST['_n'] = 5000; |
|
83 | + $_POST['_p'] = 1; |
|
84 | + |
|
85 | + $this->_handleAjax('geodir_import_export'); |
|
86 | + try { |
|
87 | + $this->assertContains("bestof-cat-title", $this->_last_response); |
|
88 | + } catch (WPAjaxDieStopException $e) { |
|
89 | + var_dump("WPAjaxDieStopException: " . $e ); |
|
90 | + } catch (WPAjaxDieContinueException $e) { |
|
91 | + var_dump("WPAjaxDieContinueException: " . $e ); |
|
92 | + } |
|
93 | + |
|
94 | + } |
|
95 | + |
|
96 | + public function tearDown() |
|
97 | + { |
|
98 | + parent::tearDown(); |
|
99 | + } |
|
100 | 100 | } |
101 | 101 | ?> |
102 | 102 | \ No newline at end of file |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | } |
9 | 9 | |
10 | 10 | public function testBestOfWidgetAjax() { |
11 | - $template = geodir_plugin_path() . '/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
11 | + $template = geodir_plugin_path().'/geodirectory-widgets/geodirectory_bestof_widget.php'; |
|
12 | 12 | include_once($template); |
13 | 13 | |
14 | 14 | $time = current_time('mysql'); |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | 'posts_per_page' => 1, |
20 | 20 | ); |
21 | 21 | |
22 | - $all_posts = new WP_Query( $query_args ); |
|
22 | + $all_posts = new WP_Query($query_args); |
|
23 | 23 | $post_id = null; |
24 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
24 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
25 | 25 | $post_id = get_the_ID(); |
26 | 26 | endwhile; |
27 | 27 | |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | //ajax function test |
53 | 53 | $ajax_nonce = wp_create_nonce("geodir-bestof-nonce"); |
54 | 54 | |
55 | - $terms = get_terms( array( |
|
55 | + $terms = get_terms(array( |
|
56 | 56 | 'taxonomy' => 'gd_placecategory', |
57 | 57 | 'hide_empty' => false, |
58 | - ) ); |
|
58 | + )); |
|
59 | 59 | $term_id = $terms[0]->term_id; |
60 | 60 | |
61 | 61 | $_POST['post_type'] = 'gd_place'; |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | public function texstImportExport() { |
77 | - $nonce = wp_create_nonce( 'geodir_import_export_nonce' ); |
|
77 | + $nonce = wp_create_nonce('geodir_import_export_nonce'); |
|
78 | 78 | |
79 | 79 | $_POST['_nonce'] = $nonce; |
80 | 80 | $_POST['_pt'] = 'gd_place'; |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | try { |
87 | 87 | $this->assertContains("bestof-cat-title", $this->_last_response); |
88 | 88 | } catch (WPAjaxDieStopException $e) { |
89 | - var_dump("WPAjaxDieStopException: " . $e ); |
|
89 | + var_dump("WPAjaxDieStopException: ".$e); |
|
90 | 90 | } catch (WPAjaxDieContinueException $e) { |
91 | - var_dump("WPAjaxDieContinueException: " . $e ); |
|
91 | + var_dump("WPAjaxDieContinueException: ".$e); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | } |
@@ -1,68 +1,68 @@ |
||
1 | 1 | <?php |
2 | 2 | class UserTest extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(1); |
|
8 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(1); |
|
8 | + } |
|
9 | 9 | |
10 | - public function testDisplayUserFavorites() { |
|
10 | + public function testDisplayUserFavorites() { |
|
11 | 11 | |
12 | - global $current_user; |
|
12 | + global $current_user; |
|
13 | 13 | |
14 | - $user_id = $current_user->ID; |
|
14 | + $user_id = $current_user->ID; |
|
15 | 15 | |
16 | - $query_args = array( |
|
17 | - 'post_status' => 'publish', |
|
18 | - 'post_type' => 'gd_place', |
|
19 | - 'posts_per_page' => 1, |
|
20 | - ); |
|
16 | + $query_args = array( |
|
17 | + 'post_status' => 'publish', |
|
18 | + 'post_type' => 'gd_place', |
|
19 | + 'posts_per_page' => 1, |
|
20 | + ); |
|
21 | 21 | |
22 | - $all_posts = new WP_Query( $query_args ); |
|
23 | - $post_id = null; |
|
24 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
25 | - $post_id = get_the_ID(); |
|
26 | - endwhile; |
|
22 | + $all_posts = new WP_Query( $query_args ); |
|
23 | + $post_id = null; |
|
24 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
25 | + $post_id = get_the_ID(); |
|
26 | + endwhile; |
|
27 | 27 | |
28 | - $this->assertTrue(is_int($post_id)); |
|
28 | + $this->assertTrue(is_int($post_id)); |
|
29 | 29 | |
30 | - ob_start(); |
|
31 | - geodir_add_to_favorite($post_id); |
|
32 | - $output = ob_get_contents(); |
|
33 | - ob_end_clean(); |
|
34 | - $this->assertContains( 'Remove from Favorites', $output ); |
|
30 | + ob_start(); |
|
31 | + geodir_add_to_favorite($post_id); |
|
32 | + $output = ob_get_contents(); |
|
33 | + ob_end_clean(); |
|
34 | + $this->assertContains( 'Remove from Favorites', $output ); |
|
35 | 35 | |
36 | 36 | |
37 | - $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
37 | + $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
38 | 38 | |
39 | - $this->assertContains( $post_id, $user_fav_posts ); |
|
39 | + $this->assertContains( $post_id, $user_fav_posts ); |
|
40 | 40 | |
41 | - ob_start(); |
|
42 | - geodir_user_show_favourites($user_id); |
|
43 | - $output = ob_get_contents(); |
|
44 | - ob_end_clean(); |
|
45 | - $this->assertContains( 'geodir_my_favourites', $output ); |
|
41 | + ob_start(); |
|
42 | + geodir_user_show_favourites($user_id); |
|
43 | + $output = ob_get_contents(); |
|
44 | + ob_end_clean(); |
|
45 | + $this->assertContains( 'geodir_my_favourites', $output ); |
|
46 | 46 | |
47 | - } |
|
47 | + } |
|
48 | 48 | |
49 | - public function testDisplayUserListings() { |
|
49 | + public function testDisplayUserListings() { |
|
50 | 50 | |
51 | - global $current_user; |
|
51 | + global $current_user; |
|
52 | 52 | |
53 | - $user_id = $current_user->ID; |
|
53 | + $user_id = $current_user->ID; |
|
54 | 54 | |
55 | - ob_start(); |
|
56 | - geodir_user_show_listings($user_id); |
|
57 | - $output = ob_get_contents(); |
|
58 | - ob_end_clean(); |
|
59 | - $this->assertContains( 'geodir_my_listings', $output ); |
|
55 | + ob_start(); |
|
56 | + geodir_user_show_listings($user_id); |
|
57 | + $output = ob_get_contents(); |
|
58 | + ob_end_clean(); |
|
59 | + $this->assertContains( 'geodir_my_listings', $output ); |
|
60 | 60 | |
61 | - } |
|
61 | + } |
|
62 | 62 | |
63 | - public function tearDown() |
|
64 | - { |
|
65 | - parent::tearDown(); |
|
66 | - } |
|
63 | + public function tearDown() |
|
64 | + { |
|
65 | + parent::tearDown(); |
|
66 | + } |
|
67 | 67 | } |
68 | 68 | ?> |
69 | 69 | \ No newline at end of file |
@@ -19,9 +19,9 @@ discard block |
||
19 | 19 | 'posts_per_page' => 1, |
20 | 20 | ); |
21 | 21 | |
22 | - $all_posts = new WP_Query( $query_args ); |
|
22 | + $all_posts = new WP_Query($query_args); |
|
23 | 23 | $post_id = null; |
24 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
24 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
25 | 25 | $post_id = get_the_ID(); |
26 | 26 | endwhile; |
27 | 27 | |
@@ -31,18 +31,18 @@ discard block |
||
31 | 31 | geodir_add_to_favorite($post_id); |
32 | 32 | $output = ob_get_contents(); |
33 | 33 | ob_end_clean(); |
34 | - $this->assertContains( 'Remove from Favorites', $output ); |
|
34 | + $this->assertContains('Remove from Favorites', $output); |
|
35 | 35 | |
36 | 36 | |
37 | 37 | $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true); |
38 | 38 | |
39 | - $this->assertContains( $post_id, $user_fav_posts ); |
|
39 | + $this->assertContains($post_id, $user_fav_posts); |
|
40 | 40 | |
41 | 41 | ob_start(); |
42 | 42 | geodir_user_show_favourites($user_id); |
43 | 43 | $output = ob_get_contents(); |
44 | 44 | ob_end_clean(); |
45 | - $this->assertContains( 'geodir_my_favourites', $output ); |
|
45 | + $this->assertContains('geodir_my_favourites', $output); |
|
46 | 46 | |
47 | 47 | } |
48 | 48 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | geodir_user_show_listings($user_id); |
57 | 57 | $output = ob_get_contents(); |
58 | 58 | ob_end_clean(); |
59 | - $this->assertContains( 'geodir_my_listings', $output ); |
|
59 | + $this->assertContains('geodir_my_listings', $output); |
|
60 | 60 | |
61 | 61 | } |
62 | 62 |