Rename Post Type labels in the Dashboard

By default Easy Property Listings registers listing types by a name.

  • Property (Residential for sale listing types)
  • Rental (Residential for lease listing types)
  • Land (Residential land for sale listing types)
  • Rural (Residential rural/acreage/farm type listings)
  • Commercial (Commercial for sale/lease/or both listing types)
  • Commercial Land (Commercial land for sale listing type)
  • Business (Business for sale listing types)

Once activated from Easy Property Listings > Settings these appear in the dashboard:

How to rename the default labels using a filter

Each post type has a label filter which allows you to pass in your own names for each post type. All post types use the same array of options as all custom post types do in WordPress.

The array of labels for the property post type is:

$array_of_values = array(
	'name'               => __( 'Properties', 'easy-property-listings' ),
	'singular_name'      => __( 'Property', 'easy-property-listings' ),
	'menu_name'          => __( 'Property', 'easy-property-listings' ),
	'add_new'            => __( 'Add New', 'easy-property-listings' ),
	'add_new_item'       => __( 'Add New Listing', 'easy-property-listings' ),
	'edit_item'          => __( 'Edit Listing', 'easy-property-listings' ),
	'new_item'           => __( 'New Listing', 'easy-property-listings' ),
	'update_item'        => __( 'Update Listing', 'easy-property-listings' ),
	'all_items'          => __( 'All Listings', 'easy-property-listings' ),
	'view_item'          => __( 'View Listing', 'easy-property-listings' ),
	'search_items'       => __( 'Search Listing', 'easy-property-listings' ),
	'not_found'          => __( 'Listing Not Found', 'easy-property-listings' ),
	'not_found_in_trash' => __( 'Listing Not Found in Trash', 'easy-property-listings' ),
	'parent_item_colon'  => __( 'Parent Listing:', 'easy-property-listings' ),
)

Using this method you can pass your own array of labels into the filter for each post type. 

Property

add_filter( 'epl_property_labels', $array_of_values );

Rental

add_filter( 'epl_rental_labels', $array_of_values );

Land

add_filter( 'epl_land_labels', $array_of_values );

Rural

add_filter( 'epl_rural_labels', $array_of_values );

Commercial

add_filter( 'epl_commercial_labels', $array_of_values );

Commercial Land

add_filter( 'epl_commercial_land_labels', $array_of_values );

Business

add_filter( 'epl_business_labels', $array_of_values );

Example function code to alter the Property to Residential.

Add the following function to your installation.

// Property to Farm
function my_rename_property_to_residental( $array_of_values ) {

	// Replace the labels with a new array
	$array_of_values = array(
		'name'               => 'Farms',
		'singular_name'      => 'Farm',
		'menu_name'          => 'Farm',
		'add_new'            => 'Add New',
		'add_new_item'       => 'Add New Farm',
		'edit_item'          => 'Edit Farm',
		'new_item'           => 'New Farm',
		'update_item'        => 'Update Farm',
		'all_items'          => 'All Farms',
		'view_item'          => 'View Farm',
		'search_items'       => 'Search Farm',
		'not_found'          => 'Farm Not Found',
		'not_found_in_trash' => 'Farm Not Found in Trash',
		'parent_item_colon'  => 'Parent Farm:',
	);
	return $array_of_values;
}
add_filter( 'epl_property_labels', 'my_rename_property_to_residental' , 1 );

As each post type has a different filter name edit that in the add_filter section.

Property will be renamed to Farm