WP Residence Help WP Residence Help

  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API
Home / Technical how to | Custom Code / Technical how to: User dashboard menu

Technical how to: User dashboard menu

4717 views 0

There are 2 types of user menu – both are generated by the same function wpestate_generate_user_menu().

The function is located in libs/dashboard_functions.php –  function wpestate_generate_user_menu at line 1429.

The top menu is in templates/user_menu.php .  It uses the wpestate_generate_user_menu to show the menu

<div class="user_tab_menu">
<ul class="user_dashboard_links">
<?php wpestate_generate_user_menu(); ?>
</ul>
</div>

The menu on right part (appears when you click the picture or submit property ).

This menu is located in templates/top_user_menu.php

The “Submit Property” (when the user is not logged in) and the user image (when the user is logged in) can be found around line 15 .

<?php if(is_user_logged_in()){ ?>
<div class="user_menu user_loged" id="user_menu_u">
<a class="menu_user_tools dropdown" id="user_menu_trigger" data-toggle="dropdown">
<a class="navicon-button x">
<div class="navicon"></div>
</a>
<div class="menu_user_picture" style="background-image: url('<?php print $user_small_picture[0]; ?>');"></div>
<?php }else{ ?>
<div class="user_menu" id="user_menu_u">
<a class="menu_user_tools dropdown" id="user_menu_trigger" data-toggle="dropdown">
<a class="navicon-button x">
<div class="navicon"></div>
</a>
<div class="submit_action"><?php _e('Submit Property','wpestate');?></div>
<?php } ?>

In there we do a check to see if the user is logged in.

if ( 0 != $current_user->ID  && is_user_logged_in() ) {

if yes we show the user dashboard links , if no we show the login & register forms.

The show/hide functionality is made via javascript in control.js around line 1050

$('#user_menu_u').click(function(event){
if( $('#user_menu_open').is(":visible")){

We also check for WooCommerce and enable the the show cart via

if( class_exists( 'WooCommerce' ) ){
$wpestate_global_payments->show_cart();
}
Technical how to | Custom Code

Related Articles

  • How to Add Custom Fields to the Login, Register and Forgot Password Forms
  • Technical: Change the Schedule Tour Email Text and the Form Default Message
  • Property list filter customization
  • Technical – How to Change the Minimum Image Dimensions for Property Uploads in WPResidence
MLSImportWordPress IDX Plugin for MLS ListingsImport MLS listings into your WordPress website, customize your property pages, and keep your inventory updated.Start free 30-day trial →

Help Categories

  • 111 Installation & Changelog
  • 18Agent, Agency & Developers
  • 5Blog Posts & Blog Lists
  • 15Footer
  • 37Header
  • 2IDX & MLSImport
  • 23Maps & Location Settings
  • 50Multilingual Websites – WPEstate Translate (Included)
  • 21Pages & Page Templates
  • 4Payments & Monetization
  • 20Property Lists, Categories & Archive
  • 37Property Single Page
  • 32Search & Filtering
  • 171Technical how to | Custom Code
  • 9Technical: Actions and filters
  • 7Technical: Child Theme
  • 85Theme Options & Global Settings
  • 6Theme Translation & Localization
  • 28Third Party Plugins Compatible
  • 16WPBakery Shortcodes
  • 51WPResidence / WPEstate CRM
  • 9WPResidence Elementor Studio
  • 39WPResidence Elementor Widgets
  • 79WPResidence FAQ

Join Us On

Powered by WP Estate - All Rights Reserved
  • WPRESIDENCE
  • Video Tutorials
  • Client Support
  • API