Archives

rem_change_admin_email

This filter can be used to change the admin email. By default, REM uses WordPress’s admin email for sending emails.

Arguments

  1. Admin Email [String]

Example

The following code will set the admin email to someone@gmail.com. Please paste the following code in your theme’s functions.php file.

add_filter( 'rem_change_admin_email', 'rem_change_admin_email', 10, 1 );

function rem_change_admin_email($email){
	return 'someone@gmail.com';
}

 

rem_energy_efficiency_fields

This filter can be used to alter any data in the Energy Efficiency fields.

Arguments

  1. EE Fields [Array]

Example

The following code will replace the Energy Efficiency scale values¬† (A+, A, B, C, …)¬† with new ones (Efficient, Average, etc), paste the following code in your theme’s functions.php file.

add_filter( 'rem_energy_efficiency_fields', 'rem_new_energy_efficiency_scales', 10, 1 );

function rem_new_energy_efficiency_scales($ee_fields){
	$ee_fields[0]['options'] = array(
		'Very Efficient',
		'Efficient',
		'Better',
		'Good',
		'Average',
		'Inefficient',
		'Very inefficient',
	);
	return $ee_fields;
}

 

rem_email_headers

This filter can be used to define custom headers for the emails sent through Real Estate Manager.

Arguments

  1. Headers [Array]

Reset Headers

The following code will set the headers to default. If you’re not receiving any email upon agent registration, property submission, or agent contact form, paste the following code in your theme’s functions.php file and it may fix that issue.

add_filter( 'rem_email_headers', 'rem_fix_emails', 10, 1 );

function rem_fix_emails($headers){
	return array();
}

 

Redefine Headers

You can use the following code in your theme’s functions.php file to define the headers (Sender Name, Email, etc). Change them accordingly

add_filter( 'rem_email_headers', 'rem_email_headers_custom', 10, 1 );

function rem_email_headers_custom($headers){
    $headers = array();
    $headers[] = "From: {sender_name} <{sender_email}>";
    $headers[] = "Content-Type: text/html";
    $headers[] = "MIME-Version: 1.0\r\n";
    return $headers;
}

 

rem_lists_sorting_options

This filter returns the array of options to sort property listings from top bar.

Arguments

  1. Options [Array]

Example

The following code will add another option with the name Sort By ID in the sorting dropdown menu and will sort in descending order. Paste the following code inside the functions.php file of your theme/child theme.

add_filter( 'rem_lists_sorting_options', 'rem_sort_by_id', 10, 1 );

function rem_sort_by_id($options){
	$id_op = array(
		'title' => __( 'Sort By ID - DESC', 'real-estate-manager' ),
		'value' => 'ID-desc',
	);
	$options[] = $id_op;
	return $options;
}

Please note that in value key you have to provide 2 values separated with a dash “-“.

{field_name}-{asc or desc}

Custom Property Fields

If you want to sort by custom property fields, you have to provide value in the following format.

rem_{field_name}-{asc or desc}-{custom}

for ascending property_area, it will become

rem_property_area-asc-custom

When you will paste the following code inside functions.php file of your theme/child theme, it will display 2 more sorting options in the top bar

  • Sort By Beds – High to Low
  • Sort By Beds – Low to Hight
add_filter( 'rem_lists_sorting_options', 'rem_sort_by_beds', 10, 1 );

function rem_sort_by_beds($options){
	$beds_desc = array(
		'title' => __( 'Sort By Beds - High to Low', 'real-estate-manager' ),
		'value' => 'rem_property_bedrooms-desc-custom',
	);
	$beds_asc = array(
		'title' => __( 'Sort By Beds - Low to Hight', 'real-estate-manager' ),
		'value' => 'rem_property_bedrooms-asc-custom',
	);
	$options[] = $beds_desc;
	$options[] = $beds_asc;
	return $options;
}

 

rem_property_price

This filter returns the formatted price for properties.

Arguments

  1. Formatted Price [HTML]
  2. Actual Price [integer]
  3. Arguments [array]

Example

Suppose you want to display a Price on Request text instead of the actual price for those properties having price 1, paste the following code in the functions.php file of the theme/child theme will do that.

add_filter('rem_property_price', 'change_price_text', 20, 3);

function change_price_text($return, $price, $args){

	if ($price == '1') {
		return 'Price on request';
	} else {
		return $return;
	}
	
}

 

rem_search_properties_query_args

This filter is responsible for changing the search query before displaying the results.

Pasting following code in the functions.php file of the theme/child theme will sort the search results by Featured Properties. (Featured properties will display first).

add_filter( 'rem_search_properties_query_args', 'rem_sort_results_by_featured', 10, 1 );

function rem_sort_results_by_featured($args){
	$args['orderby'] = 'meta_value';
	$args['meta_key'] = 'rem_property_featured';
	$args['order'] = 'DESC';

	return $args;
}

 

 

rem_single_property_field_columns_frontend

This filter can be used to alter the number of columns of the field values on the Single Property Page.

Arguments

  1. Default CSS Classes [text]
  2. Field Name (Field Data Name) [text]
  3. Field [array]
  4. Property ID [integer]

Example #1

Suppose you want to change the Number of columns to 2, you will paste the following code in your theme’s functions.php file.

add_filter( 'rem_single_property_field_columns_frontend', 'rem_frontend_columns', 10, 4 );

function rem_frontend_columns($default, $field_key, $field, $property_id){
	return 'col-sm-6';
}

Example #2

Suppose you want to display only Details section fields in 2 columns instead of 3, please paste the following code in the functions.php of theme/child theme.

add_filter( 'rem_single_property_field_columns_frontend', 'rem_2_column_fields', 50, 4 );

function rem_2_column_fields($class, $key, $field, $property_id){
	if (isset($field['tab']) && $field['tab'] == 'general_settings') {
		return 'col-md-6 col-sm-12';
	} else {
		return $class;
	}
}

Example #3 (Property Features)

add_filter( 'rem_single_property_field_columns_frontend', 'rem_2_column_features', 50, 4 );

function rem_2_column_features($class, $key, $field, $property_id){
	if ($key == 'property_features') {
		return 'col-md-6 col-sm-12';
	} else {
		return $class;
	}
}

 

rem_fotorama_attrs

This filter is responsible for all the settings related to the Gallery Slider, on the Single Property Page. We’re using Fotorama library here.

Default settings that we’re using are defined below

Now suppose you want to add some more settings from Fotorama API, and with this, you also want to modify some of the default values. Let’s say the following settings you need

  • max-width => 1150
  • max-height => 100%
  • ratio => 16/9
  • min-width => 400
  • min-height => 300

You have to paste the following code inside functions.php file of your theme to achieve this

add_filter( 'rem_fotorama_attrs', 'rem_fotorama_custom', 10, 1 );

function rem_fotorama_custom($attrs){
	$attrs['max-width'] = '1150';
	$attrs['max-height'] = '100%';
	$attrs['ratio'] = '16/9';
	$attrs['min-width'] = '400';
	$attrs['min-height'] = '300';
	return $attrs;
}

 

 

rem_property_settings_tabs

This filter is responsible for rendering the sections or tabs for property page. By default the following tabs are available

  1. Details
  2. Internal Structure
  3. Features
  4. Attachments
  5. Video
  6. Private Fields

You can add more tabs from Settings -> Single Property Page -> Property Settings Tabs.

But, what if you need to remove the default ones or want to modify the default ones? For this, you can use the filter rem_property_settings_tabs.

Pasting the following code inside the functions.php file of your theme will change the labels as following

  • Details => General Settings
  • Internal Structure => Interior
  • Features => Facilities
  • Attachments => Docs
add_filter( 'rem_property_settings_tabs', 'rem_changing_tabs', 10, 1 );

function rem_changing_tabs($tabs){
	foreach ($tabs as $tab_key => $tab_name) {
		if ($tab_key == 'general_settings') {
			$tabs[$tab_key] = 'General Settings';
		}
		if ($tab_key == 'internal_structure') {
			$tabs[$tab_key] = 'Interior';
		}
		if ($tab_key == 'property_details') {
			$tabs[$tab_key] = 'Facilities';
		}
		if ($tab_key == 'property_attachments') {
			$tabs[$tab_key] = 'Docs';
		}
	}

	return $tabs;
}

and the following code will remove the Internal Structure tab.

add_filter( 'rem_property_settings_tabs', 'rem_changing_tabs', 10, 1 );

function rem_changing_tabs($tabs){
	unset($tabs['internal_structure']);
	return $tabs;
}

 

Changing Order of Tabs

add_filter( 'rem_property_settings_tabs', 'rem_changing_tabs_order', 10, 1 );
 
function rem_changing_tabs_order($tabs){

	// Move Attachments to the Top
	$tabs = rem_move_to_top($tabs, 'property_attachments');
 
	return $tabs;
}

function rem_move_to_top($array, $key) {
	$temp = array($key => $array[$key]);
	unset($array[$key]);
	$array = $temp + $array;
	return $array;
}

function rem_move_to_bottom($array, $key) {
	$value = $array[$key];
	unset($array[$key]);
	$array[$key] = $value;
	return $array;
}

 

rem_agent_page_slider_style

This filter is responsible for the property listing style that displays in a slider, on the Agent Template.

Arguments

  1. Listing Style [integer]

Example

Suppose, you want to change this style to Style 6. You will use the following code inside your theme’s functions.php file.

add_filter( 'rem_agent_page_slider_style', 'rem_agent_page_slider_style', 10, 1 );

function rem_agent_page_slider_style($style){
	return 6;
}