Archives

rem_new_agent_register

This action is called whenever a new agent is registered and is located in classes/shortcodes.class.php

Arguments

  1. Agent Details [Array]
    • username
    • first_name
    • last_name
    • useremail
    • and all other custom agent fields

Example

Suppose you want to send a custom email to a specific email address whenever a new agent is registered, paste below code in your theme’s functions.php file and replace the email address (your@email.com).

add_action( 'rem_new_agent_register', 'rem_custom_email_on_registered', 10, 1 );

function rem_custom_email_on_registered($agent){
    wp_mail( 'your@email.com', 'Agent Registered', 'agent is registered with email address '. $agent['useremail']);
}

 

rem_new_agent_approved

This action is called whenever a new agent is approved and is located in classes/setup.class.php

Arguments

  1. Agent Details [Array]
    • username
    • first_name
    • last_name
    • useremail
    • and all other custom agent fields

Example

Suppose you want to send a custom email to a specific email address whenever a new agent is approved, paste below code in your theme’s functions.php file and replace the email address (your@email.com).

add_action( 'rem_new_agent_approved', 'rem_custom_email_on_approved', 10, 1 );

function rem_custom_email_on_approved($agent){
    wp_mail( 'your@email.com', 'Agent Approved', 'agent is approved with email address '. $agent['useremail']);
}

 

rem_new_agent_rejected

This action is called whenever a new agent is rejected and is located in classes/setup.class.php

Arguments

  1. Agent Details [Array]
    • username
    • first_name
    • last_name
    • useremail
    • and all other custom agent fields

Example

Suppose you want to send a custom email to a specific email address whenever a new agent is rejected, paste below code in your theme’s functions.php file and replace the email address (your@email.com).

add_action( 'rem_new_agent_rejected', 'rem_custom_email_on_rejected', 10, 1 );

function rem_custom_email_on_rejected($agent){
    wp_mail( 'your@email.com', 'Agent Rejected', 'agent is rejected with email address '. $agent['useremail']);
}

 

rem_agent_contact_before_submit

This action is called right before the Send Message button on the agent contact form and is located in classes\hooks.class.php

Arguments

  1. Agent ID [Integer]

Example

Suppose you want to display terms and conditions or some other custom text before the Send Message button, use the following code in the functions.php file of your theme/child theme.

add_action( 'rem_agent_contact_before_submit', 'rem_before_contact_button', 10, 1 );

function rem_before_contact_button($agent_id){
    echo "Your custom text goes here.";
}

 

rem_new_property_approved

This action is called whenever a new property is approved is located in classes\hooks.class.php and classes\shortcodes.class.php

Arguments

  1. Property ID [Integer]

Example

Suppose you want to send a custom email to a specific email address whenever a new property is approved, paste below code in your theme’s functions.php file and replace the email address (your@email.com).

add_action( 'rem_new_property_approved', 'rem_custom_email_on_approval', 10, 1 );

function rem_custom_email_on_approval($property_id){
    wp_mail( 'your@email.com', 'New Property Approved', 'A new property is approved.');
}

 

rem_new_property_submitted

This action is called whenever a new property is submitted for approval and is located in classes\hooks.class.php and classes\shortcodes.class.php

Arguments

  1. Property ID [Integer]

Example

Suppose you want to send a custom email to a specific email address whenever a new property is submitted, paste below code in your theme’s functions.php file and replace the email address (your@email.com).

add_action( 'rem_new_property_submitted', 'rem_custom_email_on_submission', 10, 1 );

function rem_custom_email_on_submission($property_id){
    wp_mail( 'your@email.com', 'New Property Submitted', 'A new property is submitted.');
}

 

rem_css_kit_styles

This action is responsible for rendering the styles or CSS globally for all the real estate manager templates and is located in assets/front/css/styles.php

Arguments

  1. Primary Color [string]

Example

Suppose you want to change the price badge color on the single property page, use the following in the functions.php file of the theme/child theme.

add_action( 'rem_css_kit_styles', 'rem_custom_badge_color', 10, 1 );

function rem_custom_badge_color($primary_color){
    echo "#property-content .large-price {background-color: black !important;}"
}

 

rem_single_property_contents

This hook can be used to insert your own contents on the single property page.

Related Properties

Suppose you want to display a Related Properties section at the end of a property page containing 3 related properties in a grid.

You will have to paste the following shortcode inside the functions.php file of your theme/child theme and it will do the job.

add_action( 'rem_single_property_contents', 'rem_related_properties', 100, 1 );

function rem_related_properties($property_id){
	$type = get_post_meta( $property_id, 'rem_property_type', true );

	if ($type != '') {
		echo '<div class="section-title line-style"><h3 class="title">Related Properties</h3></div>';
		echo do_shortcode( '[rem_list_properties style="3" pagination="disable" posts="3" class="col-sm-4" meta="property_type|'.$type.'"]' );
	}
}

Things you need to know here are Priority and the Relation of properties with the current property.

We’re using Property Type as the relation and priority 100 to display it at the end, you can change these to your needs.

Property Inquiry Form

The following code will display a contact form 7 under the properties in a separate section.

add_action( 'rem_single_property_contents', 'rem_single_property_form', 100, 1 );
function rem_single_property_form($property_id){ ?>
        <div class="wrap-map rem-section-box">
            <div class="section-title line-style">
                <?php rem_render_section_title( __( 'Ask for Details', 'real-estate-manager' ), ''); ?>
            </div>
            <div class="contact-form-wrapper">
                <?php echo do_shortcode( '[contact-form-7 id="1859" title="Contact form 1"]' ); ?>
            </div>
        </div>
    <?php
}

 

Single Property Details Page

On the single property page, the following action hooks are used.

rem_property_ribbon

It renders the ribbon on the slider. It’s 2 arguments are below

  1. Property ID
  2. Ribbon Type

Suppose you want to remove the ribbons, you will use the following code in your theme’s functions.php file.

add_action( 'init', 'rem_remove_ribbons' );

function rem_remove_ribbons(){
	global $rem_hk_ob;
	remove_action('rem_property_ribbon', array($rem_hk_ob, 'add_ribbon_with_listings'), 10 );
}

 

rem_single_property_slider

It renders the gallery images slider. It has a single argument that is property ID.

You can remove the slider using the following code in your theme’s functions.php file.

add_action( 'init', 'rem_remove_slider' );

function rem_remove_slider(){
	global $rem_hk_ob;
	remove_action( 'rem_single_property_slider', array($rem_hk_ob, 'single_property_slider' ), 10 );
}

Similarly, you can add additional content before or after the slider using this hook. For example, the following code will display the property ID after the slider.

add_action( 'rem_single_property_slider', 'rem_id_after_slider', 11, 1 );

function rem_id_after_slider($property_id){
	echo $property_id;
}

rem_single_property_contents

It’s the main hook to render all the contents on property page including custom sections. Following are contents rendered through it with the priority.

  1. Property Title => 15
  2. Property Content => 20
  3. Sections => 30
  4. Features => 40
  5. Map => 60
  6. Tags => 70
  7. Edit Property Button => 80

Now, let say you want to move the property title above the slider. First, you will remove it from the contents and then you will add it with the rem_single_property_slider hook increasing its priority.

So, the following code will do the job.

add_action( 'init', 'rem_move_property_title_top' );

function rem_move_property_title_top(){
	global $rem_hk_ob;
	remove_action( 'rem_single_property_contents', array($rem_hk_ob, 'single_property_title' ), 15 );
	add_action( 'rem_single_property_slider', array($rem_hk_ob, 'single_property_title'), 1, 1 );
}

You can also change the positions of the sections by changing the priority. The following code will move the map above property features.

add_action( 'init', 'rem_move_map_above_features' );

function rem_move_map_above_features(){
	global $rem_hk_ob;
	remove_action( 'rem_single_property_contents', array($rem_hk_ob, 'single_property_features' ), 40 );
	add_action( 'rem_single_property_contents', array($rem_hk_ob, 'single_property_features'), 65, 1 );
}

rem_single_property_agent

This hook renders the data in the sidebar. You can use this hook to add your data or to remove the default data. It has a single argument which is the ID of the agent of the current property.