1 | <?php |
||
13 | class Videopress_Attachment_Metadata { |
||
14 | |||
15 | /** |
||
16 | * Persist the VideoPress metadata information, including rating and display_embed. |
||
17 | * |
||
18 | * @param string|int $post_id The post id. |
||
19 | * @param string $guid VideoPress Guid. |
||
20 | * @param string $post_title The post title. |
||
21 | * @param string $caption Video caption. |
||
22 | * @param string $post_excerpt The post excerpt. |
||
23 | * @param string $rating The rating. |
||
24 | * @param int $display_embed The display_embed. |
||
25 | * |
||
26 | * @return bool|\WP_Error |
||
27 | */ |
||
28 | public static function persist_metadata( $post_id, $guid, $post_title, $caption, $post_excerpt, $rating, $display_embed ) { |
||
68 | |||
69 | /** |
||
70 | * Check if the given media item is a VideoPress file. |
||
71 | * |
||
72 | * @param stdClass $item The media item. |
||
73 | * |
||
74 | * @return bool |
||
75 | */ |
||
76 | public static function is_videopress_media( $item ) { |
||
84 | |||
85 | /** |
||
86 | * Check if display_embed has valid values. |
||
87 | * |
||
88 | * @param mixed $display_embed The input display embed. |
||
89 | * |
||
90 | * @return bool |
||
91 | */ |
||
92 | private static function is_display_embed_valid( $display_embed ) { |
||
95 | |||
96 | /** |
||
97 | * Validate the response received from WPCOM. |
||
98 | * |
||
99 | * @param array|\WP_Error $result The result returned by the client. |
||
100 | */ |
||
101 | private static function validate_result( $result ) { |
||
123 | |||
124 | /** |
||
125 | * Build the request values that will be passed to the WPCOM API. |
||
126 | * |
||
127 | * @param string $post_title The video title. |
||
128 | * @param string $caption The video caption. |
||
129 | * @param string $post_excerpt The except. |
||
130 | * @param string $rating The video rating. |
||
131 | * @param string $display_embed The video display_embed. |
||
132 | * |
||
133 | * @return array |
||
134 | */ |
||
135 | private static function build_wpcom_api_request_values( $post_title, $caption, $post_excerpt, $rating, $display_embed ) { |
||
161 | } |
||
162 |