Last active
June 25, 2019 14:18
-
-
Save JoeHana/4b63859ac59bb01907b796fec13c5e1f to your computer and use it in GitHub Desktop.
Custom number of baths and beds in Listing Details
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Custom number of baths and beds in Listing Details | |
*/ | |
add_filter( 'wpsight_details', 'custom_wpsight_details' ); | |
function custom_wpsight_details( $details ) { | |
$details['details_1']['data'] = array( '' => __( 'n/d', 'wpcasa' ), '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5' ); | |
$details['details_2']['data'] = array( '' => __( 'n/d', 'wpcasa' ), '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5' ); | |
return $details; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@AlviseNicoletti code has been updated, there was still a reference to $data, sorry for that. However, the name of the function itself is up to you actually, it just needs to match the callback for the filter hook. For our example snippets we currently use the original filter hook name together with the prefix "custom". For best practices it would be anyway recommended to apply your own function naming convention.