@@ -126,10 +126,11 @@ discard block |
||
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'category_ajax') {
|
| 129 | - if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude'])) |
|
| 130 | - geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']); |
|
| 131 | - else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax'])) |
|
| 132 | - geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']); |
|
| 129 | + if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude'])) { |
|
| 130 | + geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']); |
|
| 131 | + } else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax'])) { |
|
| 132 | + geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']); |
|
| 133 | + } |
|
| 133 | 134 | } |
| 134 | 135 | |
| 135 | 136 | if ((isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'admin_ajax') || isset($_REQUEST['create_field']) || isset($_REQUEST['sort_create_field'])) {
|
@@ -151,22 +152,25 @@ discard block |
||
| 151 | 152 | if (current_user_can('manage_options')) {
|
| 152 | 153 | switch ($_REQUEST['geodir_autofill']): |
| 153 | 154 | case "geodir_dummy_delete" : |
| 154 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_delete_noncename')) |
|
| 155 | - return; |
|
| 155 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_delete_noncename')) { |
|
| 156 | + return; |
|
| 157 | + } |
|
| 156 | 158 | |
| 157 | - if (isset($_REQUEST['posttype'])) |
|
| 158 | - /** |
|
| 159 | + if (isset($_REQUEST['posttype'])) { |
|
| 160 | + /** |
|
| 159 | 161 | * Used to delete the dummy post data per post type. |
| 160 | 162 | * |
| 161 | 163 | * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype']. |
| 162 | 164 | * |
| 163 | 165 | * @since 1.0.0 |
| 164 | 166 | */ |
| 165 | - do_action('geodir_delete_dummy_posts_' . $_REQUEST['posttype']);
|
|
| 167 | + do_action('geodir_delete_dummy_posts_' . $_REQUEST['posttype']); |
|
| 168 | + } |
|
| 166 | 169 | break; |
| 167 | 170 | case "geodir_dummy_insert" : |
| 168 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) |
|
| 169 | - return; |
|
| 171 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) { |
|
| 172 | + return; |
|
| 173 | + } |
|
| 170 | 174 | |
| 171 | 175 | global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2; |
| 172 | 176 | $dummy_post_index = $_REQUEST['insert_dummy_post_index']; |
@@ -175,15 +179,16 @@ discard block |
||
| 175 | 179 | $city_bound_lat2 = $_REQUEST['city_bound_lat2']; |
| 176 | 180 | $city_bound_lng2 = $_REQUEST['city_bound_lng2']; |
| 177 | 181 | |
| 178 | - if (isset($_REQUEST['posttype'])) |
|
| 179 | - /** |
|
| 182 | + if (isset($_REQUEST['posttype'])) { |
|
| 183 | + /** |
|
| 180 | 184 | * Used to insert the dummy post data per post type. |
| 181 | 185 | * |
| 182 | 186 | * Uses dynamic hook, geodir_insert_dummy_posts_$_REQUEST['posttype']. |
| 183 | 187 | * |
| 184 | 188 | * @since 1.0.0 |
| 185 | 189 | */ |
| 186 | - do_action('geodir_insert_dummy_posts_' . $_REQUEST['posttype']);
|
|
| 190 | + do_action('geodir_insert_dummy_posts_' . $_REQUEST['posttype']); |
|
| 191 | + } |
|
| 187 | 192 | |
| 188 | 193 | break; |
| 189 | 194 | endswitch; |
@@ -261,8 +266,9 @@ discard block |
||
| 261 | 266 | } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
| 262 | 267 | $redirect_to = get_permalink(geodir_add_listing_page_id()); |
| 263 | 268 | $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
|
| 264 | - } else |
|
| 265 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 269 | + } else { |
|
| 270 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 271 | + } |
|
| 266 | 272 | |
| 267 | 273 | wp_redirect($redirect_to); |
| 268 | 274 | } else {
|
@@ -275,9 +281,9 @@ discard block |
||
| 275 | 281 | |
| 276 | 282 | $gd_session->un_set('listing');
|
| 277 | 283 | |
| 278 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid'])) |
|
| 279 | - wp_redirect(get_permalink($_REQUEST['pid'])); |
|
| 280 | - else {
|
|
| 284 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid'])) { |
|
| 285 | + wp_redirect(get_permalink($_REQUEST['pid'])); |
|
| 286 | + } else {
|
|
| 281 | 287 | geodir_remove_temp_images(); |
| 282 | 288 | wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type'])));
|
| 283 | 289 | } |
@@ -305,8 +311,9 @@ discard block |
||
| 305 | 311 | } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
| 306 | 312 | $redirect_to = get_permalink(geodir_add_listing_page_id()); |
| 307 | 313 | $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
|
| 308 | - } else |
|
| 309 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 314 | + } else { |
|
| 315 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 316 | + } |
|
| 310 | 317 | |
| 311 | 318 | $gd_session->un_set('listing');
|
| 312 | 319 | wp_redirect($redirect_to); |
@@ -327,8 +334,9 @@ discard block |
||
| 327 | 334 | $lastid = wp_delete_post($_REQUEST['pid']); |
| 328 | 335 | } |
| 329 | 336 | |
| 330 | - if ($lastid && !is_wp_error($lastid)) |
|
| 331 | - wp_redirect($_SERVER['HTTP_REFERER']); |
|
| 337 | + if ($lastid && !is_wp_error($lastid)) { |
|
| 338 | + wp_redirect($_SERVER['HTTP_REFERER']); |
|
| 339 | + } |
|
| 332 | 340 | |
| 333 | 341 | //wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) );
|
| 334 | 342 | } |