/** * Output video title * @param string $before * @param string $after * @param bool $echo */ function cvm_output_title($include_duration = true, $before = '', $after = '', $echo = true) { global $cvm_video; $output = ''; if (isset($cvm_video['title'])) { $output = $cvm_video['title']; } if ($include_duration) { $output .= ' <span class="duration">[' . cvm_human_time($cvm_video['video_data']['duration']) . ']</span>'; } if ($echo) { echo $before . $output . $after; } return $before . $output . $after; }
/** * Extra columns in list table output * @param string $column_name * @param int $post_id */ public function output_extra_columns($column_name, $post_id) { switch ($column_name) { case 'video_id': echo get_post_meta($post_id, '__cvm_video_id', true); break; case 'duration': $meta = get_post_meta($post_id, '__cvm_video_data', true); echo cvm_human_time($meta['duration']); break; } }
/** * Video duration column * @param array $item */ function column_duration($item) { $meta = get_post_meta($item['ID'], '__cvm_video_data', true); return '<span id="duration' . $item['ID'] . '">' . cvm_human_time($meta['duration']) . '</span>'; }
/** * Column for video duration * @param array $item */ function column_duration($item) { return cvm_human_time($item['duration']); }