'fade', // fade, horizontal-slide, vertical-slide, horizontal-push 'animationSpeed' => 800, // how fast animtions are 'timer' => false, // true or false to have the timer 'advanceSpeed' => 4000, // if timer is enabled, time between transitions 'pauseOnHover' => true, // if you hover pauses the slider 'startClockOnMouseOut' => true, // if clock should start on MouseOut 'startClockOnMouseOutAfter' => 500, // how long after MouseOut should the timer start again 'directionalNav' => true, // manual advancing directional navs 'captions' => true, // do you want captions? 'captionAnimation' => 'fade', // fade, slideOpen, none 'captionAnimationSpeed' => 800, // if so how quickly should they animate in 'bullets' => true, // true or false to activate the bullet navigation 'afterSlideChange' => 'function(){}', // empty function 'bullets' => false, // true or false to activate the bullet navigation 'bulletThumbs' => false, // thumbnails for the bullets 'bulletThumbLocation' => '', // location from this file where thumbs will be 'width' => 620, 'height' => 300, 'context' => '', 'context_var' => false, 'listings' => 'limit=5&is_featured=true&sort_by=price', 'data' => false, ); /** Merge the arguments with the defaults. */ $args = wp_parse_args( $args, $defaults ); /** Extract the arguments after they merged with the defaults. */ extract( $args, EXTR_SKIP ); if ( ! $data || ! is_array( $data ) ) { /** Process the listings args. */ $listings_args = wp_parse_args( $listings ); /** Process arguments that need to be sent to the API. */ $request_params = PLS_Plugin_API::get_valid_property_list_fields( $listings_args ); /** Request the list of properties. */ $listings_raw = PLS_Plugin_API::get_property_list( $request_params ); /** Display a placeholder if the plugin is not active or there is no API key. */ if ( pls_has_plugin_error() && current_user_can( 'administrator' ) ) return pls_get_no_plugin_placeholder( pls_get_merged_strings( array( $context, __FUNCTION__ ), ' -> ', 'post', false ) ); /** Return nothing when no plugin and user is not admin. */ if ( pls_has_plugin_error() ) return NULL; /** Data assumed to take this form. */ $data = array( 'images' => array(), 'links' => array(), 'captions' => array(), ); foreach ( $listings_raw->properties as $index => $listing ) { $listing_url = PLS_Plugin_API::get_property_url( $listing->id ); /** Overwrite the placester url with the local url. */ $data['links'][] = $listing_url; $data['images'][] = ! empty( $listing->images ) ? $listing->images[0]->url : PLS_IMG_URL . "/null/listing-100x100.png"; $data['listing'][] = $listing; /** Get the listing caption. */ ob_start(); ?>

location->full_address ?>

%1$s beds, %2$s baths', pls_get_textdomain() ), $listing->bedrooms, $listing->bathrooms ); ?>

'', 'captions' => '', ); /** Create the slideshow */ foreach( $data['images'] as $index => $slide_src ) { $extra_attr = array(); $extra_attr['title'] = ''; /** Save the caption and the title attribute for the img. */ if ( isset( $data['captions'][$index] ) ) { $html['captions'] .= $data['captions'][$index]; $extra_attr['title'] = "#caption-{$index}"; } /** Create the img element. */ $slide = pls_h_img($slide_src, false, $extra_attr); /** Wrap it in an achor if the anchor exists. */ if ( isset( $data['links'][$index] ) ) $slide = pls_h_a( $data['links'][$index], $slide, array('data-caption' => "#caption-{$index}") ); $html['slides'] .= $slide; } /** Combine the html. */ $html = pls_h_div( $html['slides'], array( 'id' => 'slider', 'class' => 'orbitSlider' ) ) . $html['captions']; /** Filter the html array. */ $html = apply_filters( pls_get_merged_strings( array( 'pls_slideshow_html', $context ), '_', 'pre', false ), $html, $data, $context, $context_var, $args ); /** The javascript needed for orbit. */ ob_start(); ?> images)) { foreach ($listing->images as $image) { $slide_array['images'][] = $image->url; // $slide_array['links'][] = 'google.com'; $slide_array['captions'][] = ''; // $slide_array['listing'][] = $data; } // Slide array successfully created return $slide_array; } return false; } }