Skip to content

Instantly share code, notes, and snippets.

@gspice
Created August 10, 2014 16:39
Show Gist options
  • Save gspice/b29d94358bcbb6a33a85 to your computer and use it in GitHub Desktop.
Save gspice/b29d94358bcbb6a33a85 to your computer and use it in GitHub Desktop.
AgentPress Listings filter to change property details
//* Filter the property details array
add_filter( 'agentpress_property_details', 'agentpress_property_details_filter' );
function agentpress_property_details_filter( $details ) {
$details['col1'] = array(
__( 'Price:', 'agentpress' ) => '_listing_price',
__( 'Address:', 'agentpress' ) => '_listing_address',
__( 'City:', 'agentpress' ) => '_listing_city',
__( 'State:', 'agentpress' ) => '_listing_state',
__( 'ZIP:', 'agentpress' ) => '_listing_zip',
);
$details['col2'] = array(
__( 'MLS #:', 'agentpress' ) => '_listing_mls',
__( 'Square Feet:', 'agentpress' ) => '_listing_sqft',
__( 'Bedrooms:', 'agentpress' ) => '_listing_bedrooms',
__( 'Bathrooms:', 'agentpress' ) => '_listing_bathrooms',
__( 'Basement:', 'agentpress' ) => '_listing_basement',
);
return $details;
}
@mjsdiaz
Copy link

mjsdiaz commented Aug 22, 2015

// To change "Basement" to "Garage", you would add the above to your functions.php, and edit it to be:

//* Filter the property details array
add_filter( 'agentpress_property_details', 'agentpress_property_details_filter' );
function agentpress_property_details_filter( $details ) {

$details['col1'] = array( 
    __( 'Price:', 'agentpress' )   => '_listing_price', 
    __( 'Address:', 'agentpress' ) => '_listing_address', 
    __( 'City:', 'agentpress' )    => '_listing_city', 
    __( 'State:', 'agentpress' )   => '_listing_state', 
    __( 'ZIP:', 'agentpress' )     => '_listing_zip',
);
$details['col2'] = array( 
    __( 'MLS #:', 'agentpress' )       => '_listing_mls', 
    __( 'Square Feet:', 'agentpress' ) => '_listing_sqft', 
    __( 'Bedrooms:', 'agentpress' )    => '_listing_bedrooms', 
    __( 'Bathrooms:', 'agentpress' )   => '_listing_bathrooms', 
    __( 'Garage:', 'agentpress' )    => '_listing_garage',
);

return $details;

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment