PHP Class Jetpack_VideoPress, jetpack

Afficher le fichier Open project: automattic/jetpack Class Usage Examples

Méthodes publiques

Свойство Type Description
$module string
$version integer

Méthodes publiques

Méthode 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.

Méthodes protégées

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

Private Methods

Méthode Description
__construct ( ) Jetpack_VideoPress constructor.

Method Details

add_video_upload_mimes() public méthode

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
Résultat array

can() public méthode

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 méthode

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

enqueue_admin_scripts() public méthode

Register VideoPress admin scripts.

enqueue_admin_styles() public méthode

Register and enqueue VideoPress admin styles.

filter_video_mimes() public méthode

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

init() public static méthode

Singleton
public static init ( )

is_connection_owner() public méthode

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

jetpack_module_deactivated() public méthode

Runs when the VideoPress module is deactivated.

on_init() public méthode

Fires on init
public on_init ( )

should_override_media_uploader() protected méthode

The rules are simple, only try to load the script when on the edit post or new post pages.
protected should_override_media_uploader ( ) : boolean
Résultat boolean

update_attachment_url_for_videopress() public méthode

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
Résultat mixed

videopress_pluploder_config() public méthode

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

Property Details

$module public_oe property

public string $module
Résultat string

$version public_oe property

public int $version
Résultat integer