rem_property_settings_tabs
This filter is responsible for rendering the sections or tabs for property page. By default the following tabs are available
- Details
- Internal Structure
- Features
- Attachments
- Video
- 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; }