Manages the slideshow

WARNING: this method doesn't register the asset: You have to take care of it by yourself (tipically in assets.php)

author etessore
version 1.0.1
package templates
subpackage parts

 Methods

Initializes the parent object to the default values

__construct() 

Adds an asset.

add_asset(string $handle, string $type) : \FeatureWithAssets
Inherited

You cannot define an asset here, to do it please use wp_register_script or wp_register_style in functions.php or config/assets.php WARNING: this method doesn't register the asset: You have to take care of it by yourself (tipically in assets.php)

inherited_from \FeatureWithAssets::add_asset()
inherited_from \GalleryHelper::add_asset()
inherited_from \ImagePreload::add_asset()

Parameters

$handle

string

the handle for the asset.

$type

string

the asset type: js|css

Returns

\FeatureWithAssets$this for chainability

Adds an image to the current set

add_image(string | int $img) : \GalleryHelper
Inherited
inherited_from \GalleryHelper::add_image()
inherited_from \ImagePreload::add_image()

Parameters

$img

stringint

the image: if is an int it will be retrieved from the wp media, elsewhere it is an html tag

Returns

\GalleryHelper$this for chainability

Add some images to the current set

add_images(array $images) : \GalleryHelper
Inherited
inherited_from \GalleryHelper::add_images()
inherited_from \ImagePreload::add_images()

Parameters

$images

array

the list of images to be added

Returns

\GalleryHelper$this for chainability

Calculates the unique id for the current gallery

calculate_unique() : \GalleryHelper
Inherited
inherited_from \GalleryHelper::calculate_unique()
inherited_from \ImagePreload::calculate_unique()

Returns

\GalleryHelper$this for chainability

(non-PHPdoc)

get_markup() : \the
Inherited
see \GalleryHelper::get_markup()
inherited_from \ImagePreload::get_markup()

Returns

\themarkup for the current gallery

Retrives the images for the slideshow

get_the_images(int $post_id) : \Slideshow

Parameters

$post_id

int

the post id to dig in

Returns

\Slideshow$this for chainability

Loads needed scripts and css

load_assets() : \FeatureWithAssets
Inherited
inherited_from \FeatureWithAssets::load_assets()
inherited_from \GalleryHelper::load_assets()
inherited_from \ImagePreload::load_assets()

Returns

\FeatureWithAssets$this for chainability

Loads needed scripts and css

load_assets_callback() : \FeatureWithAssets
Inherited
inherited_from \FeatureWithAssets::load_assets_callback()
inherited_from \GalleryHelper::load_assets_callback()
inherited_from \ImagePreload::load_assets_callback()

Returns

\FeatureWithAssets$this for chainability

Replaces the markup in $this->tpl %tag%s with the one in the corresponding value of $this->static_markup[tag].

replace_markup() 
Inherited
inherited_from \GalleryHelper::replace_markup()
inherited_from \ImagePreload::replace_markup()

Set the assets list to the given one

set_assets(array $assets) : \FeatureWithAssets
Inherited
inherited_from \FeatureWithAssets::set_assets()
inherited_from \GalleryHelper::set_assets()
inherited_from \ImagePreload::set_assets()

Parameters

$assets

array

the list of assets: array('js'=>array(...), 'css'=>array(...));

Returns

\FeatureWithAssets$this for chainability

Set the static markup; ie: prev\next\loading divs

set_markup(string $key, string $markup) : \GalleryHelper
Inherited
inherited_from \GalleryHelper::set_markup()
inherited_from \ImagePreload::set_markup()

Parameters

$key

string

the string has to be substituted

$markup

string

html markup

Returns

\GalleryHelper$this for chainability

Set the html template for this gallery

set_template(string $tpl) : \GalleryHelper
Inherited
inherited_from \GalleryHelper::set_template()
inherited_from \ImagePreload::set_template()

Parameters

$tpl

string

the template

Returns

\GalleryHelper$this for chainability

Set the timthumb options If set_wp_media_dimension() is called it will prevale on this.

set_timthumb_options(array $options) 
Inherited
inherited_from \GalleryHelper::set_timthumb_options()
inherited_from \ImagePreload::set_timthumb_options()

Parameters

$options

array

Set the unique id for this gallery

set_uid(string $unid) : \GalleryHelper
Inherited
inherited_from \GalleryHelper::set_uid()
inherited_from \ImagePreload::set_uid()

Parameters

$unid

string

the unique

Returns

\GalleryHelper$this for chainability

Sets the dimension for this gallery.

set_wp_media_dimension(string $dimension) : \GalleryHelper
Inherited

If set this option will prevale on timthumb

inherited_from \GalleryHelper::set_wp_media_dimension()
inherited_from \ImagePreload::set_wp_media_dimension()

Parameters

$dimension

string

WordPress media dimension name

Returns

\GalleryHelper$this for chainability

Echoes the markup for the current gallery

the_markup() 
Inherited
inherited_from \GalleryHelper::the_markup()
inherited_from \ImagePreload::the_markup()

Checks if the $index image of the list is a wordpress media id or an image object

get_image_alt(int $index) 
Inherited
returns the alt attribute for the $index image of the set
inherited_from \GalleryHelper::get_image_alt()
inherited_from \ImagePreload::get_image_alt()

Parameters

$index

int

the index of the images list

Checks if the $index image of the list is a wordpress media id or an image object

get_image_caption(int $index) 
Inherited
returns the caption for the $index image of the set
inherited_from \GalleryHelper::get_image_caption()
inherited_from \ImagePreload::get_image_caption()

Parameters

$index

int

the index of the images list

Checks if the $index image of the list is a wordpress media id or an image object

get_image_description(int $index) 
Inherited
returns the description for the $index image of the set
inherited_from \GalleryHelper::get_image_description()
inherited_from \ImagePreload::get_image_description()

Parameters

$index

int

the index of the images list

Get the height for the n-th image of the list

get_image_height(int $index) 
Inherited
inherited_from \GalleryHelper::get_image_height()
inherited_from \ImagePreload::get_image_height()

Parameters

$index

int

the index of the images list

Checks if the $index image of the list is a wordpress media id or an image object

get_image_id(int $index) 
Inherited
returns the id attribute for the $index image of the set
inherited_from \GalleryHelper::get_image_id()
inherited_from \ImagePreload::get_image_id()

Parameters

$index

int

the index of the images list

Checks if the $index image of the list is a wordpress media id or an image object

get_image_src(int $index) 
Inherited
returns the src attribute for the $index image of the set
inherited_from \GalleryHelper::get_image_src()
inherited_from \ImagePreload::get_image_src()

Parameters

$index

int

the index of the images list

Get the width for the n-th image of the list

get_image_width(int $index) 
Inherited
inherited_from \GalleryHelper::get_image_width()
inherited_from \ImagePreload::get_image_width()

Parameters

$index

int

the index of the images list

 Properties

 

the list of assets to be loaded array('js'=>array(...), 'css'=>array(...));

$assets : array
Inherited
inherited_from \FeatureWithAssets::$$assets
inherited_from \GalleryHelper::$$assets
inherited_from \ImagePreload::$$assets
 

the list of imagese to be slided

$images : array
 

WordPress media size name

$media_dimension : string
Inherited
inherited_from \GalleryHelper::$$media_dimension
inherited_from \ImagePreload::$$media_dimension
 

the id of the post

$post_id : int
 

Stores some static html

$static_markup : array
Inherited
inherited_from \GalleryHelper::$$static_markup
inherited_from \ImagePreload::$$static_markup
 

options for timthumb

$timthumb_opts : array
Inherited
inherited_from \GalleryHelper::$$timthumb_opts
inherited_from \ImagePreload::$$timthumb_opts
 

the html template

$tpl : String
Inherited
inherited_from \GalleryHelper::$$tpl
inherited_from \ImagePreload::$$tpl
 

the unique id for the current gallery it will be automatically created if not specified

$unid : string
Inherited
inherited_from \GalleryHelper::$$unid
inherited_from \ImagePreload::$$unid