| 1: | <?php |
| 2: | /** |
| 3: | * SHORTCODE :: Commercial Listing Search [commercial_listing_search] |
| 4: | * |
| 5: | * @package EPL |
| 6: | * @subpackage Shortcode/CommercialListingSearch |
| 7: | * @copyright Copyright (c) 2020, Merv Barrett |
| 8: | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9: | * @since 1.2 |
| 10: | */ |
| 11: | |
| 12: | // Exit if accessed directly. |
| 13: | if ( ! defined( 'ABSPATH' ) ) { |
| 14: | exit; |
| 15: | } |
| 16: | |
| 17: | /** |
| 18: | * Commercial Listing Search [commercial_listing_search] This shortcode allows for you to specify the property type(s) using |
| 19: | * [commercial_listing_search title="" post_type="commercial" property_status="current/sold/leased" search_house_category="on/off" search_price="on/off" search_bed="on/off" search_bath="on/off" search_car="on/off" search_other="on/off"] option |
| 20: | * |
| 21: | * @param array $atts shortcode array of options. |
| 22: | * |
| 23: | * @return false|string |
| 24: | * @since 1.2 |
| 25: | */ |
| 26: | function epl_shortcode_commercial_listing_search_callback( $atts ) { |
| 27: | $attributes = shortcode_atts( epl_commercial_search_get_defaults(), $atts ); |
| 28: | ob_start(); |
| 29: | // Rendering view of listing search shortcode. |
| 30: | epl_get_template_part( 'shortcodes/commercial-listing-search/' . ( ! empty( $attributes['view'] ) ? trim( $attributes['view'] ) . '.php' : 'default.php' ), array( 'atts' => $attributes ) ); |
| 31: | return ob_get_clean(); |
| 32: | } |
| 33: | add_shortcode( 'commercial_listing_search', 'epl_shortcode_commercial_listing_search_callback' ); |
| 34: |