@@ -39,12 +39,12 @@ discard block |
||
| 39 | 39 | $cf = (isset($cf_arr[$field_type_key])) ? $cf_arr[$field_type_key] : ''; |
| 40 | 40 | |
| 41 | 41 | |
| 42 | -if(isset($field_info->extra_fields)){$extra_fields = $field_info->extra_fields;}
|
|
| 42 | +if (isset($field_info->extra_fields)) {$extra_fields = $field_info->extra_fields; }
|
|
| 43 | 43 | $field_info = stripslashes_deep($field_info); // strip slashes from labels |
| 44 | -if(isset($field_info->extra_fields)){$field_info->extra_fields = $extra_fields;}
|
|
| 44 | +if (isset($field_info->extra_fields)) {$field_info->extra_fields = $extra_fields; }
|
|
| 45 | 45 | |
| 46 | 46 | |
| 47 | -$nonce = wp_create_nonce('custom_fields_' . $result_str);
|
|
| 47 | +$nonce = wp_create_nonce('custom_fields_'.$result_str);
|
|
| 48 | 48 | |
| 49 | 49 | $field_admin_title = ''; |
| 50 | 50 | if (isset($field_info->admin_title)) |
@@ -69,15 +69,15 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) {
|
| 71 | 71 | $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>'; |
| 72 | -}elseif(isset($cf['icon']) && $cf['icon']){
|
|
| 72 | +}elseif (isset($cf['icon']) && $cf['icon']) {
|
|
| 73 | 73 | $field_icon = '<b style="background-image: url("'.$cf['icon'].'")"></b>';
|
| 74 | -}else{
|
|
| 74 | +} else {
|
|
| 75 | 75 | $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | -if(isset($cf['name']) && $cf['name']){
|
|
| 78 | +if (isset($cf['name']) && $cf['name']) {
|
|
| 79 | 79 | $field_type_name = $cf['name']; |
| 80 | -}else{
|
|
| 80 | +} else {
|
|
| 81 | 81 | $field_type_name = $field_type; |
| 82 | 82 | } |
| 83 | 83 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | ondblclick="show_hide('field_frm<?php echo $result_str; ?>')" >
|
| 93 | 93 | <?php |
| 94 | 94 | |
| 95 | - $nonce = wp_create_nonce('custom_fields_' . $result_str);
|
|
| 95 | + $nonce = wp_create_nonce('custom_fields_'.$result_str);
|
|
| 96 | 96 | ?> |
| 97 | 97 | |
| 98 | 98 | <?php if (!$default): ?> |
@@ -105,12 +105,12 @@ discard block |
||
| 105 | 105 | <i class="fa fa-long-arrow-left " aria-hidden="true"></i> |
| 106 | 106 | <i class="fa fa-long-arrow-right " aria-hidden="true"></i> |
| 107 | 107 | <b style="cursor:pointer;" |
| 108 | - onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b>
|
|
| 108 | + onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory').' '.$field_admin_title); ?></b>
|
|
| 109 | 109 | <?php |
| 110 | 110 | } else {echo $field_icon;
|
| 111 | 111 | ?> |
| 112 | 112 | <b style="cursor:pointer;" |
| 113 | - onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(' ' . $field_admin_title . ' (' . $field_type_name . ')');?></b>
|
|
| 113 | + onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(' '.$field_admin_title.' ('.$field_type_name.')'); ?></b>
|
|
| 114 | 114 | <?php |
| 115 | 115 | } |
| 116 | 116 | ?> |
@@ -133,43 +133,43 @@ discard block |
||
| 133 | 133 | } ?>"/> |
| 134 | 134 | <input type="hidden" name="is_active" id="is_active" value="1"/> |
| 135 | 135 | |
| 136 | - <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : '';?>" /><?php // show in sidebar value?> |
|
| 137 | - <input type="hidden" name="show_on_listing" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : '';?>" /> |
|
| 138 | - <input type="hidden" name="show_on_detail" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : '';?>" /> |
|
| 139 | - <input type="hidden" name="show_as_tab" value="<?php echo isset($field_info->show_as_tab) ? $field_info->show_as_tab : '';?>" /> |
|
| 136 | + <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : ''; ?>" /><?php // show in sidebar value?> |
|
| 137 | + <input type="hidden" name="show_on_listing" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : ''; ?>" /> |
|
| 138 | + <input type="hidden" name="show_on_detail" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : ''; ?>" /> |
|
| 139 | + <input type="hidden" name="show_as_tab" value="<?php echo isset($field_info->show_as_tab) ? $field_info->show_as_tab : ''; ?>" /> |
|
| 140 | 140 | |
| 141 | 141 | <ul class="widefat post fixed" border="0" style="width:100%;"> |
| 142 | 142 | |
| 143 | 143 | <?php |
| 144 | 144 | |
| 145 | 145 | // data_type |
| 146 | - if(has_filter("geodir_cfa_data_type_{$field_type}")){
|
|
| 146 | + if (has_filter("geodir_cfa_data_type_{$field_type}")) {
|
|
| 147 | 147 | |
| 148 | - echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 148 | + echo apply_filters("geodir_cfa_data_type_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 149 | 149 | |
| 150 | - }else{
|
|
| 150 | + } else {
|
|
| 151 | 151 | $value = ''; |
| 152 | 152 | if (isset($field_info->data_type)) {
|
| 153 | 153 | $value = esc_attr($field_info->data_type); |
| 154 | - }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
|
|
| 154 | + }elseif (isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']) {
|
|
| 155 | 155 | $value = $cf['defaults']['data_type']; |
| 156 | 156 | } |
| 157 | 157 | ?> |
| 158 | - <input type="hidden" name="data_type" id="data_type" value="<?php echo $value;?>"/> |
|
| 158 | + <input type="hidden" name="data_type" id="data_type" value="<?php echo $value; ?>"/> |
|
| 159 | 159 | <?php |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
| 163 | 163 | // admin_title |
| 164 | - if(has_filter("geodir_cfa_admin_title_{$field_type}")){
|
|
| 164 | + if (has_filter("geodir_cfa_admin_title_{$field_type}")) {
|
|
| 165 | 165 | |
| 166 | - echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 166 | + echo apply_filters("geodir_cfa_admin_title_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 167 | 167 | |
| 168 | - }else{
|
|
| 168 | + } else {
|
|
| 169 | 169 | $value = ''; |
| 170 | 170 | if (isset($field_info->admin_title)) {
|
| 171 | 171 | $value = esc_attr($field_info->admin_title); |
| 172 | - }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
|
|
| 172 | + }elseif (isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']) {
|
|
| 173 | 173 | $value = $cf['defaults']['admin_title']; |
| 174 | 174 | } |
| 175 | 175 | ?> |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | </label> |
| 183 | 183 | <div class="gd-cf-input-wrap"> |
| 184 | 184 | <input type="text" name="admin_title" id="admin_title" |
| 185 | - value="<?php echo $value;?>"/> |
|
| 185 | + value="<?php echo $value; ?>"/> |
|
| 186 | 186 | </div> |
| 187 | 187 | </li> |
| 188 | 188 | <?php |
@@ -190,15 +190,15 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | |
| 192 | 192 | // site_title |
| 193 | - if(has_filter("geodir_cfa_site_title_{$field_type}")){
|
|
| 193 | + if (has_filter("geodir_cfa_site_title_{$field_type}")) {
|
|
| 194 | 194 | |
| 195 | - echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 195 | + echo apply_filters("geodir_cfa_site_title_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 196 | 196 | |
| 197 | - }else{
|
|
| 197 | + } else {
|
|
| 198 | 198 | $value = ''; |
| 199 | 199 | if (isset($field_info->site_title)) {
|
| 200 | 200 | $value = esc_attr($field_info->site_title); |
| 201 | - }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
|
|
| 201 | + }elseif (isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']) {
|
|
| 202 | 202 | $value = $cf['defaults']['site_title']; |
| 203 | 203 | } |
| 204 | 204 | ?> |
@@ -218,15 +218,15 @@ discard block |
||
| 218 | 218 | |
| 219 | 219 | |
| 220 | 220 | // admin_desc |
| 221 | - if(has_filter("geodir_cfa_admin_desc_{$field_type}")){
|
|
| 221 | + if (has_filter("geodir_cfa_admin_desc_{$field_type}")) {
|
|
| 222 | 222 | |
| 223 | - echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 223 | + echo apply_filters("geodir_cfa_admin_desc_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 224 | 224 | |
| 225 | - }else{
|
|
| 225 | + } else {
|
|
| 226 | 226 | $value = ''; |
| 227 | 227 | if (isset($field_info->admin_desc)) {
|
| 228 | 228 | $value = esc_attr($field_info->admin_desc); |
| 229 | - }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
|
|
| 229 | + }elseif (isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']) {
|
|
| 230 | 230 | $value = $cf['defaults']['admin_desc']; |
| 231 | 231 | } |
| 232 | 232 | ?> |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | </div> |
| 238 | 238 | </label> |
| 239 | 239 | <div class="gd-cf-input-wrap"> |
| 240 | - <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value;?>"/> |
|
| 240 | + <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value; ?>"/> |
|
| 241 | 241 | </div> |
| 242 | 242 | </li> |
| 243 | 243 | <?php |
@@ -246,26 +246,26 @@ discard block |
||
| 246 | 246 | |
| 247 | 247 | |
| 248 | 248 | // htmlvar_name |
| 249 | - if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){
|
|
| 249 | + if (has_filter("geodir_cfa_htmlvar_name_{$field_type}")) {
|
|
| 250 | 250 | |
| 251 | - echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 251 | + echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 252 | 252 | |
| 253 | - }else{
|
|
| 253 | + } else {
|
|
| 254 | 254 | $value = ''; |
| 255 | 255 | if (isset($field_info->htmlvar_name)) {
|
| 256 | 256 | $value = esc_attr($field_info->htmlvar_name); |
| 257 | - }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
|
|
| 257 | + }elseif (isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']) {
|
|
| 258 | 258 | $value = $cf['defaults']['htmlvar_name']; |
| 259 | 259 | } |
| 260 | 260 | ?> |
| 261 | 261 | <li> |
| 262 | - <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory');?>
|
|
| 262 | + <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory'); ?>
|
|
| 263 | 263 | <div class="gdcf-tooltip"> |
| 264 | 264 | <?php _e('This is a unique identifier used in the HTML, it MUST NOT contain spaces or special characters.', 'geodirectory'); ?>
|
| 265 | 265 | </div> |
| 266 | 266 | </label> |
| 267 | 267 | <div class="gd-cf-input-wrap"> |
| 268 | - <input type="text" name="htmlvar_name" id="htmlvar_name" pattern="[a-zA-Z0-9]+" title="<?php _e('Must not contain spaces or special characters', 'geodirectory');?>"
|
|
| 268 | + <input type="text" name="htmlvar_name" id="htmlvar_name" pattern="[a-zA-Z0-9]+" title="<?php _e('Must not contain spaces or special characters', 'geodirectory'); ?>"
|
|
| 269 | 269 | value="<?php if ($value) {
|
| 270 | 270 | echo preg_replace('/geodir_/', '', $value, 1);
|
| 271 | 271 | }?>" <?php if ($default) {
|
@@ -278,15 +278,15 @@ discard block |
||
| 278 | 278 | |
| 279 | 279 | |
| 280 | 280 | // is_active |
| 281 | - if(has_filter("geodir_cfa_is_active_{$field_type}")){
|
|
| 281 | + if (has_filter("geodir_cfa_is_active_{$field_type}")) {
|
|
| 282 | 282 | |
| 283 | - echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 283 | + echo apply_filters("geodir_cfa_is_active_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 284 | 284 | |
| 285 | - }else{
|
|
| 285 | + } else {
|
|
| 286 | 286 | $value = ''; |
| 287 | 287 | if (isset($field_info->is_active)) {
|
| 288 | 288 | $value = esc_attr($field_info->is_active); |
| 289 | - }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
|
|
| 289 | + }elseif (isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']) {
|
|
| 290 | 290 | $value = $cf['defaults']['is_active']; |
| 291 | 291 | } |
| 292 | 292 | ?> |
@@ -298,17 +298,17 @@ discard block |
||
| 298 | 298 | </label> |
| 299 | 299 | <div class="gd-cf-input-wrap gd-switch"> |
| 300 | 300 | |
| 301 | - <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled" value="1" |
|
| 301 | + <input type="radio" id="is_active_yes<?php echo $radio_id; ?>" name="is_active" class="gdri-enabled" value="1" |
|
| 302 | 302 | <?php if ($value == '1') {
|
| 303 | 303 | echo 'checked'; |
| 304 | 304 | } ?>/> |
| 305 | - <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 305 | + <label for="is_active_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 306 | 306 | |
| 307 | - <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0" |
|
| 307 | + <input type="radio" id="is_active_no<?php echo $radio_id; ?>" name="is_active" class="gdri-disabled" value="0" |
|
| 308 | 308 | <?php if ($value == '0' || !$value) {
|
| 309 | 309 | echo 'checked'; |
| 310 | 310 | } ?>/> |
| 311 | - <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 311 | + <label for="is_active_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 312 | 312 | |
| 313 | 313 | </div> |
| 314 | 314 | </li> |
@@ -317,15 +317,15 @@ discard block |
||
| 317 | 317 | |
| 318 | 318 | |
| 319 | 319 | // for_admin_use |
| 320 | - if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){
|
|
| 320 | + if (has_filter("geodir_cfa_for_admin_use_{$field_type}")) {
|
|
| 321 | 321 | |
| 322 | - echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 322 | + echo apply_filters("geodir_cfa_for_admin_use_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 323 | 323 | |
| 324 | - }else{
|
|
| 324 | + } else {
|
|
| 325 | 325 | $value = ''; |
| 326 | 326 | if (isset($field_info->for_admin_use)) {
|
| 327 | 327 | $value = esc_attr($field_info->for_admin_use); |
| 328 | - }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
|
|
| 328 | + }elseif (isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']) {
|
|
| 329 | 329 | $value = $cf['defaults']['for_admin_use']; |
| 330 | 330 | } |
| 331 | 331 | ?> |
@@ -337,17 +337,17 @@ discard block |
||
| 337 | 337 | </label> |
| 338 | 338 | <div class="gd-cf-input-wrap gd-switch"> |
| 339 | 339 | |
| 340 | - <input type="radio" id="for_admin_use_yes<?php echo $radio_id;?>" name="for_admin_use" class="gdri-enabled" value="1" |
|
| 340 | + <input type="radio" id="for_admin_use_yes<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-enabled" value="1" |
|
| 341 | 341 | <?php if ($value == '1') {
|
| 342 | 342 | echo 'checked'; |
| 343 | 343 | } ?>/> |
| 344 | - <label for="for_admin_use_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 344 | + <label for="for_admin_use_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 345 | 345 | |
| 346 | - <input type="radio" id="for_admin_use_no<?php echo $radio_id;?>" name="for_admin_use" class="gdri-disabled" value="0" |
|
| 346 | + <input type="radio" id="for_admin_use_no<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-disabled" value="0" |
|
| 347 | 347 | <?php if ($value == '0' || !$value) {
|
| 348 | 348 | echo 'checked'; |
| 349 | 349 | } ?>/> |
| 350 | - <label for="for_admin_use_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 350 | + <label for="for_admin_use_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 351 | 351 | |
| 352 | 352 | </div> |
| 353 | 353 | </li> |
@@ -356,20 +356,20 @@ discard block |
||
| 356 | 356 | |
| 357 | 357 | |
| 358 | 358 | // default_value |
| 359 | - if(has_filter("geodir_cfa_default_value_{$field_type}")){
|
|
| 359 | + if (has_filter("geodir_cfa_default_value_{$field_type}")) {
|
|
| 360 | 360 | |
| 361 | - echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 361 | + echo apply_filters("geodir_cfa_default_value_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 362 | 362 | |
| 363 | - }else{
|
|
| 363 | + } else {
|
|
| 364 | 364 | $value = ''; |
| 365 | 365 | if (isset($field_info->default_value)) {
|
| 366 | 366 | $value = esc_attr($field_info->default_value); |
| 367 | - }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
|
|
| 367 | + }elseif (isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']) {
|
|
| 368 | 368 | $value = $cf['defaults']['default_value']; |
| 369 | 369 | } |
| 370 | 370 | ?> |
| 371 | 371 | <li> |
| 372 | - <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory');?>
|
|
| 372 | + <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory'); ?>
|
|
| 373 | 373 | <div class="gdcf-tooltip"> |
| 374 | 374 | <?php |
| 375 | 375 | if ($field_type == 'checkbox') {
|
@@ -386,12 +386,12 @@ discard block |
||
| 386 | 386 | <?php if ($field_type == 'checkbox') { ?>
|
| 387 | 387 | <select name="default_value" id="default_value"> |
| 388 | 388 | <option value=""><?php _e('Unchecked', 'geodirectory'); ?></option>
|
| 389 | - <option value="1" <?php selected(true, (int)$value === 1);?>><?php _e('Checked', 'geodirectory'); ?></option>
|
|
| 389 | + <option value="1" <?php selected(true, (int) $value === 1); ?>><?php _e('Checked', 'geodirectory'); ?></option>
|
|
| 390 | 390 | </select> |
| 391 | 391 | <?php } else if ($field_type == 'email') { ?>
|
| 392 | - <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory') ;?>" id="default_value" value="<?php echo esc_attr($value);?>" /><br/>
|
|
| 392 | + <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory'); ?>" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/>
|
|
| 393 | 393 | <?php } else { ?>
|
| 394 | - <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value);?>" /><br/> |
|
| 394 | + <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/> |
|
| 395 | 395 | <?php } ?> |
| 396 | 396 | </div> |
| 397 | 397 | </li> |
@@ -400,15 +400,15 @@ discard block |
||
| 400 | 400 | |
| 401 | 401 | |
| 402 | 402 | // show_in |
| 403 | - if(has_filter("geodir_cfa_show_in_{$field_type}")){
|
|
| 403 | + if (has_filter("geodir_cfa_show_in_{$field_type}")) {
|
|
| 404 | 404 | |
| 405 | - echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 405 | + echo apply_filters("geodir_cfa_show_in_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 406 | 406 | |
| 407 | - }else{
|
|
| 407 | + } else {
|
|
| 408 | 408 | $value = ''; |
| 409 | 409 | if (isset($field_info->show_in)) {
|
| 410 | 410 | $value = esc_attr($field_info->show_in); |
| 411 | - }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
|
|
| 411 | + }elseif (isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']) {
|
|
| 412 | 412 | $value = esc_attr($cf['defaults']['show_in']); |
| 413 | 413 | } |
| 414 | 414 | ?> |
@@ -441,18 +441,18 @@ discard block |
||
| 441 | 441 | * @param object $field_info The field being displayed info. |
| 442 | 442 | * @param string $field_info The type of field. |
| 443 | 443 | */ |
| 444 | - $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type);
|
|
| 444 | + $show_in_locations = apply_filters('geodir_show_in_locations', $show_in_locations, $field_info, $field_type);
|
|
| 445 | 445 | |
| 446 | 446 | |
| 447 | 447 | // remove some locations for some field types |
| 448 | 448 | |
| 449 | 449 | // don't show new tab option for some types |
| 450 | - if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file','address','taxonomy'))) {
|
|
| 451 | - }else{
|
|
| 450 | + if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file', 'address', 'taxonomy'))) {
|
|
| 451 | + } else {
|
|
| 452 | 452 | unset($show_in_locations['[owntab]']); |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | - if(!$display_on_listing){
|
|
| 455 | + if (!$display_on_listing) {
|
|
| 456 | 456 | unset($show_in_locations['[listings]']); |
| 457 | 457 | } |
| 458 | 458 | |
@@ -466,17 +466,17 @@ discard block |
||
| 466 | 466 | option-ajaxchosen="false"> |
| 467 | 467 | <?php |
| 468 | 468 | |
| 469 | - $show_in_values = explode(',',$value);
|
|
| 469 | + $show_in_values = explode(',', $value);
|
|
| 470 | 470 | |
| 471 | - foreach( $show_in_locations as $key => $val){
|
|
| 471 | + foreach ($show_in_locations as $key => $val) {
|
|
| 472 | 472 | $selected = ''; |
| 473 | 473 | |
| 474 | - if(is_array($show_in_values) && in_array($key,$show_in_values ) ){
|
|
| 474 | + if (is_array($show_in_values) && in_array($key, $show_in_values)) {
|
|
| 475 | 475 | $selected = 'selected'; |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | ?> |
| 479 | - <option value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $val;?></option> |
|
| 479 | + <option value="<?php echo $key; ?>" <?php echo $selected; ?>><?php echo $val; ?></option> |
|
| 480 | 480 | <?php |
| 481 | 481 | } |
| 482 | 482 | ?> |
@@ -488,9 +488,9 @@ discard block |
||
| 488 | 488 | |
| 489 | 489 | |
| 490 | 490 | // advanced_editor |
| 491 | - if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){
|
|
| 491 | + if (has_filter("geodir_cfa_advanced_editor_{$field_type}")) {
|
|
| 492 | 492 | |
| 493 | - echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 493 | + echo apply_filters("geodir_cfa_advanced_editor_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 494 | 494 | |
| 495 | 495 | } |
| 496 | 496 | |
@@ -501,10 +501,10 @@ discard block |
||
| 501 | 501 | |
| 502 | 502 | |
| 503 | 503 | <?php // @todo this does not seem to be used for anything, it can be removed or replaced ?> |
| 504 | - <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels);} ?>"/>
|
|
| 504 | + <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels); } ?>"/>
|
|
| 505 | 505 | |
| 506 | 506 | <?php // we dont need to show the sort order ?> |
| 507 | - <input type="hidden" readonly="readonly" name="sort_order" id="sort_order" value="<?php if (isset($field_info->sort_order)) { echo esc_attr($field_info->sort_order);} ?>"/>
|
|
| 507 | + <input type="hidden" readonly="readonly" name="sort_order" id="sort_order" value="<?php if (isset($field_info->sort_order)) { echo esc_attr($field_info->sort_order); } ?>"/>
|
|
| 508 | 508 | |
| 509 | 509 | |
| 510 | 510 | |
@@ -557,15 +557,15 @@ discard block |
||
| 557 | 557 | <?php |
| 558 | 558 | |
| 559 | 559 | // is_required |
| 560 | - if(has_filter("geodir_cfa_is_required_{$field_type}")){
|
|
| 560 | + if (has_filter("geodir_cfa_is_required_{$field_type}")) {
|
|
| 561 | 561 | |
| 562 | - echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 562 | + echo apply_filters("geodir_cfa_is_required_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 563 | 563 | |
| 564 | - }else{
|
|
| 564 | + } else {
|
|
| 565 | 565 | $value = ''; |
| 566 | 566 | if (isset($field_info->is_required)) {
|
| 567 | 567 | $value = esc_attr($field_info->is_required); |
| 568 | - }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
|
|
| 568 | + }elseif (isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']) {
|
|
| 569 | 569 | $value = $cf['defaults']['is_required']; |
| 570 | 570 | } |
| 571 | 571 | ?> |
@@ -578,17 +578,17 @@ discard block |
||
| 578 | 578 | |
| 579 | 579 | <div class="gd-cf-input-wrap gd-switch"> |
| 580 | 580 | |
| 581 | - <input type="radio" id="is_required_yes<?php echo $radio_id;?>" name="is_required" class="gdri-enabled" value="1" |
|
| 581 | + <input type="radio" id="is_required_yes<?php echo $radio_id; ?>" name="is_required" class="gdri-enabled" value="1" |
|
| 582 | 582 | <?php if ($value == '1') {
|
| 583 | 583 | echo 'checked'; |
| 584 | 584 | } ?>/> |
| 585 | - <label onclick="show_hide_radio(this,'show','cf-is-required-msg');" for="is_required_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 585 | + <label onclick="show_hide_radio(this,'show','cf-is-required-msg');" for="is_required_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 586 | 586 | |
| 587 | - <input type="radio" id="is_required_no<?php echo $radio_id;?>" name="is_required" class="gdri-disabled" value="0" |
|
| 587 | + <input type="radio" id="is_required_no<?php echo $radio_id; ?>" name="is_required" class="gdri-disabled" value="0" |
|
| 588 | 588 | <?php if ($value == '0' || !$value) {
|
| 589 | 589 | echo 'checked'; |
| 590 | 590 | } ?>/> |
| 591 | - <label onclick="show_hide_radio(this,'hide','cf-is-required-msg');" for="is_required_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 591 | + <label onclick="show_hide_radio(this,'hide','cf-is-required-msg');" for="is_required_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 592 | 592 | |
| 593 | 593 | </div> |
| 594 | 594 | |
@@ -598,19 +598,19 @@ discard block |
||
| 598 | 598 | } |
| 599 | 599 | |
| 600 | 600 | // required_msg |
| 601 | - if(has_filter("geodir_cfa_required_msg_{$field_type}")){
|
|
| 601 | + if (has_filter("geodir_cfa_required_msg_{$field_type}")) {
|
|
| 602 | 602 | |
| 603 | - echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 603 | + echo apply_filters("geodir_cfa_required_msg_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 604 | 604 | |
| 605 | - }else{
|
|
| 605 | + } else {
|
|
| 606 | 606 | $value = ''; |
| 607 | 607 | if (isset($field_info->required_msg)) {
|
| 608 | 608 | $value = esc_attr($field_info->required_msg); |
| 609 | - }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
|
|
| 609 | + }elseif (isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']) {
|
|
| 610 | 610 | $value = $cf['defaults']['required_msg']; |
| 611 | 611 | } |
| 612 | 612 | ?> |
| 613 | - <li class="cf-is-required-msg" <?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {echo "style='display:none;'";}?>>
|
|
| 613 | + <li class="cf-is-required-msg" <?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {echo "style='display:none;'"; }?>>
|
|
| 614 | 614 | <label for="required_msg" class="gd-cf-tooltip-wrap"> |
| 615 | 615 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Required message:', 'geodirectory'); ?>
|
| 616 | 616 | <div class="gdcf-tooltip"> |
@@ -627,31 +627,31 @@ discard block |
||
| 627 | 627 | |
| 628 | 628 | |
| 629 | 629 | // required_msg |
| 630 | - if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){
|
|
| 630 | + if (has_filter("geodir_cfa_validation_pattern_{$field_type}")) {
|
|
| 631 | 631 | |
| 632 | - echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 632 | + echo apply_filters("geodir_cfa_validation_pattern_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 633 | 633 | |
| 634 | 634 | } |
| 635 | 635 | |
| 636 | 636 | |
| 637 | 637 | // extra_fields |
| 638 | - if(has_filter("geodir_cfa_extra_fields_{$field_type}")){
|
|
| 638 | + if (has_filter("geodir_cfa_extra_fields_{$field_type}")) {
|
|
| 639 | 639 | |
| 640 | - echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 640 | + echo apply_filters("geodir_cfa_extra_fields_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 641 | 641 | |
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | |
| 645 | 645 | // field_icon |
| 646 | - if(has_filter("geodir_cfa_field_icon_{$field_type}")){
|
|
| 646 | + if (has_filter("geodir_cfa_field_icon_{$field_type}")) {
|
|
| 647 | 647 | |
| 648 | - echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 648 | + echo apply_filters("geodir_cfa_field_icon_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 649 | 649 | |
| 650 | - }else{
|
|
| 650 | + } else {
|
|
| 651 | 651 | $value = ''; |
| 652 | 652 | if (isset($field_info->field_icon)) {
|
| 653 | 653 | $value = esc_attr($field_info->field_icon); |
| 654 | - }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
|
|
| 654 | + }elseif (isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']) {
|
|
| 655 | 655 | $value = $cf['defaults']['field_icon']; |
| 656 | 656 | } |
| 657 | 657 | ?> |
@@ -662,12 +662,12 @@ discard block |
||
| 662 | 662 | <label for="field_icon" class="gd-cf-tooltip-wrap"> |
| 663 | 663 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Upload icon :', 'geodirectory'); ?>
|
| 664 | 664 | <div class="gdcf-tooltip"> |
| 665 | - <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory');?>
|
|
| 665 | + <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory'); ?>
|
|
| 666 | 666 | </div> |
| 667 | 667 | </label> |
| 668 | 668 | <div class="gd-cf-input-wrap"> |
| 669 | 669 | <input type="text" name="field_icon" id="field_icon" |
| 670 | - value="<?php echo $value;?>"/> |
|
| 670 | + value="<?php echo $value; ?>"/> |
|
| 671 | 671 | </div> |
| 672 | 672 | |
| 673 | 673 | </li> |
@@ -676,15 +676,15 @@ discard block |
||
| 676 | 676 | |
| 677 | 677 | |
| 678 | 678 | // css_class |
| 679 | - if(has_filter("geodir_cfa_css_class_{$field_type}")){
|
|
| 679 | + if (has_filter("geodir_cfa_css_class_{$field_type}")) {
|
|
| 680 | 680 | |
| 681 | - echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 681 | + echo apply_filters("geodir_cfa_css_class_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 682 | 682 | |
| 683 | - }else{
|
|
| 683 | + } else {
|
|
| 684 | 684 | $value = ''; |
| 685 | 685 | if (isset($field_info->css_class)) {
|
| 686 | 686 | $value = esc_attr($field_info->css_class); |
| 687 | - }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
|
|
| 687 | + }elseif (isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']) {
|
|
| 688 | 688 | $value = $cf['defaults']['css_class']; |
| 689 | 689 | } |
| 690 | 690 | ?> |
@@ -693,8 +693,8 @@ discard block |
||
| 693 | 693 | <label for="css_class" class="gd-cf-tooltip-wrap"> |
| 694 | 694 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Css class :', 'geodirectory'); ?>
|
| 695 | 695 | <div class="gdcf-tooltip"> |
| 696 | - <?php _e('Enter custom css class for field custom style.', 'geodirectory');?>
|
|
| 697 | - <?php if($field_type=='multiselect'){_e('(Enter class `gd-comma-list` to show list as comma separated)', 'geodirectory');}?>
|
|
| 696 | + <?php _e('Enter custom css class for field custom style.', 'geodirectory'); ?>
|
|
| 697 | + <?php if ($field_type == 'multiselect') {_e('(Enter class `gd-comma-list` to show list as comma separated)', 'geodirectory'); }?>
|
|
| 698 | 698 | </div> |
| 699 | 699 | </label> |
| 700 | 700 | <div class="gd-cf-input-wrap"> |
@@ -709,23 +709,23 @@ discard block |
||
| 709 | 709 | |
| 710 | 710 | |
| 711 | 711 | // cat_sort |
| 712 | - if(has_filter("geodir_cfa_cat_sort_{$field_type}")){
|
|
| 712 | + if (has_filter("geodir_cfa_cat_sort_{$field_type}")) {
|
|
| 713 | 713 | |
| 714 | - echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info);
|
|
| 714 | + echo apply_filters("geodir_cfa_cat_sort_{$field_type}", '', $result_str, $cf, $field_info);
|
|
| 715 | 715 | |
| 716 | - }else{
|
|
| 716 | + } else {
|
|
| 717 | 717 | $value = ''; |
| 718 | - $hide_cat_sort =''; |
|
| 718 | + $hide_cat_sort = ''; |
|
| 719 | 719 | if (isset($field_info->cat_sort)) {
|
| 720 | 720 | $value = esc_attr($field_info->cat_sort); |
| 721 | - }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
|
|
| 721 | + }elseif (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']) {
|
|
| 722 | 722 | $value = $cf['defaults']['cat_sort']; |
| 723 | - $hide_cat_sort = ($value===false) ? "style='display:none;'" : ''; |
|
| 723 | + $hide_cat_sort = ($value === false) ? "style='display:none;'" : ''; |
|
| 724 | 724 | } |
| 725 | 725 | |
| 726 | - $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : ''; |
|
| 726 | + $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort'] === false) ? "style='display:none;'" : ''; |
|
| 727 | 727 | ?> |
| 728 | - <li <?php echo $hide_cat_sort ;?>> |
|
| 728 | + <li <?php echo $hide_cat_sort; ?>> |
|
| 729 | 729 | <h3><?php |
| 730 | 730 | /** |
| 731 | 731 | * Filter the section title. |
@@ -744,23 +744,23 @@ discard block |
||
| 744 | 744 | <label for="cat_sort" class="gd-cf-tooltip-wrap"> |
| 745 | 745 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Include this field in sorting options :', 'geodirectory'); ?>
|
| 746 | 746 | <div class="gdcf-tooltip"> |
| 747 | - <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory');?>
|
|
| 747 | + <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory'); ?>
|
|
| 748 | 748 | </div> |
| 749 | 749 | </label> |
| 750 | 750 | |
| 751 | 751 | <div class="gd-cf-input-wrap gd-switch"> |
| 752 | 752 | |
| 753 | - <input type="radio" id="cat_sort_yes<?php echo $radio_id;?>" name="cat_sort" class="gdri-enabled" value="1" |
|
| 753 | + <input type="radio" id="cat_sort_yes<?php echo $radio_id; ?>" name="cat_sort" class="gdri-enabled" value="1" |
|
| 754 | 754 | <?php if ($value == '1') {
|
| 755 | 755 | echo 'checked'; |
| 756 | 756 | } ?>/> |
| 757 | - <label for="cat_sort_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 757 | + <label for="cat_sort_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
|
| 758 | 758 | |
| 759 | - <input type="radio" id="cat_sort_no<?php echo $radio_id;?>" name="cat_sort" class="gdri-disabled" value="0" |
|
| 759 | + <input type="radio" id="cat_sort_no<?php echo $radio_id; ?>" name="cat_sort" class="gdri-disabled" value="0" |
|
| 760 | 760 | <?php if (!$value) {
|
| 761 | 761 | echo 'checked'; |
| 762 | 762 | } ?>/> |
| 763 | - <label for="cat_sort_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 763 | + <label for="cat_sort_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
|
| 764 | 764 | |
| 765 | 765 | </div> |
| 766 | 766 | </li> |
@@ -787,7 +787,7 @@ discard block |
||
| 787 | 787 | * @param object $field_info The current fields info. |
| 788 | 788 | * @param array $cf The custom field settings |
| 789 | 789 | */ |
| 790 | - do_action('geodir_advance_custom_fields', $field_info,$cf);?>
|
|
| 790 | + do_action('geodir_advance_custom_fields', $field_info, $cf); ?>
|
|
| 791 | 791 | |
| 792 | 792 | |
| 793 | 793 | <?php endswitch; ?> |
@@ -799,10 +799,10 @@ discard block |
||
| 799 | 799 | <h3></h3> |
| 800 | 800 | </label> |
| 801 | 801 | <div class="gd-cf-input-wrap"> |
| 802 | - <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>"
|
|
| 802 | + <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>"
|
|
| 803 | 803 | onclick="save_field('<?php echo esc_attr($result_str); ?>')"/>
|
| 804 | 804 | <?php if (!$default): ?> |
| 805 | - <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>"
|
|
| 805 | + <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>"
|
|
| 806 | 806 | onclick="delete_field('<?php echo esc_attr($result_str); ?>', '<?php echo $nonce; ?>')"
|
| 807 | 807 | class="button"/></a> |
| 808 | 808 | <?php endif; ?> |
@@ -60,16 +60,16 @@ discard block |
||
| 60 | 60 | * @since 1.0.0 |
| 61 | 61 | * @param string $menu_class The menu HTML class. |
| 62 | 62 | */ |
| 63 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 63 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item '.$menu_class);
|
|
| 64 | 64 | /** |
| 65 | 65 | * Filter the menu a class. |
| 66 | 66 | * |
| 67 | 67 | * @since 1.0.0 |
| 68 | 68 | */ |
| 69 | 69 | $a_class = apply_filters('geodir_menu_a_class', '');
|
| 70 | - $items .= '<li class="' . $li_class . '"> |
|
| 71 | - <a href="' . get_post_type_archive_link($post_type) . '" class="' . $a_class . '"> |
|
| 72 | - ' . __(geodir_utf8_ucfirst($args->labels->name),'geodirectory') . ' |
|
| 70 | + $items .= '<li class="'.$li_class.'"> |
|
| 71 | + <a href="' . get_post_type_archive_link($post_type).'" class="'.$a_class.'"> |
|
| 72 | + ' . __(geodir_utf8_ucfirst($args->labels->name), 'geodirectory').' |
|
| 73 | 73 | </a> |
| 74 | 74 | </li>'; |
| 75 | 75 | } |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | * @since 1.0.0 |
| 89 | 89 | * @param string $menu_class The menu HTML class. |
| 90 | 90 | */ |
| 91 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-listings ' . $menu_class);
|
|
| 91 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-listings '.$menu_class);
|
|
| 92 | 92 | /** |
| 93 | 93 | * Filter the sub menu li class. |
| 94 | 94 | * |
| 95 | 95 | * @since 1.0.0 |
| 96 | 96 | * @param string $menu_class The menu HTML class. |
| 97 | 97 | */ |
| 98 | - $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 98 | + $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item '.$menu_class);
|
|
| 99 | 99 | /** |
| 100 | 100 | * Filter the sub menu ul class. |
| 101 | 101 | * |
@@ -114,9 +114,9 @@ discard block |
||
| 114 | 114 | * @since 1.0.0 |
| 115 | 115 | */ |
| 116 | 116 | $sub_a_class = apply_filters('geodir_sub_menu_a_class', '');
|
| 117 | - $items .= '<li class="' . $li_class . '"> |
|
| 118 | - <a href="#" class="' . $a_class . '">' . __('Listing', 'geodirectory') . '</a>
|
|
| 119 | - <ul class="' . $sub_ul_class . '">'; |
|
| 117 | + $items .= '<li class="'.$li_class.'"> |
|
| 118 | + <a href="#" class="' . $a_class.'">'.__('Listing', 'geodirectory').'</a>
|
|
| 119 | + <ul class="' . $sub_ul_class.'">'; |
|
| 120 | 120 | $post_types = geodir_get_posttypes('object');
|
| 121 | 121 | |
| 122 | 122 | $show_listing_post_types = get_option('geodir_add_posttype_in_listing_nav');
|
@@ -133,9 +133,9 @@ discard block |
||
| 133 | 133 | if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing'))
|
| 134 | 134 | $menu_class = 'current-menu-item'; |
| 135 | 135 | |
| 136 | - $items .= '<li class="' . $sub_li_class . '"> |
|
| 137 | - <a href="' . get_post_type_archive_link($post_type) . '" class="' . $sub_a_class . '"> |
|
| 138 | - ' . __(geodir_utf8_ucfirst($args->labels->name),'geodirectory') . ' |
|
| 136 | + $items .= '<li class="'.$sub_li_class.'"> |
|
| 137 | + <a href="' . get_post_type_archive_link($post_type).'" class="'.$sub_a_class.'"> |
|
| 138 | + ' . __(geodir_utf8_ucfirst($args->labels->name), 'geodirectory').' |
|
| 139 | 139 | </a> |
| 140 | 140 | </li>'; |
| 141 | 141 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * |
| 152 | 152 | * @since 1.5.9 |
| 153 | 153 | */ |
| 154 | - $items .= apply_filters('geodir_menu_after_sub_ul','');
|
|
| 154 | + $items .= apply_filters('geodir_menu_after_sub_ul', '');
|
|
| 155 | 155 | $items .= '</li>'; |
| 156 | 156 | } |
| 157 | 157 | } |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | * @since 1.0.0 |
| 185 | 185 | * @param string $menu_class The menu HTML class. |
| 186 | 186 | */ |
| 187 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 187 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item '.$menu_class);
|
|
| 188 | 188 | /** |
| 189 | 189 | * Filter the menu a class. |
| 190 | 190 | * |
@@ -192,9 +192,9 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | $a_class = apply_filters('geodir_menu_a_class', '');
|
| 194 | 194 | $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
| 195 | - $items .= '<li class="' . $li_class . '"> |
|
| 196 | - <a href="' . geodir_get_addlisting_link($post_type) . '" class="' . $a_class . '"> |
|
| 197 | - ' . sprintf( __('Add %s', 'geodirectory'), $cpt_name ) . '
|
|
| 195 | + $items .= '<li class="'.$li_class.'"> |
|
| 196 | + <a href="' . geodir_get_addlisting_link($post_type).'" class="'.$a_class.'"> |
|
| 197 | + ' . sprintf(__('Add %s', 'geodirectory'), $cpt_name).'
|
|
| 198 | 198 | </a> |
| 199 | 199 | </li>'; |
| 200 | 200 | } |
@@ -218,14 +218,14 @@ discard block |
||
| 218 | 218 | * @since 1.0.0 |
| 219 | 219 | * @param string $menu_class The menu HTML class. |
| 220 | 220 | */ |
| 221 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-add-listing ' . $menu_class);
|
|
| 221 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-add-listing '.$menu_class);
|
|
| 222 | 222 | /** |
| 223 | 223 | * Filter the sub menu li class. |
| 224 | 224 | * |
| 225 | 225 | * @since 1.0.0 |
| 226 | 226 | * @param string $menu_class The menu HTML class. |
| 227 | 227 | */ |
| 228 | - $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 228 | + $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item '.$menu_class);
|
|
| 229 | 229 | /** |
| 230 | 230 | * Filter the sub menu ul class. |
| 231 | 231 | * |
@@ -244,9 +244,9 @@ discard block |
||
| 244 | 244 | * @since 1.0.0 |
| 245 | 245 | */ |
| 246 | 246 | $sub_a_class = apply_filters('geodir_sub_menu_a_class', '');
|
| 247 | - $items .= '<li class="' . $li_class . '"> |
|
| 248 | - <a href="#" class="' . $a_class . '">' . __('Add Listing', 'geodirectory') . '</a>
|
|
| 249 | - <ul class="' . $sub_ul_class . '">'; |
|
| 247 | + $items .= '<li class="'.$li_class.'"> |
|
| 248 | + <a href="#" class="' . $a_class.'">'.__('Add Listing', 'geodirectory').'</a>
|
|
| 249 | + <ul class="' . $sub_ul_class.'">'; |
|
| 250 | 250 | |
| 251 | 251 | $post_types = geodir_get_posttypes('object');
|
| 252 | 252 | |
@@ -269,11 +269,11 @@ discard block |
||
| 269 | 269 | * @since 1.0.0 |
| 270 | 270 | * @param string $menu_class The menu HTML class. |
| 271 | 271 | */ |
| 272 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 272 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item '.$menu_class);
|
|
| 273 | 273 | $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
| 274 | - $items .= '<li class="' . $sub_li_class . '"> |
|
| 275 | - <a href="' . geodir_get_addlisting_link($post_type) . '" class="' . $sub_a_class . '"> |
|
| 276 | - ' . sprintf( __('Add %s', 'geodirectory'), $cpt_name ) . '
|
|
| 274 | + $items .= '<li class="'.$sub_li_class.'"> |
|
| 275 | + <a href="' . geodir_get_addlisting_link($post_type).'" class="'.$sub_a_class.'"> |
|
| 276 | + ' . sprintf(__('Add %s', 'geodirectory'), $cpt_name).'
|
|
| 277 | 277 | </a> |
| 278 | 278 | </li>'; |
| 279 | 279 | } |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | $items .= ' </ul> '; |
| 288 | - $items .= apply_filters('geodir_menu_after_sub_ul','');
|
|
| 288 | + $items .= apply_filters('geodir_menu_after_sub_ul', '');
|
|
| 289 | 289 | $items .= '</li>'; |
| 290 | 290 | |
| 291 | 291 | } |
@@ -313,14 +313,14 @@ discard block |
||
| 313 | 313 | $geodir_theme_location = get_option('geodir_theme_location_nav');
|
| 314 | 314 | $geodir_theme_location_nav = array(); |
| 315 | 315 | if (empty($locations) && empty($geodir_theme_location)) {
|
| 316 | - $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu);
|
|
| 316 | + $menu = str_replace("</ul></div>", geodir_add_nav_menu_items()."</ul></div>", $menu);
|
|
| 317 | 317 | $geodir_theme_location_nav[] = $args['theme_location']; |
| 318 | 318 | update_option('geodir_theme_location_nav', $geodir_theme_location_nav);
|
| 319 | 319 | } |
| 320 | 320 | //else if(empty($geodir_theme_location)) // It means 'Show geodirectory navigation in selected menu locations' is not set yet. |
| 321 | 321 | // $menu = str_replace("</ul></div>",geodir_add_nav_menu_items()."</ul></div>",$menu);
|
| 322 | 322 | else if (is_array($geodir_theme_location) && isset($args['theme_location']) && in_array($args['theme_location'], $geodir_theme_location)) |
| 323 | - $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu);
|
|
| 323 | + $menu = str_replace("</ul></div>", geodir_add_nav_menu_items()."</ul></div>", $menu);
|
|
| 324 | 324 | |
| 325 | 325 | return $menu; |
| 326 | 326 | |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | |
| 349 | 349 | if (has_nav_menu($location) == '1' && is_array($geodir_theme_location) && in_array($location, $geodir_theme_location)) {
|
| 350 | 350 | |
| 351 | - $items = $items . geodir_add_nav_menu_items(); |
|
| 351 | + $items = $items.geodir_add_nav_menu_items(); |
|
| 352 | 352 | return $items; |
| 353 | 353 | |
| 354 | 354 | } else {
|
@@ -373,12 +373,12 @@ discard block |
||
| 373 | 373 | |
| 374 | 374 | $taxonomies = geodir_get_taxonomies(); |
| 375 | 375 | $taxonomies = implode("','", $taxonomies);
|
| 376 | - $taxonomies = "'" . $taxonomies . "'"; |
|
| 376 | + $taxonomies = "'".$taxonomies."'"; |
|
| 377 | 377 | |
| 378 | 378 | $pn_categories = $wpdb->get_results( |
| 379 | 379 | $wpdb->prepare( |
| 380 | 380 | "SELECT $wpdb->terms.name as name, $wpdb->term_taxonomy.count as count, $wpdb->terms.term_id as cat_ID FROM $wpdb->term_taxonomy, $wpdb->terms WHERE $wpdb->term_taxonomy.term_id = %d AND $wpdb->term_taxonomy.taxonomy in ( $taxonomies ) ORDER BY name", |
| 381 | - array($wpdb->terms . term_id) |
|
| 381 | + array($wpdb->terms.term_id) |
|
| 382 | 382 | ) |
| 383 | 383 | ); |
| 384 | 384 | |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | |
| 409 | 409 | if (geodir_is_page('add-listing') || geodir_is_page('preview')) {
|
| 410 | 410 | if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
| 411 | - $geodir_post_type = get_post_type((int)$_REQUEST['pid']); |
|
| 411 | + $geodir_post_type = get_post_type((int) $_REQUEST['pid']); |
|
| 412 | 412 | elseif (isset($_REQUEST['listing_type'])) |
| 413 | 413 | $geodir_post_type = sanitize_text_field($_REQUEST['listing_type']); |
| 414 | 414 | } |
@@ -434,7 +434,7 @@ discard block |
||
| 434 | 434 | if (is_array($all_postypes) && !in_array($geodir_post_type, $all_postypes)) |
| 435 | 435 | $geodir_post_type = ''; |
| 436 | 436 | |
| 437 | - if( defined( 'DOING_AJAX' ) && isset($_REQUEST['stype'])){
|
|
| 437 | + if (defined('DOING_AJAX') && isset($_REQUEST['stype'])) {
|
|
| 438 | 438 | $geodir_post_type = sanitize_text_field($_REQUEST['stype']); |
| 439 | 439 | } |
| 440 | 440 | |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | * |
| 445 | 445 | * @since 1.6.9 |
| 446 | 446 | */ |
| 447 | - return apply_filters('geodir_get_current_posttype',$geodir_post_type);
|
|
| 447 | + return apply_filters('geodir_get_current_posttype', $geodir_post_type);
|
|
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | /** |
@@ -458,18 +458,18 @@ discard block |
||
| 458 | 458 | */ |
| 459 | 459 | function geodir_get_default_posttype() |
| 460 | 460 | {
|
| 461 | - $post_types = apply_filters( 'geodir_get_default_posttype', geodir_get_posttypes( 'object' ) ); |
|
| 461 | + $post_types = apply_filters('geodir_get_default_posttype', geodir_get_posttypes('object'));
|
|
| 462 | 462 | |
| 463 | 463 | $stype = false; |
| 464 | - foreach ( $post_types as $post_type => $info ) {
|
|
| 464 | + foreach ($post_types as $post_type => $info) {
|
|
| 465 | 465 | global $wpdb; |
| 466 | - $has_posts = $wpdb->get_row( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_status='publish' LIMIT 1", $post_type ) ); |
|
| 467 | - if ( $has_posts ) {
|
|
| 466 | + $has_posts = $wpdb->get_row($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_status='publish' LIMIT 1", $post_type));
|
|
| 467 | + if ($has_posts) {
|
|
| 468 | 468 | $stype = $post_type; break; |
| 469 | 469 | } |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | - if(!$stype){
|
|
| 472 | + if (!$stype) {
|
|
| 473 | 473 | $stype = 'gd_place'; |
| 474 | 474 | } |
| 475 | 475 | |
@@ -494,14 +494,14 @@ discard block |
||
| 494 | 494 | switch ($output): |
| 495 | 495 | case 'object': |
| 496 | 496 | case 'Object': |
| 497 | - $post_types = json_decode(json_encode($post_types), FALSE);//(object)$post_types; |
|
| 497 | + $post_types = json_decode(json_encode($post_types), FALSE); //(object)$post_types; |
|
| 498 | 498 | break; |
| 499 | 499 | case 'array': |
| 500 | 500 | case 'Array': |
| 501 | - $post_types = (array)$post_types; |
|
| 501 | + $post_types = (array) $post_types; |
|
| 502 | 502 | break; |
| 503 | 503 | case 'options': |
| 504 | - $post_types = (array)$post_types; |
|
| 504 | + $post_types = (array) $post_types; |
|
| 505 | 505 | |
| 506 | 506 | $options = array(); |
| 507 | 507 | if (!empty($post_types)) {
|
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | $gd_taxonomies[] = $taxonomy; |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | - if ($tages_taxonomies === false && substr($taxonomy , -5) == '_tags') {
|
|
| 572 | + if ($tages_taxonomies === false && substr($taxonomy, -5) == '_tags') {
|
|
| 573 | 573 | if (array_search($taxonomy, $gd_taxonomies) !== false) {
|
| 574 | 574 | unset($gd_taxonomies[array_search($taxonomy, $gd_taxonomies)]); |
| 575 | 575 | } |
@@ -615,15 +615,15 @@ discard block |
||
| 615 | 615 | |
| 616 | 616 | $categories = get_terms($taxonomies); |
| 617 | 617 | |
| 618 | - $html .= '<option value="0">' . __('All', 'geodirectory') . '</option>';
|
|
| 618 | + $html .= '<option value="0">'.__('All', 'geodirectory').'</option>';
|
|
| 619 | 619 | |
| 620 | 620 | foreach ($categories as $category_obj) {
|
| 621 | 621 | $select_opt = ''; |
| 622 | 622 | if ($selected == $category_obj->term_id) {
|
| 623 | 623 | $select_opt = 'selected="selected"'; |
| 624 | 624 | } |
| 625 | - $html .= '<option ' . $select_opt . ' value="' . $category_obj->term_id . '">' |
|
| 626 | - . geodir_utf8_ucfirst($category_obj->name) . '</option>'; |
|
| 625 | + $html .= '<option '.$select_opt.' value="'.$category_obj->term_id.'">' |
|
| 626 | + . geodir_utf8_ucfirst($category_obj->name).'</option>'; |
|
| 627 | 627 | } |
| 628 | 628 | |
| 629 | 629 | if ($echo) |
@@ -691,7 +691,7 @@ discard block |
||
| 691 | 691 | } elseif (isset($wp_query->tax_query->queries)) {
|
| 692 | 692 | $tax_arr = $wp_query->tax_query->queries; |
| 693 | 693 | //if tax query has 'relation' set then it will break wp_list_pluck so we remove it |
| 694 | - if(isset( $tax_arr['relation'])){unset( $tax_arr['relation']);}
|
|
| 694 | + if (isset($tax_arr['relation'])) {unset($tax_arr['relation']); }
|
|
| 695 | 695 | $taxonomies = wp_list_pluck($tax_arr, 'taxonomy'); |
| 696 | 696 | } |
| 697 | 697 | |
@@ -745,7 +745,7 @@ discard block |
||
| 745 | 745 | |
| 746 | 746 | if ((!geodir_is_page('listing')) || (is_search() && $_REQUEST['search_taxonomy'] == '')) {
|
| 747 | 747 | if ($cat_parent == 0) {
|
| 748 | - $list_class = 'main_list gd-parent-cats-list gd-cats-display-' . $cat_display; |
|
| 748 | + $list_class = 'main_list gd-parent-cats-list gd-cats-display-'.$cat_display; |
|
| 749 | 749 | $main_list_class = 'class="main_list_selecter"'; |
| 750 | 750 | } else {
|
| 751 | 751 | //$display = 'display:none'; |
@@ -755,7 +755,7 @@ discard block |
||
| 755 | 755 | |
| 756 | 756 | if ($cat_display == 'checkbox' || $cat_display == 'radio') {
|
| 757 | 757 | $p = 0; |
| 758 | - $out = '<div class="' . $list_class . ' gd-cat-row-' . $cat_parent . '" style="margin-left:' . $p . 'px;' . $display . ';">'; |
|
| 758 | + $out = '<div class="'.$list_class.' gd-cat-row-'.$cat_parent.'" style="margin-left:'.$p.'px;'.$display.';">'; |
|
| 759 | 759 | } |
| 760 | 760 | |
| 761 | 761 | foreach ($cat_terms as $cat_term) {
|
@@ -770,12 +770,12 @@ discard block |
||
| 770 | 770 | } |
| 771 | 771 | |
| 772 | 772 | if ($cat_display == 'radio') |
| 773 | - $out .= '<span style="display:block" ><input type="radio" field_type="radio" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . geodir_utf8_ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . geodir_utf8_ucfirst($cat_term->name) . '</span>'; |
|
| 773 | + $out .= '<span style="display:block" ><input type="radio" field_type="radio" name="post_category['.$cat_term->taxonomy.'][]" '.$main_list_class.' alt="'.$cat_term->taxonomy.'" title="'.geodir_utf8_ucfirst($cat_term->name).'" value="'.$cat_term->term_id.'" '.$checked.$onchange.' id="gd-cat-'.$cat_term->term_id.'" >'.$term_check.geodir_utf8_ucfirst($cat_term->name).'</span>'; |
|
| 774 | 774 | elseif ($cat_display == 'select' || $cat_display == 'multiselect') |
| 775 | - $out .= '<option ' . $main_list_class . ' style="margin-left:' . $p . 'px;" alt="' . $cat_term->taxonomy . '" title="' . geodir_utf8_ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' >' . $term_check . geodir_utf8_ucfirst($cat_term->name) . '</option>'; |
|
| 775 | + $out .= '<option '.$main_list_class.' style="margin-left:'.$p.'px;" alt="'.$cat_term->taxonomy.'" title="'.geodir_utf8_ucfirst($cat_term->name).'" value="'.$cat_term->term_id.'" '.$checked.$onchange.' >'.$term_check.geodir_utf8_ucfirst($cat_term->name).'</option>'; |
|
| 776 | 776 | |
| 777 | 777 | else {
|
| 778 | - $out .= '<span style="display:block"><input style="display:inline-block" type="checkbox" field_type="checkbox" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . geodir_utf8_ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . geodir_utf8_ucfirst($cat_term->name) . '</span>'; |
|
| 778 | + $out .= '<span style="display:block"><input style="display:inline-block" type="checkbox" field_type="checkbox" name="post_category['.$cat_term->taxonomy.'][]" '.$main_list_class.' alt="'.$cat_term->taxonomy.'" title="'.geodir_utf8_ucfirst($cat_term->name).'" value="'.$cat_term->term_id.'" '.$checked.$onchange.' id="gd-cat-'.$cat_term->term_id.'" >'.$term_check.geodir_utf8_ucfirst($cat_term->name).'</span>'; |
|
| 779 | 779 | } |
| 780 | 780 | |
| 781 | 781 | // Call recurson to print sub cats |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | $cat_exclude = serialize($exclude_cats); |
| 815 | 815 | |
| 816 | 816 | if (isset($_REQUEST['backandedit'])) {
|
| 817 | - $post = (object)$gd_session->get('listing');
|
|
| 817 | + $post = (object) $gd_session->get('listing');
|
|
| 818 | 818 | |
| 819 | 819 | if (!is_array($post->post_category[$cat_taxonomy])) |
| 820 | 820 | $post_category = $post->post_category[$cat_taxonomy]; |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | |
| 847 | 847 | if (!empty($post_category)) {
|
| 848 | 848 | $cat1 = array_filter(explode(',', $post_category));
|
| 849 | - $post_category = ',' . implode(',', $cat1) . ',';
|
|
| 849 | + $post_category = ','.implode(',', $cat1).',';
|
|
| 850 | 850 | |
| 851 | 851 | } |
| 852 | 852 | |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | foreach ($post_category_upd as $cat) {
|
| 858 | 858 | |
| 859 | 859 | if (!in_array($cat, $exclude_cats) && $cat != '') {
|
| 860 | - $post_category_change .= ',' . $cat; |
|
| 860 | + $post_category_change .= ','.$cat; |
|
| 861 | 861 | } |
| 862 | 862 | } |
| 863 | 863 | $post_category = $post_category_change; |
@@ -869,11 +869,11 @@ discard block |
||
| 869 | 869 | } |
| 870 | 870 | } |
| 871 | 871 | |
| 872 | - echo '<input type="hidden" id="cat_limit" value="' . $cat_limit . '" name="cat_limit[' . $cat_taxonomy . ']" />'; |
|
| 872 | + echo '<input type="hidden" id="cat_limit" value="'.$cat_limit.'" name="cat_limit['.$cat_taxonomy.']" />'; |
|
| 873 | 873 | |
| 874 | - echo '<input type="hidden" id="post_category" value="' . $post_category . '" name="post_category[' . $cat_taxonomy . ']" />'; |
|
| 874 | + echo '<input type="hidden" id="post_category" value="'.$post_category.'" name="post_category['.$cat_taxonomy.']" />'; |
|
| 875 | 875 | |
| 876 | - echo '<input type="hidden" id="post_category_str" value="' . $post_category_str . '" name="post_category_str[' . $cat_taxonomy . ']" />'; |
|
| 876 | + echo '<input type="hidden" id="post_category_str" value="'.$post_category_str.'" name="post_category_str['.$cat_taxonomy.']" />'; |
|
| 877 | 877 | |
| 878 | 878 | |
| 879 | 879 | ?> |
@@ -892,14 +892,14 @@ discard block |
||
| 892 | 892 | |
| 893 | 893 | function show_subcatlist(main_cat, catObj) {
|
| 894 | 894 | if (main_cat != '') {
|
| 895 | - var url = '<?php echo geodir_get_ajax_url();?>'; |
|
| 896 | - var cat_taxonomy = '<?php echo $cat_taxonomy;?>'; |
|
| 897 | - var cat_exclude = '<?php echo base64_encode($cat_exclude);?>'; |
|
| 895 | + var url = '<?php echo geodir_get_ajax_url(); ?>'; |
|
| 896 | + var cat_taxonomy = '<?php echo $cat_taxonomy; ?>'; |
|
| 897 | + var cat_exclude = '<?php echo base64_encode($cat_exclude); ?>'; |
|
| 898 | 898 | var cat_limit = jQuery('#' + cat_taxonomy).find('#cat_limit').val();
|
| 899 | - <?php if ((int)$cat_limit > 0) { ?>
|
|
| 899 | + <?php if ((int) $cat_limit > 0) { ?>
|
|
| 900 | 900 | var selected = parseInt(jQuery('#' + cat_taxonomy).find('.cat_sublist > div.post_catlist_item').length);
|
| 901 | 901 | if (cat_limit != '' && selected > 0 && selected >= cat_limit && cat_limit != 0) {
|
| 902 | - alert("<?php echo esc_attr(wp_sprintf(__('You have reached category limit of %d categories.', 'geodirectory'), (int)$cat_limit));?>");
|
|
| 902 | + alert("<?php echo esc_attr(wp_sprintf(__('You have reached category limit of %d categories.', 'geodirectory'), (int) $cat_limit)); ?>");
|
|
| 903 | 903 | return false; |
| 904 | 904 | } |
| 905 | 905 | <?php } ?> |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | } |
| 939 | 939 | |
| 940 | 940 | function update_listing_cat(el) {
|
| 941 | - var cat_taxonomy = '<?php echo $cat_taxonomy;?>'; |
|
| 941 | + var cat_taxonomy = '<?php echo $cat_taxonomy; ?>'; |
|
| 942 | 942 | var cat_ids = ''; |
| 943 | 943 | var main_cat = ''; |
| 944 | 944 | var sub_cat = ''; |
@@ -1019,7 +1019,7 @@ discard block |
||
| 1019 | 1019 | <div class="main_cat_list" style=" <?php if (isset($style)) {
|
| 1020 | 1020 | echo $style; |
| 1021 | 1021 | }?> "> |
| 1022 | - <?php geodir_get_catlist($cat_taxonomy, 0); // print main categories list |
|
| 1022 | + <?php geodir_get_catlist($cat_taxonomy, 0); // print main categories list |
|
| 1023 | 1023 | ?> |
| 1024 | 1024 | </div> |
| 1025 | 1025 | <?php |
@@ -1046,9 +1046,9 @@ discard block |
||
| 1046 | 1046 | if ($exclude != '') {
|
| 1047 | 1047 | $exclude_cats = maybe_unserialize(base64_decode($exclude)); |
| 1048 | 1048 | |
| 1049 | - if(is_array( $exclude_cats)){
|
|
| 1050 | - $exclude_cats = array_map( 'intval', $exclude_cats ); |
|
| 1051 | - }else{
|
|
| 1049 | + if (is_array($exclude_cats)) {
|
|
| 1050 | + $exclude_cats = array_map('intval', $exclude_cats);
|
|
| 1051 | + } else {
|
|
| 1052 | 1052 | $exclude_cats = intval($exclude_cats); |
| 1053 | 1053 | } |
| 1054 | 1054 | |
@@ -1062,25 +1062,25 @@ discard block |
||
| 1062 | 1062 | <?php $main_cat = get_term($parrent, $request_taxonomy); ?> |
| 1063 | 1063 | |
| 1064 | 1064 | <div class="post_catlist_item" style="border:1px solid #CCCCCC; margin:5px auto; padding:5px;"> |
| 1065 | - <img alt="move icon" src="<?php echo geodir_plugin_url() . '/geodirectory-assets/images/move.png';?>" |
|
| 1065 | + <img alt="move icon" src="<?php echo geodir_plugin_url().'/geodirectory-assets/images/move.png'; ?>" |
|
| 1066 | 1066 | onclick="jQuery(this).closest('div').remove();update_listing_cat(this);" align="right"/>
|
| 1067 | 1067 | <?php /* ?> |
| 1068 | 1068 | <img src="<?php echo geodir_plugin_url().'/geodirectory-assets/images/move.png';?>" onclick="jQuery(this).closest('div').remove();show_subcatlist();" align="right" />
|
| 1069 | 1069 | <?php */ ?> |
| 1070 | 1070 | |
| 1071 | - <input type="checkbox" value="<?php echo $main_cat->term_id;?>" class="listing_main_cat" |
|
| 1071 | + <input type="checkbox" value="<?php echo $main_cat->term_id; ?>" class="listing_main_cat" |
|
| 1072 | 1072 | onchange="if(jQuery(this).is(':checked')){jQuery(this).closest('div').find('.post_default_category').prop('checked',false).show();}else{jQuery(this).closest('div').find('.post_default_category').prop('checked',false).hide();};update_listing_cat()"
|
| 1073 | 1073 | checked="checked" disabled="disabled"/> |
| 1074 | 1074 | <span> |
| 1075 | - <?php printf(__('Add listing in %s category', 'geodirectory'), geodir_ucwords($main_cat->name));?>
|
|
| 1075 | + <?php printf(__('Add listing in %s category', 'geodirectory'), geodir_ucwords($main_cat->name)); ?>
|
|
| 1076 | 1076 | </span> |
| 1077 | 1077 | <br/> |
| 1078 | 1078 | |
| 1079 | 1079 | <div class="post_default_category"> |
| 1080 | - <input type="radio" name="post_default_category" value="<?php echo $main_cat->term_id;?>" |
|
| 1081 | - onchange="update_listing_cat()" <?php if ($default) echo ' checked="checked" ';?> /> |
|
| 1080 | + <input type="radio" name="post_default_category" value="<?php echo $main_cat->term_id; ?>" |
|
| 1081 | + onchange="update_listing_cat()" <?php if ($default) echo ' checked="checked" '; ?> /> |
|
| 1082 | 1082 | <span> |
| 1083 | - <?php printf(__('Set %s as default category', 'geodirectory'), geodir_ucwords($main_cat->name));?>
|
|
| 1083 | + <?php printf(__('Set %s as default category', 'geodirectory'), geodir_ucwords($main_cat->name)); ?>
|
|
| 1084 | 1084 | </span> |
| 1085 | 1085 | </div> |
| 1086 | 1086 | |
@@ -1113,7 +1113,7 @@ discard block |
||
| 1113 | 1113 | $post_cat_str = $post_categories[$request_taxonomy]; |
| 1114 | 1114 | $post_cat_array = explode("#", $post_cat_str);
|
| 1115 | 1115 | if (is_array($post_cat_array)) {
|
| 1116 | - $post_cat_array = array_unique( $post_cat_array ); |
|
| 1116 | + $post_cat_array = array_unique($post_cat_array); |
|
| 1117 | 1117 | |
| 1118 | 1118 | foreach ($post_cat_array as $post_cat_html) {
|
| 1119 | 1119 | |
@@ -1128,7 +1128,7 @@ discard block |
||
| 1128 | 1128 | } |
| 1129 | 1129 | $post_sub_catid = ''; |
| 1130 | 1130 | if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) {
|
| 1131 | - $post_sub_catid = (int)$post_cat_info[1]; |
|
| 1131 | + $post_sub_catid = (int) $post_cat_info[1]; |
|
| 1132 | 1132 | } |
| 1133 | 1133 | |
| 1134 | 1134 | geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
@@ -1149,7 +1149,7 @@ discard block |
||
| 1149 | 1149 | } |
| 1150 | 1150 | |
| 1151 | 1151 | if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) {
|
| 1152 | - $post_sub_catid = (int)$post_cat_info[1]; |
|
| 1152 | + $post_sub_catid = (int) $post_cat_info[1]; |
|
| 1153 | 1153 | } |
| 1154 | 1154 | |
| 1155 | 1155 | geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
@@ -1181,9 +1181,9 @@ discard block |
||
| 1181 | 1181 | if (!$selected) |
| 1182 | 1182 | $option_slected = ' selected="selected" '; |
| 1183 | 1183 | |
| 1184 | - echo '<select field_type="select" id="' . sanitize_text_field($cat_taxonomy) . '" class="chosen_select" ' . $onchange . ' option-ajaxChosen="false" >'; |
|
| 1184 | + echo '<select field_type="select" id="'.sanitize_text_field($cat_taxonomy).'" class="chosen_select" '.$onchange.' option-ajaxChosen="false" >'; |
|
| 1185 | 1185 | |
| 1186 | - echo '<option value="" ' . $option_selected . ' >' . __('Select Category', 'geodirectory') . '</option>';
|
|
| 1186 | + echo '<option value="" '.$option_selected.' >'.__('Select Category', 'geodirectory').'</option>';
|
|
| 1187 | 1187 | |
| 1188 | 1188 | foreach ($cat_terms as $cat_term) {
|
| 1189 | 1189 | $option_selected = ''; |
@@ -1191,10 +1191,10 @@ discard block |
||
| 1191 | 1191 | $option_selected = ' selected="selected" '; |
| 1192 | 1192 | |
| 1193 | 1193 | // Count child terms |
| 1194 | - $child_terms = get_terms( $cat_taxonomy, array( 'parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1 ) ); |
|
| 1195 | - $has_child = !empty( $child_terms ) ? 't' : 'f'; |
|
| 1194 | + $child_terms = get_terms($cat_taxonomy, array('parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1));
|
|
| 1195 | + $has_child = !empty($child_terms) ? 't' : 'f'; |
|
| 1196 | 1196 | |
| 1197 | - echo '<option ' . $option_selected . ' alt="' . $cat_term->taxonomy . '" title="' . geodir_utf8_ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" _hc="' . $has_child . '" >' . geodir_utf8_ucfirst($cat_term->name) . '</option>'; |
|
| 1197 | + echo '<option '.$option_selected.' alt="'.$cat_term->taxonomy.'" title="'.geodir_utf8_ucfirst($cat_term->name).'" value="'.$cat_term->term_id.'" _hc="'.$has_child.'" >'.geodir_utf8_ucfirst($cat_term->name).'</option>'; |
|
| 1198 | 1198 | } |
| 1199 | 1199 | echo '</select>'; |
| 1200 | 1200 | } |
@@ -1225,7 +1225,7 @@ discard block |
||
| 1225 | 1225 | 2 => __('Custom field updated.', 'geodirectory'),
|
| 1226 | 1226 | 3 => __('Custom field deleted.', 'geodirectory'),
|
| 1227 | 1227 | 4 => sprintf(__('%s updated.', 'geodirectory'), $post_object->labels->singular_name),
|
| 1228 | - 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'geodirectory'), $post_object->labels->singular_name, wp_post_revision_title((int)$_GET['revision'], false)) : false,
|
|
| 1228 | + 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'geodirectory'), $post_object->labels->singular_name, wp_post_revision_title((int) $_GET['revision'], false)) : false,
|
|
| 1229 | 1229 | 6 => sprintf(__('%s published. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name),
|
| 1230 | 1230 | 7 => sprintf(__('%s saved.', 'geodirectory'), $post_object->labels->singular_name),
|
| 1231 | 1231 | 8 => sprintf(__('%s submitted. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name),
|
@@ -1251,7 +1251,7 @@ discard block |
||
| 1251 | 1251 | |
| 1252 | 1252 | global $wpdb; |
| 1253 | 1253 | |
| 1254 | - $menu_icon = geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico'; |
|
| 1254 | + $menu_icon = geodir_plugin_url().'/geodirectory-assets/images/favicon.ico'; |
|
| 1255 | 1255 | |
| 1256 | 1256 | if (!$listing_slug = get_option('geodir_listing_prefix'))
|
| 1257 | 1257 | $listing_slug = 'places'; |
@@ -1264,11 +1264,11 @@ discard block |
||
| 1264 | 1264 | |
| 1265 | 1265 | $gd_placetags = array(); |
| 1266 | 1266 | $gd_placetags['object_type'] = 'gd_place'; |
| 1267 | - $gd_placetags['listing_slug'] = $listing_slug . '/tags'; |
|
| 1267 | + $gd_placetags['listing_slug'] = $listing_slug.'/tags'; |
|
| 1268 | 1268 | $gd_placetags['args'] = array( |
| 1269 | 1269 | 'public' => true, |
| 1270 | 1270 | 'hierarchical' => false, |
| 1271 | - 'rewrite' => array('slug' => $listing_slug . '/tags', 'with_front' => false, 'hierarchical' => true),
|
|
| 1271 | + 'rewrite' => array('slug' => $listing_slug.'/tags', 'with_front' => false, 'hierarchical' => true),
|
|
| 1272 | 1272 | 'query_var' => true, |
| 1273 | 1273 | |
| 1274 | 1274 | 'labels' => array( |
@@ -1362,7 +1362,7 @@ discard block |
||
| 1362 | 1362 | 'menu_icon' => $menu_icon, |
| 1363 | 1363 | 'public' => true, |
| 1364 | 1364 | 'query_var' => true, |
| 1365 | - 'rewrite' => array('slug' => $listing_slug , 'with_front' => false, 'hierarchical' => true, 'feeds' => true),
|
|
| 1365 | + 'rewrite' => array('slug' => $listing_slug, 'with_front' => false, 'hierarchical' => true, 'feeds' => true),
|
|
| 1366 | 1366 | 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'comments', /*'revisions', 'post-formats'*/),
|
| 1367 | 1367 | 'taxonomies' => array('gd_placecategory', 'gd_place_tags'));
|
| 1368 | 1368 | |
@@ -1395,12 +1395,12 @@ discard block |
||
| 1395 | 1395 | return $_REQUEST['lang']; |
| 1396 | 1396 | } |
| 1397 | 1397 | |
| 1398 | - $url = str_replace(array("http://","https://"),"",$url);
|
|
| 1398 | + $url = str_replace(array("http://", "https://"), "", $url);
|
|
| 1399 | 1399 | |
| 1400 | 1400 | // site_url() seems to work better than get_bloginfo('url') here, WPML can change get_bloginfo('url') to add the lang.
|
| 1401 | - $site_url = str_replace(array("http://","https://"),"",site_url());
|
|
| 1401 | + $site_url = str_replace(array("http://", "https://"), "", site_url());
|
|
| 1402 | 1402 | |
| 1403 | - $url = str_replace($site_url,"",$url); |
|
| 1403 | + $url = str_replace($site_url, "", $url); |
|
| 1404 | 1404 | |
| 1405 | 1405 | $segments = explode('/', trim($url, '/'));
|
| 1406 | 1406 | |
@@ -1456,7 +1456,7 @@ discard block |
||
| 1456 | 1456 | |
| 1457 | 1457 | global $wpdb, $wp_query, $plugin_prefix, $post, $comment_post_cache, $gd_permalink_cache; |
| 1458 | 1458 | if (isset($post_obj->ID) && isset($post->ID) && $post_obj->ID == $post->ID) {
|
| 1459 | - if($post_obj->post_status == 'auto-draft' || $post_obj->post_status == 'draft' || $post_obj->post_status == 'pending'){return $post_link;}
|
|
| 1459 | + if ($post_obj->post_status == 'auto-draft' || $post_obj->post_status == 'draft' || $post_obj->post_status == 'pending') {return $post_link; }
|
|
| 1460 | 1460 | } elseif (isset($post_obj->post_status) && ($post_obj->post_status == 'auto-draft' || $post_obj->post_status == 'draft' || $post_obj->post_status == 'pending')) {
|
| 1461 | 1461 | return $post_link; |
| 1462 | 1462 | } else {
|
@@ -1470,9 +1470,9 @@ discard block |
||
| 1470 | 1470 | |
| 1471 | 1471 | |
| 1472 | 1472 | // if we dont have a GD post then try to grab it |
| 1473 | - if(!isset($post->default_category)){
|
|
| 1473 | + if (!isset($post->default_category)) {
|
|
| 1474 | 1474 | $gd_post = geodir_get_post_info($post->ID); |
| 1475 | - if(!empty($gd_post)){
|
|
| 1475 | + if (!empty($gd_post)) {
|
|
| 1476 | 1476 | $post = $gd_post; |
| 1477 | 1477 | } |
| 1478 | 1478 | } |
@@ -1482,17 +1482,17 @@ discard block |
||
| 1482 | 1482 | $slug = $post_types[$post->post_type]['rewrite']['slug']; |
| 1483 | 1483 | |
| 1484 | 1484 | // Alter the CPT slug if WPML is set to do so |
| 1485 | - if(geodir_wpml_is_post_type_translated($post->post_type)){
|
|
| 1486 | - if ( gd_wpml_slug_translation_turned_on( $post->post_type ) && $language_code = gd_wpml_get_lang_from_url($post_link)) {
|
|
| 1485 | + if (geodir_wpml_is_post_type_translated($post->post_type)) {
|
|
| 1486 | + if (gd_wpml_slug_translation_turned_on($post->post_type) && $language_code = gd_wpml_get_lang_from_url($post_link)) {
|
|
| 1487 | 1487 | |
| 1488 | 1488 | $org_slug = $slug; |
| 1489 | - $slug = apply_filters( 'wpml_translate_single_string', |
|
| 1489 | + $slug = apply_filters('wpml_translate_single_string',
|
|
| 1490 | 1490 | $slug, |
| 1491 | 1491 | 'WordPress', |
| 1492 | - 'URL slug: ' . $slug, |
|
| 1492 | + 'URL slug: '.$slug, |
|
| 1493 | 1493 | $language_code); |
| 1494 | 1494 | |
| 1495 | - if(!$slug){$slug = $org_slug;}
|
|
| 1495 | + if (!$slug) {$slug = $org_slug; }
|
|
| 1496 | 1496 | |
| 1497 | 1497 | } |
| 1498 | 1498 | } |
@@ -1514,11 +1514,11 @@ discard block |
||
| 1514 | 1514 | } |
| 1515 | 1515 | |
| 1516 | 1516 | $post_link = trailingslashit( |
| 1517 | - preg_replace( "/" . preg_quote( $slug, "/" ) . "/", $slug ."/%gd_taxonomy%",$post_link, 1 ) |
|
| 1517 | + preg_replace("/".preg_quote($slug, "/")."/", $slug."/%gd_taxonomy%", $post_link, 1)
|
|
| 1518 | 1518 | ); |
| 1519 | 1519 | |
| 1520 | 1520 | if ($fix_url) {
|
| 1521 | - $post_link = $site_url . $post_link; |
|
| 1521 | + $post_link = $site_url.$post_link; |
|
| 1522 | 1522 | } |
| 1523 | 1523 | |
| 1524 | 1524 | if (isset($comment_post_cache[$post->ID])) {
|
@@ -1537,12 +1537,12 @@ discard block |
||
| 1537 | 1537 | $ID = $post->ID; |
| 1538 | 1538 | $post2 = $wpdb->get_row( |
| 1539 | 1539 | $wpdb->prepare( |
| 1540 | - "SELECT * from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
| 1540 | + "SELECT * from ".$plugin_prefix.$post->post_type."_detail WHERE post_id = %d ", |
|
| 1541 | 1541 | array($post->ID) |
| 1542 | 1542 | ) |
| 1543 | 1543 | ); |
| 1544 | 1544 | |
| 1545 | - $post = (object)array_merge((array)$post, (array)$post2); |
|
| 1545 | + $post = (object) array_merge((array) $post, (array) $post2); |
|
| 1546 | 1546 | |
| 1547 | 1547 | $comment_post_cache[$post->ID] = $post; |
| 1548 | 1548 | } |
@@ -1551,7 +1551,7 @@ discard block |
||
| 1551 | 1551 | |
| 1552 | 1552 | if (false !== strpos($post_link, '%gd_taxonomy%')) {
|
| 1553 | 1553 | |
| 1554 | - if ( apply_filters("geodir_add_location_url_to_url",get_option('geodir_add_location_url'),$post->post_type,$post)) {
|
|
| 1554 | + if (apply_filters("geodir_add_location_url_to_url", get_option('geodir_add_location_url'), $post->post_type, $post)) {
|
|
| 1555 | 1555 | $location_request = ''; |
| 1556 | 1556 | |
| 1557 | 1557 | |
@@ -1565,7 +1565,7 @@ discard block |
||
| 1565 | 1565 | $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]);
|
| 1566 | 1566 | $post->country_slug = str_replace(']', '', $post->country_slug);
|
| 1567 | 1567 | |
| 1568 | - $post_location = (object)array('country_slug' => $post->country_slug,
|
|
| 1568 | + $post_location = (object) array('country_slug' => $post->country_slug,
|
|
| 1569 | 1569 | 'region_slug' => $post->region_slug, |
| 1570 | 1570 | 'city_slug' => $post->city_slug |
| 1571 | 1571 | ); |
@@ -1578,7 +1578,7 @@ discard block |
||
| 1578 | 1578 | |
| 1579 | 1579 | $post_location_sql = $wpdb->get_results( |
| 1580 | 1580 | $wpdb->prepare( |
| 1581 | - "SELECT post_locations from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
| 1581 | + "SELECT post_locations from ".$plugin_prefix.$post->post_type."_detail WHERE post_id = %d ", |
|
| 1582 | 1582 | array($post->ID) |
| 1583 | 1583 | ) |
| 1584 | 1584 | ); |
@@ -1594,7 +1594,7 @@ discard block |
||
| 1594 | 1594 | $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]);
|
| 1595 | 1595 | $post->country_slug = str_replace(']', '', $post->country_slug);
|
| 1596 | 1596 | |
| 1597 | - $post_location = (object)array('country_slug' => $post->country_slug,
|
|
| 1597 | + $post_location = (object) array('country_slug' => $post->country_slug,
|
|
| 1598 | 1598 | 'region_slug' => $post->region_slug, |
| 1599 | 1599 | 'city_slug' => $post->city_slug |
| 1600 | 1600 | ); |
@@ -1623,7 +1623,7 @@ discard block |
||
| 1623 | 1623 | } |
| 1624 | 1624 | $location_slug[] = $city_slug; |
| 1625 | 1625 | |
| 1626 | - $location_request .= implode('/', $location_slug) . '/';
|
|
| 1626 | + $location_request .= implode('/', $location_slug).'/';
|
|
| 1627 | 1627 | } |
| 1628 | 1628 | } |
| 1629 | 1629 | |
@@ -1638,9 +1638,9 @@ discard block |
||
| 1638 | 1638 | } else {
|
| 1639 | 1639 | $post_terms = ''; |
| 1640 | 1640 | |
| 1641 | - if(isset($_POST['post_default_category']) && $_POST['post_default_category']){
|
|
| 1641 | + if (isset($_POST['post_default_category']) && $_POST['post_default_category']) {
|
|
| 1642 | 1642 | $post_terms = absint($_POST['post_default_category']); |
| 1643 | - }elseif(isset($_POST['post_category'][$taxonomies]) && $_POST['post_category'][$taxonomies]) {
|
|
| 1643 | + }elseif (isset($_POST['post_category'][$taxonomies]) && $_POST['post_category'][$taxonomies]) {
|
|
| 1644 | 1644 | $post_terms = is_array($_POST['post_category'][$taxonomies]) ? $_POST['post_category'][$taxonomies] : explode(",", trim($_POST['post_category'][$taxonomies], ","));
|
| 1645 | 1645 | $post_terms = !empty($post_terms) ? absint($post_terms[0]) : 0; |
| 1646 | 1646 | }elseif (isset($post->{$taxonomies})) {
|
@@ -1686,14 +1686,14 @@ discard block |
||
| 1686 | 1686 | $request_term = trim($request_term, '/'); |
| 1687 | 1687 | |
| 1688 | 1688 | // Fix with WPML the location terms added twice when CPT slug is translated. |
| 1689 | - if ($sample && !empty($location_request) && geodir_is_wpml() && strpos($post_link, '%gd_taxonomy%/' . $request_term . $detailurl_separator) !== false) {
|
|
| 1689 | + if ($sample && !empty($location_request) && geodir_is_wpml() && strpos($post_link, '%gd_taxonomy%/'.$request_term.$detailurl_separator) !== false) {
|
|
| 1690 | 1690 | $post_link = str_replace('%gd_taxonomy%/', '', $post_link);
|
| 1691 | 1691 | } |
| 1692 | 1692 | |
| 1693 | 1693 | if (!empty($request_term)) |
| 1694 | - $post_link = str_replace('%gd_taxonomy%', $request_term . $detailurl_separator, $post_link);
|
|
| 1694 | + $post_link = str_replace('%gd_taxonomy%', $request_term.$detailurl_separator, $post_link);
|
|
| 1695 | 1695 | else |
| 1696 | - $post_link = str_replace('/%gd_taxonomy%', $request_term . $detailurl_separator, $post_link);
|
|
| 1696 | + $post_link = str_replace('/%gd_taxonomy%', $request_term.$detailurl_separator, $post_link);
|
|
| 1697 | 1697 | //echo $post_link ; |
| 1698 | 1698 | } |
| 1699 | 1699 | // temp cache the permalink |
@@ -1786,9 +1786,9 @@ discard block |
||
| 1786 | 1786 | $url_separator = ''; |
| 1787 | 1787 | |
| 1788 | 1788 | if (get_option('permalink_structure') != '') {
|
| 1789 | - $old_listing_slug = '/' . $listing_slug . '/'; |
|
| 1789 | + $old_listing_slug = '/'.$listing_slug.'/'; |
|
| 1790 | 1790 | $request_term = implode("/", $location_terms);
|
| 1791 | - $new_listing_slug = '/' . $listing_slug . '/' . $request_term . '/'; |
|
| 1791 | + $new_listing_slug = '/'.$listing_slug.'/'.$request_term.'/'; |
|
| 1792 | 1792 | |
| 1793 | 1793 | $termlink = substr_replace($termlink, $new_listing_slug, strpos($termlink, $old_listing_slug), strlen($old_listing_slug)); |
| 1794 | 1794 | } else {
|
@@ -1808,25 +1808,25 @@ discard block |
||
| 1808 | 1808 | // Alter the CPT slug if WPML is set to do so |
| 1809 | 1809 | if (geodir_is_wpml()) {
|
| 1810 | 1810 | $post_types = get_option('geodir_post_types');
|
| 1811 | - $post_type = str_replace("category","",$taxonomy);
|
|
| 1812 | - $post_type = str_replace("_tags","",$post_type);
|
|
| 1811 | + $post_type = str_replace("category", "", $taxonomy);
|
|
| 1812 | + $post_type = str_replace("_tags", "", $post_type);
|
|
| 1813 | 1813 | $slug = $post_types[$post_type]['rewrite']['slug']; |
| 1814 | 1814 | if (geodir_wpml_is_post_type_translated($post_type) && gd_wpml_slug_translation_turned_on($post_type)) {
|
| 1815 | 1815 | global $sitepress; |
| 1816 | 1816 | $default_lang = $sitepress->get_default_language(); |
| 1817 | 1817 | $language_code = gd_wpml_get_lang_from_url($termlink); |
| 1818 | - if (!$language_code ) {
|
|
| 1819 | - $language_code = $default_lang; |
|
| 1818 | + if (!$language_code) {
|
|
| 1819 | + $language_code = $default_lang; |
|
| 1820 | 1820 | } |
| 1821 | 1821 | |
| 1822 | 1822 | $org_slug = $slug; |
| 1823 | - $slug = apply_filters('wpml_translate_single_string', $slug, 'WordPress', 'URL slug: ' . $slug, $language_code);
|
|
| 1823 | + $slug = apply_filters('wpml_translate_single_string', $slug, 'WordPress', 'URL slug: '.$slug, $language_code);
|
|
| 1824 | 1824 | |
| 1825 | 1825 | if (!$slug) {
|
| 1826 | 1826 | $slug = $org_slug; |
| 1827 | 1827 | } |
| 1828 | 1828 | |
| 1829 | - $termlink = trailingslashit(preg_replace("/" . preg_quote($org_slug, "/") . "/", $slug ,$termlink, 1));
|
|
| 1829 | + $termlink = trailingslashit(preg_replace("/".preg_quote($org_slug, "/")."/", $slug, $termlink, 1));
|
|
| 1830 | 1830 | } |
| 1831 | 1831 | } |
| 1832 | 1832 | } |
@@ -1856,7 +1856,7 @@ discard block |
||
| 1856 | 1856 | |
| 1857 | 1857 | if (in_array($post_type, geodir_get_posttypes())) {
|
| 1858 | 1858 | if (get_option('geodir_add_location_url') && $gd_session->get('gd_multi_location') == 1) {
|
| 1859 | - if(geodir_is_page('detail') && !empty($post) && isset($post->country_slug)) {
|
|
| 1859 | + if (geodir_is_page('detail') && !empty($post) && isset($post->country_slug)) {
|
|
| 1860 | 1860 | $location_terms = array( |
| 1861 | 1861 | 'gd_country' => $post->country_slug, |
| 1862 | 1862 | 'gd_region' => $post->region_slug, |
@@ -1873,7 +1873,7 @@ discard block |
||
| 1873 | 1873 | $location_terms = implode("/", $location_terms);
|
| 1874 | 1874 | $location_terms = rtrim($location_terms, '/'); |
| 1875 | 1875 | |
| 1876 | - $link .= urldecode($location_terms) . '/'; |
|
| 1876 | + $link .= urldecode($location_terms).'/'; |
|
| 1877 | 1877 | } else {
|
| 1878 | 1878 | $link = geodir_getlink($link, $location_terms); |
| 1879 | 1879 | } |
@@ -1961,9 +1961,9 @@ discard block |
||
| 1961 | 1961 | return 0; |
| 1962 | 1962 | $where = 't.term_id = %d'; |
| 1963 | 1963 | if (!empty($taxonomy)) |
| 1964 | - return $wpdb->get_row($wpdb->prepare($tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); |
|
| 1964 | + return $wpdb->get_row($wpdb->prepare($tax_select.$where." AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); |
|
| 1965 | 1965 | else |
| 1966 | - return $wpdb->get_var($wpdb->prepare($select . $where, $term)); |
|
| 1966 | + return $wpdb->get_var($wpdb->prepare($select.$where, $term)); |
|
| 1967 | 1967 | } |
| 1968 | 1968 | |
| 1969 | 1969 | $term = trim(wp_unslash($term)); |
@@ -1975,7 +1975,7 @@ discard block |
||
| 1975 | 1975 | |
| 1976 | 1976 | $where_fields = array($slug); |
| 1977 | 1977 | if (!empty($taxonomy)) {
|
| 1978 | - $parent = (int)$parent; |
|
| 1978 | + $parent = (int) $parent; |
|
| 1979 | 1979 | if ($parent > 0) {
|
| 1980 | 1980 | $where_fields[] = $parent; |
| 1981 | 1981 | $else_where_fields[] = $parent; |
@@ -2039,13 +2039,13 @@ discard block |
||
| 2039 | 2039 | $post_types = geodir_get_posttypes(); |
| 2040 | 2040 | $tax_arr = array(); |
| 2041 | 2041 | foreach ($post_types as $post_type) {
|
| 2042 | - $tax_arr[] = "'" . $post_type . "category'"; |
|
| 2042 | + $tax_arr[] = "'".$post_type."category'"; |
|
| 2043 | 2043 | } |
| 2044 | 2044 | $tax_c = implode(',', $tax_arr);
|
| 2045 | 2045 | $terms = $wpdb->get_results("SELECT * FROM $wpdb->term_taxonomy WHERE taxonomy IN ($tax_c)");
|
| 2046 | 2046 | //$terms = get_terms( $taxonomy ); |
| 2047 | 2047 | |
| 2048 | - if($terms) {
|
|
| 2048 | + if ($terms) {
|
|
| 2049 | 2049 | foreach ($terms as $term) {
|
| 2050 | 2050 | $post_type = str_replace("category", "", $term->taxonomy);
|
| 2051 | 2051 | $a_terms[$post_type][] = $term; |
@@ -2053,7 +2053,7 @@ discard block |
||
| 2053 | 2053 | } |
| 2054 | 2054 | } |
| 2055 | 2055 | |
| 2056 | - if($a_terms) {
|
|
| 2056 | + if ($a_terms) {
|
|
| 2057 | 2057 | foreach ($a_terms as $pt => $t2) {
|
| 2058 | 2058 | |
| 2059 | 2059 | foreach ($t2 as $term) {
|
@@ -2078,7 +2078,7 @@ discard block |
||
| 2078 | 2078 | } |
| 2079 | 2079 | |
| 2080 | 2080 | if (is_ssl()) {
|
| 2081 | - $terms_icons = str_replace("http:","https:",$terms_icons );
|
|
| 2081 | + $terms_icons = str_replace("http:", "https:", $terms_icons);
|
|
| 2082 | 2082 | } |
| 2083 | 2083 | |
| 2084 | 2084 | return apply_filters('geodir_get_term_icons', $terms_icons, $term_id);
|
@@ -11,17 +11,17 @@ discard block |
||
| 11 | 11 | * @global string $plugin_prefix Geodirectory plugin table prefix. |
| 12 | 12 | * @return array User listing count for each post type. |
| 13 | 13 | */ |
| 14 | -function geodir_user_favourite_listing_count($user_id=false) |
|
| 14 | +function geodir_user_favourite_listing_count($user_id = false) |
|
| 15 | 15 | { |
| 16 | 16 | global $wpdb, $plugin_prefix, $current_user; |
| 17 | 17 | |
| 18 | - if(!$user_id){$user_id = $current_user->ID;} |
|
| 19 | - if(!$user_id){return array();} |
|
| 18 | + if (!$user_id) {$user_id = $current_user->ID; } |
|
| 19 | + if (!$user_id) {return array(); } |
|
| 20 | 20 | |
| 21 | 21 | $site_id = ''; |
| 22 | - if ( is_multisite() ) { |
|
| 22 | + if (is_multisite()) { |
|
| 23 | 23 | $blog_id = get_current_blog_id(); |
| 24 | - if($blog_id && $blog_id!='1'){$site_id = '_' . $blog_id ;} |
|
| 24 | + if ($blog_id && $blog_id != '1') {$site_id = '_'.$blog_id; } |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | $user_favorites = geodir_get_user_favourites($user_id); |
@@ -29,10 +29,10 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | $user_listing = array(); |
| 31 | 31 | if (is_array($all_posts) && !empty($all_posts) && is_array($user_favorites) && !empty($user_favorites)) { |
| 32 | - $user_favorites = "'" . implode("','", $user_favorites) . "'"; |
|
| 32 | + $user_favorites = "'".implode("','", $user_favorites)."'"; |
|
| 33 | 33 | |
| 34 | 34 | foreach ($all_posts as $ptype) { |
| 35 | - $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_type='" . $ptype . "' AND post_status = 'publish' AND ID IN (" . $user_favorites . ")"); |
|
| 35 | + $total_posts = $wpdb->get_var("SELECT count( ID ) FROM ".$wpdb->prefix."posts WHERE post_type='".$ptype."' AND post_status = 'publish' AND ID IN (".$user_favorites.")"); |
|
| 36 | 36 | |
| 37 | 37 | if ($total_posts > 0) { |
| 38 | 38 | $user_listing[$ptype] = $total_posts; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @package GeoDirectory |
| 53 | 53 | */ |
| 54 | 54 | |
| 55 | -function geodir_user_show_favourites($user_id='',$output_type='select'){ |
|
| 55 | +function geodir_user_show_favourites($user_id = '', $output_type = 'select') { |
|
| 56 | 56 | // My Favourites in Dashboard |
| 57 | 57 | $show_favorite_link_user_dashboard = get_option('geodir_favorite_link_user_dashboard'); |
| 58 | 58 | $user_favourite = geodir_user_favourite_listing_count($user_id); |
@@ -84,10 +84,10 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | $post_type_link = apply_filters('geodir_dashboard_link_favorite_listing', $post_type_link, $key, $user_id); |
| 86 | 86 | |
| 87 | - if($output_type=='select'){ |
|
| 88 | - $favourite_links .= '<option ' . $selected . ' value="' . $post_type_link . '">' . __(geodir_utf8_ucfirst($name), 'geodirectory') . '</option>'; |
|
| 89 | - }elseif($output_type=='link'){ |
|
| 90 | - $favourite_links[] = '<a href="' . $post_type_link . '">' . __(geodir_utf8_ucfirst($name), 'geodirectory') . '</a>'; |
|
| 87 | + if ($output_type == 'select') { |
|
| 88 | + $favourite_links .= '<option '.$selected.' value="'.$post_type_link.'">'.__(geodir_utf8_ucfirst($name), 'geodirectory').'</option>'; |
|
| 89 | + }elseif ($output_type == 'link') { |
|
| 90 | + $favourite_links[] = '<a href="'.$post_type_link.'">'.__(geodir_utf8_ucfirst($name), 'geodirectory').'</a>'; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
@@ -95,8 +95,8 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | if ($favourite_links != '') { |
| 98 | - $user = get_user_by( 'ID', $user_id ); |
|
| 99 | - if($output_type=='select') { |
|
| 98 | + $user = get_user_by('ID', $user_id); |
|
| 99 | + if ($output_type == 'select') { |
|
| 100 | 100 | ?> |
| 101 | 101 | <li> |
| 102 | 102 | <select id="geodir_my_favourites" class="chosen_select" onchange="window.location.href=this.value" |
@@ -108,9 +108,9 @@ discard block |
||
| 108 | 108 | </select> |
| 109 | 109 | </li> |
| 110 | 110 | <?php |
| 111 | - }elseif($output_type=='link'){ |
|
| 112 | - if(!empty($favourite_links)){ |
|
| 113 | - echo implode(" | ",$favourite_links); |
|
| 111 | + }elseif ($output_type == 'link') { |
|
| 112 | + if (!empty($favourite_links)) { |
|
| 113 | + echo implode(" | ", $favourite_links); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | |
| 122 | 122 | |
| 123 | -function geodir_user_show_listings($user_id='',$output_type='select'){ |
|
| 123 | +function geodir_user_show_listings($user_id = '', $output_type = 'select') { |
|
| 124 | 124 | |
| 125 | 125 | $show_listing_link_user_dashboard = get_option('geodir_listing_link_user_dashboard'); |
| 126 | 126 | $user_listing = geodir_user_post_listing_count($user_id); |
@@ -152,17 +152,17 @@ discard block |
||
| 152 | 152 | * @param int $current_user->ID Current user ID. |
| 153 | 153 | */ |
| 154 | 154 | $listing_link = apply_filters('geodir_dashboard_link_my_listing', $listing_link, $key, $user_id); |
| 155 | - if($output_type=='select') { |
|
| 156 | - $listing_links .= '<option ' . $selected . ' value="' . $listing_link . '">' . __(geodir_utf8_ucfirst($name), 'geodirectory') . '</option>'; |
|
| 157 | - }elseif($output_type=='link'){ |
|
| 158 | - $listing_links[] = '<a href="' .$listing_link . '">' . __(geodir_utf8_ucfirst($name), 'geodirectory') . '</a>'; |
|
| 155 | + if ($output_type == 'select') { |
|
| 156 | + $listing_links .= '<option '.$selected.' value="'.$listing_link.'">'.__(geodir_utf8_ucfirst($name), 'geodirectory').'</option>'; |
|
| 157 | + }elseif ($output_type == 'link') { |
|
| 158 | + $listing_links[] = '<a href="'.$listing_link.'">'.__(geodir_utf8_ucfirst($name), 'geodirectory').'</a>'; |
|
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | if ($listing_links != '') { |
| 164 | - $user = get_user_by( 'ID', $user_id ); |
|
| 165 | - if($output_type=='select') { |
|
| 164 | + $user = get_user_by('ID', $user_id); |
|
| 165 | + if ($output_type == 'select') { |
|
| 166 | 166 | ?> |
| 167 | 167 | <li> |
| 168 | 168 | <select id="geodir_my_listings" class="chosen_select" onchange="window.location.href=this.value" |
@@ -174,9 +174,9 @@ discard block |
||
| 174 | 174 | </select> |
| 175 | 175 | </li> |
| 176 | 176 | <?php |
| 177 | - }elseif($output_type=='link'){ |
|
| 178 | - if(!empty($listing_links )){ |
|
| 179 | - echo implode(" | ",$listing_links ); |
|
| 177 | + }elseif ($output_type == 'link') { |
|
| 178 | + if (!empty($listing_links)) { |
|
| 179 | + echo implode(" | ", $listing_links); |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | } |
@@ -192,12 +192,12 @@ discard block |
||
| 192 | 192 | * @since 1.6.24 |
| 193 | 193 | * @return mixed |
| 194 | 194 | */ |
| 195 | -function geodir_get_user_favourites($user_id=''){ |
|
| 196 | - if(!$user_id){$user_id = get_current_user_id();} |
|
| 195 | +function geodir_get_user_favourites($user_id = '') { |
|
| 196 | + if (!$user_id) {$user_id = get_current_user_id(); } |
|
| 197 | 197 | $site_id = ''; |
| 198 | - if ( is_multisite() ) { |
|
| 198 | + if (is_multisite()) { |
|
| 199 | 199 | $blog_id = get_current_blog_id(); |
| 200 | - if($blog_id && $blog_id!='1'){$site_id = '_' . $blog_id ;} |
|
| 200 | + if ($blog_id && $blog_id != '1') {$site_id = '_'.$blog_id; } |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | return get_user_meta($user_id, 'gd_user_favourite_post'.$site_id, true); |