PHP Class VideoPress_Edit_Attachment, jetpack

Since: 4.1
Show file Open project: automattic/jetpack Class Usage Examples

Public Methods

Method Description
__construct ( ) VideoPress_Edit_Attachment constructor.
configure_meta_boxes ( string $post_type = 'unknown', object $post = NULL )
fields_to_edit ( array $fields, stdClass $post ) : array Creates an array of video fields to edit based on transcoded videos.
init ( ) : VideoPress_Edit_Attachment Singleton method to initialize the object only once.
make_video_api_path ( string $guid ) : string Get the upload api path.
save_fields ( array $post, array | null $attachment = null ) : array
videopress_information_box ( stdClass $post )

Protected Methods

Method Description
display_embed_choice ( object $info ) : string Build HTML to display a form checkbox for embedcode display preference
display_rating ( object $info ) : string Build HTML to display a form input radio button for video ratings

Method Details

__construct() public method

Adds in appropriate actions for attachment fields editor, meta boxes and saving.
public __construct ( )

configure_meta_boxes() public method

public configure_meta_boxes ( string $post_type = 'unknown', object $post = NULL )
$post_type string
$post object

display_embed_choice() protected method

Build HTML to display a form checkbox for embedcode display preference
protected display_embed_choice ( object $info ) : string
$info object database row from the videos table
return string input element of type checkbox set to checked state based on stored embed preference

display_rating() protected method

Build HTML to display a form input radio button for video ratings
protected display_rating ( object $info ) : string
$info object database row from the videos table
return string input elements of type radio with existing stored value selected

fields_to_edit() public method

Creates an array of video fields to edit based on transcoded videos.
public fields_to_edit ( array $fields, stdClass $post ) : array
$fields array video fields of interest
$post stdClass post object
return array modified version of video fields for administrative interface display

init() public static method

Singleton method to initialize the object only once.
public static init ( ) : VideoPress_Edit_Attachment
return VideoPress_Edit_Attachment

make_video_api_path() public method

Get the upload api path.
public make_video_api_path ( string $guid ) : string
$guid string
return string

save_fields() public method

public save_fields ( array $post, array | null $attachment = null ) : array
$post array
$attachment array | null
return array

videopress_information_box() public method

public videopress_information_box ( stdClass $post )
$post stdClass