@@ -18,9 +18,9 @@ discard block |
||
| 18 | 18 | global $post_type; |
| 19 | 19 | |
| 20 | 20 | if (!isset($field_info->post_type)) {
|
| 21 | - $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 21 | + $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 22 | 22 | } else |
| 23 | - $post_type = $field_info->post_type; |
|
| 23 | + $post_type = $field_info->post_type; |
|
| 24 | 24 | |
| 25 | 25 | //if(isset($_REQUEST['custom_type']) && $_REQUEST['custom_type']=='predefined'){
|
| 26 | 26 | // $cf_arr = geodir_custom_fields_predefined($post_type); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $field_admin_title = ''; |
| 50 | 50 | if (isset($field_info->admin_title)) |
| 51 | - $field_admin_title = $field_info->admin_title; |
|
| 51 | + $field_admin_title = $field_info->admin_title; |
|
| 52 | 52 | |
| 53 | 53 | $default = isset($field_info->is_admin) ? $field_info->is_admin : ''; |
| 54 | 54 | |
@@ -68,21 +68,21 @@ discard block |
||
| 68 | 68 | //print_r($field_info); |
| 69 | 69 | |
| 70 | 70 | if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) {
|
| 71 | - $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>'; |
|
| 71 | + $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>'; |
|
| 72 | 72 | }elseif(isset($cf['icon']) && $cf['icon']){
|
| 73 | - $field_icon = '<b style="background-image: url("'.$cf['icon'].'")"></b>';
|
|
| 73 | + $field_icon = '<b style="background-image: url("'.$cf['icon'].'")"></b>';
|
|
| 74 | 74 | }else{
|
| 75 | - $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
|
| 75 | + $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | if(isset($cf['name']) && $cf['name']){
|
| 79 | - $field_type_name = $cf['name']; |
|
| 79 | + $field_type_name = $cf['name']; |
|
| 80 | 80 | }else{
|
| 81 | - $field_type_name = $field_type; |
|
| 81 | + $field_type_name = $field_type; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | if (isset($field_info->data_type) && $field_info->data_type == 'VARCHAR') {
|
| 85 | - $field_info->data_type = 'XVARCHAR'; |
|
| 85 | + $field_info->data_type = 'XVARCHAR'; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | ?> |
@@ -92,45 +92,45 @@ 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);
|
|
| 96 | - ?> |
|
| 95 | + $nonce = wp_create_nonce('custom_fields_' . $result_str);
|
|
| 96 | + ?> |
|
| 97 | 97 | |
| 98 | 98 | <?php if (!$default): ?> |
| 99 | 99 | <div title="<?php _e('Click to remove field', 'geodirectory'); ?>"
|
| 100 | 100 | onclick="delete_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>')"
|
| 101 | 101 | class="handlediv close"><i class="fa fa-times" aria-hidden="true"></i></div> |
| 102 | 102 | <?php endif; |
| 103 | - if ($field_type == 'fieldset') {
|
|
| 104 | - ?> |
|
| 103 | + if ($field_type == 'fieldset') {
|
|
| 104 | + ?> |
|
| 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 | 108 | onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b>
|
| 109 | 109 | <?php |
| 110 | - } else {echo $field_icon;
|
|
| 111 | - ?> |
|
| 110 | + } else {echo $field_icon;
|
|
| 111 | + ?> |
|
| 112 | 112 | <b style="cursor:pointer;" |
| 113 | 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 | - } |
|
| 116 | - ?> |
|
| 115 | + } |
|
| 116 | + ?> |
|
| 117 | 117 | </div> |
| 118 | 118 | |
| 119 | 119 | <form><!-- we need to wrap in a fom so we can use radio buttons with same name --> |
| 120 | 120 | <div id="field_frm<?php echo $result_str; ?>" class="field_frm" |
| 121 | 121 | style="display:<?php if ($field_ins_upd == 'submit') {
|
| 122 | - echo 'block;'; |
|
| 123 | - } else {
|
|
| 124 | - echo 'none;'; |
|
| 125 | - } ?>"> |
|
| 122 | + echo 'block;'; |
|
| 123 | + } else {
|
|
| 124 | + echo 'none;'; |
|
| 125 | + } ?>"> |
|
| 126 | 126 | <input type="hidden" name="_wpnonce" value="<?php echo esc_attr($nonce); ?>"/> |
| 127 | 127 | <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/> |
| 128 | 128 | <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/> |
| 129 | 129 | <input type="hidden" name="field_type_key" id="field_type_key" value="<?php echo $field_type_key; ?>"/> |
| 130 | 130 | <input type="hidden" name="field_id" id="field_id" value="<?php echo esc_attr($result_str); ?>"/> |
| 131 | 131 | <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
|
| 132 | - echo $field_info->data_type; |
|
| 133 | - } ?>"/> |
|
| 132 | + echo $field_info->data_type; |
|
| 133 | + } ?>"/> |
|
| 134 | 134 | <input type="hidden" name="is_active" id="is_active" value="1"/> |
| 135 | 135 | |
| 136 | 136 | <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : '';?>" /><?php // show in sidebar value?> |
@@ -142,37 +142,37 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | <?php |
| 144 | 144 | |
| 145 | - // data_type |
|
| 146 | - if(has_filter("geodir_cfa_data_type_{$field_type}")){
|
|
| 145 | + // data_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{
|
|
| 151 | - $value = ''; |
|
| 152 | - if (isset($field_info->data_type)) {
|
|
| 153 | - $value = esc_attr($field_info->data_type); |
|
| 154 | - }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
|
|
| 155 | - $value = $cf['defaults']['data_type']; |
|
| 156 | - } |
|
| 157 | - ?> |
|
| 150 | + }else{
|
|
| 151 | + $value = ''; |
|
| 152 | + if (isset($field_info->data_type)) {
|
|
| 153 | + $value = esc_attr($field_info->data_type); |
|
| 154 | + }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
|
|
| 155 | + $value = $cf['defaults']['data_type']; |
|
| 156 | + } |
|
| 157 | + ?> |
|
| 158 | 158 | <input type="hidden" name="data_type" id="data_type" value="<?php echo $value;?>"/> |
| 159 | 159 | <?php |
| 160 | - } |
|
| 160 | + } |
|
| 161 | 161 | |
| 162 | 162 | |
| 163 | - // admin_title |
|
| 164 | - if(has_filter("geodir_cfa_admin_title_{$field_type}")){
|
|
| 163 | + // admin_title |
|
| 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{
|
|
| 169 | - $value = ''; |
|
| 170 | - if (isset($field_info->admin_title)) {
|
|
| 171 | - $value = esc_attr($field_info->admin_title); |
|
| 172 | - }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
|
|
| 173 | - $value = $cf['defaults']['admin_title']; |
|
| 174 | - } |
|
| 175 | - ?> |
|
| 168 | + }else{
|
|
| 169 | + $value = ''; |
|
| 170 | + if (isset($field_info->admin_title)) {
|
|
| 171 | + $value = esc_attr($field_info->admin_title); |
|
| 172 | + }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
|
|
| 173 | + $value = $cf['defaults']['admin_title']; |
|
| 174 | + } |
|
| 175 | + ?> |
|
| 176 | 176 | <li> |
| 177 | 177 | <label for="admin_title" class="gd-cf-tooltip-wrap"> |
| 178 | 178 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Admin title :', 'geodirectory'); ?>
|
@@ -186,22 +186,22 @@ discard block |
||
| 186 | 186 | </div> |
| 187 | 187 | </li> |
| 188 | 188 | <?php |
| 189 | - } |
|
| 189 | + } |
|
| 190 | 190 | |
| 191 | 191 | |
| 192 | - // site_title |
|
| 193 | - if(has_filter("geodir_cfa_site_title_{$field_type}")){
|
|
| 192 | + // site_title |
|
| 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{
|
|
| 198 | - $value = ''; |
|
| 199 | - if (isset($field_info->site_title)) {
|
|
| 200 | - $value = esc_attr($field_info->site_title); |
|
| 201 | - }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
|
|
| 202 | - $value = $cf['defaults']['site_title']; |
|
| 203 | - } |
|
| 204 | - ?> |
|
| 197 | + }else{
|
|
| 198 | + $value = ''; |
|
| 199 | + if (isset($field_info->site_title)) {
|
|
| 200 | + $value = esc_attr($field_info->site_title); |
|
| 201 | + }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
|
|
| 202 | + $value = $cf['defaults']['site_title']; |
|
| 203 | + } |
|
| 204 | + ?> |
|
| 205 | 205 | <li> |
| 206 | 206 | <label for="site_title" class="gd-cf-tooltip-wrap"> <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Frontend title :', 'geodirectory'); ?>
|
| 207 | 207 | <div class="gdcf-tooltip"> |
@@ -214,22 +214,22 @@ discard block |
||
| 214 | 214 | </div> |
| 215 | 215 | </li> |
| 216 | 216 | <?php |
| 217 | - } |
|
| 217 | + } |
|
| 218 | 218 | |
| 219 | 219 | |
| 220 | - // admin_desc |
|
| 221 | - if(has_filter("geodir_cfa_admin_desc_{$field_type}")){
|
|
| 220 | + // admin_desc |
|
| 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{
|
|
| 226 | - $value = ''; |
|
| 227 | - if (isset($field_info->admin_desc)) {
|
|
| 228 | - $value = esc_attr($field_info->admin_desc); |
|
| 229 | - }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
|
|
| 230 | - $value = $cf['defaults']['admin_desc']; |
|
| 231 | - } |
|
| 232 | - ?> |
|
| 225 | + }else{
|
|
| 226 | + $value = ''; |
|
| 227 | + if (isset($field_info->admin_desc)) {
|
|
| 228 | + $value = esc_attr($field_info->admin_desc); |
|
| 229 | + }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
|
|
| 230 | + $value = $cf['defaults']['admin_desc']; |
|
| 231 | + } |
|
| 232 | + ?> |
|
| 233 | 233 | <li> |
| 234 | 234 | <label for="admin_desc" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Frontend description :', 'geodirectory'); ?>
|
| 235 | 235 | <div class="gdcf-tooltip"> |
@@ -241,23 +241,23 @@ discard block |
||
| 241 | 241 | </div> |
| 242 | 242 | </li> |
| 243 | 243 | <?php |
| 244 | - } |
|
| 244 | + } |
|
| 245 | 245 | |
| 246 | 246 | |
| 247 | 247 | |
| 248 | - // htmlvar_name |
|
| 249 | - if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){
|
|
| 248 | + // htmlvar_name |
|
| 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{
|
|
| 254 | - $value = ''; |
|
| 255 | - if (isset($field_info->htmlvar_name)) {
|
|
| 256 | - $value = esc_attr($field_info->htmlvar_name); |
|
| 257 | - }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
|
|
| 258 | - $value = $cf['defaults']['htmlvar_name']; |
|
| 259 | - } |
|
| 260 | - ?> |
|
| 253 | + }else{
|
|
| 254 | + $value = ''; |
|
| 255 | + if (isset($field_info->htmlvar_name)) {
|
|
| 256 | + $value = esc_attr($field_info->htmlvar_name); |
|
| 257 | + }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
|
|
| 258 | + $value = $cf['defaults']['htmlvar_name']; |
|
| 259 | + } |
|
| 260 | + ?> |
|
| 261 | 261 | <li> |
| 262 | 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"> |
@@ -267,29 +267,29 @@ discard block |
||
| 267 | 267 | <div class="gd-cf-input-wrap"> |
| 268 | 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 | - echo preg_replace('/geodir_/', '', $value, 1);
|
|
| 271 | - }?>" <?php if ($default) {
|
|
| 272 | - echo 'readonly="readonly"'; |
|
| 273 | - }?> /> |
|
| 270 | + echo preg_replace('/geodir_/', '', $value, 1);
|
|
| 271 | + }?>" <?php if ($default) {
|
|
| 272 | + echo 'readonly="readonly"'; |
|
| 273 | + }?> /> |
|
| 274 | 274 | </div> |
| 275 | 275 | </li> |
| 276 | 276 | <?php |
| 277 | - } |
|
| 277 | + } |
|
| 278 | 278 | |
| 279 | 279 | |
| 280 | - // is_active |
|
| 281 | - if(has_filter("geodir_cfa_is_active_{$field_type}")){
|
|
| 280 | + // is_active |
|
| 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{
|
|
| 286 | - $value = ''; |
|
| 287 | - if (isset($field_info->is_active)) {
|
|
| 288 | - $value = esc_attr($field_info->is_active); |
|
| 289 | - }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
|
|
| 290 | - $value = $cf['defaults']['is_active']; |
|
| 291 | - } |
|
| 292 | - ?> |
|
| 285 | + }else{
|
|
| 286 | + $value = ''; |
|
| 287 | + if (isset($field_info->is_active)) {
|
|
| 288 | + $value = esc_attr($field_info->is_active); |
|
| 289 | + }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
|
|
| 290 | + $value = $cf['defaults']['is_active']; |
|
| 291 | + } |
|
| 292 | + ?> |
|
| 293 | 293 | <li <?php echo $field_display; ?>> |
| 294 | 294 | <label for="is_active" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Is active :', 'geodirectory'); ?>
|
| 295 | 295 | <div class="gdcf-tooltip"> |
@@ -300,35 +300,35 @@ discard block |
||
| 300 | 300 | |
| 301 | 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 | - echo 'checked'; |
|
| 304 | - } ?>/> |
|
| 303 | + echo 'checked'; |
|
| 304 | + } ?>/> |
|
| 305 | 305 | <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
| 306 | 306 | |
| 307 | 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 | - echo 'checked'; |
|
| 310 | - } ?>/> |
|
| 309 | + echo 'checked'; |
|
| 310 | + } ?>/> |
|
| 311 | 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> |
| 315 | 315 | <?php |
| 316 | - } |
|
| 316 | + } |
|
| 317 | 317 | |
| 318 | 318 | |
| 319 | - // for_admin_use |
|
| 320 | - if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){
|
|
| 319 | + // for_admin_use |
|
| 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{
|
|
| 325 | - $value = ''; |
|
| 326 | - if (isset($field_info->for_admin_use)) {
|
|
| 327 | - $value = esc_attr($field_info->for_admin_use); |
|
| 328 | - }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
|
|
| 329 | - $value = $cf['defaults']['for_admin_use']; |
|
| 330 | - } |
|
| 331 | - ?> |
|
| 324 | + }else{
|
|
| 325 | + $value = ''; |
|
| 326 | + if (isset($field_info->for_admin_use)) {
|
|
| 327 | + $value = esc_attr($field_info->for_admin_use); |
|
| 328 | + }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
|
|
| 329 | + $value = $cf['defaults']['for_admin_use']; |
|
| 330 | + } |
|
| 331 | + ?> |
|
| 332 | 332 | <li> |
| 333 | 333 | <label for="for_admin_use" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('For admin use only? :', 'geodirectory'); ?>
|
| 334 | 334 | <div class="gdcf-tooltip"> |
@@ -339,47 +339,47 @@ discard block |
||
| 339 | 339 | |
| 340 | 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 | - echo 'checked'; |
|
| 343 | - } ?>/> |
|
| 342 | + echo 'checked'; |
|
| 343 | + } ?>/> |
|
| 344 | 344 | <label for="for_admin_use_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
| 345 | 345 | |
| 346 | 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 | - echo 'checked'; |
|
| 349 | - } ?>/> |
|
| 348 | + echo 'checked'; |
|
| 349 | + } ?>/> |
|
| 350 | 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> |
| 354 | 354 | <?php |
| 355 | - } |
|
| 355 | + } |
|
| 356 | 356 | |
| 357 | 357 | |
| 358 | - // default_value |
|
| 359 | - if(has_filter("geodir_cfa_default_value_{$field_type}")){
|
|
| 358 | + // default_value |
|
| 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{
|
|
| 364 | - $value = ''; |
|
| 365 | - if (isset($field_info->default_value)) {
|
|
| 366 | - $value = esc_attr($field_info->default_value); |
|
| 367 | - }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
|
|
| 368 | - $value = $cf['defaults']['default_value']; |
|
| 369 | - } |
|
| 370 | - ?> |
|
| 363 | + }else{
|
|
| 364 | + $value = ''; |
|
| 365 | + if (isset($field_info->default_value)) {
|
|
| 366 | + $value = esc_attr($field_info->default_value); |
|
| 367 | + }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
|
|
| 368 | + $value = $cf['defaults']['default_value']; |
|
| 369 | + } |
|
| 370 | + ?> |
|
| 371 | 371 | <li> |
| 372 | 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 | - if ($field_type == 'checkbox') {
|
|
| 376 | - _e('Should the checkbox be checked by default?', 'geodirectory');
|
|
| 377 | - } else if ($field_type == 'email') {
|
|
| 378 | - _e('A default value for the field, usually blank. Ex: [email protected]', 'geodirectory');
|
|
| 379 | - } else {
|
|
| 380 | - _e('A default value for the field, usually blank. (for "link" this will be used as the link text)', 'geodirectory');
|
|
| 381 | - } |
|
| 382 | - ?> |
|
| 375 | + if ($field_type == 'checkbox') {
|
|
| 376 | + _e('Should the checkbox be checked by default?', 'geodirectory');
|
|
| 377 | + } else if ($field_type == 'email') {
|
|
| 378 | + _e('A default value for the field, usually blank. Ex: [email protected]', 'geodirectory');
|
|
| 379 | + } else {
|
|
| 380 | + _e('A default value for the field, usually blank. (for "link" this will be used as the link text)', 'geodirectory');
|
|
| 381 | + } |
|
| 382 | + ?> |
|
| 383 | 383 | </div> |
| 384 | 384 | </label> |
| 385 | 385 | <div class="gd-cf-input-wrap"> |
@@ -396,22 +396,22 @@ discard block |
||
| 396 | 396 | </div> |
| 397 | 397 | </li> |
| 398 | 398 | <?php |
| 399 | - } |
|
| 399 | + } |
|
| 400 | 400 | |
| 401 | 401 | |
| 402 | - // show_in |
|
| 403 | - if(has_filter("geodir_cfa_show_in_{$field_type}")){
|
|
| 402 | + // show_in |
|
| 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{
|
|
| 408 | - $value = ''; |
|
| 409 | - if (isset($field_info->show_in)) {
|
|
| 410 | - $value = esc_attr($field_info->show_in); |
|
| 411 | - }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
|
|
| 412 | - $value = esc_attr($cf['defaults']['show_in']); |
|
| 413 | - } |
|
| 414 | - ?> |
|
| 407 | + }else{
|
|
| 408 | + $value = ''; |
|
| 409 | + if (isset($field_info->show_in)) {
|
|
| 410 | + $value = esc_attr($field_info->show_in); |
|
| 411 | + }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
|
|
| 412 | + $value = esc_attr($cf['defaults']['show_in']); |
|
| 413 | + } |
|
| 414 | + ?> |
|
| 415 | 415 | <li> |
| 416 | 416 | <label for="show_in" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show in what locations?:', 'geodirectory'); ?>
|
| 417 | 417 | <div class="gdcf-tooltip"> |
@@ -422,41 +422,41 @@ discard block |
||
| 422 | 422 | |
| 423 | 423 | <?php |
| 424 | 424 | |
| 425 | - /* |
|
| 425 | + /* |
|
| 426 | 426 | * We wrap the key values in [] so we can search the DB easier with a LIKE query. |
| 427 | 427 | */ |
| 428 | - $show_in_locations = array( |
|
| 429 | - "[detail]" => __("Details page sidebar", 'geodirectory'),
|
|
| 430 | - "[moreinfo]" => __("More info tab", 'geodirectory'),
|
|
| 431 | - "[listing]" => __("Listings page", 'geodirectory'),
|
|
| 432 | - "[owntab]" => __("Details page own tab", 'geodirectory'),
|
|
| 433 | - "[mapbubble]" => __("Map bubble", 'geodirectory'),
|
|
| 434 | - ); |
|
| 435 | - |
|
| 436 | - /** |
|
| 437 | - * Filter the locations array for where to display custom fields. |
|
| 438 | - * |
|
| 439 | - * @since 1.6.6 |
|
| 440 | - * @param array $show_in_locations The array of locations and descriptions. |
|
| 441 | - * @param object $field_info The field being displayed info. |
|
| 442 | - * @param string $field_info The type of field. |
|
| 443 | - */ |
|
| 444 | - $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type);
|
|
| 445 | - |
|
| 446 | - |
|
| 447 | - // remove some locations for some field types |
|
| 448 | - |
|
| 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{
|
|
| 452 | - unset($show_in_locations['[owntab]']); |
|
| 453 | - } |
|
| 454 | - |
|
| 455 | - if(!$display_on_listing){
|
|
| 456 | - unset($show_in_locations['[listings]']); |
|
| 457 | - } |
|
| 458 | - |
|
| 459 | - ?> |
|
| 428 | + $show_in_locations = array( |
|
| 429 | + "[detail]" => __("Details page sidebar", 'geodirectory'),
|
|
| 430 | + "[moreinfo]" => __("More info tab", 'geodirectory'),
|
|
| 431 | + "[listing]" => __("Listings page", 'geodirectory'),
|
|
| 432 | + "[owntab]" => __("Details page own tab", 'geodirectory'),
|
|
| 433 | + "[mapbubble]" => __("Map bubble", 'geodirectory'),
|
|
| 434 | + ); |
|
| 435 | + |
|
| 436 | + /** |
|
| 437 | + * Filter the locations array for where to display custom fields. |
|
| 438 | + * |
|
| 439 | + * @since 1.6.6 |
|
| 440 | + * @param array $show_in_locations The array of locations and descriptions. |
|
| 441 | + * @param object $field_info The field being displayed info. |
|
| 442 | + * @param string $field_info The type of field. |
|
| 443 | + */ |
|
| 444 | + $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type);
|
|
| 445 | + |
|
| 446 | + |
|
| 447 | + // remove some locations for some field types |
|
| 448 | + |
|
| 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{
|
|
| 452 | + unset($show_in_locations['[owntab]']); |
|
| 453 | + } |
|
| 454 | + |
|
| 455 | + if(!$display_on_listing){
|
|
| 456 | + unset($show_in_locations['[listings]']); |
|
| 457 | + } |
|
| 458 | + |
|
| 459 | + ?> |
|
| 460 | 460 | |
| 461 | 461 | <select multiple="multiple" name="show_in[]" |
| 462 | 462 | id="show_in" |
@@ -466,38 +466,38 @@ 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){
|
|
| 472 | - $selected = ''; |
|
| 471 | + foreach( $show_in_locations as $key => $val){
|
|
| 472 | + $selected = ''; |
|
| 473 | 473 | |
| 474 | - if(is_array($show_in_values) && in_array($key,$show_in_values ) ){
|
|
| 475 | - $selected = 'selected'; |
|
| 476 | - } |
|
| 474 | + if(is_array($show_in_values) && in_array($key,$show_in_values ) ){
|
|
| 475 | + $selected = 'selected'; |
|
| 476 | + } |
|
| 477 | 477 | |
| 478 | - ?> |
|
| 478 | + ?> |
|
| 479 | 479 | <option value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $val;?></option> |
| 480 | 480 | <?php |
| 481 | - } |
|
| 482 | - ?> |
|
| 481 | + } |
|
| 482 | + ?> |
|
| 483 | 483 | </select> |
| 484 | 484 | </div> |
| 485 | 485 | </li> |
| 486 | 486 | <?php |
| 487 | - } |
|
| 487 | + } |
|
| 488 | 488 | |
| 489 | 489 | |
| 490 | - // advanced_editor |
|
| 491 | - if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){
|
|
| 490 | + // advanced_editor |
|
| 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 | |
| 497 | 497 | |
| 498 | 498 | |
| 499 | 499 | |
| 500 | - ?> |
|
| 500 | + ?> |
|
| 501 | 501 | |
| 502 | 502 | |
| 503 | 503 | <?php // @todo this does not seem to be used for anything, it can be removed or replaced ?> |
@@ -510,38 +510,38 @@ discard block |
||
| 510 | 510 | |
| 511 | 511 | <?php |
| 512 | 512 | |
| 513 | - $pricearr = array(); |
|
| 514 | - if (isset($field_info->packages) && $field_info->packages != '') {
|
|
| 515 | - $pricearr = explode(',', trim($field_info->packages, ','));
|
|
| 516 | - } else {
|
|
| 517 | - $package_info = array(); |
|
| 513 | + $pricearr = array(); |
|
| 514 | + if (isset($field_info->packages) && $field_info->packages != '') {
|
|
| 515 | + $pricearr = explode(',', trim($field_info->packages, ','));
|
|
| 516 | + } else {
|
|
| 517 | + $package_info = array(); |
|
| 518 | 518 | |
| 519 | - $package_info = geodir_post_package_info($package_info, '', $post_type); |
|
| 520 | - $pricearr[] = $package_info->pid; |
|
| 521 | - } |
|
| 519 | + $package_info = geodir_post_package_info($package_info, '', $post_type); |
|
| 520 | + $pricearr[] = $package_info->pid; |
|
| 521 | + } |
|
| 522 | 522 | |
| 523 | - ob_start() |
|
| 524 | - ?> |
|
| 523 | + ob_start() |
|
| 524 | + ?> |
|
| 525 | 525 | |
| 526 | 526 | <select style="display:none" name="show_on_pkg[]" id="show_on_pkg" multiple="multiple"> |
| 527 | 527 | <?php |
| 528 | - if (!empty($pricearr)) {
|
|
| 529 | - foreach ($pricearr as $val) {
|
|
| 530 | - ?> |
|
| 528 | + if (!empty($pricearr)) {
|
|
| 529 | + foreach ($pricearr as $val) {
|
|
| 530 | + ?> |
|
| 531 | 531 | <option selected="selected" value="<?php echo esc_attr($val); ?>" ><?php echo $val; ?></option><?php |
| 532 | - } |
|
| 533 | - } |
|
| 534 | - ?> |
|
| 532 | + } |
|
| 533 | + } |
|
| 534 | + ?> |
|
| 535 | 535 | </select> |
| 536 | 536 | |
| 537 | 537 | <?php |
| 538 | - $html = ob_get_clean(); |
|
| 538 | + $html = ob_get_clean(); |
|
| 539 | 539 | |
| 540 | 540 | /** |
| 541 | 541 | * Filter the price packages list. |
| 542 | 542 | * |
| 543 | 543 | * Filter the price packages list in custom field form in admin |
| 544 | - * custom fields settings. |
|
| 544 | + * custom fields settings. |
|
| 545 | 545 | * |
| 546 | 546 | * @since 1.0.0 |
| 547 | 547 | * |
@@ -550,25 +550,25 @@ discard block |
||
| 550 | 550 | */ |
| 551 | 551 | echo $html = apply_filters('geodir_packages_list_on_custom_fields', $html, $field_info);
|
| 552 | 552 | |
| 553 | - ?> |
|
| 553 | + ?> |
|
| 554 | 554 | |
| 555 | 555 | |
| 556 | 556 | |
| 557 | 557 | <?php |
| 558 | 558 | |
| 559 | - // is_required |
|
| 560 | - if(has_filter("geodir_cfa_is_required_{$field_type}")){
|
|
| 559 | + // is_required |
|
| 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{
|
|
| 565 | - $value = ''; |
|
| 566 | - if (isset($field_info->is_required)) {
|
|
| 567 | - $value = esc_attr($field_info->is_required); |
|
| 568 | - }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
|
|
| 569 | - $value = $cf['defaults']['is_required']; |
|
| 570 | - } |
|
| 571 | - ?> |
|
| 564 | + }else{
|
|
| 565 | + $value = ''; |
|
| 566 | + if (isset($field_info->is_required)) {
|
|
| 567 | + $value = esc_attr($field_info->is_required); |
|
| 568 | + }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
|
|
| 569 | + $value = $cf['defaults']['is_required']; |
|
| 570 | + } |
|
| 571 | + ?> |
|
| 572 | 572 | <li> |
| 573 | 573 | <label for="is_required" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Is required :', 'geodirectory'); ?>
|
| 574 | 574 | <div class="gdcf-tooltip"> |
@@ -580,14 +580,14 @@ discard block |
||
| 580 | 580 | |
| 581 | 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 | - echo 'checked'; |
|
| 584 | - } ?>/> |
|
| 583 | + echo 'checked'; |
|
| 584 | + } ?>/> |
|
| 585 | 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 | 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 | - echo 'checked'; |
|
| 590 | - } ?>/> |
|
| 589 | + echo 'checked'; |
|
| 590 | + } ?>/> |
|
| 591 | 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> |
@@ -595,21 +595,21 @@ discard block |
||
| 595 | 595 | </li> |
| 596 | 596 | |
| 597 | 597 | <?php |
| 598 | - } |
|
| 598 | + } |
|
| 599 | 599 | |
| 600 | - // required_msg |
|
| 601 | - if(has_filter("geodir_cfa_required_msg_{$field_type}")){
|
|
| 600 | + // required_msg |
|
| 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{
|
|
| 606 | - $value = ''; |
|
| 607 | - if (isset($field_info->required_msg)) {
|
|
| 608 | - $value = esc_attr($field_info->required_msg); |
|
| 609 | - }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
|
|
| 610 | - $value = $cf['defaults']['required_msg']; |
|
| 611 | - } |
|
| 612 | - ?> |
|
| 605 | + }else{
|
|
| 606 | + $value = ''; |
|
| 607 | + if (isset($field_info->required_msg)) {
|
|
| 608 | + $value = esc_attr($field_info->required_msg); |
|
| 609 | + }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
|
|
| 610 | + $value = $cf['defaults']['required_msg']; |
|
| 611 | + } |
|
| 612 | + ?> |
|
| 613 | 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'); ?>
|
@@ -623,38 +623,38 @@ discard block |
||
| 623 | 623 | </div> |
| 624 | 624 | </li> |
| 625 | 625 | <?php |
| 626 | - } |
|
| 626 | + } |
|
| 627 | 627 | |
| 628 | 628 | |
| 629 | - // required_msg |
|
| 630 | - if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){
|
|
| 629 | + // required_msg |
|
| 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 | - // extra_fields |
|
| 638 | - if(has_filter("geodir_cfa_extra_fields_{$field_type}")){
|
|
| 637 | + // extra_fields |
|
| 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 | - // field_icon |
|
| 646 | - if(has_filter("geodir_cfa_field_icon_{$field_type}")){
|
|
| 645 | + // field_icon |
|
| 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{
|
|
| 651 | - $value = ''; |
|
| 652 | - if (isset($field_info->field_icon)) {
|
|
| 653 | - $value = esc_attr($field_info->field_icon); |
|
| 654 | - }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
|
|
| 655 | - $value = $cf['defaults']['field_icon']; |
|
| 656 | - } |
|
| 657 | - ?> |
|
| 650 | + }else{
|
|
| 651 | + $value = ''; |
|
| 652 | + if (isset($field_info->field_icon)) {
|
|
| 653 | + $value = esc_attr($field_info->field_icon); |
|
| 654 | + }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
|
|
| 655 | + $value = $cf['defaults']['field_icon']; |
|
| 656 | + } |
|
| 657 | + ?> |
|
| 658 | 658 | <li> |
| 659 | 659 | <h3><?php echo __('Custom css', 'geodirectory'); ?></h3>
|
| 660 | 660 | |
@@ -672,22 +672,22 @@ discard block |
||
| 672 | 672 | |
| 673 | 673 | </li> |
| 674 | 674 | <?php |
| 675 | - } |
|
| 675 | + } |
|
| 676 | 676 | |
| 677 | 677 | |
| 678 | - // css_class |
|
| 679 | - if(has_filter("geodir_cfa_css_class_{$field_type}")){
|
|
| 678 | + // css_class |
|
| 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{
|
|
| 684 | - $value = ''; |
|
| 685 | - if (isset($field_info->css_class)) {
|
|
| 686 | - $value = esc_attr($field_info->css_class); |
|
| 687 | - }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
|
|
| 688 | - $value = $cf['defaults']['css_class']; |
|
| 689 | - } |
|
| 690 | - ?> |
|
| 683 | + }else{
|
|
| 684 | + $value = ''; |
|
| 685 | + if (isset($field_info->css_class)) {
|
|
| 686 | + $value = esc_attr($field_info->css_class); |
|
| 687 | + }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
|
|
| 688 | + $value = $cf['defaults']['css_class']; |
|
| 689 | + } |
|
| 690 | + ?> |
|
| 691 | 691 | <li> |
| 692 | 692 | |
| 693 | 693 | <label for="css_class" class="gd-cf-tooltip-wrap"> |
@@ -700,47 +700,47 @@ discard block |
||
| 700 | 700 | <div class="gd-cf-input-wrap"> |
| 701 | 701 | <input type="text" name="css_class" id="css_class" |
| 702 | 702 | value="<?php if (isset($field_info->css_class)) {
|
| 703 | - echo esc_attr($field_info->css_class); |
|
| 704 | - }?>"/> |
|
| 703 | + echo esc_attr($field_info->css_class); |
|
| 704 | + }?>"/> |
|
| 705 | 705 | </div> |
| 706 | 706 | </li> |
| 707 | 707 | <?php |
| 708 | - } |
|
| 708 | + } |
|
| 709 | 709 | |
| 710 | 710 | |
| 711 | - // cat_sort |
|
| 712 | - if(has_filter("geodir_cfa_cat_sort_{$field_type}")){
|
|
| 711 | + // cat_sort |
|
| 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{
|
|
| 717 | - $value = ''; |
|
| 718 | - $hide_cat_sort =''; |
|
| 719 | - if (isset($field_info->cat_sort)) {
|
|
| 720 | - $value = esc_attr($field_info->cat_sort); |
|
| 721 | - }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
|
|
| 722 | - $value = $cf['defaults']['cat_sort']; |
|
| 723 | - $hide_cat_sort = ($value===false) ? "style='display:none;'" : ''; |
|
| 724 | - } |
|
| 716 | + }else{
|
|
| 717 | + $value = ''; |
|
| 718 | + $hide_cat_sort =''; |
|
| 719 | + if (isset($field_info->cat_sort)) {
|
|
| 720 | + $value = esc_attr($field_info->cat_sort); |
|
| 721 | + }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
|
|
| 722 | + $value = $cf['defaults']['cat_sort']; |
|
| 723 | + $hide_cat_sort = ($value===false) ? "style='display:none;'" : ''; |
|
| 724 | + } |
|
| 725 | 725 | |
| 726 | - $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : ''; |
|
| 727 | - ?> |
|
| 726 | + $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : ''; |
|
| 727 | + ?> |
|
| 728 | 728 | <li <?php echo $hide_cat_sort ;?>> |
| 729 | 729 | <h3><?php |
| 730 | - /** |
|
| 731 | - * Filter the section title. |
|
| 732 | - * |
|
| 733 | - * Filter the section title in custom field form in admin |
|
| 734 | - * custom fields settings. |
|
| 735 | - * |
|
| 736 | - * @since 1.0.0 |
|
| 737 | - * |
|
| 738 | - * @param string $title Title of the section. |
|
| 739 | - * @param string $field_type Current field type. |
|
| 740 | - */ |
|
| 741 | - echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type);
|
|
| 742 | - |
|
| 743 | - ?></h3> |
|
| 730 | + /** |
|
| 731 | + * Filter the section title. |
|
| 732 | + * |
|
| 733 | + * Filter the section title in custom field form in admin |
|
| 734 | + * custom fields settings. |
|
| 735 | + * |
|
| 736 | + * @since 1.0.0 |
|
| 737 | + * |
|
| 738 | + * @param string $title Title of the section. |
|
| 739 | + * @param string $field_type Current field type. |
|
| 740 | + */ |
|
| 741 | + echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type);
|
|
| 742 | + |
|
| 743 | + ?></h3> |
|
| 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"> |
@@ -752,42 +752,42 @@ discard block |
||
| 752 | 752 | |
| 753 | 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 | - echo 'checked'; |
|
| 756 | - } ?>/> |
|
| 755 | + echo 'checked'; |
|
| 756 | + } ?>/> |
|
| 757 | 757 | <label for="cat_sort_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
| 758 | 758 | |
| 759 | 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 | - echo 'checked'; |
|
| 762 | - } ?>/> |
|
| 761 | + echo 'checked'; |
|
| 762 | + } ?>/> |
|
| 763 | 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> |
| 767 | 767 | <?php |
| 768 | - } |
|
| 769 | - |
|
| 770 | - |
|
| 771 | - |
|
| 772 | - switch ($field_type): |
|
| 773 | - case 'html': |
|
| 774 | - case 'file': |
|
| 775 | - case 'url': |
|
| 776 | - case 'fieldset': |
|
| 777 | - break; |
|
| 778 | - default: |
|
| 779 | - |
|
| 780 | - /** |
|
| 781 | - * Called at the end of the advanced custom fields settings page loop. |
|
| 782 | - * |
|
| 783 | - * Can be used to add or deal with different settings types. |
|
| 784 | - * |
|
| 785 | - * @since 1.0.0 |
|
| 786 | - * @since 1.6.6 $cf param added. |
|
| 787 | - * @param object $field_info The current fields info. |
|
| 788 | - * @param array $cf The custom field settings |
|
| 789 | - */ |
|
| 790 | - do_action('geodir_advance_custom_fields', $field_info,$cf);?>
|
|
| 768 | + } |
|
| 769 | + |
|
| 770 | + |
|
| 771 | + |
|
| 772 | + switch ($field_type): |
|
| 773 | + case 'html': |
|
| 774 | + case 'file': |
|
| 775 | + case 'url': |
|
| 776 | + case 'fieldset': |
|
| 777 | + break; |
|
| 778 | + default: |
|
| 779 | + |
|
| 780 | + /** |
|
| 781 | + * Called at the end of the advanced custom fields settings page loop. |
|
| 782 | + * |
|
| 783 | + * Can be used to add or deal with different settings types. |
|
| 784 | + * |
|
| 785 | + * @since 1.0.0 |
|
| 786 | + * @since 1.6.6 $cf param added. |
|
| 787 | + * @param object $field_info The current fields info. |
|
| 788 | + * @param array $cf The custom field settings |
|
| 789 | + */ |
|
| 790 | + do_action('geodir_advance_custom_fields', $field_info,$cf);?>
|
|
| 791 | 791 | |
| 792 | 792 | |
| 793 | 793 | <?php endswitch; ?> |