diff --git a/inc/agency/class-opalestate-agency-front.php b/inc/agency/class-opalestate-agency-front.php index f0301859..6138ce11 100755 --- a/inc/agency/class-opalestate-agency-front.php +++ b/inc/agency/class-opalestate-agency-front.php @@ -61,9 +61,9 @@ class Opalestate_Agency_Front { add_filter( 'opalestate_management_user_menu', [ $this, 'render_extra_profile_link' ] ); - add_action( "opalestate_user_content_agency_profile_page", [ $this, 'render_profile' ] ); - add_action( "opalestate_user_content_agency_team_page", [ $this, 'render_team' ] ); - add_action( "opalestate_user_init", [ $this, 'process_action_member' ] ); + add_action( 'opalestate_user_content_agency_profile_page', [ $this, 'render_profile' ] ); + add_action( 'opalestate_user_content_agency_team_page', [ $this, 'render_team' ] ); + add_action( 'opalestate_user_init', [ $this, 'process_action_member' ] ); $this->register_shortcodes(); } @@ -153,7 +153,6 @@ class Opalestate_Agency_Front { unset( $_POST[ $prefix . 'title' ] ); unset( $_POST[ $prefix . 'text' ] ); - if ( $data['ID'] > 0 ) { $post_id = wp_update_post( $data, true ); } else { @@ -309,8 +308,8 @@ class Opalestate_Agency_Front { */ public function register_shortcodes() { $this->shortcodes = [ - 'search_agencies' => [ 'code' => 'search_agencies', 'label' => esc_html__( 'Search Agencies', 'opalestate-pro' ) ], - 'agency_carousel' => [ 'code' => 'agency_carousel', 'label' => esc_html__( 'Agency Carousel', 'opalestate-pro' ) ], + 'search_agencies' => [ 'code' => 'search_agencies', 'label' => esc_html__( 'Search Agencies', 'opalestate-pro' ) ], + 'agency_carousel' => [ 'code' => 'agency_carousel', 'label' => esc_html__( 'Agency Carousel', 'opalestate-pro' ) ], ]; foreach ( $this->shortcodes as $shortcode ) { @@ -318,51 +317,59 @@ class Opalestate_Agency_Front { } } - public function agency_carousel ( $atts ) { + public function agency_carousel( $atts ) { + + $atts = is_array( $atts ) ? $atts : []; + + $default = [ + 'current_uri' => null, + 'column' => 3, + 'limit' => 12, + 'paged' => 1, + 'onlyfeatured' => 0, + ]; - $atts = is_array( $atts ) ? $atts : []; - - $default = array( - 'current_uri' => null, - 'column' => 3, - 'limit' => 12, - 'paged' => 1, - 'onlyfeatured' => 0, - ); - $atts = array_merge( $default, $atts ); - return opalestate_load_template_path( 'shortcodes/agency-carousel' , $atts ); - } + return opalestate_load_template_path( 'shortcodes/agency-carousel', $atts ); + } /** * */ - public function search_agencies ( $atts=[] ) { - - $atts = is_array( $atts ) ? $atts : []; - $layout = 'search-agency-form'; + public function search_agencies( $atts = [] ) { + + $atts = is_array( $atts ) ? $atts : []; + $layout = 'search-agency-form'; + + $default = [ + 'current_uri' => null, + 'form' => $layout, + ]; - $default = array( - 'current_uri' => null, - 'form' => $layout - ); - $atts = array_merge( $default, $atts ); - return opalestate_load_template_path( 'shortcodes/search-agencies' , $atts ); + return opalestate_load_template_path( 'shortcodes/search-agencies', $atts ); } /** * */ public function render_profile() { - + $user_id = get_current_user_id(); $post_id = OpalEstate_User::get_member_id(); - if ( isset( $post->ID ) && $post->post_status != 'publish' ) { - opalestate_add_notice( "warning", esc_html__( 'You account is under reviewing! it take some time to process' ) ); - add_action( "opalestate_profile_agency_form_before", "opalestate_print_notices" ); + // Check if have not any relationship, create a new then update this meta value. + if ( ! $post_id || $post_id < 0 ) { + static::on_set_role( $user_id ); + } + + $post_id = get_user_meta( $user_id, OPALESTATE_USER_PROFILE_PREFIX . 'related_id', true ); + $post = get_post( $post_id ); + + if ( isset( $post->ID ) && ( $post->post_status != 'publish' || $post->ID == get_the_ID() ) ) { + opalestate_add_notice( 'warning', esc_html__( 'You account is under reviewing! It take some time to process.', 'opalestate-pro' ) ); + add_action( 'opalestate_profile_agency_form_before', 'opalestate_print_notices' ); } $metaboxes = $this->render_front_form( [], $post_id ); @@ -446,15 +453,12 @@ class Opalestate_Agency_Front { } public static function on_set_role( $user_id ) { - if ( $user_id ) { - $args = [ 'post_type' => 'opalestate_agency', 'posts_per_page' => 10, ]; - $args['meta_key'] = OPALESTATE_AGENCY_PREFIX . 'user_id'; $args['meta_value'] = $user_id; $args['meta_compare'] = '='; @@ -477,6 +481,8 @@ class Opalestate_Agency_Front { public static function create_agency( $args = [], $user_id ) { $data = get_user_by( 'id', $user_id ); + $post_title = sprintf( esc_html__( 'User ID: %s', 'opalestate-pro' ), $user_id ); + $args = wp_parse_args( $args, [ 'first_name' => $data->first_name, 'last_name' => $data->last_name, @@ -495,9 +501,14 @@ class Opalestate_Agency_Front { 'instagram' => '', ] ); + if ( $args['first_name'] && $args['last_name'] ) { + $post_title = $args['first_name'] . ' ' . $args['last_name']; + } elseif ( isset( $data->display_name ) && $data->display_name ) { + $post_title = esc_html( $data->display_name ); + } $agency_id = wp_insert_post( [ - 'post_title' => $args['first_name'] && $args['last_name'] ? $args['first_name'] . ' ' . $args['last_name'] : esc_html__( 'User ID', 'opalestate-pro' ) . ': ' . $user_id, + 'post_title' => $post_title, 'post_content' => 'empty description', 'post_excerpt' => 'empty excerpt', 'post_type' => 'opalestate_agency', diff --git a/inc/agent/class-opalestate-agent-front.php b/inc/agent/class-opalestate-agent-front.php index b366b1f6..e7b129e4 100755 --- a/inc/agent/class-opalestate-agent-front.php +++ b/inc/agent/class-opalestate-agent-front.php @@ -90,15 +90,20 @@ class Opalestate_Agent_Front { * render_profile */ public function render_profile() { - $user_id = get_current_user_id(); $post_id = get_user_meta( $user_id, OPALESTATE_USER_PROFILE_PREFIX . 'related_id', true ); - $post = get_post( $post_id ); + // Check if have not any relationship, create a new then update this meta value. + if ( ! $post_id || $post_id < 0 ) { + $this->on_set_role( $user_id ); + } - if ( isset( $post->ID ) && $post->post_status != 'publish' ) { - opalestate_add_notice( "warning", esc_html__( 'You account is under reviewing! it take some time to process' ) ); - add_action( "opalestate_profile_agency_form_before", "opalestate_print_notices" ); + $post_id = get_user_meta( $user_id, OPALESTATE_USER_PROFILE_PREFIX . 'related_id', true ); + $post = get_post( $post_id ); + + if ( isset( $post->ID ) && ( $post->post_status != 'publish' || $post->ID == get_the_ID() ) ) { + opalestate_add_notice( 'warning', esc_html__( 'You account is under reviewing! It take some time to process.', 'opalestate-pro' ) ); + add_action( 'opalestate_profile_agent_form_before', 'opalestate_print_notices' ); } $metaboxes = $this->render_front_form( [], $post_id ); @@ -310,29 +315,29 @@ class Opalestate_Agent_Front { 'agent_carousel' => [ 'code' => 'agent_carousel', 'label' => esc_html__( 'Agent Carousel', 'opalestate-pro' ) ], ]; - foreach ( $this->shortcodes as $shortcode ) { + foreach ( $this->shortcodes as $shortcode ) { add_shortcode( 'opalestate_' . $shortcode['code'], [ $this, $shortcode['code'] ] ); } } - public function agent_carousel ( $atts ) { + public function agent_carousel( $atts ) { - $atts = is_array( $atts ) ? $atts : []; - $layout = 'search-agency-form'; + $atts = is_array( $atts ) ? $atts : []; + $layout = 'search-agency-form'; + + $default = [ + 'current_uri' => null, + 'column' => 4, + 'limit' => 12, + 'paged' => 1, + 'onlyfeatured' => 0, + 'form' => $layout, + ]; - $default = array( - 'current_uri' => null, - 'column' => 4, - 'limit' => 12, - 'paged' => 1, - 'onlyfeatured' => 0, - 'form' => $layout - ); - $atts = array_merge( $default, $atts ); - return opalestate_load_template_path( 'shortcodes/agent-carousel' , $atts ); + return opalestate_load_template_path( 'shortcodes/agent-carousel', $atts ); } public function archives_query( $query ) { @@ -461,7 +466,6 @@ class Opalestate_Agent_Front { 'posts_per_page' => 10, ]; - $args['meta_key'] = OPALESTATE_AGENT_PREFIX . 'user_id'; $args['meta_value'] = $user_id; $args['meta_compare'] = '='; @@ -478,9 +482,10 @@ class Opalestate_Agent_Front { } public function create_agent( $args = [], $user_id ) { - $data = get_user_by( 'id', $user_id ); + $post_title = sprintf( esc_html__( 'User ID: %s', 'opalestate-pro' ), $user_id ); + $args = wp_parse_args( $args, [ 'first_name' => $data->first_name, 'last_name' => $data->last_name, @@ -500,8 +505,14 @@ class Opalestate_Agent_Front { 'instagram' => '', ] ); + if ( $args['first_name'] && $args['last_name'] ) { + $post_title = $args['first_name'] . ' ' . $args['last_name']; + } elseif ( isset( $data->display_name ) && $data->display_name ) { + $post_title = esc_html( $data->display_name ); + } + $agent_id = wp_insert_post( [ - 'post_title' => $args['first_name'] && $args['last_name'] ? $args['first_name'] . ' ' . $args['last_name'] : esc_html__( 'User ID', 'opalestate-pro' ) . ': ' . $user_id, + 'post_title' => $post_title, 'post_content' => '', 'post_excerpt' => '', 'post_type' => 'opalestate_agent', @@ -509,7 +520,6 @@ class Opalestate_Agent_Front { 'post_author' => $user_id, ], true ); - do_action( 'opalesate_insert_user_agent', $agent_id ); return $agent_id; diff --git a/inc/api/v1/property.php b/inc/api/v1/property.php old mode 100755 new mode 100644 index b8b996b9..047b6a2b --- a/inc/api/v1/property.php +++ b/inc/api/v1/property.php @@ -1,118 +1,111 @@ - * @license https://opensource.org/licenses/gpl-license GNU Public License - * @since 1.0 - */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } + /** - * @class Job_Api + * Property_Api * * @since 1.0.0 - * @package Opal_Job - * @subpackage Opal_Job/controllers + * @package Property_Api */ -class Property_Api extends Base_Api { +class Property_Api extends Base_Api { /** * The unique identifier of the route resource. * * @since 1.0.0 * @access public - * @var string $base. + * @var string $base . */ public $base = '/property'; - - /** + + /** * Register Routes * * Register all CURD actions with POST/GET/PUT and calling function for each * + * @return avoid * @since 1.0 * - * @return avoid */ - public function register_routes ( ) { - /// call http://domain.com/wp-json/job-api/v1/job/list //// - register_rest_route( $this->namespace, $this->base.'/list', array( - 'methods' => WP_REST_Server::READABLE, - 'callback' => array( $this, 'get_list' ), - 'permission_callback' => array( $this, 'validate_request' ), - )); + public function register_routes() { + /// call http://domain.com/wp-json/estate-api/v1/estate/list //// + register_rest_route( $this->namespace, $this->base . '/list', [ + 'methods' => WP_REST_Server::READABLE, + 'callback' => [ $this, 'get_list' ], + 'permission_callback' => [ $this, 'validate_request' ], + ] ); - /// call http://domain.com/wp-json/job-api/v1/job/featured //// - register_rest_route( $this->namespace, $this->base.'/featured', array( - 'methods' => WP_REST_Server::READABLE, - 'callback' => array( $this, 'get_featured_list' ), - 'permission_callback' => array( $this, 'validate_request' ), - )); + /// call http://domain.com/wp-json/estate-api/v1/estate/featured //// + register_rest_route( $this->namespace, $this->base . '/featured', [ + 'methods' => WP_REST_Server::READABLE, + 'callback' => [ $this, 'get_featured_list' ], + 'permission_callback' => [ $this, 'validate_request' ], + ] ); /// call http://domain.com/wp-json/job-api/v1/job/1 //// - register_rest_route( $this->namespace, $this->base.'/(?P\d+)', array( - 'methods' => WP_REST_Server::READABLE, - 'callback' => array( $this, 'get_job' ), - 'permission_callback' => array( $this, 'validate_request' ), - )); + register_rest_route( $this->namespace, $this->base . '/(?P\d+)', [ + 'methods' => WP_REST_Server::READABLE, + 'callback' => [ $this, 'get_job' ], + 'permission_callback' => [ $this, 'validate_request' ], + ] ); /// call http://domain.com/wp-json/job-api/v1/job/create //// - register_rest_route( $this->namespace, $this->base.'/create', array( - 'methods' => 'GET', - 'callback' => array( $this, 'create' ), - 'permission_callback' => array( $this, 'validate_request' ), - )); + register_rest_route( $this->namespace, $this->base . '/create', [ + 'methods' => 'GET', + 'callback' => [ $this, 'create' ], + 'permission_callback' => [ $this, 'validate_request' ], + ] ); + /// call http://domain.com/wp-json/job-api/v1/job/edit //// - register_rest_route( $this->namespace, $this->base.'/edit', array( - 'methods' => 'GET', - 'callback' => array( $this, 'edit' ), - )); + register_rest_route( $this->namespace, $this->base . '/edit', [ + 'methods' => 'GET', + 'callback' => [ $this, 'edit' ], + ] ); + /// call http://domain.com/wp-json/job-api/v1/job/delete //// - register_rest_route( $this->namespace, $this->base.'/delete', array( - 'methods' => 'GET', - 'callback' => array( $this, 'delete' ), - 'permission_callback' => array( $this, 'validate_request' ), - )); + register_rest_route( $this->namespace, $this->base . '/delete', [ + 'methods' => 'GET', + 'callback' => [ $this, 'delete' ], + 'permission_callback' => [ $this, 'validate_request' ], + ] ); /** - * List job by tags and taxonmies + * List job by tags and taxonmies */ /// call http://domain.com/wp-json/job-api/v1/jobs //// - register_rest_route( $this->namespace, $this->base.'/tags', array( - 'methods' => 'GET', - 'callback' => array( $this, 'delete' ), - 'permission_callback' => array( $this, 'validate_request' ), - )); + register_rest_route( $this->namespace, $this->base . '/tags', [ + 'methods' => 'GET', + 'callback' => [ $this, 'delete' ], + 'permission_callback' => [ $this, 'validate_request' ], + ] ); } - - public function get_featured_list() { - $properties = array(); - $error = array(); - - $property = null; + + public function get_featured_list() { + $properties = []; + $error = []; + + $property = null; if ( $property == null ) { - $properties = array(); + $properties = []; - $property_list = get_posts( array( + $property_list = get_posts( [ 'post_type' => 'opalestate_property', 'posts_per_page' => $this->per_page(), 'suppress_filters' => true, - 'meta_key' => OPALESTATE_PROPERTY_PREFIX . 'featured', - 'meta_value' => 'on', - 'paged' => $this->get_paged() - ) ); + 'meta_key' => OPALESTATE_PROPERTY_PREFIX . 'featured', + 'meta_value' => 'on', + 'paged' => $this->get_paged(), + ] ); if ( $property_list ) { $i = 0; foreach ( $property_list as $property_info ) { $properties[ $i ] = $this->get_property_data( $property_info ); - $i ++; + $i++; } } } else { @@ -123,7 +116,7 @@ class Property_Api extends Base_Api { } else { $error['error'] = sprintf( - /* translators: %s: property */ + /* translators: %s: property */ esc_html__( 'Form %s not found!', 'opalestate-pro' ), $property ); @@ -132,44 +125,44 @@ class Property_Api extends Base_Api { } } - $response['collection'] = $properties; - $response['pages'] = 4; - $response['current'] = 1; - + $response['collection'] = $properties; + $response['pages'] = 4; + $response['current'] = 1; + return $this->get_response( 200, $response ); - } + } /** * Get List Of Job * * Based on request to get collection * + * @return WP_REST_Response is json data * @since 1.0 * - * @return WP_REST_Response is json data */ - public function get_list ( $request ) { + public function get_list( $request ) { - $properties = array(); - $error = array(); - - $property = null; + $properties = []; + $error = []; + + $property = null; if ( $property == null ) { - $properties = array(); + $properties = []; - $property_list = get_posts( array( + $property_list = get_posts( [ 'post_type' => 'opalestate_property', 'posts_per_page' => $this->per_page(), 'suppress_filters' => true, - 'paged' => $this->get_paged() - ) ); + 'paged' => $this->get_paged(), + ] ); if ( $property_list ) { $i = 0; foreach ( $property_list as $property_info ) { $properties[ $i ] = $this->get_property_data( $property_info ); - $i ++; + $i++; } } } else { @@ -180,7 +173,7 @@ class Property_Api extends Base_Api { } else { $error['error'] = sprintf( - /* translators: %s: property */ + /* translators: %s: property */ esc_html__( 'Form %s not found!', 'opalestate-pro' ), $property ); @@ -189,9 +182,10 @@ class Property_Api extends Base_Api { } } - $response['collection'] = $properties; - $response['pages'] = 4; - $response['current'] = 1; + $response['collection'] = $properties; + $response['pages'] = 4; + $response['current'] = 1; + return $this->get_response( 200, $response ); } @@ -199,15 +193,15 @@ class Property_Api extends Base_Api { /** * Opalestaten a opalestate_property post object, generate the data for the API output * - * @since 1.1 - * - * @param object $property_info The Download Post Object + * @param object $property_info The Download Post Object * * @return array Array of post data to return back in the API + * @since 1.1 + * */ private function get_property_data( $property_info ) { - $property = array(); + $property = []; $property['info']['id'] = $property_info->ID; $property['info']['slug'] = $property_info->post_name; @@ -219,24 +213,24 @@ class Property_Api extends Base_Api { $property['info']['content'] = $property_info->post_content; $property['info']['thumbnail'] = wp_get_attachment_url( get_post_thumbnail_id( $property_info->ID ) ); - $data = opalesetate_property( $property_info->ID ); - $gallery = $data->get_gallery(); - $property['info']['gallery'] = isset($gallery[0]) && !empty($gallery[0]) ? $gallery[0]: array(); - $property['info']['price'] = opalestate_price_format( $data->get_price() ); - $property['info']['map'] = $data->get_map(); + $data = opalesetate_property( $property_info->ID ); + $gallery = $data->get_gallery(); + $property['info']['gallery'] = isset( $gallery[0] ) && ! empty( $gallery[0] ) ? $gallery[0] : []; + $property['info']['price'] = opalestate_price_format( $data->get_price() ); + $property['info']['map'] = $data->get_map(); $property['info']['address'] = $data->get_address(); - $property['meta'] = $data->get_meta_shortinfo(); + $property['meta'] = $data->get_meta_shortinfo(); + $property['is_featured'] = $data->is_featured(); + $property['status'] = $data->get_status(); + $property['labels'] = $data->get_labels(); + $property['locations'] = $data->get_locations(); + $property['amenities'] = $data->get_amenities(); + $property['types'] = $data->get_types_tax(); + $property['author_type'] = $data->get_author_type(); + $property['author_data'] = $data->get_author_link(); - $property['is_featured'] = $data->is_featured(); - $property['status'] = $data->get_status(); - $property['labels'] = $data->get_labels(); - $property['locations'] = $data->get_locations(); - $property['amenities'] = $data->get_amenities(); - $property['types'] = $data->get_types_tax(); - return apply_filters( 'opalestate_api_properties_property', $property ); - } /** @@ -244,24 +238,24 @@ class Property_Api extends Base_Api { * * Based on request to get collection * + * @return WP_REST_Response is json data * @since 1.0 * - * @return WP_REST_Response is json data */ - public function delete( ) { + public function delete() { } - public function reviews () { + public function reviews() { } - public function categories () { + public function categories() { } - - public function tags () { - + + public function tags() { + } } diff --git a/inc/property/class-opalestate-property.php b/inc/property/class-opalestate-property.php index e9669d94..7c75601b 100755 --- a/inc/property/class-opalestate-property.php +++ b/inc/property/class-opalestate-property.php @@ -454,7 +454,7 @@ class Opalestate_Property { return '' . $avatar . '' . $data['name'] . ''; } - private function get_author_link() { + public function get_author_link() { $image_id = get_user_meta( get_the_author_meta( 'ID' ), OPALESTATE_USER_PROFILE_PREFIX . 'avatar_id', true ); $related_id = get_user_meta( get_the_author_meta( 'ID' ), OPALESTATE_USER_PROFILE_PREFIX . 'related_id', true ); diff --git a/inc/user/class-opalestate-user-form-handler.php b/inc/user/class-opalestate-user-form-handler.php index 03f3c033..ba2940c6 100755 --- a/inc/user/class-opalestate-user-form-handler.php +++ b/inc/user/class-opalestate-user-form-handler.php @@ -186,8 +186,8 @@ class Opalestate_User_Form_Handler { if ( $password !== $password1 ) { throw new Exception( '' . esc_html__( 'ERROR', 'opalestate-pro' ) . ': ' . esc_html__( 'Re-Password is not match.', 'opalestate-pro' ) ); } - $credentials['user_pass'] = $password; + $credentials['user_pass'] = $password; /* create new user */ $user_id = opalestate_create_user( $credentials ); @@ -195,8 +195,7 @@ class Opalestate_User_Form_Handler { if ( is_wp_error( $user_id ) ) { throw new Exception( '' . esc_html__( 'ERROR', 'opalestate-pro' ) . ': ' . $user_id->get_error_message() ); } else { - - /* after register successfully */ + /* After register successfully */ do_action( 'opalestate_after_register_successfully', $user_id ); $redirect = home_url(); @@ -213,7 +212,7 @@ class Opalestate_User_Form_Handler { $redirect = apply_filters( 'opalestate_register_redirect_url', $redirect ); - /* is ajax request */ + /* Is ajax request */ if ( opalestate_is_ajax_request() ) { wp_send_json( [ 'status' => true, 'redirect' => $redirect ] ); } else { diff --git a/inc/user/class-opalestate-user.php b/inc/user/class-opalestate-user.php index eb6ce761..c2492586 100755 --- a/inc/user/class-opalestate-user.php +++ b/inc/user/class-opalestate-user.php @@ -185,20 +185,24 @@ class OpalEstate_User { } /** + * On Register user. * + * @param int $user_id User ID */ public function on_regiser_user( $user_id ) { if ( isset( $_POST['role'] ) ) { - $roles = opalestate_user_roles_by_user_id( $user_id ); - // Fetch the WP_User object of our user. $u = new WP_User( $user_id ); $u->remove_role( 'subscriber' ); + // Replace the current role with 'editor' role $u->set_role( sanitize_text_field( $_POST['role'] ) ); + $roles = opalestate_user_roles_by_user_id( $user_id ); + if ( $roles && in_array( $_POST['role'], $roles ) ) { $role = str_replace( 'opalestate_', '', sanitize_text_field( $_POST['role'] ) ); + do_action( 'opalestate_on_set_role_' . $role, $user_id ); } } diff --git a/templates/content-property-featured-v1.php b/templates/content-property-featured-v1.php index e093cb04..38b3a7a0 100755 --- a/templates/content-property-featured-v1.php +++ b/templates/content-property-featured-v1.php @@ -29,7 +29,7 @@ $property = opalesetate_property( get_the_ID() );

- +

diff --git a/templates/single-property/author-v2.php b/templates/single-property/author-v2.php index 259e54e4..eacb7d4a 100755 --- a/templates/single-property/author-v2.php +++ b/templates/single-property/author-v2.php @@ -50,7 +50,8 @@ switch ( $type ) { break; } ?> -
+ +
@@ -59,5 +60,3 @@ switch ( $type ) {
- - diff --git a/templates/single-property/author-v3.php b/templates/single-property/author-v3.php index 51c26751..a83e08e5 100755 --- a/templates/single-property/author-v3.php +++ b/templates/single-property/author-v3.php @@ -44,7 +44,7 @@ switch ( $type ) { break; } ?> -
+
diff --git a/templates/single-property/author.php b/templates/single-property/author.php index 876e742d..c0656eab 100755 --- a/templates/single-property/author.php +++ b/templates/single-property/author.php @@ -44,7 +44,7 @@ switch ( $type ) { break; } ?> -
+
diff --git a/templates/single-property/user/author-user-box.php b/templates/single-property/user/author-user-box.php index 485da563..b26ea82c 100755 --- a/templates/single-property/user/author-user-box.php +++ b/templates/single-property/user/author-user-box.php @@ -6,10 +6,8 @@ $prefix = OPALESTATE_USER_PROFILE_PREFIX; } - $user_id = $author->ID; - $is_sticky = get_user_meta( $user_id, $prefix . 'sticky', true ); - - + $user_id = $author->ID; + $is_sticky = get_user_meta( $user_id, $prefix . 'sticky', true ); $desciption = get_user_meta( $user_id, 'description', true ); $roles = opalestate_user_roles_by_user_id( $user_id ); @@ -75,7 +73,6 @@
-

@@ -143,11 +140,8 @@ -

-
-
diff --git a/templates/user/agency/profile-agency.php b/templates/user/agency/profile-agency.php index cb0617d5..f024ce24 100755 --- a/templates/user/agency/profile-agency.php +++ b/templates/user/agency/profile-agency.php @@ -1,40 +1,39 @@ -
-
+
-
+
-
+
- -
+ +
-
- -
-

+
+ +
+

'.print_r( $metaboxes ,1 );die; + do_action( 'opalestate_profile_agency_form_before' ); - if ( function_exists( 'cmb2_get_metabox_form' ) ) { - echo cmb2_get_metabox_form( $metaboxes[OPALESTATE_AGENCY_PREFIX.'front'], $post_id, array( - 'form_format' => '
%3$s
', - 'save_button' => esc_html__( 'Save Change', 'opalestate-pro' ), - ) ); - } + if ( function_exists( 'cmb2_get_metabox_form' ) ) { + echo cmb2_get_metabox_form( $metaboxes[ OPALESTATE_AGENCY_PREFIX . 'front' ], $post_id, [ + 'form_format' => '
%3$s
', + 'save_button' => esc_html__( 'Save Change', 'opalestate-pro' ), + ] ); + } - do_action( 'opalestate_profile_agency_form_after' ); + do_action( 'opalestate_profile_agency_form_after' ); ?> -
-
+
+
diff --git a/templates/user/agent/profile-agent.php b/templates/user/agent/profile-agent.php index a187bceb..8387ac3f 100755 --- a/templates/user/agent/profile-agent.php +++ b/templates/user/agent/profile-agent.php @@ -1,27 +1,26 @@ -
- -
- -
-

- - - if ( function_exists( 'cmb2_get_metabox_form' ) ) { - echo cmb2_get_metabox_form( $metaboxes[ OPALESTATE_AGENT_PREFIX . 'front' ], $post_id, [ - 'form_format' => '
%3$s
', - 'save_button' => esc_html__( 'Save Change', 'opalestate-pro' ), - ] ); - } +
+

+ + + '
%3$s
', + 'save_button' => esc_html__( 'Save Change', 'opalestate-pro' ), + ] ); + } do_action( 'opalestate_profile_agency_form_after' ); - ?> + ?> -
- -
-
+
+ +
+