'submission_list' ] ); } function opalestate_get_user_management_page_uri( $args = [] ) { global $opalestate_options; $uri = isset( $opalestate_options['user_management_page'] ) ? get_permalink( absint( $opalestate_options['user_management_page'] ) ) : get_bloginfo( 'url' ); if ( ! empty( $args ) ) { // Check for backward compatibility if ( is_string( $args ) ) { $args = str_replace( '?', '', $args ); } $args = wp_parse_args( $args ); $uri = add_query_arg( $args, $uri ); } return apply_filters( 'opalestate_user_management_page_uri', $uri ); } function opalestate_get_current_url( $args = [] ) { global $wp; if ( isset( $_GET['tab'] ) && $_GET['tab'] ) { $args['tab'] = $_GET['tab']; } $current_url = home_url( add_query_arg( $args, $wp->request ) ); return $current_url; } function opalestate_get_user_tab_uri( $tab ) { $args['tab'] = $tab; return opalestate_get_current_url( $args ); } function opalestate_management_show_content_page_tab() { $tab = isset( $_GET['tab'] ) && $_GET['tab'] ? sanitize_text_field( $_GET['tab'] ) : 'dashboard'; $fnc = 'opalestate_user_content_' . $tab . '_page'; $content = apply_filters( $fnc, '' ); if ( $content ) { echo $content; } else { if ( function_exists( $fnc ) ) { $fnc(); } else { opalestate_user_content_dashboard_page(); } } } function opalestate_user_savedsearch_page( $args = [] ) { $uri = get_permalink( opalestate_get_option( 'saved_link_page', '/' ) ); if ( ! empty( $args ) ) { // Check for backward compatibility if ( is_string( $args ) ) { $args = str_replace( '?', '', $args ); } $args = wp_parse_args( $args ); $uri = add_query_arg( $args, $uri ); } return $uri; } function opalestate_my_account_page( $id = false, $args = [] ) { $page = get_permalink( opalestate_get_option( 'user_myaccount_page', '/' ) ); if ( $id ) { $edit_page_id = opalestate_get_option( 'user_myaccount_page' ); $page = $edit_page_id ? get_permalink( $edit_page_id ) : $page; $page = add_query_arg( 'id', $id, $page ); } if ( $args ) { foreach ( $args as $key => $value ) { $page = add_query_arg( $key, $value, $page ); } } return $page; } function opalestate_submssion_page( $id = false, $args = [] ) { $page = get_permalink( opalestate_get_option( 'submission_page', '/' ) ); if ( $id ) { $edit_page_id = opalestate_get_option( 'submission_edit_page' ); $page = $edit_page_id ? get_permalink( $edit_page_id ) : $page; $page = add_query_arg( 'id', $id, $page ); } if ( $args ) { foreach ( $args as $key => $value ) { $page = add_query_arg( $key, $value, $page ); } } return $page; } function opalestate_management_user_menu() { } function opalestate_management_user_menu_tabs() { global $opalestate_options; $menu = []; $menu['dashboard'] = [ 'icon' => 'fas fa-chart-line', 'link' => 'dashboard', 'title' => esc_html__( 'Dashboard', 'opalestate-pro' ), 'id' => isset( $opalestate_options['profile_page'] ) ? $opalestate_options['profile_page'] : 0, ]; $menu['profile'] = [ 'icon' => 'far fa-user', 'link' => 'profile', 'title' => esc_html__( 'Personal Information', 'opalestate-pro' ), 'id' => isset( $opalestate_options['profile_page'] ) ? $opalestate_options['profile_page'] : 0, ]; $menu['favorite'] = [ 'icon' => 'far fa-heart', 'link' => 'favorite', 'title' => esc_html__( 'Favorite', 'opalestate-pro' ), 'id' => isset( $opalestate_options['favorite_page'] ) ? $opalestate_options['favorite_page'] : 0, ]; $menu['reviews'] = [ 'icon' => 'far fa-star', 'link' => 'reviews', 'title' => esc_html__( 'Reviews', 'opalestate-pro' ), 'id' => isset( $opalestate_options['reviews_page'] ) ? $opalestate_options['reviews_page'] : 0, ]; if ( opalestate_get_option( 'message_log' ) ) { $menu['messages'] = [ 'icon' => 'fa fa-envelope', 'link' => 'messages', 'title' => esc_html__( 'Messages', 'opalestate-pro' ), 'id' => isset( $opalestate_options['reviews_page'] ) ? $opalestate_options['reviews_page'] : 0, ]; } $menu['submission'] = [ 'icon' => 'fa fa-upload', 'link' => 'submission', 'title' => esc_html__( 'Submit Property', 'opalestate-pro' ), 'id' => isset( $opalestate_options['submission_page'] ) ? $opalestate_options['submission_page'] : 0, ]; $statistics = new OpalEstate_User_Statistics(); $menu['myproperties'] = [ 'icon' => 'fas fa-building', 'link' => 'submission_list', 'title' => esc_html__( 'My Properties', 'opalestate-pro' ) . '' . $statistics->get_count_properties() . '', 'id' => isset( $opalestate_options['submission_list_page'] ) ? $opalestate_options['submission_list_page'] : 0, ]; $menu = apply_filters( 'opalestate_management_user_menu', $menu ); $output = '