@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | if ($is_wpml && !empty($wp->query_vars['page_id'])) {
|
| 69 | 69 | wp_redirect(geodir_getlink(get_permalink($wp->query_vars['page_id']), array('listing_type' => $post_type)));
|
| 70 | 70 | } else {
|
| 71 | - wp_redirect(trailingslashit(get_site_url()) . $pagename . '/?listing_type=' . $post_type); |
|
| 71 | + wp_redirect(trailingslashit(get_site_url()).$pagename.'/?listing_type='.$post_type); |
|
| 72 | 72 | } |
| 73 | 73 | gd_die(); |
| 74 | 74 | } |
@@ -126,21 +126,21 @@ discard block |
||
| 126 | 126 | case 'listing-listview': |
| 127 | 127 | $template = locate_template(array("geodirectory/listing-listview.php"));
|
| 128 | 128 | if (!$template) {
|
| 129 | - $template = geodir_plugin_path() . '/geodirectory-templates/listing-listview.php'; |
|
| 129 | + $template = geodir_plugin_path().'/geodirectory-templates/listing-listview.php'; |
|
| 130 | 130 | } |
| 131 | 131 | return $template; |
| 132 | 132 | break; |
| 133 | 133 | case 'widget-listing-listview': |
| 134 | 134 | $template = locate_template(array("geodirectory/widget-listing-listview.php"));
|
| 135 | 135 | if (!$template) {
|
| 136 | - $template = geodir_plugin_path() . '/geodirectory-templates/widget-listing-listview.php'; |
|
| 136 | + $template = geodir_plugin_path().'/geodirectory-templates/widget-listing-listview.php'; |
|
| 137 | 137 | } |
| 138 | 138 | return $template; |
| 139 | 139 | break; |
| 140 | 140 | case 'email-message': |
| 141 | 141 | $template = locate_template(array("geodirectory/email-message.php"));
|
| 142 | 142 | if (!$template) {
|
| 143 | - $template = geodir_plugin_path() . '/geodirectory-templates/email-message.php'; |
|
| 143 | + $template = geodir_plugin_path().'/geodirectory-templates/email-message.php'; |
|
| 144 | 144 | } |
| 145 | 145 | return $template; |
| 146 | 146 | break; |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | |
| 199 | 199 | $template = geodir_locate_template('signup');
|
| 200 | 200 | |
| 201 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php'; |
|
| 201 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-signup.php'; |
|
| 202 | 202 | |
| 203 | 203 | /** |
| 204 | 204 | * Filter the signup template path. |
@@ -212,11 +212,11 @@ discard block |
||
| 212 | 212 | if (geodir_is_page('add-listing') || $geodir_custom_page_list['geodir_add_listing_page']) {
|
| 213 | 213 | if (!geodir_is_default_location_set()) {
|
| 214 | 214 | global $information; |
| 215 | - $information = sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>');
|
|
| 215 | + $information = sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\''.admin_url('admin.php?page=geodirectory&tab=default_location_settings').'\'>', '</a>');
|
|
| 216 | 216 | |
| 217 | 217 | $template = geodir_locate_template('information');
|
| 218 | 218 | |
| 219 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
| 219 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-information.php'; |
|
| 220 | 220 | /** |
| 221 | 221 | * Filter the information template path. |
| 222 | 222 | * |
@@ -228,10 +228,10 @@ discard block |
||
| 228 | 228 | // check if pid exists in the record if yes then check if this post belongs to the user who is logged in. |
| 229 | 229 | if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
| 230 | 230 | /// WPML |
| 231 | - if (geodir_wpml_is_post_type_translated(get_post_type((int)$_GET['pid'])) && $duplicate_of = wpml_get_master_post_from_duplicate((int)$_GET['pid'])) {
|
|
| 231 | + if (geodir_wpml_is_post_type_translated(get_post_type((int) $_GET['pid'])) && $duplicate_of = wpml_get_master_post_from_duplicate((int) $_GET['pid'])) {
|
|
| 232 | 232 | global $sitepress; |
| 233 | 233 | |
| 234 | - $lang_of_duplicate = geodir_get_language_for_element($duplicate_of, 'post_' . get_post_type($duplicate_of)); |
|
| 234 | + $lang_of_duplicate = geodir_get_language_for_element($duplicate_of, 'post_'.get_post_type($duplicate_of)); |
|
| 235 | 235 | $sitepress->switch_lang($lang_of_duplicate, true); |
| 236 | 236 | |
| 237 | 237 | $redirect_to = get_permalink(geodir_add_listing_page_id()); |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | if (!$is_current_user_owner) {
|
| 251 | 251 | $template = geodir_locate_template('information');
|
| 252 | 252 | |
| 253 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
| 253 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-information.php'; |
|
| 254 | 254 | /** |
| 255 | 255 | * Filter the information template path. |
| 256 | 256 | * |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | |
| 273 | 273 | $template = geodir_locate_template('add-listing');
|
| 274 | 274 | |
| 275 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php'; |
|
| 275 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/add-listing.php'; |
|
| 276 | 276 | /** |
| 277 | 277 | * Filter the add listing template path. |
| 278 | 278 | * |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | $template = geodir_locate_template('preview');
|
| 291 | 291 | |
| 292 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
| 292 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/listing-detail.php'; |
|
| 293 | 293 | /** |
| 294 | 294 | * Filter the preview template path. |
| 295 | 295 | * |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | |
| 306 | 306 | $template = geodir_locate_template('success');
|
| 307 | 307 | |
| 308 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php'; |
|
| 308 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/listing-success.php'; |
|
| 309 | 309 | /** |
| 310 | 310 | * Filter the success template path. |
| 311 | 311 | * |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | |
| 321 | 321 | $template = geodir_locate_template('detail');
|
| 322 | 322 | |
| 323 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
| 323 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/listing-detail.php'; |
|
| 324 | 324 | /** |
| 325 | 325 | * Filter the detail template path. |
| 326 | 326 | * |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | |
| 336 | 336 | $template = geodir_locate_template('listing');
|
| 337 | 337 | |
| 338 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php'; |
|
| 338 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-listing.php'; |
|
| 339 | 339 | /** |
| 340 | 340 | * Filter the listing template path. |
| 341 | 341 | * |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | |
| 351 | 351 | $template = geodir_locate_template('search');
|
| 352 | 352 | |
| 353 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php'; |
|
| 353 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-search.php'; |
|
| 354 | 354 | /** |
| 355 | 355 | * Filter the search template path. |
| 356 | 356 | * |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | |
| 366 | 366 | $template = geodir_locate_template('author');
|
| 367 | 367 | |
| 368 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php'; |
|
| 368 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-author.php'; |
|
| 369 | 369 | /** |
| 370 | 370 | * Filter the author template path. |
| 371 | 371 | * |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | - if ( geodir_is_page('home') || geodir_is_page('location')) {
|
|
| 379 | + if (geodir_is_page('home') || geodir_is_page('location')) {
|
|
| 380 | 380 | |
| 381 | 381 | global $post, $wp_query; |
| 382 | 382 | |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | |
| 387 | 387 | $template = geodir_locate_template('geodir-home');
|
| 388 | 388 | |
| 389 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php'; |
|
| 389 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-home.php'; |
|
| 390 | 390 | /** |
| 391 | 391 | * Filter the home page template path. |
| 392 | 392 | * |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | |
| 400 | 400 | $template = geodir_locate_template('location');
|
| 401 | 401 | |
| 402 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php'; |
|
| 402 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-location.php'; |
|
| 403 | 403 | /** |
| 404 | 404 | * Filter the location template path. |
| 405 | 405 | * |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | */ |
| 442 | 442 | do_action("geodir_get_template_part_{$slug}", $slug, $name);
|
| 443 | 443 | $templates = array(); |
| 444 | - $name = (string)$name; |
|
| 444 | + $name = (string) $name; |
|
| 445 | 445 | if ('' !== $name) {
|
| 446 | 446 | $template_name = "{$slug}-{$name}.php";
|
| 447 | 447 | |
@@ -449,14 +449,14 @@ discard block |
||
| 449 | 449 | $template_name = "{$slug}.php";
|
| 450 | 450 | } |
| 451 | 451 | |
| 452 | - if (!locate_template(array("geodirectory/" . $template_name))) :
|
|
| 452 | + if (!locate_template(array("geodirectory/".$template_name))) :
|
|
| 453 | 453 | /** |
| 454 | 454 | * Filter the template part with slug and name. |
| 455 | 455 | * |
| 456 | 456 | * @since 1.0.0 |
| 457 | 457 | * @param string $template_name The template name. |
| 458 | 458 | */ |
| 459 | - $template = apply_filters("geodir_template_part-{$slug}-{$name}", geodir_plugin_path() . '/geodirectory-templates/' . $template_name);
|
|
| 459 | + $template = apply_filters("geodir_template_part-{$slug}-{$name}", geodir_plugin_path().'/geodirectory-templates/'.$template_name);
|
|
| 460 | 460 | /** |
| 461 | 461 | * Includes the template part with slug and name. |
| 462 | 462 | * |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | */ |
| 465 | 465 | include($template); |
| 466 | 466 | else: |
| 467 | - locate_template(array("geodirectory/" . $template_name), true, false);
|
|
| 467 | + locate_template(array("geodirectory/".$template_name), true, false);
|
|
| 468 | 468 | endif; |
| 469 | 469 | |
| 470 | 470 | } |
@@ -492,9 +492,9 @@ discard block |
||
| 492 | 492 | $gdp_post_type = $gdp_post_type != '' && !empty($all_postypes) && in_array($gdp_post_type, $all_postypes) ? $gdp_post_type : NULL; |
| 493 | 493 | |
| 494 | 494 | if ($gdp_post_id && $gdp_post_type) {
|
| 495 | - $append_class = 'gd-post-' . $gdp_post_type; |
|
| 495 | + $append_class = 'gd-post-'.$gdp_post_type; |
|
| 496 | 496 | $append_class .= isset($post->is_featured) && $post->is_featured > 0 ? ' gd-post-featured' : ''; |
| 497 | - $class = $class != '' ? $class . ' ' . $append_class : $append_class; |
|
| 497 | + $class = $class != '' ? $class.' '.$append_class : $append_class; |
|
| 498 | 498 | } |
| 499 | 499 | |
| 500 | 500 | return $class; |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | */ |
| 527 | 527 | $message = apply_filters('geodir_message_listing_not_found', $message, $template_listview, $favorite);
|
| 528 | 528 | |
| 529 | - echo '<li class="no-listing">' . $message . '</li>'; |
|
| 529 | + echo '<li class="no-listing">'.$message.'</li>'; |
|
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | /** |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | function geodir_convert_listing_view_class($columns = '') {
|
| 556 | 556 | $class = ''; |
| 557 | 557 | |
| 558 | - switch ((int)$columns) {
|
|
| 558 | + switch ((int) $columns) {
|
|
| 559 | 559 | case 1: |
| 560 | 560 | $class = ''; |
| 561 | 561 | break; |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | $html .= '<option value=""></option>'; |
| 621 | 621 | if (!empty($star_texts) && is_array($star_texts)) {
|
| 622 | 622 | foreach ($star_texts as $i => $text) {
|
| 623 | - $html .= '<option ' . selected((int)($i + 1), (int)$default, false) . ' value="' . (int)($i + 1) . '">' . $text . '</option>'; |
|
| 623 | + $html .= '<option '.selected((int) ($i + 1), (int) $default, false).' value="'.(int) ($i + 1).'">'.$text.'</option>'; |
|
| 624 | 624 | } |
| 625 | 625 | } else {
|
| 626 | 626 | $html .= '<option value="1">1</option>'; |
@@ -649,14 +649,14 @@ discard block |
||
| 649 | 649 | function geodir_font_awesome_rating_stars_html($html, $rating, $star_count = 5) {
|
| 650 | 650 | if (get_option('geodir_reviewrating_enable_font_awesome') == '1') {
|
| 651 | 651 | $rating = min($rating, $star_count); |
| 652 | - $full_stars = floor( $rating ); |
|
| 653 | - $half_stars = ceil( $rating - $full_stars ); |
|
| 652 | + $full_stars = floor($rating); |
|
| 653 | + $half_stars = ceil($rating - $full_stars); |
|
| 654 | 654 | $empty_stars = $star_count - $full_stars - $half_stars; |
| 655 | 655 | |
| 656 | 656 | $html = '<div class="gd-star-rating gd-fa-star-rating">'; |
| 657 | - $html .= str_repeat( '<i class="fas fa-star gd-full-star"></i>', $full_stars ); |
|
| 658 | - $html .= str_repeat( '<i class="fas fa-star-half-alt gd-half-star"></i>', $half_stars ); |
|
| 659 | - $html .= str_repeat( '<i class="far fa-star gd-empty-star"></i>', $empty_stars); |
|
| 657 | + $html .= str_repeat('<i class="fas fa-star gd-full-star"></i>', $full_stars);
|
|
| 658 | + $html .= str_repeat('<i class="fas fa-star-half-alt gd-half-star"></i>', $half_stars);
|
|
| 659 | + $html .= str_repeat('<i class="far fa-star gd-empty-star"></i>', $empty_stars);
|
|
| 660 | 660 | $html .= '</div>'; |
| 661 | 661 | } |
| 662 | 662 | |
@@ -675,48 +675,48 @@ discard block |
||
| 675 | 675 | $full_color = get_option('geodir_reviewrating_fa_full_rating_color', '#757575');
|
| 676 | 676 | if ($full_color != '#757575') {
|
| 677 | 677 | echo '<style type="text/css">.br-theme-fontawesome-stars .br-widget a.br-active,.br-theme-fontawesome-stars .br-widget a.br-selected, |
| 678 | - .gd-star-rating svg.svg-inline--fa {color:' . stripslashes($full_color) . '!important;}</style>';
|
|
| 678 | + .gd-star-rating svg.svg-inline--fa {color:' . stripslashes($full_color).'!important;}</style>';
|
|
| 679 | 679 | } |
| 680 | 680 | } |
| 681 | 681 | } |
| 682 | 682 | |
| 683 | -function geodir_parse_shortcodes( $content, $shortcode, $first = true ) {
|
|
| 684 | - if ( empty( $content ) || empty( $shortcode ) ) {
|
|
| 683 | +function geodir_parse_shortcodes($content, $shortcode, $first = true) {
|
|
| 684 | + if (empty($content) || empty($shortcode)) {
|
|
| 685 | 685 | return array(); |
| 686 | 686 | } |
| 687 | 687 | |
| 688 | - if ( false === strpos( $content, '[' ) ) {
|
|
| 688 | + if (false === strpos($content, '[')) {
|
|
| 689 | 689 | return array(); |
| 690 | 690 | } |
| 691 | 691 | |
| 692 | - if ( ! has_shortcode( $content, $shortcode ) ) {
|
|
| 692 | + if (!has_shortcode($content, $shortcode)) {
|
|
| 693 | 693 | return array(); |
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | $shortcodes = array(); |
| 697 | - if ( preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER ) ) {
|
|
| 698 | - foreach ( $matches as $match ) {
|
|
| 699 | - if ( $shortcode === $match[2] ) {
|
|
| 700 | - $shortcode_attrs = shortcode_parse_atts( $match[3] ); |
|
| 701 | - if ( ! is_array( $shortcode_attrs ) ) {
|
|
| 697 | + if (preg_match_all('/'.get_shortcode_regex().'/s', $content, $matches, PREG_SET_ORDER)) {
|
|
| 698 | + foreach ($matches as $match) {
|
|
| 699 | + if ($shortcode === $match[2]) {
|
|
| 700 | + $shortcode_attrs = shortcode_parse_atts($match[3]); |
|
| 701 | + if (!is_array($shortcode_attrs)) {
|
|
| 702 | 702 | $shortcode_attrs = array(); |
| 703 | 703 | } |
| 704 | 704 | $shortcode_attrs['shortcode_tag'] = $shortcode; |
| 705 | - if ( !empty( $match[5] ) ) {
|
|
| 705 | + if (!empty($match[5])) {
|
|
| 706 | 706 | $shortcode_attrs['shortcode_content'] = $match[5]; |
| 707 | 707 | } |
| 708 | 708 | $shortcodes[] = $shortcode_attrs; |
| 709 | - if ( $first === true ) {
|
|
| 709 | + if ($first === true) {
|
|
| 710 | 710 | break; |
| 711 | 711 | } |
| 712 | 712 | } |
| 713 | 713 | } |
| 714 | - if ( $first === true && !empty( $shortcodes ) ) {
|
|
| 714 | + if ($first === true && !empty($shortcodes)) {
|
|
| 715 | 715 | $shortcodes = $shortcodes[0]; |
| 716 | 716 | } |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | - return apply_filters( 'geodir_parse_shortcodes', $shortcodes, $content, $shortcode, $first ); |
|
| 719 | + return apply_filters('geodir_parse_shortcodes', $shortcodes, $content, $shortcode, $first);
|
|
| 720 | 720 | } |
| 721 | 721 | |
| 722 | 722 | /** |
@@ -730,14 +730,14 @@ discard block |
||
| 730 | 730 | * @param array $email_vars The email parameters. |
| 731 | 731 | * @return string Filtered email message. |
| 732 | 732 | */ |
| 733 | -function geodir_email_wrap_message( $message, $email_type = '', $email_vars = array() ) {
|
|
| 733 | +function geodir_email_wrap_message($message, $email_type = '', $email_vars = array()) {
|
|
| 734 | 734 | global $geodir_email_content, $geodir_email_type, $geodir_email_vars; |
| 735 | 735 | |
| 736 | 736 | $geodir_email_content = $message; |
| 737 | 737 | $geodir_email_type = $email_type; |
| 738 | 738 | $geodir_email_vars = $email_vars; |
| 739 | 739 | |
| 740 | - $template = apply_filters( "geodir_template_part-email-content", geodir_locate_template( 'email-message' ) ); |
|
| 740 | + $template = apply_filters("geodir_template_part-email-content", geodir_locate_template('email-message'));
|
|
| 741 | 741 | |
| 742 | 742 | ob_start(); |
| 743 | 743 | /** |
@@ -745,7 +745,7 @@ discard block |
||
| 745 | 745 | * |
| 746 | 746 | * @since 1.6.26 |
| 747 | 747 | */ |
| 748 | - include( $template ); |
|
| 748 | + include($template); |
|
| 749 | 749 | |
| 750 | 750 | $content = ob_get_clean(); |
| 751 | 751 | |
@@ -770,7 +770,7 @@ discard block |
||
| 770 | 770 | * @param string $post_id The post ID. |
| 771 | 771 | * @param string $user_id The user ID. |
| 772 | 772 | */ |
| 773 | -function geodir_email_wrap_user_message( $message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id ) {
|
|
| 773 | +function geodir_email_wrap_user_message($message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id) {
|
|
| 774 | 774 | $email_vars = array(); |
| 775 | 775 | $email_vars['message_type'] = $message_type; |
| 776 | 776 | $email_vars['fromEmail'] = $fromEmail; |
@@ -783,9 +783,9 @@ discard block |
||
| 783 | 783 | $email_vars['post_id'] = $post_id; |
| 784 | 784 | $email_vars['user_id'] = $user_id; |
| 785 | 785 | |
| 786 | - return geodir_email_wrap_message( $message, $message_type, $email_vars ); |
|
| 786 | + return geodir_email_wrap_message($message, $message_type, $email_vars); |
|
| 787 | 787 | } |
| 788 | -add_filter( 'geodir_sendEmail_message', 'geodir_email_wrap_user_message', 10, 11 ); |
|
| 788 | +add_filter('geodir_sendEmail_message', 'geodir_email_wrap_user_message', 10, 11);
|
|
| 789 | 789 | |
| 790 | 790 | /** |
| 791 | 791 | * Filter the admin email message. |
@@ -799,13 +799,13 @@ discard block |
||
| 799 | 799 | * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'. |
| 800 | 800 | * @param string $custom_1 Custom data to be sent. |
| 801 | 801 | */ |
| 802 | -function geodir_email_wrap_admin_message( $message, $page_id, $user_id, $message_type, $custom_1 ) {
|
|
| 802 | +function geodir_email_wrap_admin_message($message, $page_id, $user_id, $message_type, $custom_1) {
|
|
| 803 | 803 | $email_vars = array(); |
| 804 | 804 | $email_vars['message_type'] = $message_type; |
| 805 | 805 | $email_vars['page_id'] = $page_id; |
| 806 | 806 | $email_vars['user_id'] = $user_id; |
| 807 | 807 | $email_vars['custom_1'] = $custom_1; |
| 808 | 808 | |
| 809 | - return geodir_email_wrap_message( $message, $message_type, $email_vars ); |
|
| 809 | + return geodir_email_wrap_message($message, $message_type, $email_vars); |
|
| 810 | 810 | } |
| 811 | -add_filter( 'geodir_adminEmail_message', 'geodir_email_wrap_admin_message', 10, 5 ); |
|
| 812 | 811 | \ No newline at end of file |
| 812 | +add_filter('geodir_adminEmail_message', 'geodir_email_wrap_admin_message', 10, 5); |
|
| 813 | 813 | \ No newline at end of file |
@@ -17,370 +17,370 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | function geodir_custom_fields_predefined($post_type=''){ |
| 19 | 19 | |
| 20 | - $custom_fields = array(); |
|
| 21 | - |
|
| 22 | - |
|
| 23 | - // price |
|
| 24 | - $custom_fields['price'] = array( // The key value should be unique and not contain any spaces. |
|
| 25 | - 'field_type' => 'text', |
|
| 26 | - 'class' => 'gd-price', |
|
| 27 | - 'icon' => 'fas fa-dollar-sign', |
|
| 28 | - 'name' => __('Price', 'geodirectory'), |
|
| 29 | - 'description' => __('Adds a input for a price field. This will let you filter and sort by price.', 'geodirectory'), |
|
| 30 | - 'defaults' => array( |
|
| 31 | - 'data_type' => 'FLOAT', |
|
| 32 | - 'decimal_point' => '2', |
|
| 33 | - 'admin_title' => 'Price', |
|
| 34 | - 'site_title' => 'Price', |
|
| 35 | - 'admin_desc' => 'Enter the price in $ (no currency symbol)', |
|
| 36 | - 'htmlvar_name' => 'price', |
|
| 37 | - 'is_active' => true, |
|
| 38 | - 'for_admin_use' => false, |
|
| 39 | - 'default_value' => '', |
|
| 40 | - 'show_in' => '[detail],[listing]', |
|
| 41 | - 'is_required' => false, |
|
| 42 | - 'validation_pattern' => '\d+(\.\d{2})?', |
|
| 43 | - 'validation_msg' => 'Please enter number and decimal only ie: 100.50', |
|
| 44 | - 'required_msg' => '', |
|
| 45 | - 'field_icon' => 'fas fa-dollar-sign', |
|
| 46 | - 'css_class' => '', |
|
| 47 | - 'cat_sort' => true, |
|
| 48 | - 'cat_filter' => true, |
|
| 49 | - 'extra_fields' => array( |
|
| 50 | - 'is_price' => 1, |
|
| 51 | - 'thousand_separator' => 'comma', |
|
| 52 | - 'decimal_separator' => 'period', |
|
| 53 | - 'decimal_display' => 'if', |
|
| 54 | - 'currency_symbol' => '$', |
|
| 55 | - 'currency_symbol_placement' => 'left' |
|
| 56 | - ) |
|
| 57 | - ) |
|
| 58 | - ); |
|
| 59 | - |
|
| 60 | - // property status |
|
| 61 | - $custom_fields['property_status'] = array( // The key value should be unique and not contain any spaces. |
|
| 62 | - 'field_type' => 'select', |
|
| 63 | - 'class' => 'gd-property-status', |
|
| 64 | - 'icon' => 'fas fa-home', |
|
| 65 | - 'name' => __('Property Status', 'geodirectory'), |
|
| 66 | - 'description' => __('Adds a select input to be able to set the status of a property ie: For Sale, For Rent', 'geodirectory'), |
|
| 67 | - 'defaults' => array( |
|
| 68 | - 'data_type' => 'VARCHAR', |
|
| 69 | - 'admin_title' => 'Property Status', |
|
| 70 | - 'site_title' => 'Property Status', |
|
| 71 | - 'admin_desc' => 'Enter the status of the property.', |
|
| 72 | - 'htmlvar_name' => 'property_status', |
|
| 73 | - 'is_active' => true, |
|
| 74 | - 'for_admin_use' => false, |
|
| 75 | - 'default_value' => '', |
|
| 76 | - 'show_in' => '[detail],[listing]', |
|
| 77 | - 'is_required' => true, |
|
| 78 | - 'option_values' => __('Select Status/,For Sale,For Rent,Sold,Let','geodirectory'), |
|
| 79 | - 'validation_pattern' => '', |
|
| 80 | - 'validation_msg' => '', |
|
| 81 | - 'required_msg' => '', |
|
| 82 | - 'field_icon' => 'fas fa-home', |
|
| 83 | - 'css_class' => '', |
|
| 84 | - 'cat_sort' => true, |
|
| 85 | - 'cat_filter' => true |
|
| 86 | - ) |
|
| 87 | - ); |
|
| 88 | - |
|
| 89 | - // property furnishing |
|
| 90 | - $custom_fields['property_furnishing'] = array( // The key value should be unique and not contain any spaces. |
|
| 91 | - 'field_type' => 'select', |
|
| 92 | - 'class' => 'gd-property-furnishing', |
|
| 93 | - 'icon' => 'fas fa-home', |
|
| 94 | - 'name' => __('Property Furnishing', 'geodirectory'), |
|
| 95 | - 'description' => __('Adds a select input to be able to set the furnishing status of a property ie: Unfurnished, Furnished', 'geodirectory'), |
|
| 96 | - 'defaults' => array( |
|
| 97 | - 'data_type' => 'VARCHAR', |
|
| 98 | - 'admin_title' => 'Furnishing', |
|
| 99 | - 'site_title' => 'Furnishing', |
|
| 100 | - 'admin_desc' => 'Enter the furnishing status of the property.', |
|
| 101 | - 'htmlvar_name' => 'property_furnishing', |
|
| 102 | - 'is_active' => true, |
|
| 103 | - 'for_admin_use' => false, |
|
| 104 | - 'default_value' => '', |
|
| 105 | - 'show_in' => '[detail],[listing]', |
|
| 106 | - 'is_required' => true, |
|
| 107 | - 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
| 108 | - 'validation_pattern' => '', |
|
| 109 | - 'validation_msg' => '', |
|
| 110 | - 'required_msg' => '', |
|
| 111 | - 'field_icon' => 'fas fa-th-large', |
|
| 112 | - 'css_class' => '', |
|
| 113 | - 'cat_sort' => true, |
|
| 114 | - 'cat_filter' => true |
|
| 115 | - ) |
|
| 116 | - ); |
|
| 117 | - |
|
| 118 | - // property type |
|
| 119 | - $custom_fields['property_type'] = array( // The key value should be unique and not contain any spaces. |
|
| 120 | - 'field_type' => 'select', |
|
| 121 | - 'class' => 'gd-property-type', |
|
| 122 | - 'icon' => 'fas fa-home', |
|
| 123 | - 'name' => __('Property Type', 'geodirectory'), |
|
| 124 | - 'description' => __('Adds a select input for the property type ie: Detached house, Apartment', 'geodirectory'), |
|
| 125 | - 'defaults' => array( |
|
| 126 | - 'data_type' => 'VARCHAR', |
|
| 127 | - 'admin_title' => 'Property Type', |
|
| 128 | - 'site_title' => 'Property Type', |
|
| 129 | - 'admin_desc' => 'Select the property type.', |
|
| 130 | - 'htmlvar_name' => 'property_type', |
|
| 131 | - 'is_active' => true, |
|
| 132 | - 'for_admin_use' => false, |
|
| 133 | - 'default_value' => '', |
|
| 134 | - 'show_in' => '[detail],[listing]', |
|
| 135 | - 'is_required' => true, |
|
| 136 | - 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage','geodirectory'), |
|
| 137 | - 'validation_pattern' => '', |
|
| 138 | - 'validation_msg' => '', |
|
| 139 | - 'required_msg' => '', |
|
| 140 | - 'field_icon' => 'fas fa-home', |
|
| 141 | - 'css_class' => '', |
|
| 142 | - 'cat_sort' => true, |
|
| 143 | - 'cat_filter' => true |
|
| 144 | - ) |
|
| 145 | - ); |
|
| 146 | - |
|
| 147 | - // property bedrooms |
|
| 148 | - $custom_fields['property_bedrooms'] = array( // The key value should be unique and not contain any spaces. |
|
| 149 | - 'field_type' => 'select', |
|
| 150 | - 'class' => 'gd-property-bedrooms', |
|
| 151 | - 'icon' => 'fas fa-home', |
|
| 152 | - 'name' => __('Property Bedrooms', 'geodirectory'), |
|
| 153 | - 'description' => __('Adds a select input for the number of bedrooms.', 'geodirectory'), |
|
| 154 | - 'defaults' => array( |
|
| 155 | - 'data_type' => 'VARCHAR', |
|
| 156 | - 'admin_title' => 'Property Bedrooms', |
|
| 157 | - 'site_title' => 'Bedrooms', |
|
| 158 | - 'admin_desc' => 'Select the number of bedrooms', |
|
| 159 | - 'htmlvar_name' => 'property_bedrooms', |
|
| 160 | - 'is_active' => true, |
|
| 161 | - 'for_admin_use' => false, |
|
| 162 | - 'default_value' => '', |
|
| 163 | - 'show_in' => '[detail],[listing]', |
|
| 164 | - 'is_required' => true, |
|
| 165 | - 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 166 | - 'validation_pattern' => '', |
|
| 167 | - 'validation_msg' => '', |
|
| 168 | - 'required_msg' => '', |
|
| 169 | - 'field_icon' => 'fas fa-bed', |
|
| 170 | - 'css_class' => '', |
|
| 171 | - 'cat_sort' => true, |
|
| 172 | - 'cat_filter' => true |
|
| 173 | - ) |
|
| 174 | - ); |
|
| 175 | - |
|
| 176 | - // property bathrooms |
|
| 177 | - $custom_fields['property_bathrooms'] = array( // The key value should be unique and not contain any spaces. |
|
| 178 | - 'field_type' => 'select', |
|
| 179 | - 'class' => 'gd-property-bathrooms', |
|
| 180 | - 'icon' => 'fas fa-home', |
|
| 181 | - 'name' => __('Property Bathrooms', 'geodirectory'), |
|
| 182 | - 'description' => __('Adds a select input for the number of bathrooms.', 'geodirectory'), |
|
| 183 | - 'defaults' => array( |
|
| 184 | - 'data_type' => 'VARCHAR', |
|
| 185 | - 'admin_title' => 'Property Bathrooms', |
|
| 186 | - 'site_title' => 'Bathrooms', |
|
| 187 | - 'admin_desc' => 'Select the number of bathrooms', |
|
| 188 | - 'htmlvar_name' => 'property_bathrooms', |
|
| 189 | - 'is_active' => true, |
|
| 190 | - 'for_admin_use' => false, |
|
| 191 | - 'default_value' => '', |
|
| 192 | - 'show_in' => '[detail],[listing]', |
|
| 193 | - 'is_required' => true, |
|
| 194 | - 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 195 | - 'validation_pattern' => '', |
|
| 196 | - 'validation_msg' => '', |
|
| 197 | - 'required_msg' => '', |
|
| 198 | - 'field_icon' => 'fas fa-bold', |
|
| 199 | - 'css_class' => '', |
|
| 200 | - 'cat_sort' => true, |
|
| 201 | - 'cat_filter' => true |
|
| 202 | - ) |
|
| 203 | - ); |
|
| 204 | - |
|
| 205 | - // property area |
|
| 206 | - $custom_fields['property_area'] = array( // The key value should be unique and not contain any spaces. |
|
| 207 | - 'field_type' => 'text', |
|
| 208 | - 'class' => 'gd-area', |
|
| 209 | - 'icon' => 'fas fa-home', |
|
| 210 | - 'name' => __('Property Area', 'geodirectory'), |
|
| 211 | - 'description' => __('Adds a input for the property area.', 'geodirectory'), |
|
| 212 | - 'defaults' => array( |
|
| 213 | - 'data_type' => 'FLOAT', |
|
| 214 | - 'admin_title' => 'Property Area', |
|
| 215 | - 'site_title' => 'Area (Sq Ft)', |
|
| 216 | - 'admin_desc' => 'Enter the Sq Ft value for the property', |
|
| 217 | - 'htmlvar_name' => 'property_area', |
|
| 218 | - 'is_active' => true, |
|
| 219 | - 'for_admin_use' => false, |
|
| 220 | - 'default_value' => '', |
|
| 221 | - 'show_in' => '[detail],[listing]', |
|
| 222 | - 'is_required' => false, |
|
| 223 | - 'validation_pattern' => '\d+(\.\d{2})?', |
|
| 224 | - 'validation_msg' => 'Please enter the property area in numbers only: 1500', |
|
| 225 | - 'required_msg' => '', |
|
| 226 | - 'field_icon' => 'fas fa-chart-area', |
|
| 227 | - 'css_class' => '', |
|
| 228 | - 'cat_sort' => true, |
|
| 229 | - 'cat_filter' => true |
|
| 230 | - ) |
|
| 231 | - ); |
|
| 232 | - |
|
| 233 | - // property features |
|
| 234 | - $custom_fields['property_features'] = array( // The key value should be unique and not contain any spaces. |
|
| 235 | - 'field_type' => 'multiselect', |
|
| 236 | - 'class' => 'gd-property-features', |
|
| 237 | - 'icon' => 'fas fa-home', |
|
| 238 | - 'name' => __('Property Features', 'geodirectory'), |
|
| 239 | - 'description' => __('Adds a select input for the property features.', 'geodirectory'), |
|
| 240 | - 'defaults' => array( |
|
| 241 | - 'data_type' => 'VARCHAR', |
|
| 242 | - 'admin_title' => 'Property Features', |
|
| 243 | - 'site_title' => 'Features', |
|
| 244 | - 'admin_desc' => 'Select the property features.', |
|
| 245 | - 'htmlvar_name' => 'property_features', |
|
| 246 | - 'is_active' => true, |
|
| 247 | - 'for_admin_use' => false, |
|
| 248 | - 'default_value' => '', |
|
| 249 | - 'show_in' => '[detail],[listing]', |
|
| 250 | - 'is_required' => true, |
|
| 251 | - 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
| 252 | - 'validation_pattern' => '', |
|
| 253 | - 'validation_msg' => '', |
|
| 254 | - 'required_msg' => '', |
|
| 255 | - 'field_icon' => 'fas fa-plus-square', |
|
| 256 | - 'css_class' => '', |
|
| 257 | - 'cat_sort' => true, |
|
| 258 | - 'cat_filter' => true |
|
| 259 | - ) |
|
| 260 | - ); |
|
| 261 | - |
|
| 262 | - // Twitter feed |
|
| 263 | - $custom_fields['twitter_feed'] = array( // The key value should be unique and not contain any spaces. |
|
| 264 | - 'field_type' => 'text', |
|
| 265 | - 'class' => 'gd-twitter', |
|
| 266 | - 'icon' => 'fab fa-twitter', |
|
| 267 | - 'name' => __('Twitter feed', 'geodirectory'), |
|
| 268 | - 'description' => __('Adds a input for twitter username and outputs feed.', 'geodirectory'), |
|
| 269 | - 'defaults' => array( |
|
| 270 | - 'data_type' => 'VARCHAR', |
|
| 271 | - 'admin_title' => 'Twitter', |
|
| 272 | - 'site_title' => 'Twitter', |
|
| 273 | - 'admin_desc' => 'Enter your Twitter username', |
|
| 274 | - 'htmlvar_name' => 'twitterusername', |
|
| 275 | - 'is_active' => true, |
|
| 276 | - 'for_admin_use' => false, |
|
| 277 | - 'default_value' => '', |
|
| 278 | - 'show_in' => '[detail],[owntab]', |
|
| 279 | - 'is_required' => false, |
|
| 280 | - 'validation_pattern' => '^[A-Za-z0-9_]{1,32}$', |
|
| 281 | - 'validation_msg' => 'Please enter a valid twitter username.', |
|
| 282 | - 'required_msg' => '', |
|
| 283 | - 'field_icon' => 'fab fa-twitter', |
|
| 284 | - 'css_class' => '', |
|
| 285 | - 'cat_sort' => false, |
|
| 286 | - 'cat_filter' => false |
|
| 287 | - ) |
|
| 288 | - ); |
|
| 289 | - |
|
| 290 | - // Get directions link |
|
| 291 | - $custom_fields['get_directions'] = array( // The key value should be unique and not contain any spaces. |
|
| 292 | - 'field_type' => 'text', |
|
| 293 | - 'class' => 'gd-get-directions', |
|
| 294 | - 'icon' => 'fas fa-location-arrow', |
|
| 295 | - 'name' => __('Get Directions Link', 'geodirectory'), |
|
| 296 | - 'description' => __('Adds a input for twitter username and outputs feed.', 'geodirectory'), |
|
| 297 | - 'defaults' => array( |
|
| 298 | - 'data_type' => 'VARCHAR', |
|
| 299 | - 'admin_title' => 'Get Directions', |
|
| 300 | - 'site_title' => 'Get Directions', |
|
| 301 | - 'admin_desc' => '', |
|
| 302 | - 'htmlvar_name' => 'get_directions', |
|
| 303 | - 'is_active' => true, |
|
| 304 | - 'for_admin_use' => true, |
|
| 305 | - 'default_value' => 'Get Directions', |
|
| 306 | - 'show_in' => '[detail],[listing]', |
|
| 307 | - 'is_required' => false, |
|
| 308 | - 'validation_pattern' => '', |
|
| 309 | - 'validation_msg' => '', |
|
| 310 | - 'required_msg' => '', |
|
| 311 | - 'field_icon' => 'fas fa-location-arrow', |
|
| 312 | - 'css_class' => '', |
|
| 313 | - 'cat_sort' => false, |
|
| 314 | - 'cat_filter' => false |
|
| 315 | - ) |
|
| 316 | - ); |
|
| 317 | - |
|
| 318 | - |
|
| 319 | - // JOB TYPE CF |
|
| 320 | - |
|
| 321 | - // job type |
|
| 322 | - $custom_fields['job_type'] = array( // The key value should be unique and not contain any spaces. |
|
| 323 | - 'field_type' => 'select', |
|
| 324 | - 'class' => 'gd-job-type', |
|
| 325 | - 'icon' => 'fas fa-briefcase', |
|
| 326 | - 'name' => __('Job Type', 'geodirectory'), |
|
| 327 | - 'description' => __('Adds a select input to be able to set the type of a job ie: Full Time, Part Time', 'geodirectory'), |
|
| 328 | - 'defaults' => array( |
|
| 329 | - 'data_type' => 'VARCHAR', |
|
| 330 | - 'admin_title' => __('Job Type', 'geodirectory'), |
|
| 331 | - 'site_title' => __('Job Type','geodirectory'), |
|
| 332 | - 'admin_desc' => __('Select the type of job.','geodirectory'), |
|
| 333 | - 'htmlvar_name' => 'job_type', |
|
| 334 | - 'is_active' => true, |
|
| 335 | - 'for_admin_use' => false, |
|
| 336 | - 'default_value' => '', |
|
| 337 | - 'show_in' => '[detail],[listing]', |
|
| 338 | - 'is_required' => true, |
|
| 339 | - 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'), |
|
| 340 | - 'validation_pattern' => '', |
|
| 341 | - 'validation_msg' => '', |
|
| 342 | - 'required_msg' => '', |
|
| 343 | - 'field_icon' => 'fas fa-briefcase', |
|
| 344 | - 'css_class' => '', |
|
| 345 | - 'cat_sort' => true, |
|
| 346 | - 'cat_filter' => true |
|
| 347 | - ) |
|
| 348 | - ); |
|
| 349 | - |
|
| 350 | - // job sector |
|
| 351 | - $custom_fields['job_sector'] = array( // The key value should be unique and not contain any spaces. |
|
| 352 | - 'field_type' => 'select', |
|
| 353 | - 'class' => 'gd-job-type', |
|
| 354 | - 'icon' => 'fas fa-briefcase', |
|
| 355 | - 'name' => __('Job Sector', 'geodirectory'), |
|
| 356 | - 'description' => __('Adds a select input to be able to set the type of a job Sector ie: Private Sector,Public Sector', 'geodirectory'), |
|
| 357 | - 'defaults' => array( |
|
| 358 | - 'data_type' => 'VARCHAR', |
|
| 359 | - 'admin_title' => __('Job Sector','geodirectory'), |
|
| 360 | - 'site_title' => __('Job Sector','geodirectory'), |
|
| 361 | - 'admin_desc' => __('Select the job sector.','geodirectory'), |
|
| 362 | - 'htmlvar_name' => 'job_sector', |
|
| 363 | - 'is_active' => true, |
|
| 364 | - 'for_admin_use' => false, |
|
| 365 | - 'default_value' => '', |
|
| 366 | - 'show_in' => '[detail]', |
|
| 367 | - 'is_required' => true, |
|
| 368 | - 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'), |
|
| 369 | - 'validation_pattern' => '', |
|
| 370 | - 'validation_msg' => '', |
|
| 371 | - 'required_msg' => '', |
|
| 372 | - 'field_icon' => 'fas fa-briefcase', |
|
| 373 | - 'css_class' => '', |
|
| 374 | - 'cat_sort' => true, |
|
| 375 | - 'cat_filter' => true |
|
| 376 | - ) |
|
| 377 | - ); |
|
| 378 | - |
|
| 379 | - |
|
| 380 | - /** |
|
| 381 | - * @see `geodir_custom_fields` |
|
| 382 | - */ |
|
| 383 | - return apply_filters('geodir_custom_fields_predefined',$custom_fields,$post_type); |
|
| 20 | + $custom_fields = array(); |
|
| 21 | + |
|
| 22 | + |
|
| 23 | + // price |
|
| 24 | + $custom_fields['price'] = array( // The key value should be unique and not contain any spaces. |
|
| 25 | + 'field_type' => 'text', |
|
| 26 | + 'class' => 'gd-price', |
|
| 27 | + 'icon' => 'fas fa-dollar-sign', |
|
| 28 | + 'name' => __('Price', 'geodirectory'), |
|
| 29 | + 'description' => __('Adds a input for a price field. This will let you filter and sort by price.', 'geodirectory'), |
|
| 30 | + 'defaults' => array( |
|
| 31 | + 'data_type' => 'FLOAT', |
|
| 32 | + 'decimal_point' => '2', |
|
| 33 | + 'admin_title' => 'Price', |
|
| 34 | + 'site_title' => 'Price', |
|
| 35 | + 'admin_desc' => 'Enter the price in $ (no currency symbol)', |
|
| 36 | + 'htmlvar_name' => 'price', |
|
| 37 | + 'is_active' => true, |
|
| 38 | + 'for_admin_use' => false, |
|
| 39 | + 'default_value' => '', |
|
| 40 | + 'show_in' => '[detail],[listing]', |
|
| 41 | + 'is_required' => false, |
|
| 42 | + 'validation_pattern' => '\d+(\.\d{2})?', |
|
| 43 | + 'validation_msg' => 'Please enter number and decimal only ie: 100.50', |
|
| 44 | + 'required_msg' => '', |
|
| 45 | + 'field_icon' => 'fas fa-dollar-sign', |
|
| 46 | + 'css_class' => '', |
|
| 47 | + 'cat_sort' => true, |
|
| 48 | + 'cat_filter' => true, |
|
| 49 | + 'extra_fields' => array( |
|
| 50 | + 'is_price' => 1, |
|
| 51 | + 'thousand_separator' => 'comma', |
|
| 52 | + 'decimal_separator' => 'period', |
|
| 53 | + 'decimal_display' => 'if', |
|
| 54 | + 'currency_symbol' => '$', |
|
| 55 | + 'currency_symbol_placement' => 'left' |
|
| 56 | + ) |
|
| 57 | + ) |
|
| 58 | + ); |
|
| 59 | + |
|
| 60 | + // property status |
|
| 61 | + $custom_fields['property_status'] = array( // The key value should be unique and not contain any spaces. |
|
| 62 | + 'field_type' => 'select', |
|
| 63 | + 'class' => 'gd-property-status', |
|
| 64 | + 'icon' => 'fas fa-home', |
|
| 65 | + 'name' => __('Property Status', 'geodirectory'), |
|
| 66 | + 'description' => __('Adds a select input to be able to set the status of a property ie: For Sale, For Rent', 'geodirectory'), |
|
| 67 | + 'defaults' => array( |
|
| 68 | + 'data_type' => 'VARCHAR', |
|
| 69 | + 'admin_title' => 'Property Status', |
|
| 70 | + 'site_title' => 'Property Status', |
|
| 71 | + 'admin_desc' => 'Enter the status of the property.', |
|
| 72 | + 'htmlvar_name' => 'property_status', |
|
| 73 | + 'is_active' => true, |
|
| 74 | + 'for_admin_use' => false, |
|
| 75 | + 'default_value' => '', |
|
| 76 | + 'show_in' => '[detail],[listing]', |
|
| 77 | + 'is_required' => true, |
|
| 78 | + 'option_values' => __('Select Status/,For Sale,For Rent,Sold,Let','geodirectory'), |
|
| 79 | + 'validation_pattern' => '', |
|
| 80 | + 'validation_msg' => '', |
|
| 81 | + 'required_msg' => '', |
|
| 82 | + 'field_icon' => 'fas fa-home', |
|
| 83 | + 'css_class' => '', |
|
| 84 | + 'cat_sort' => true, |
|
| 85 | + 'cat_filter' => true |
|
| 86 | + ) |
|
| 87 | + ); |
|
| 88 | + |
|
| 89 | + // property furnishing |
|
| 90 | + $custom_fields['property_furnishing'] = array( // The key value should be unique and not contain any spaces. |
|
| 91 | + 'field_type' => 'select', |
|
| 92 | + 'class' => 'gd-property-furnishing', |
|
| 93 | + 'icon' => 'fas fa-home', |
|
| 94 | + 'name' => __('Property Furnishing', 'geodirectory'), |
|
| 95 | + 'description' => __('Adds a select input to be able to set the furnishing status of a property ie: Unfurnished, Furnished', 'geodirectory'), |
|
| 96 | + 'defaults' => array( |
|
| 97 | + 'data_type' => 'VARCHAR', |
|
| 98 | + 'admin_title' => 'Furnishing', |
|
| 99 | + 'site_title' => 'Furnishing', |
|
| 100 | + 'admin_desc' => 'Enter the furnishing status of the property.', |
|
| 101 | + 'htmlvar_name' => 'property_furnishing', |
|
| 102 | + 'is_active' => true, |
|
| 103 | + 'for_admin_use' => false, |
|
| 104 | + 'default_value' => '', |
|
| 105 | + 'show_in' => '[detail],[listing]', |
|
| 106 | + 'is_required' => true, |
|
| 107 | + 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
| 108 | + 'validation_pattern' => '', |
|
| 109 | + 'validation_msg' => '', |
|
| 110 | + 'required_msg' => '', |
|
| 111 | + 'field_icon' => 'fas fa-th-large', |
|
| 112 | + 'css_class' => '', |
|
| 113 | + 'cat_sort' => true, |
|
| 114 | + 'cat_filter' => true |
|
| 115 | + ) |
|
| 116 | + ); |
|
| 117 | + |
|
| 118 | + // property type |
|
| 119 | + $custom_fields['property_type'] = array( // The key value should be unique and not contain any spaces. |
|
| 120 | + 'field_type' => 'select', |
|
| 121 | + 'class' => 'gd-property-type', |
|
| 122 | + 'icon' => 'fas fa-home', |
|
| 123 | + 'name' => __('Property Type', 'geodirectory'), |
|
| 124 | + 'description' => __('Adds a select input for the property type ie: Detached house, Apartment', 'geodirectory'), |
|
| 125 | + 'defaults' => array( |
|
| 126 | + 'data_type' => 'VARCHAR', |
|
| 127 | + 'admin_title' => 'Property Type', |
|
| 128 | + 'site_title' => 'Property Type', |
|
| 129 | + 'admin_desc' => 'Select the property type.', |
|
| 130 | + 'htmlvar_name' => 'property_type', |
|
| 131 | + 'is_active' => true, |
|
| 132 | + 'for_admin_use' => false, |
|
| 133 | + 'default_value' => '', |
|
| 134 | + 'show_in' => '[detail],[listing]', |
|
| 135 | + 'is_required' => true, |
|
| 136 | + 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage','geodirectory'), |
|
| 137 | + 'validation_pattern' => '', |
|
| 138 | + 'validation_msg' => '', |
|
| 139 | + 'required_msg' => '', |
|
| 140 | + 'field_icon' => 'fas fa-home', |
|
| 141 | + 'css_class' => '', |
|
| 142 | + 'cat_sort' => true, |
|
| 143 | + 'cat_filter' => true |
|
| 144 | + ) |
|
| 145 | + ); |
|
| 146 | + |
|
| 147 | + // property bedrooms |
|
| 148 | + $custom_fields['property_bedrooms'] = array( // The key value should be unique and not contain any spaces. |
|
| 149 | + 'field_type' => 'select', |
|
| 150 | + 'class' => 'gd-property-bedrooms', |
|
| 151 | + 'icon' => 'fas fa-home', |
|
| 152 | + 'name' => __('Property Bedrooms', 'geodirectory'), |
|
| 153 | + 'description' => __('Adds a select input for the number of bedrooms.', 'geodirectory'), |
|
| 154 | + 'defaults' => array( |
|
| 155 | + 'data_type' => 'VARCHAR', |
|
| 156 | + 'admin_title' => 'Property Bedrooms', |
|
| 157 | + 'site_title' => 'Bedrooms', |
|
| 158 | + 'admin_desc' => 'Select the number of bedrooms', |
|
| 159 | + 'htmlvar_name' => 'property_bedrooms', |
|
| 160 | + 'is_active' => true, |
|
| 161 | + 'for_admin_use' => false, |
|
| 162 | + 'default_value' => '', |
|
| 163 | + 'show_in' => '[detail],[listing]', |
|
| 164 | + 'is_required' => true, |
|
| 165 | + 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 166 | + 'validation_pattern' => '', |
|
| 167 | + 'validation_msg' => '', |
|
| 168 | + 'required_msg' => '', |
|
| 169 | + 'field_icon' => 'fas fa-bed', |
|
| 170 | + 'css_class' => '', |
|
| 171 | + 'cat_sort' => true, |
|
| 172 | + 'cat_filter' => true |
|
| 173 | + ) |
|
| 174 | + ); |
|
| 175 | + |
|
| 176 | + // property bathrooms |
|
| 177 | + $custom_fields['property_bathrooms'] = array( // The key value should be unique and not contain any spaces. |
|
| 178 | + 'field_type' => 'select', |
|
| 179 | + 'class' => 'gd-property-bathrooms', |
|
| 180 | + 'icon' => 'fas fa-home', |
|
| 181 | + 'name' => __('Property Bathrooms', 'geodirectory'), |
|
| 182 | + 'description' => __('Adds a select input for the number of bathrooms.', 'geodirectory'), |
|
| 183 | + 'defaults' => array( |
|
| 184 | + 'data_type' => 'VARCHAR', |
|
| 185 | + 'admin_title' => 'Property Bathrooms', |
|
| 186 | + 'site_title' => 'Bathrooms', |
|
| 187 | + 'admin_desc' => 'Select the number of bathrooms', |
|
| 188 | + 'htmlvar_name' => 'property_bathrooms', |
|
| 189 | + 'is_active' => true, |
|
| 190 | + 'for_admin_use' => false, |
|
| 191 | + 'default_value' => '', |
|
| 192 | + 'show_in' => '[detail],[listing]', |
|
| 193 | + 'is_required' => true, |
|
| 194 | + 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 195 | + 'validation_pattern' => '', |
|
| 196 | + 'validation_msg' => '', |
|
| 197 | + 'required_msg' => '', |
|
| 198 | + 'field_icon' => 'fas fa-bold', |
|
| 199 | + 'css_class' => '', |
|
| 200 | + 'cat_sort' => true, |
|
| 201 | + 'cat_filter' => true |
|
| 202 | + ) |
|
| 203 | + ); |
|
| 204 | + |
|
| 205 | + // property area |
|
| 206 | + $custom_fields['property_area'] = array( // The key value should be unique and not contain any spaces. |
|
| 207 | + 'field_type' => 'text', |
|
| 208 | + 'class' => 'gd-area', |
|
| 209 | + 'icon' => 'fas fa-home', |
|
| 210 | + 'name' => __('Property Area', 'geodirectory'), |
|
| 211 | + 'description' => __('Adds a input for the property area.', 'geodirectory'), |
|
| 212 | + 'defaults' => array( |
|
| 213 | + 'data_type' => 'FLOAT', |
|
| 214 | + 'admin_title' => 'Property Area', |
|
| 215 | + 'site_title' => 'Area (Sq Ft)', |
|
| 216 | + 'admin_desc' => 'Enter the Sq Ft value for the property', |
|
| 217 | + 'htmlvar_name' => 'property_area', |
|
| 218 | + 'is_active' => true, |
|
| 219 | + 'for_admin_use' => false, |
|
| 220 | + 'default_value' => '', |
|
| 221 | + 'show_in' => '[detail],[listing]', |
|
| 222 | + 'is_required' => false, |
|
| 223 | + 'validation_pattern' => '\d+(\.\d{2})?', |
|
| 224 | + 'validation_msg' => 'Please enter the property area in numbers only: 1500', |
|
| 225 | + 'required_msg' => '', |
|
| 226 | + 'field_icon' => 'fas fa-chart-area', |
|
| 227 | + 'css_class' => '', |
|
| 228 | + 'cat_sort' => true, |
|
| 229 | + 'cat_filter' => true |
|
| 230 | + ) |
|
| 231 | + ); |
|
| 232 | + |
|
| 233 | + // property features |
|
| 234 | + $custom_fields['property_features'] = array( // The key value should be unique and not contain any spaces. |
|
| 235 | + 'field_type' => 'multiselect', |
|
| 236 | + 'class' => 'gd-property-features', |
|
| 237 | + 'icon' => 'fas fa-home', |
|
| 238 | + 'name' => __('Property Features', 'geodirectory'), |
|
| 239 | + 'description' => __('Adds a select input for the property features.', 'geodirectory'), |
|
| 240 | + 'defaults' => array( |
|
| 241 | + 'data_type' => 'VARCHAR', |
|
| 242 | + 'admin_title' => 'Property Features', |
|
| 243 | + 'site_title' => 'Features', |
|
| 244 | + 'admin_desc' => 'Select the property features.', |
|
| 245 | + 'htmlvar_name' => 'property_features', |
|
| 246 | + 'is_active' => true, |
|
| 247 | + 'for_admin_use' => false, |
|
| 248 | + 'default_value' => '', |
|
| 249 | + 'show_in' => '[detail],[listing]', |
|
| 250 | + 'is_required' => true, |
|
| 251 | + 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
| 252 | + 'validation_pattern' => '', |
|
| 253 | + 'validation_msg' => '', |
|
| 254 | + 'required_msg' => '', |
|
| 255 | + 'field_icon' => 'fas fa-plus-square', |
|
| 256 | + 'css_class' => '', |
|
| 257 | + 'cat_sort' => true, |
|
| 258 | + 'cat_filter' => true |
|
| 259 | + ) |
|
| 260 | + ); |
|
| 261 | + |
|
| 262 | + // Twitter feed |
|
| 263 | + $custom_fields['twitter_feed'] = array( // The key value should be unique and not contain any spaces. |
|
| 264 | + 'field_type' => 'text', |
|
| 265 | + 'class' => 'gd-twitter', |
|
| 266 | + 'icon' => 'fab fa-twitter', |
|
| 267 | + 'name' => __('Twitter feed', 'geodirectory'), |
|
| 268 | + 'description' => __('Adds a input for twitter username and outputs feed.', 'geodirectory'), |
|
| 269 | + 'defaults' => array( |
|
| 270 | + 'data_type' => 'VARCHAR', |
|
| 271 | + 'admin_title' => 'Twitter', |
|
| 272 | + 'site_title' => 'Twitter', |
|
| 273 | + 'admin_desc' => 'Enter your Twitter username', |
|
| 274 | + 'htmlvar_name' => 'twitterusername', |
|
| 275 | + 'is_active' => true, |
|
| 276 | + 'for_admin_use' => false, |
|
| 277 | + 'default_value' => '', |
|
| 278 | + 'show_in' => '[detail],[owntab]', |
|
| 279 | + 'is_required' => false, |
|
| 280 | + 'validation_pattern' => '^[A-Za-z0-9_]{1,32}$', |
|
| 281 | + 'validation_msg' => 'Please enter a valid twitter username.', |
|
| 282 | + 'required_msg' => '', |
|
| 283 | + 'field_icon' => 'fab fa-twitter', |
|
| 284 | + 'css_class' => '', |
|
| 285 | + 'cat_sort' => false, |
|
| 286 | + 'cat_filter' => false |
|
| 287 | + ) |
|
| 288 | + ); |
|
| 289 | + |
|
| 290 | + // Get directions link |
|
| 291 | + $custom_fields['get_directions'] = array( // The key value should be unique and not contain any spaces. |
|
| 292 | + 'field_type' => 'text', |
|
| 293 | + 'class' => 'gd-get-directions', |
|
| 294 | + 'icon' => 'fas fa-location-arrow', |
|
| 295 | + 'name' => __('Get Directions Link', 'geodirectory'), |
|
| 296 | + 'description' => __('Adds a input for twitter username and outputs feed.', 'geodirectory'), |
|
| 297 | + 'defaults' => array( |
|
| 298 | + 'data_type' => 'VARCHAR', |
|
| 299 | + 'admin_title' => 'Get Directions', |
|
| 300 | + 'site_title' => 'Get Directions', |
|
| 301 | + 'admin_desc' => '', |
|
| 302 | + 'htmlvar_name' => 'get_directions', |
|
| 303 | + 'is_active' => true, |
|
| 304 | + 'for_admin_use' => true, |
|
| 305 | + 'default_value' => 'Get Directions', |
|
| 306 | + 'show_in' => '[detail],[listing]', |
|
| 307 | + 'is_required' => false, |
|
| 308 | + 'validation_pattern' => '', |
|
| 309 | + 'validation_msg' => '', |
|
| 310 | + 'required_msg' => '', |
|
| 311 | + 'field_icon' => 'fas fa-location-arrow', |
|
| 312 | + 'css_class' => '', |
|
| 313 | + 'cat_sort' => false, |
|
| 314 | + 'cat_filter' => false |
|
| 315 | + ) |
|
| 316 | + ); |
|
| 317 | + |
|
| 318 | + |
|
| 319 | + // JOB TYPE CF |
|
| 320 | + |
|
| 321 | + // job type |
|
| 322 | + $custom_fields['job_type'] = array( // The key value should be unique and not contain any spaces. |
|
| 323 | + 'field_type' => 'select', |
|
| 324 | + 'class' => 'gd-job-type', |
|
| 325 | + 'icon' => 'fas fa-briefcase', |
|
| 326 | + 'name' => __('Job Type', 'geodirectory'), |
|
| 327 | + 'description' => __('Adds a select input to be able to set the type of a job ie: Full Time, Part Time', 'geodirectory'), |
|
| 328 | + 'defaults' => array( |
|
| 329 | + 'data_type' => 'VARCHAR', |
|
| 330 | + 'admin_title' => __('Job Type', 'geodirectory'), |
|
| 331 | + 'site_title' => __('Job Type','geodirectory'), |
|
| 332 | + 'admin_desc' => __('Select the type of job.','geodirectory'), |
|
| 333 | + 'htmlvar_name' => 'job_type', |
|
| 334 | + 'is_active' => true, |
|
| 335 | + 'for_admin_use' => false, |
|
| 336 | + 'default_value' => '', |
|
| 337 | + 'show_in' => '[detail],[listing]', |
|
| 338 | + 'is_required' => true, |
|
| 339 | + 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'), |
|
| 340 | + 'validation_pattern' => '', |
|
| 341 | + 'validation_msg' => '', |
|
| 342 | + 'required_msg' => '', |
|
| 343 | + 'field_icon' => 'fas fa-briefcase', |
|
| 344 | + 'css_class' => '', |
|
| 345 | + 'cat_sort' => true, |
|
| 346 | + 'cat_filter' => true |
|
| 347 | + ) |
|
| 348 | + ); |
|
| 349 | + |
|
| 350 | + // job sector |
|
| 351 | + $custom_fields['job_sector'] = array( // The key value should be unique and not contain any spaces. |
|
| 352 | + 'field_type' => 'select', |
|
| 353 | + 'class' => 'gd-job-type', |
|
| 354 | + 'icon' => 'fas fa-briefcase', |
|
| 355 | + 'name' => __('Job Sector', 'geodirectory'), |
|
| 356 | + 'description' => __('Adds a select input to be able to set the type of a job Sector ie: Private Sector,Public Sector', 'geodirectory'), |
|
| 357 | + 'defaults' => array( |
|
| 358 | + 'data_type' => 'VARCHAR', |
|
| 359 | + 'admin_title' => __('Job Sector','geodirectory'), |
|
| 360 | + 'site_title' => __('Job Sector','geodirectory'), |
|
| 361 | + 'admin_desc' => __('Select the job sector.','geodirectory'), |
|
| 362 | + 'htmlvar_name' => 'job_sector', |
|
| 363 | + 'is_active' => true, |
|
| 364 | + 'for_admin_use' => false, |
|
| 365 | + 'default_value' => '', |
|
| 366 | + 'show_in' => '[detail]', |
|
| 367 | + 'is_required' => true, |
|
| 368 | + 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'), |
|
| 369 | + 'validation_pattern' => '', |
|
| 370 | + 'validation_msg' => '', |
|
| 371 | + 'required_msg' => '', |
|
| 372 | + 'field_icon' => 'fas fa-briefcase', |
|
| 373 | + 'css_class' => '', |
|
| 374 | + 'cat_sort' => true, |
|
| 375 | + 'cat_filter' => true |
|
| 376 | + ) |
|
| 377 | + ); |
|
| 378 | + |
|
| 379 | + |
|
| 380 | + /** |
|
| 381 | + * @see `geodir_custom_fields` |
|
| 382 | + */ |
|
| 383 | + return apply_filters('geodir_custom_fields_predefined',$custom_fields,$post_type); |
|
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | |
@@ -395,32 +395,32 @@ discard block |
||
| 395 | 395 | * @return string The html to output. |
| 396 | 396 | */ |
| 397 | 397 | function geodir_predefined_custom_field_output_twitter_feed($html,$location,$cf){ |
| 398 | - global $post; |
|
| 398 | + global $post; |
|
| 399 | 399 | |
| 400 | 400 | |
| 401 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
| 401 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
| 402 | 402 | |
| 403 | - $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
|
| 403 | + $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
|
| 404 | 404 | |
| 405 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 406 | - if (strpos($field_icon, 'http') !== false) { |
|
| 407 | - $field_icon_af = ''; |
|
| 408 | - } elseif ($field_icon == '') { |
|
| 409 | - $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="far fa-clock"></i>' : ""; |
|
| 410 | - } else { |
|
| 411 | - $field_icon_af = $field_icon; |
|
| 412 | - $field_icon = ''; |
|
| 413 | - } |
|
| 405 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 406 | + if (strpos($field_icon, 'http') !== false) { |
|
| 407 | + $field_icon_af = ''; |
|
| 408 | + } elseif ($field_icon == '') { |
|
| 409 | + $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="far fa-clock"></i>' : ""; |
|
| 410 | + } else { |
|
| 411 | + $field_icon_af = $field_icon; |
|
| 412 | + $field_icon = ''; |
|
| 413 | + } |
|
| 414 | 414 | |
| 415 | 415 | |
| 416 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
| 416 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
| 417 | 417 | |
| 418 | - $html .= '<a class="twitter-timeline" data-height="600" data-dnt="true" href="https://twitter.com/'.$post->{$cf['htmlvar_name']}.'">Tweets by '.$post->{$cf['htmlvar_name']}.'</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>'; |
|
| 419 | - $html .= '</div>'; |
|
| 418 | + $html .= '<a class="twitter-timeline" data-height="600" data-dnt="true" href="https://twitter.com/'.$post->{$cf['htmlvar_name']}.'">Tweets by '.$post->{$cf['htmlvar_name']}.'</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>'; |
|
| 419 | + $html .= '</div>'; |
|
| 420 | 420 | |
| 421 | - endif; |
|
| 421 | + endif; |
|
| 422 | 422 | |
| 423 | - return $html; |
|
| 423 | + return $html; |
|
| 424 | 424 | } |
| 425 | 425 | add_filter('geodir_custom_field_output_text_key_twitter_feed','geodir_predefined_custom_field_output_twitter_feed',10,3); |
| 426 | 426 | |
@@ -435,37 +435,37 @@ discard block |
||
| 435 | 435 | * @return string The html to output. |
| 436 | 436 | */ |
| 437 | 437 | function geodir_predefined_custom_field_output_get_directions($html,$location,$cf) { |
| 438 | - global $post; |
|
| 438 | + global $post; |
|
| 439 | 439 | |
| 440 | 440 | |
| 441 | - if ( isset( $post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset( $post->post_latitude ) && $post->post_latitude ){ |
|
| 441 | + if ( isset( $post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset( $post->post_latitude ) && $post->post_latitude ){ |
|
| 442 | 442 | |
| 443 | - $field_icon = geodir_field_icon_proccess( $cf ); |
|
| 444 | - if ( strpos( $field_icon, 'http' ) !== false ) { |
|
| 445 | - $field_icon_af = ''; |
|
| 446 | - } elseif ( $field_icon == '' ) { |
|
| 447 | - $field_icon_af = '<i class="fas fa-location-arrow"></i>'; |
|
| 448 | - } else { |
|
| 449 | - $field_icon_af = $field_icon; |
|
| 450 | - $field_icon = ''; |
|
| 451 | - } |
|
| 443 | + $field_icon = geodir_field_icon_proccess( $cf ); |
|
| 444 | + if ( strpos( $field_icon, 'http' ) !== false ) { |
|
| 445 | + $field_icon_af = ''; |
|
| 446 | + } elseif ( $field_icon == '' ) { |
|
| 447 | + $field_icon_af = '<i class="fas fa-location-arrow"></i>'; |
|
| 448 | + } else { |
|
| 449 | + $field_icon_af = $field_icon; |
|
| 450 | + $field_icon = ''; |
|
| 451 | + } |
|
| 452 | 452 | |
| 453 | - $link_text = !empty( $cf['default_value']) ? $cf['default_value'] : __( 'Get Directions', 'geodirectory' ); |
|
| 453 | + $link_text = !empty( $cf['default_value']) ? $cf['default_value'] : __( 'Get Directions', 'geodirectory' ); |
|
| 454 | 454 | |
| 455 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
| 455 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
| 456 | 456 | |
| 457 | - if(isset( $cf['field_icon'] ) && $cf['field_icon']){ |
|
| 458 | - $html .= $field_icon_af; |
|
| 459 | - } |
|
| 457 | + if(isset( $cf['field_icon'] ) && $cf['field_icon']){ |
|
| 458 | + $html .= $field_icon_af; |
|
| 459 | + } |
|
| 460 | 460 | |
| 461 | - // We use maps.apple.com here because it will handle redirects nicely in most cases |
|
| 462 | - $html .= '<a href="https://maps.apple.com/?daddr=' . $post->post_latitude . ',' . $post->post_longitude . '" target="_blank" >' . $link_text . '</a>'; |
|
| 463 | - $html .= '</div>'; |
|
| 461 | + // We use maps.apple.com here because it will handle redirects nicely in most cases |
|
| 462 | + $html .= '<a href="https://maps.apple.com/?daddr=' . $post->post_latitude . ',' . $post->post_longitude . '" target="_blank" >' . $link_text . '</a>'; |
|
| 463 | + $html .= '</div>'; |
|
| 464 | 464 | |
| 465 | - }else{ |
|
| 466 | - $html =''; |
|
| 467 | - } |
|
| 465 | + }else{ |
|
| 466 | + $html =''; |
|
| 467 | + } |
|
| 468 | 468 | |
| 469 | - return $html; |
|
| 469 | + return $html; |
|
| 470 | 470 | } |
| 471 | 471 | add_filter('geodir_custom_field_output_text_key_get_directions','geodir_predefined_custom_field_output_get_directions',10,3); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | * @package GeoDirectory |
| 16 | 16 | * @see `geodir_custom_field_save` for array details. |
| 17 | 17 | */ |
| 18 | -function geodir_custom_fields_predefined($post_type=''){ |
|
| 18 | +function geodir_custom_fields_predefined($post_type = '') { |
|
| 19 | 19 | |
| 20 | 20 | $custom_fields = array(); |
| 21 | 21 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | 'default_value' => '', |
| 76 | 76 | 'show_in' => '[detail],[listing]', |
| 77 | 77 | 'is_required' => true, |
| 78 | - 'option_values' => __('Select Status/,For Sale,For Rent,Sold,Let','geodirectory'), |
|
| 78 | + 'option_values' => __('Select Status/,For Sale,For Rent,Sold,Let', 'geodirectory'), |
|
| 79 | 79 | 'validation_pattern' => '', |
| 80 | 80 | 'validation_msg' => '', |
| 81 | 81 | 'required_msg' => '', |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | 'default_value' => '', |
| 105 | 105 | 'show_in' => '[detail],[listing]', |
| 106 | 106 | 'is_required' => true, |
| 107 | - 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
| 107 | + 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional', 'geodirectory'), |
|
| 108 | 108 | 'validation_pattern' => '', |
| 109 | 109 | 'validation_msg' => '', |
| 110 | 110 | 'required_msg' => '', |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | 'default_value' => '', |
| 134 | 134 | 'show_in' => '[detail],[listing]', |
| 135 | 135 | 'is_required' => true, |
| 136 | - 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage','geodirectory'), |
|
| 136 | + 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage', 'geodirectory'), |
|
| 137 | 137 | 'validation_pattern' => '', |
| 138 | 138 | 'validation_msg' => '', |
| 139 | 139 | 'required_msg' => '', |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | 'default_value' => '', |
| 163 | 163 | 'show_in' => '[detail],[listing]', |
| 164 | 164 | 'is_required' => true, |
| 165 | - 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 165 | + 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'), |
|
| 166 | 166 | 'validation_pattern' => '', |
| 167 | 167 | 'validation_msg' => '', |
| 168 | 168 | 'required_msg' => '', |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | 'default_value' => '', |
| 192 | 192 | 'show_in' => '[detail],[listing]', |
| 193 | 193 | 'is_required' => true, |
| 194 | - 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 194 | + 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10', 'geodirectory'), |
|
| 195 | 195 | 'validation_pattern' => '', |
| 196 | 196 | 'validation_msg' => '', |
| 197 | 197 | 'required_msg' => '', |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | 'default_value' => '', |
| 249 | 249 | 'show_in' => '[detail],[listing]', |
| 250 | 250 | 'is_required' => true, |
| 251 | - 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
| 251 | + 'option_values' => __('Select Features/,Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace', 'geodirectory'), |
|
| 252 | 252 | 'validation_pattern' => '', |
| 253 | 253 | 'validation_msg' => '', |
| 254 | 254 | 'required_msg' => '', |
@@ -328,15 +328,15 @@ discard block |
||
| 328 | 328 | 'defaults' => array( |
| 329 | 329 | 'data_type' => 'VARCHAR', |
| 330 | 330 | 'admin_title' => __('Job Type', 'geodirectory'), |
| 331 | - 'site_title' => __('Job Type','geodirectory'), |
|
| 332 | - 'admin_desc' => __('Select the type of job.','geodirectory'), |
|
| 331 | + 'site_title' => __('Job Type', 'geodirectory'), |
|
| 332 | + 'admin_desc' => __('Select the type of job.', 'geodirectory'), |
|
| 333 | 333 | 'htmlvar_name' => 'job_type', |
| 334 | 334 | 'is_active' => true, |
| 335 | 335 | 'for_admin_use' => false, |
| 336 | 336 | 'default_value' => '', |
| 337 | 337 | 'show_in' => '[detail],[listing]', |
| 338 | 338 | 'is_required' => true, |
| 339 | - 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other','geodirectory'), |
|
| 339 | + 'option_values' => __('Select Type/,Freelance,Full Time,Internship,Part Time,Temporary,Other', 'geodirectory'), |
|
| 340 | 340 | 'validation_pattern' => '', |
| 341 | 341 | 'validation_msg' => '', |
| 342 | 342 | 'required_msg' => '', |
@@ -356,16 +356,16 @@ discard block |
||
| 356 | 356 | 'description' => __('Adds a select input to be able to set the type of a job Sector ie: Private Sector,Public Sector', 'geodirectory'), |
| 357 | 357 | 'defaults' => array( |
| 358 | 358 | 'data_type' => 'VARCHAR', |
| 359 | - 'admin_title' => __('Job Sector','geodirectory'), |
|
| 360 | - 'site_title' => __('Job Sector','geodirectory'), |
|
| 361 | - 'admin_desc' => __('Select the job sector.','geodirectory'), |
|
| 359 | + 'admin_title' => __('Job Sector', 'geodirectory'), |
|
| 360 | + 'site_title' => __('Job Sector', 'geodirectory'), |
|
| 361 | + 'admin_desc' => __('Select the job sector.', 'geodirectory'), |
|
| 362 | 362 | 'htmlvar_name' => 'job_sector', |
| 363 | 363 | 'is_active' => true, |
| 364 | 364 | 'for_admin_use' => false, |
| 365 | 365 | 'default_value' => '', |
| 366 | 366 | 'show_in' => '[detail]', |
| 367 | 367 | 'is_required' => true, |
| 368 | - 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies','geodirectory'), |
|
| 368 | + 'option_values' => __('Select Sector/,Private Sector,Public Sector,Agencies', 'geodirectory'), |
|
| 369 | 369 | 'validation_pattern' => '', |
| 370 | 370 | 'validation_msg' => '', |
| 371 | 371 | 'required_msg' => '', |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | /** |
| 381 | 381 | * @see `geodir_custom_fields` |
| 382 | 382 | */ |
| 383 | - return apply_filters('geodir_custom_fields_predefined',$custom_fields,$post_type); |
|
| 383 | + return apply_filters('geodir_custom_fields_predefined', $custom_fields, $post_type); |
|
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | |
@@ -394,11 +394,11 @@ discard block |
||
| 394 | 394 | * @since 1.6.9 |
| 395 | 395 | * @return string The html to output. |
| 396 | 396 | */ |
| 397 | -function geodir_predefined_custom_field_output_twitter_feed($html,$location,$cf){ |
|
| 397 | +function geodir_predefined_custom_field_output_twitter_feed($html, $location, $cf) { |
|
| 398 | 398 | global $post; |
| 399 | 399 | |
| 400 | 400 | |
| 401 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
| 401 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
|
| 402 | 402 | |
| 403 | 403 | $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
| 404 | 404 | |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | |
| 416 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
| 416 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;">'; |
|
| 417 | 417 | |
| 418 | 418 | $html .= '<a class="twitter-timeline" data-height="600" data-dnt="true" href="https://twitter.com/'.$post->{$cf['htmlvar_name']}.'">Tweets by '.$post->{$cf['htmlvar_name']}.'</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>'; |
| 419 | 419 | $html .= '</div>'; |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | |
| 423 | 423 | return $html; |
| 424 | 424 | } |
| 425 | -add_filter('geodir_custom_field_output_text_key_twitter_feed','geodir_predefined_custom_field_output_twitter_feed',10,3); |
|
| 425 | +add_filter('geodir_custom_field_output_text_key_twitter_feed', 'geodir_predefined_custom_field_output_twitter_feed', 10, 3); |
|
| 426 | 426 | |
| 427 | 427 | /** |
| 428 | 428 | * Filter the get_directions custom field output to show a link. |
@@ -434,38 +434,38 @@ discard block |
||
| 434 | 434 | * @since 1.6.9 |
| 435 | 435 | * @return string The html to output. |
| 436 | 436 | */ |
| 437 | -function geodir_predefined_custom_field_output_get_directions($html,$location,$cf) { |
|
| 437 | +function geodir_predefined_custom_field_output_get_directions($html, $location, $cf) { |
|
| 438 | 438 | global $post; |
| 439 | 439 | |
| 440 | 440 | |
| 441 | - if ( isset( $post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset( $post->post_latitude ) && $post->post_latitude ){ |
|
| 441 | + if (isset($post->{$cf['htmlvar_name']} ) && $post->{$cf['htmlvar_name']} != '' && isset($post->post_latitude) && $post->post_latitude) { |
|
| 442 | 442 | |
| 443 | - $field_icon = geodir_field_icon_proccess( $cf ); |
|
| 444 | - if ( strpos( $field_icon, 'http' ) !== false ) { |
|
| 443 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 444 | + if (strpos($field_icon, 'http') !== false) { |
|
| 445 | 445 | $field_icon_af = ''; |
| 446 | - } elseif ( $field_icon == '' ) { |
|
| 446 | + } elseif ($field_icon == '') { |
|
| 447 | 447 | $field_icon_af = '<i class="fas fa-location-arrow"></i>'; |
| 448 | 448 | } else { |
| 449 | 449 | $field_icon_af = $field_icon; |
| 450 | 450 | $field_icon = ''; |
| 451 | 451 | } |
| 452 | 452 | |
| 453 | - $link_text = !empty( $cf['default_value']) ? $cf['default_value'] : __( 'Get Directions', 'geodirectory' ); |
|
| 453 | + $link_text = !empty($cf['default_value']) ? $cf['default_value'] : __('Get Directions', 'geodirectory'); |
|
| 454 | 454 | |
| 455 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;">'; |
|
| 455 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;">'; |
|
| 456 | 456 | |
| 457 | - if(isset( $cf['field_icon'] ) && $cf['field_icon']){ |
|
| 457 | + if (isset($cf['field_icon']) && $cf['field_icon']) { |
|
| 458 | 458 | $html .= $field_icon_af; |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | // We use maps.apple.com here because it will handle redirects nicely in most cases |
| 462 | - $html .= '<a href="https://maps.apple.com/?daddr=' . $post->post_latitude . ',' . $post->post_longitude . '" target="_blank" >' . $link_text . '</a>'; |
|
| 462 | + $html .= '<a href="https://maps.apple.com/?daddr='.$post->post_latitude.','.$post->post_longitude.'" target="_blank" >'.$link_text.'</a>'; |
|
| 463 | 463 | $html .= '</div>'; |
| 464 | 464 | |
| 465 | - }else{ |
|
| 466 | - $html =''; |
|
| 465 | + } else { |
|
| 466 | + $html = ''; |
|
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | return $html; |
| 470 | 470 | } |
| 471 | -add_filter('geodir_custom_field_output_text_key_get_directions','geodir_predefined_custom_field_output_get_directions',10,3); |
|
| 471 | +add_filter('geodir_custom_field_output_text_key_get_directions', 'geodir_predefined_custom_field_output_get_directions', 10, 3); |
|