PHP Class RTMediaAlbum, rtMedia

Author: Udit Desai ([email protected])
Mostrar archivo Open project: rtCamp/rtMedia Class Usage Examples

Public Properties

Property Type Description
$media RTMediaMedia Media object associated with the album. It works as an interface for the actions specific the media from this album

Public Methods

Method Description
__construct ( )
add ( string $title = '', boolean | integer $author_id = false, boolean | type $new = true, boolean | integer $post_id = false, boolean $context = false, boolean $context_id = false ) : type Adds a new album
add_global ( string $title = '' ) : boolean Wrapper method to add a global album
delete ( integer $id ) : boolean Generic method to delete any album
delete_global ( integer $id ) : boolean Wrapper method to delete a global album
get_current_author ( ) : integer returns user_id of the current logged in user in wordpress
get_default ( ) : type There is a default global album which works as a Wall Post Album for the user.
get_globals ( ) : bool/mixed/void Get the list of all global albums
merge ( integer $primary_album_id, integer $secondary_album_id ) : int/bool Generic function to merge two albums
register_post_types ( ) Register Custom Post Types required by rtMedia
rtmedia_album_custom_post_status ( )
save_globals ( $album_ids = false ) : boolean Save global albums for newly added album
set_queries_per_page ( integer $per_page, string $table_name ) : integer Helper function to set number of queries in pagination
update ( integer $id, string $title = '' ) : boolean Update any album. Generic method for all the user.
update_global ( integer $id, string $title = '' ) : boolean Wrapper method to update details for any global album
verify_nonce ( type $mode ) : boolean Method verifies the nonce passed while performing any CRUD operations on the album.

Method Details

__construct() public method

public __construct ( )

add() public method

Adds a new album
public add ( string $title = '', boolean | integer $author_id = false, boolean | type $new = true, boolean | integer $post_id = false, boolean $context = false, boolean $context_id = false ) : type
$title string
$author_id boolean | integer
$new boolean | type
$post_id boolean | integer
$context boolean
$context_id boolean
return type

add_global() public method

Wrapper method to add a global album
public add_global ( string $title = '' ) : boolean
$title string
return boolean

delete() public method

Generic method to delete any album
public delete ( integer $id ) : boolean
$id integer
return boolean

delete_global() public method

Wrapper method to delete a global album
public delete_global ( integer $id ) : boolean
$id integer
return boolean

get_current_author() public method

returns user_id of the current logged in user in wordpress
public get_current_author ( ) : integer
return integer

get_default() static public method

There is a default global album which works as a Wall Post Album for the user.
static public get_default ( ) : type
return type

get_globals() static public method

Get the list of all global albums
static public get_globals ( ) : bool/mixed/void
return bool/mixed/void

merge() public method

Generic function to merge two albums
public merge ( integer $primary_album_id, integer $secondary_album_id ) : int/bool
$primary_album_id integer
$secondary_album_id integer
return int/bool

register_post_types() public method

Register Custom Post Types required by rtMedia
public register_post_types ( )

rtmedia_album_custom_post_status() public method

save_globals() public method

Save global albums for newly added album
public save_globals ( $album_ids = false ) : boolean
return boolean

set_queries_per_page() public method

Helper function to set number of queries in pagination
public set_queries_per_page ( integer $per_page, string $table_name ) : integer
$per_page integer
$table_name string
return integer

update() public method

Update any album. Generic method for all the user.
public update ( integer $id, string $title = '' ) : boolean
$id integer
$title string
return boolean

update_global() public method

Wrapper method to update details for any global album
public update_global ( integer $id, string $title = '' ) : boolean
$id integer
$title string
return boolean

verify_nonce() public method

Method verifies the nonce passed while performing any CRUD operations on the album.
public verify_nonce ( type $mode ) : boolean
$mode type
return boolean

Property Details

$media public_oe property

Media object associated with the album. It works as an interface for the actions specific the media from this album
public RTMediaMedia $media
return RTMediaMedia