PHP 클래스 RTMediaMedia, rtMedia

저자: Udit Desai ([email protected])
파일 보기 프로젝트 열기: rtCamp/rtMedia 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$default_object
$model DB Model object to interact on Database operations

공개 메소드들

메소드 설명
__construct ( ) Initialises the model object of the mediua object
activity_enabled ( ) : boolean Check if BuddyPress and the activity component are enabled
add ( type $uploaded, type $file_object ) : type Generic method to add a media
add_meta ( array $attachments, array $custom_fields ) : boolean
add_taxonomy ( array $attachments, array $taxonomies ) Adds taxonomy
delete ( integer $id, boolean $core = false, boolean $delete_activity = true ) : boolean Generic method to delete a media
delete_hook ( ) Adds a hook to delete_attachment tag called when a media is deleted externally out of rtMedia context
delete_wordpress_attachment ( integer $id ) : boolean Generic method to delete a media from wordpress media library ( other than by rtMedia )
generate_post_array ( type $uploaded, type $file_object ) : type
image_sizes ( type $sizes ) : type
import_attachment ( ) Imports attachment as media
insert_activity ( $id, $media, $activity_text = false )
insert_album ( type $attributes ) : integer
insert_attachment ( type $attachments, type $file_object ) : array
insertmedia ( array $attachment_ids, array $uploaded, $file_object ) : array
is_multisite ( ) : boolean Helper method to check for multisite - will add a few additional checks for handling taxonomies
media_nonce_generator ( $id, boolean $echo = true ) : string Generate nonce
move ( type $media_id, type $album_id ) : boolean Move a media from one album to another
reassign_wordpress_user ( integer $user_id, $reassign ) Method to reassign media to another user while deleting user
set_media_type ( $mime_type, $file_object )
update ( $id, $data, integer $media_id ) : boolean Generic method to update a media. media details can be changed from this method
verify_nonce ( string $mode ) : boolean Method verifies the nonce passed while performing any CRUD operations on the media.

메소드 상세

__construct() 공개 메소드

Initialises the model object of the mediua object
public __construct ( )

activity_enabled() 공개 메소드

Check if BuddyPress and the activity component are enabled
public activity_enabled ( ) : boolean
리턴 boolean

add() 공개 메소드

Generic method to add a media
public add ( type $uploaded, type $file_object ) : type
$uploaded type
$file_object type
리턴 type

add_meta() 공개 메소드

public add_meta ( array $attachments, array $custom_fields ) : boolean
$attachments array attachment ids
$custom_fields array array of key value pairs of meta
리턴 boolean success of meta

add_taxonomy() 공개 메소드

Adds taxonomy
public add_taxonomy ( array $attachments, array $taxonomies )
$attachments array ids of the attachments created after upload
$taxonomies array array of terms indexed by a taxonomy

delete() 공개 메소드

Generic method to delete a media
public delete ( integer $id, boolean $core = false, boolean $delete_activity = true ) : boolean
$id integer
$core boolean
$delete_activity boolean
리턴 boolean

delete_hook() 공개 메소드

Adds a hook to delete_attachment tag called when a media is deleted externally out of rtMedia context
public delete_hook ( )

delete_wordpress_attachment() 공개 메소드

Generic method to delete a media from wordpress media library ( other than by rtMedia )

generate_post_array() 공개 메소드

public generate_post_array ( type $uploaded, type $file_object ) : type
$uploaded type
$file_object type
리턴 type

image_sizes() 공개 메소드

public image_sizes ( type $sizes ) : type
$sizes type
리턴 type

import_attachment() 공개 메소드

Imports attachment as media
public import_attachment ( )

insert_activity() 공개 메소드

public insert_activity ( $id, $media, $activity_text = false )

insert_album() 공개 메소드

public insert_album ( type $attributes ) : integer
$attributes type
리턴 integer

insert_attachment() 공개 메소드

public insert_attachment ( type $attachments, type $file_object ) : array
$attachments type
$file_object type
리턴 array $updated_attachment_ids

insertmedia() 공개 메소드

public insertmedia ( array $attachment_ids, array $uploaded, $file_object ) : array
$attachment_ids array
$uploaded array
$file_object
리턴 array

is_multisite() 공개 메소드

Helper method to check for multisite - will add a few additional checks for handling taxonomies
public is_multisite ( ) : boolean
리턴 boolean

media_nonce_generator() 정적인 공개 메소드

Generate nonce
static public media_nonce_generator ( $id, boolean $echo = true ) : string
$echo boolean whether nonce should be echoed
리턴 string json encoded nonce

move() 공개 메소드

Move a media from one album to another
public move ( type $media_id, type $album_id ) : boolean
$media_id type
$album_id type
리턴 boolean

reassign_wordpress_user() 공개 메소드

Method to reassign media to another user while deleting user
public reassign_wordpress_user ( integer $user_id, $reassign )
$user_id integer , $reassign

set_media_type() 공개 메소드

public set_media_type ( $mime_type, $file_object )

update() 공개 메소드

Generic method to update a media. media details can be changed from this method
public update ( $id, $data, integer $media_id ) : boolean
$id
$data
$media_id integer
리턴 boolean

verify_nonce() 공개 메소드

Method verifies the nonce passed while performing any CRUD operations on the media.
public verify_nonce ( string $mode ) : boolean
$mode string The upload mode
리턴 boolean whether the nonce is valid

프로퍼티 상세

$default_object 정적으로 공개적으로 프로퍼티

static public $default_object

$model 공개적으로 프로퍼티

DB Model object to interact on Database operations
public $model