function wpsight_do_listing_details_overview($args = '', $instance = '') { // Stop if on listing single page if (is_listing_single() && !is_page_template('page-tpl-listings.php') && !is_page_template('page-tpl-properties.php') && !is_page_template('page-tpl-favorites.php') && !is_page_template('page-tpl-map.php') && empty($instance)) { return; } // Don't show when password required if (post_password_required()) { return; } echo preg_replace('/\\s+/', ' ', wpsight_get_listing_details()); }
function wpsight_listing_details_short_shortcode($atts) { $defaults = array('id' => get_the_ID(), 'nr' => apply_filters('wpsight_get_listing_details_nr', 3), 'before' => '', 'after' => '', 'wrap' => 'div'); extract(shortcode_atts($defaults, $atts)); // Get details $details = wpsight_get_listing_details($id, $nr); $output = sprintf('%1$s%3$s%2$s', $before, $after, $details); // Optionally wrap shortcode in HTML tags if (!empty($wrap) && $wrap != 'false' && in_array($wrap, array_keys(wp_kses_allowed_html('post')))) { $output = sprintf('<%2$s class="listing-details-short-sc">%1$s</%2$s>', $output, $wrap); } return apply_filters('wpsight_listing_details_short_shortcode', $output, $atts); }
/** * Echo listing details * * @since 1.0 */ function wpsight_listing_details($post_id = '', $details_nr = '') { echo wpsight_get_listing_details($post_id, $details_nr); }