roles ? $user->roles[0] : false; ## All Users remove_menu_page( 'edit-comments.php' ); ## Staff Users if( $userRole == 'staff' ) { remove_menu_page( 'edit.php' ); remove_menu_page( 'tools.php' ); remove_menu_page( 'profile.php' ); remove_menu_page( 'wpcf7' ); remove_menu_page( 'admin.php?page=acf-options-theme-settings' ); } #remove_menu_page( 'edit-comments.php' ); } #add_action( 'admin_init', 'restrictAdminMenu', 999); ## Setup custom Email (SMTP) settings for the site -> OFF function send_smtp_email( $phpmailer ) { $phpmailer->isSMTP(); $phpmailer->Host = "smtp.mailgun.org"; $phpmailer->SMTPAuth = true; $phpmailer->Port = "25"; $phpmailer->Username = "postmaster@mg.kanemitchell.co.uk"; ## Add Username from MailGun $phpmailer->Password = "4324bf505ac90db817b531e341935ddc"; ## Add Password from MailGun $phpmailer->SMTPSecure = "tls"; $phpmailer->From = "no-reply@kanemitchell.co.uk"; $phpmailer->FromName = "Kane Mitchell"; } #add_action('phpmailer_init','send_smtp_email'); ## Remove support for comments -> OFF function remove_comment_support() { remove_post_type_support( 'post', 'comments' ); remove_post_type_support( 'page', 'comments' ); } add_action('init', 'remove_comment_support', 100); ?> $user_id, 'admin_color' => 'midnight' ); wp_update_user( $args ); } add_action('user_register', 'set_default_admin_color'); // Site Custom Stylesheet function site_settings_customStylesheet() { wp_enqueue_style( 'site-settings-custom-style', PLUGIN_SITE_SETUP_URL.'style/css/site-style.css' ); } add_action( 'wp_enqueue_scripts', 'site_settings_customStylesheet' ); // Admin Custom Stylesheet function site_settings_adminStylesheet() { wp_register_style( 'site-settings-admin-style', PLUGIN_SITE_SETUP_URL.'style/css/admin-style.css', false, '1.0.0' ); wp_enqueue_style( 'site-settings-admin-style' ); // wp_register_script( 'site_settings_customJS', PLUGIN_SITE_SETUP_URL.'javascript/min/custom-scripts-min.js', array(), '20130115', true ); // wp_localize_script( 'site_settings_customJS', 'MyAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php'))); // wp_enqueue_script( 'site_settings_customJS' ); wp_register_script( 'property_site_script', PLUGIN_SITE_SETUP_URL.'javascript/min/property-site-scripts-min.js', array( 'jquery' ) ); wp_localize_script( 'property_site_script', 'MyAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php'))); wp_enqueue_script( 'property_site_script' ); wp_enqueue_script( 'google-maps-script', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyADcK3NeArY7gv3L0infWsa1kycL_Lve7Q', array( 'jquery' ) ); } add_action( 'admin_enqueue_scripts', 'site_settings_adminStylesheet' ); ## Custom JS function site_settings_addJS() { // wp_register_script( 'site_settings_customJS', PLUGIN_SITE_SETUP_URL.'javascript/min/custom-scripts-min.js', array( 'jquery' ) ); // wp_localize_script( 'site_settings_customJS', 'MyAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php'))); // wp_enqueue_script( 'site_settings_customJS' ); wp_register_script( 'property_site_script', PLUGIN_SITE_SETUP_URL.'javascript/min/property-site-scripts-min.js', array( 'jquery' ) ); wp_localize_script( 'property_site_script', 'MyAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php'))); wp_enqueue_script( 'property_site_script' ); wp_enqueue_script( 'google-maps-script', 'https://maps.googleapis.com/maps/api/js?key=AIzaSyADcK3NeArY7gv3L0infWsa1kycL_Lve7Q', array( 'jquery' ) ); } add_action( 'wp_enqueue_scripts', 'site_settings_addJS' ); // Login Stylesheet function siteSettings_login_stylesheet() { wp_register_style( 'custom_login_style', PLUGIN_SITE_SETUP_URL.'style/css/login-style.css' ); wp_enqueue_style( 'custom_login_style' ); wp_enqueue_style( 'custom_login_font', 'https://fonts.googleapis.com/css?family=Droid+Sans', false ); } add_action( 'login_enqueue_scripts', 'siteSettings_login_stylesheet' ); function siteSettings_disable_wp_emojicons() { // all actions related to emojis remove_action( 'admin_print_styles', 'print_emoji_styles' ); remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); remove_action( 'wp_print_styles', 'print_emoji_styles' ); remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); // filter to remove TinyMCE emojis add_filter( 'tiny_mce_plugins', 'disable_emojicons_tinymce' ); } add_action( 'init', 'siteSettings_disable_wp_emojicons'); function disable_emojicons_tinymce( $plugins ) { if ( is_array( $plugins ) ) { return array_diff( $plugins, array( 'wpemoji' ) ); } else { return array(); } } // Defer jQuery Parsing using the HTML5 defer property function siteSettings_defer_js() { $current_user = wp_get_current_user(); if( !current_user_can('editor') && !current_user_can('administrator') ) { function siteSettings_defer_parsing_of_js ( $url ) { if ( FALSE === strpos( $url, '.js' ) ) return $url; if ( strpos( $url, 'jquery.js' ) ) return $url; // return "$url' defer "; return "$url' defer onload='"; } add_filter( 'clean_url', 'siteSettings_defer_parsing_of_js', 11, 1 ); } } #add_action( 'init', 'siteSettings_defer_js'); ?> __( 'Footer Offer Type Links' ), 'footer-type-links' => __( 'Footer Type Links' ), ) ); } add_action( 'init', 'custom_register_my_menus' ); // Limit media library access function wpb_show_current_user_attachments( $query ) { $user_id = get_current_user_id(); if ( $user_id && !current_user_can('activate_plugins') && !current_user_can('edit_others_posts') ) { $query['author'] = $user_id; } return $query; } add_filter( 'ajax_query_attachments_args', 'wpb_show_current_user_attachments' ); // Block Agents Accessing WP Dashbard function blockAgentDashboardAccess() { $user_id = get_current_user_id(); $user_info = get_userdata($user_id); $user_roles = implode(', ', $user_info->roles); if (strpos($user_roles, 'agent') !== false && is_admin() && ! wp_doing_ajax() ) { header("Location:/"); die(); } } add_action( 'admin_init', 'blockAgentDashboardAccess' ); #add_filter('show_admin_bar', '__return_false'); add_image_size( 'agent-logo', 300, 125, true ); function remove_menus() { global $user_ID; if ( current_user_can( 'staff' ) ) { remove_menu_page( 'edit.php' ); remove_menu_page( 'edit.php?post_type=notifications' ); remove_menu_page( 'edit-comments.php' ); } } add_action( 'admin_menu', 'remove_menus' ); function my_footer_shh() { remove_filter( 'update_footer', 'core_update_footer' ); } add_action( 'admin_menu', 'my_footer_shh' ); function remove_wp_logo( $wp_admin_bar ) { $wp_admin_bar->remove_node( 'wp-logo' ); $wp_admin_bar->remove_node( 'new-content' ); $wp_admin_bar->remove_node( 'bar-comments' ); } add_action( 'admin_bar_menu', 'remove_wp_logo', 999 ); add_filter( 'bulk_actions-edit-property', 'my_custom_bulk_actions' ); function my_custom_bulk_actions( $actions ){ unset( $actions[ 'edit' ] ); unset( $actions[ 'trash' ] ); return $actions; } function remove_dashboard_meta() { global $user_ID; if ( current_user_can( 'staff' ) ) { remove_meta_box('dashboard_activity', 'dashboard', 'normal'); //Removes the 'Activity' widget (since 3.8) remove_meta_box('dashboard_right_now', 'dashboard', 'normal'); //Removes the 'At a Glance' widget } // remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); //Removes the 'incoming links' widget // remove_meta_box('dashboard_plugins', 'dashboard', 'normal'); //Removes the 'plugins' widget // remove_meta_box('dashboard_primary', 'dashboard', 'normal'); //Removes the 'WordPress News' widget // remove_meta_box('dashboard_secondary', 'dashboard', 'normal'); //Removes the secondary widget // remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); //Removes the 'Quick Draft' widget // remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side'); //Removes the 'Recent Drafts' widget // remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); //Removes the 'Activity' widget } add_action('admin_init', 'remove_dashboard_meta'); ?> Properties function register_posttype_properties() { $labels = array( 'name' => _x( 'Properties', 'Post Type General Name', 'text_domain' ), 'singular_name' => _x( 'Property', 'Post Type Singular Name', 'text_domain' ), 'menu_name' => __( 'Properties', 'text_domain' ), 'name_admin_bar' => __( 'Properties', 'text_domain' ), 'archives' => __( 'Item Archives', 'text_domain' ), 'attributes' => __( 'Item Attributes', 'text_domain' ), 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ), 'all_items' => __( 'All Items', 'text_domain' ), 'add_new_item' => __( 'Add New Item', 'text_domain' ), 'add_new' => __( 'Add New', 'text_domain' ), 'new_item' => __( 'New Item', 'text_domain' ), 'edit_item' => __( 'Edit Item', 'text_domain' ), 'update_item' => __( 'Update Item', 'text_domain' ), 'view_item' => __( 'View Item', 'text_domain' ), 'view_items' => __( 'View Items', 'text_domain' ), 'search_items' => __( 'Search Item', 'text_domain' ), 'not_found' => __( 'Not found', 'text_domain' ), 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ), 'featured_image' => __( 'Featured Image', 'text_domain' ), 'set_featured_image' => __( 'Set featured image', 'text_domain' ), 'remove_featured_image' => __( 'Remove featured image', 'text_domain' ), 'use_featured_image' => __( 'Use as featured image', 'text_domain' ), 'insert_into_item' => __( 'Insert into item', 'text_domain' ), 'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ), 'items_list' => __( 'Items list', 'text_domain' ), 'items_list_navigation' => __( 'Items list navigation', 'text_domain' ), 'filter_items_list' => __( 'Filter items list', 'text_domain' ), ); $args = array( 'label' => __( 'Property', 'text_domain' ), 'labels' => $labels, 'supports' => array( 'title', 'author', 'publicize' ), 'taxonomies' => array(), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 5, 'show_in_admin_bar' => false, 'show_in_nav_menus' => true, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', ); register_post_type( 'property', $args ); ## Add Property Offer Type -> This is used to say what type of building it is. $labels = array( 'name' => _x( 'Property Offer Types', 'taxonomy general name' ), 'singular_name' => _x( 'Property Offer Type', 'taxonomy singular name' ), 'search_items' => __( 'Search Property Offer Types' ), 'all_items' => __( 'All Property Offer Types' ), 'parent_item' => __( 'Parent Property Offer Type' ), 'parent_item_colon' => __( 'Parent Property Offer Type:' ), 'edit_item' => __( 'Edit Property Offer Type' ), 'update_item' => __( 'Update Property Offer Type' ), 'add_new_item' => __( 'Add New Property Offer Type' ), 'new_item_name' => __( 'New Property Offer Type Name' ), 'menu_name' => __( 'Property Offer Types' ), ); register_taxonomy('property_offer_type','property', array( 'hierarchical' => false, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => false, 'query_var' => true, 'show_in_nav_menus' => false, 'rewrite' => array('slug' => 'properties/property-offer-type', 'with_front' => false), ) ); ## Add Property Type Category -> This is used to say what type of building it is. $labels = array( 'name' => _x( 'Property Types', 'taxonomy general name' ), 'singular_name' => _x( 'Property Type', 'taxonomy singular name' ), 'search_items' => __( 'Search Property Types' ), 'all_items' => __( 'All Property Types' ), 'parent_item' => __( 'Parent Property Type' ), 'parent_item_colon' => __( 'Parent Property Type:' ), 'edit_item' => __( 'Edit Property Type' ), 'update_item' => __( 'Update Property Type' ), 'add_new_item' => __( 'Add New Property Type' ), 'new_item_name' => __( 'New Property Type Name' ), 'menu_name' => __( 'Property Types' ), ); register_taxonomy('property_type','property', array( 'labels' => $labels, 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_admin_column' => false, 'show_in_nav_menus' => false, 'show_tagcloud' => false, 'rewrite' => array('slug' => 'properties/property-type', 'with_front' => false), ) ); ## Add Location State -> States of Nigeria $labels = array( 'name' => _x( 'States', 'taxonomy general name' ), 'singular_name' => _x( 'State', 'taxonomy singular name' ), 'search_items' => __( 'Search States' ), 'all_items' => __( 'All States' ), 'parent_item' => __( 'Parent State' ), 'parent_item_colon' => __( 'Parent State:' ), 'edit_item' => __( 'Edit State' ), 'update_item' => __( 'Update State' ), 'add_new_item' => __( 'Add New State' ), 'new_item_name' => __( 'New State Name' ), 'menu_name' => __( 'States' ), ); register_taxonomy('property_state','property', array( 'labels' => $labels, 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_admin_column' => false, 'show_in_nav_menus' => false, 'show_tagcloud' => false, 'rewrite' => array('slug' => 'properties/property-state', 'with_front' => false), ) ); ## Add Location Cities & Towns -> Cities & Towns of Nigeria $labels = array( 'name' => _x( 'Localitys', 'taxonomy general name' ), 'singular_name' => _x( 'Locality', 'taxonomy singular name' ), 'search_items' => __( 'Search Localitys' ), 'all_items' => __( 'All Localitys' ), 'parent_item' => __( 'Parent Locality' ), 'parent_item_colon' => __( 'Parent Locality:' ), 'edit_item' => __( 'Edit Locality' ), 'update_item' => __( 'Update Locality' ), 'add_new_item' => __( 'Add New Locality' ), 'new_item_name' => __( 'New Locality Name' ), 'menu_name' => __( 'Locality' ), ); register_taxonomy('property_place','property', array( 'labels' => $labels, 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_admin_column' => false, 'show_in_nav_menus' => false, 'show_tagcloud' => false, 'rewrite' => array('slug' => 'properties/property-place', 'with_front' => false), ) ); ## Add Location Area $labels = array( 'name' => _x( 'Areas', 'taxonomy general name' ), 'singular_name' => _x( 'Area', 'taxonomy singular name' ), 'search_items' => __( 'Search Areas' ), 'all_items' => __( 'All Areas' ), 'parent_item' => __( 'Parent Area' ), 'parent_item_colon' => __( 'Parent Area:' ), 'edit_item' => __( 'Edit Area' ), 'update_item' => __( 'Update Area' ), 'add_new_item' => __( 'Add New Area' ), 'new_item_name' => __( 'New Area Name' ), 'menu_name' => __( 'Areas' ), ); register_taxonomy('property_area','property', array( 'labels' => $labels, 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_admin_column' => false, 'show_in_nav_menus' => false, 'show_tagcloud' => false, 'rewrite' => array('slug' => 'properties/property-area', 'with_front' => false), ) ); } add_action( 'init', 'register_posttype_properties', 0 ); ## REMORE META BOXES function remove_PropertyMetaBoxes() { remove_meta_box( 'tagsdiv-property-offer-type', 'property', 'normal' ); remove_meta_box( 'tagsdiv-property_type', 'property', 'normal' ); remove_meta_box( 'tagsdiv-property_state', 'property', 'normal' ); remove_meta_box( 'tagsdiv-property_place', 'property', 'normal' ); } add_action( 'admin_menu' , 'remove_PropertyMetaBoxes' ); // Show the data in the Post List in the admin area. function bs_projects_table_head( $columns ) { $screen = get_current_screen(); #echo $screen; $new = array(); foreach($columns as $key => $title) { if ($key == 'author') { $new['status'] = 'Status'; } $new[$key] = $title; } return $new; } add_filter('manage_property_posts_columns', 'bs_projects_table_head'); function bs_projects_table_content( $column_name, $post_id ) { if( $column_name == 'status' ) { $propertyApproved = get_post_meta( $post_id, 'approved', true ); $propertyRejected = get_post_meta( $post_id, 'rejected', true ); $propertyPublished = get_post_meta( $post_id, 'published', true ); $status = ""; if( $propertyPublished == 0 ) { $status == 'Draft'; } elseif( $propertyPublished == 1 && $propertyApproved == 1 && $propertyRejected == 0 ) { $status = 'Approved'; } elseif( $propertyPublished == 1 && $propertyApproved == 0 && $propertyRejected == 0 ) { $status = 'Awaiting Approval'; } elseif( $propertyPublished == 1 && $propertyRejected == 1 ) { $status = 'Rejected'; } echo $status; } } add_action( 'manage_property_posts_custom_column', 'bs_projects_table_content', 10, 2 ); ?> _x( 'Notifications', 'Post Type General Name', 'text_domain' ), 'singular_name' => _x( 'Notification', 'Post Type Singular Name', 'text_domain' ), 'menu_name' => __( 'Notifications', 'text_domain' ), 'name_admin_bar' => __( 'Post Type', 'text_domain' ), 'archives' => __( 'Notifications Archives', 'text_domain' ), 'attributes' => __( 'Notification Attributes', 'text_domain' ), 'parent_item_colon' => __( 'Notification Item:', 'text_domain' ), 'all_items' => __( 'All Notifications', 'text_domain' ), 'add_new_item' => __( 'Add New Notifications', 'text_domain' ), 'add_new' => __( 'Add Notification', 'text_domain' ), 'new_item' => __( 'New Notification', 'text_domain' ), 'edit_item' => __( 'Edit Notification', 'text_domain' ), 'update_item' => __( 'Update Notification', 'text_domain' ), 'view_item' => __( 'View Notification', 'text_domain' ), 'view_items' => __( 'View Notifications', 'text_domain' ), 'search_items' => __( 'Search Notification', 'text_domain' ), 'not_found' => __( 'Not found', 'text_domain' ), 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ), 'featured_image' => __( 'Featured Image', 'text_domain' ), 'set_featured_image' => __( 'Set featured image', 'text_domain' ), 'remove_featured_image' => __( 'Remove featured image', 'text_domain' ), 'use_featured_image' => __( 'Use as featured image', 'text_domain' ), 'insert_into_item' => __( 'Insert into item', 'text_domain' ), 'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ), 'items_list' => __( 'Notifications list', 'text_domain' ), 'items_list_navigation' => __( 'Notifications list navigation', 'text_domain' ), 'filter_items_list' => __( 'Filter Notifications list', 'text_domain' ), ); $args = array( 'label' => __( 'Notification', 'text_domain' ), 'description' => __( 'Post Type Description', 'text_domain' ), 'labels' => $labels, 'supports' => array( 'title', 'editor' ), 'hierarchical' => false, 'public' => false, 'show_ui' => true, 'show_in_menu' => true, 'menu_position' => 5, 'show_in_admin_bar' => false, 'show_in_nav_menus' => true, 'can_export' => false, 'has_archive' => false, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', ); register_post_type( 'notifications', $args ); } add_action( 'init', 'register_posttype_notifications', 0 ); ?> Shortcodes *****/ ## Add frontend form ## Main Search Form function shc_property_MainSearch() { $termsTypes = get_terms( array('taxonomy' => 'property_type', 'parent' => 0, 'orderby' => 'ID', 'order' => 'ASC', 'hide_empty' => false)); $termsStates = get_terms( array('taxonomy' => 'property_state','hide_empty' => false)); $termsPlaces = get_terms( array('taxonomy' => 'property_place','hide_empty' => false)); $termsAreas = get_terms( array('taxonomy' => 'property_area','hide_empty' => false)); $arrLocations = array(); $arrStates = array(); $arrPlaces = array(); $arrAreas = array(); $typeOptions = ""; foreach ($termsTypes as $type) { $typeOptions .= "
  • ".$type->name."
  • "; } foreach ($termsStates as $state) { $termName = str_replace("'", "'", $state->name); $arrLocations[] = array( "termID" => $state->term_id, "termName" => $termName ,'termSlug' => $state->slug, 'type' => 'state' ); } foreach ($termsPlaces as $place) { $termName = str_replace("'", "'", $place->name); $arrLocations[] = array( "termID" => $place->term_id, "termName" => $termName ,'termSlug' => $place->slug, 'type' => 'place' ); } foreach ($termsAreas as $area) { $termName = str_replace("'", "'", $area->name); $arrLocations[] = array( "termID" => $area->term_id, "termName" => $termName ,'termSlug' => $area->slug, 'type' => 'area' ); } $jsonLocations = json_encode($arrLocations); $html = <<

      Property Type:

      Any

      • Any
      • $typeOptions

      Bedroom:

      Any

      • Any
      • 1
      • 2
      • 3
      • 4
      • 5
      • 6
      • 7
      • 8
      • 9

      Min Price:

      Any

      • No Min
      • ₦ 10,000
      • ₦ 50,000
      • ₦ 100,000
      • ₦ 250,000
      • ₦ 500,000
      • ₦ 750,000
      • ₦ 1,000,000
      • ₦ 2,000,000
      • ₦ 5,000,000
      • ₦ 10,000,000
      • ₦ 20,000,000
      • ₦ 40,000,000
      • ₦ 60,000,000
      • ₦ 80,000,000
      • ₦ 100,000,000
      • ₦ 150,000,000

      Max Price:

      Any

      • No Max
      • ₦ 10,000
      • ₦ 50,000
      • ₦ 100,000
      • ₦ 250,000
      • ₦ 500,000
      • ₦ 750,000
      • ₦ 1,000,000
      • ₦ 2,000,000
      • ₦ 5,000,000
      • ₦ 10,000,000
      • ₦ 20,000,000
      • ₦ 40,000,000
      • ₦ 60,000,000
      • ₦ 80,000,000
      • ₦ 100,000,000
      • ₦ 150,000,000
      • ₦ 250,000,000
      • ₦ 600,000,000
      • ₦ 1,000,000,000
      • ₦ 2,000,000,000

      Furnished:

      Any

      • All
      • Furnished
      • Unfurnished

      Added to the site:

      Any

      • Anytime
      • 24 Hours
      • 3 Days
      • 7 Days
      • 14 Days

      Keywords:

      Ref Num:

      EOT; return $html; } add_shortcode( 'propertyMainSearch' , 'shc_property_MainSearch' ); function shc_propertyActivateAccount() { $html = ""; if( isset( $_GET['a'] ) && $_GET['a'] != "" ) { ### Activate ACCOUNT global $wpdb; $sql = "SELECT user_id FROM propEX_usermeta WHERE meta_key = '_user_activationcode' AND meta_value = '".$_GET['a']."';"; $getUser = $wpdb->get_row($sql); $userID = $getUser->user_id; ### $checkAct = "SELECT * FROM propEX_usermeta WHERE meta_key = '_user_active' AND meta_value = 0 AND user_id = '".$userID."';"; $getData = $wpdb->get_row($checkAct); if( !empty($getData) ) { $wpdb->update( 'propEX_usermeta', array( 'meta_value' => '1', // string ), array( 'meta_key' => '_user_active', 'user_id' => $userID ), array( '%s', '%s' ), array( '%s' ) ); $html .= "

      We've activated your account.

      "; $html .= '

      Login

      '; } else { $html .= '

      This account is already activated!

      '; $html .= '

      Login

      '; } } else { $html .= "

      Oops... we've got an error!

      "; } return $html; } add_shortcode( 'propertyActivateAccount' , 'shc_propertyActivateAccount' ); ?> 'property', 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => 3, 'post__not_in' => array($_POST['id']) ); $latestProps = new WP_Query( $args ); $html = ""; if ( $latestProps->have_posts() ) : while ( $latestProps->have_posts() ) : $latestProps->the_post(); $arrProperty = array(); // Property Basics $arrProperty['id'] = get_the_ID(); $arrProperty['title'] = get_the_title(); $arrProperty['link'] = get_the_permalink(); $arrProperty['meta'] = get_PropertyMetaData($arrProperty['id']); $strPropertyGallery = $arrProperty['meta']['property_gallery']; $arrPropertyGallery = unserialize($strPropertyGallery); $arrProperty['featImg'] = wp_get_attachment_image( $arrPropertyGallery[0], 'property-thumbnail' ); $arrProperty['price'] = str_replace(',', '', $arrProperty['meta']['property_price']); $arrProperty['priceFormat'] = number_format($arrProperty['price']); $html .= "
      "; $html .= ""; $html .= $arrProperty['featImg']; $html .= "
      "; $html .= "
      ".$arrProperty['title']."
      "; $html .= "
      ₦".$arrProperty['priceFormat']."
      "; $html .= ""; $html .= "
      "; $html .= "
      "; endwhile; endif; wp_reset_postdata(); echo $html; die(); } add_action( 'wp_ajax_getLatestProperties', 'getLatestProperties'); add_action( 'wp_ajax_nopriv_getLatestProperties', 'getLatestProperties'); ?> $taxType, 'hide_empty' => false, 'include' => $val)); $val = $termsTypes[0]->name; return $prefix.$val; } function searchDetails_searchProp($val) { switch ($val) { case '18': $val = "For Sale"; break; case '19': $val = "For Rent"; break; case '20': $val = "Land"; break; case '1371': $val = 'Oil & Gas'; break; } return $val; } function searchDetails_date($val) { switch ($val) { case '0': $val = "Anytime"; break; case '1': $val = "24 Hours"; break; case '3': $val = "3 Days"; break; case '7': $val = "7 Days"; break; case '14': $val = "14 Days"; break; } return $val; } function searchDetails_type($val) { #echo "VAL == : ".$val; $termsTypes = get_terms( array('taxonomy' => 'property_type','hide_empty' => false, 'include' => $val)); $val = $termsTypes[0]->name; #print_r($val); #echo '

      '; return $val; } ?>