PHP Класс Jetpack_VideoPress, jetpack

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$module string
$version integer

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
should_override_media_uploader ( ) : boolean Helper function to determine if the media uploader should be overridden.

Приватные методы

Метод Описание
__construct ( ) Jetpack_VideoPress constructor.

Описание методов

add_video_upload_mimes() публичный Метод

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
Результат array

can() публичный Метод

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() публичный Метод

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() публичный Метод

Filter designed to get rid of non video mime types.
public filter_video_mimes ( string $value ) : integer
$value string
Результат integer

init() публичный статический Метод

Singleton
public static init ( )

is_connection_owner() публичный Метод

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

jetpack_module_deactivated() публичный Метод

Runs when the VideoPress module is deactivated.

on_init() публичный Метод

Fires on init
public on_init ( )

should_override_media_uploader() защищенный Метод

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
Результат boolean

update_attachment_url_for_videopress() публичный Метод

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
Результат mixed

videopress_pluploder_config() публичный Метод

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

Описание свойств

$module публичное свойство

public string $module
Результат string

$version публичное свойство

public int $version
Результат integer