From d8a0462533b24503514a16f6f913cfe7a174c2ac Mon Sep 17 00:00:00 2001 From: ThemeLexus Date: Mon, 30 Sep 2019 13:04:39 +0700 Subject: [PATCH] uapte --- inc/agency/class-opalestate-agency-front.php | 24 ++++++++++++++++++++ templates/shortcodes/search-agencies.php | 4 ++++ 2 files changed, 28 insertions(+) create mode 100644 templates/shortcodes/search-agencies.php diff --git a/inc/agency/class-opalestate-agency-front.php b/inc/agency/class-opalestate-agency-front.php index 2b027d7f..16519320 100755 --- a/inc/agency/class-opalestate-agency-front.php +++ b/inc/agency/class-opalestate-agency-front.php @@ -308,7 +308,31 @@ class Opalestate_Agency_Front { * */ public function register_shortcodes() { + $this->shortcodes = [ + 'search_agencies' => [ 'code' => 'search_agencies', 'label' => esc_html__( 'Search Agencies', 'opalestate-pro' ) ], + ]; + foreach ( $this->shortcodes as $shortcode ) { + add_shortcode( 'opalestate_' . $shortcode['code'], [ $this, $shortcode['code'] ] ); + } + } + + /** + * + */ + public function search_agencies ( $atts=[] ) { + + $atts = is_array( $atts ) ? $atts : []; + $layout = 'search-agency-form'; + + $default = array( + 'current_uri' => null, + 'form' => $layout + ); + + $atts = array_merge( $default, $atts ); + + return opalestate_load_template_path( 'shortcodes/search-agencies' , $atts ); } /** diff --git a/templates/shortcodes/search-agencies.php b/templates/shortcodes/search-agencies.php new file mode 100644 index 00000000..75e3805b --- /dev/null +++ b/templates/shortcodes/search-agencies.php @@ -0,0 +1,4 @@ +
+ $current_uri ) ); ?> +
+ \ No newline at end of file