PHP Class Jetpack_VideoPress, jetpack

Show file Open project: automattic/jetpack Class Usage Examples

Public Properties

Property Type Description
$module string
$version integer

Public Methods

Method Description
add_video_upload_mimes ( array $existing_mimes = [] ) : array Makes sure that all video mimes are added in, as multi site installs can remove them.
can ( $cap, $user_id = false ) A can of coke
change_add_new_menu_location ( ) Changes the add new menu location, so that VideoPress will be enabled when a user clicks that button.
enqueue_admin_scripts ( ) Register VideoPress admin scripts.
enqueue_admin_styles ( ) Register and enqueue VideoPress admin styles.
filter_video_mimes ( string $value ) : integer Filter designed to get rid of non video mime types.
init ( ) Singleton
is_connection_owner ( $user_id = false ) Returns true if the provided user is the Jetpack connection owner.
jetpack_module_deactivated ( ) Runs when the VideoPress module is deactivated.
on_init ( ) Fires on init
print_in_footer_open_media_add_new ( ) : boolean A work-around / hack to make it possible to go to the media library with the add new box open.
update_attachment_url_for_videopress ( string $url, integer $post_id ) : mixed An override for the attachment url, which returns back the WPCOM videopress original url, if it is set to the the objects metadata. this allows us to show the original uploaded file on the WPCOM architecture, instead of the locally uplodaded file, which doeasn't exist.
videopress_pluploder_config ( $config ) Modify the default plupload config to turn on videopress specific filters.

Protected Methods

Method Description
should_override_media_uploader ( ) : boolean Helper function to determine if the media uploader should be overridden.

Private Methods

Method Description
__construct ( ) Jetpack_VideoPress constructor.

Method Details

add_video_upload_mimes() public method

Makes sure that all video mimes are added in, as multi site installs can remove them.
public add_video_upload_mimes ( array $existing_mimes = [] ) : array
$existing_mimes array
return array

can() public method

Similar to current_user_can, but internal to VideoPress. Returns true if the given VideoPress capability is allowed by the given user.
public can ( $cap, $user_id = false )

change_add_new_menu_location() public method

Changes the add new menu location, so that VideoPress will be enabled when a user clicks that button.

enqueue_admin_scripts() public method

Register VideoPress admin scripts.

enqueue_admin_styles() public method

Register and enqueue VideoPress admin styles.

filter_video_mimes() public method

Filter designed to get rid of non video mime types.
public filter_video_mimes ( string $value ) : integer
$value string
return integer

init() public static method

Singleton
public static init ( )

is_connection_owner() public method

Returns true if the provided user is the Jetpack connection owner.
public is_connection_owner ( $user_id = false )

jetpack_module_deactivated() public method

Runs when the VideoPress module is deactivated.

on_init() public method

Fires on init
public on_init ( )

should_override_media_uploader() protected method

The rules are simple, only try to load the script when on the edit post or new post pages.

update_attachment_url_for_videopress() public method

An override for the attachment url, which returns back the WPCOM videopress original url, if it is set to the the objects metadata. this allows us to show the original uploaded file on the WPCOM architecture, instead of the locally uplodaded file, which doeasn't exist.
public update_attachment_url_for_videopress ( string $url, integer $post_id ) : mixed
$url string
$post_id integer
return mixed

videopress_pluploder_config() public method

Modify the default plupload config to turn on videopress specific filters.
public videopress_pluploder_config ( $config )

Property Details

$module public property

public string $module
return string

$version public property

public int $version
return integer