fahidjavid
8/10/2017 - 5:17 AM

Real Homes: Add property custom meta fields

Real Homes: Add property custom meta fields

<?php
/**
 * Add property custom meta fields
 */
function add_property_custom_fields( $new_fields ) {
 
    $new_fields['tab'] = array(
        'label' => 'Custom Tab', // tab name
        'icon'  => 'dashicons-admin-generic' // tab icon class (of dashicon). See all dashicons here: https://developer.wordpress.org/resource/dashicons
    );
 
    $new_fields['fields'] = array(
        array(
            'name'    => 'Year Built', // field name
            'desc'    => 'Example Value: 12-06-2016', // field description
            'postfix' => '', // field postfix (if any)
            'icon'    => 'year', // Place “png” icon in "realhomes/assets/(variation you are using)/icons" directory. Retina (double sized) icons should use @2x as postfix with icon name. E.g: year.png, year@2x.png
            'columns' => 6, // use ‘6’ for two fields in one row and ’12’ for one field in one row
            'display' => true // true to display field value on property detail page, otherwise false
        ),
        array(
            'name'    => 'Plot Size', // field name
            'desc'    => 'Example Value: 300', // field description
            'postfix' => 'SqFt', // field postfix (if any)
            'icon'    => 'size', // Place “png” icon in "realhomes/assets/(variation you are using)/icons" directory. Retina (double sized) icons should use @2x as postfix with icon name. E.g: year.png, year@2x.png
            'columns' => 6, // use ‘6’ for two fields in one row and ’12’ for one field in one row
            'display' => true // true to display field value on property detail page, otherwise false
        ),
    );
 
    return $new_fields;
}
 
add_filter( 'inspiry_property_custom_fields', 'add_property_custom_fields' );