示例#1
0
/**
 * Prints the type of the file associated to the given post
 *
 * @see get_the_file_type
 *
 * @param int $post_id
 *
 * @return string|mixed
 */
function cuar_the_file_size($post_id = null, $human = true)
{
    echo cuar_get_the_file_size($post_id, $human);
}
/** Template version: 1.1.0 

-= 1.1.0 =-
- Updated markup
- Normalized the extra class filter name

-= 1.0.0 =-
- Initial version

*/
?>

<?php 
global $post;
$is_author = get_the_author_meta('ID') == get_current_user_id();
$file_size = cuar_get_the_file_size(get_the_ID());
if ($is_author) {
    $subtitle_popup = __('You uploaded this file', 'cuar');
    $subtitle = sprintf(__('Published for %s', 'cuar'), cuar_get_the_owner());
} else {
    $subtitle_popup = sprintf(__('Published for %s', 'cuar'), cuar_get_the_owner());
    $subtitle = sprintf(__('Published by %s', 'cuar'), get_the_author_meta('display_name'));
}
$title_popup = sprintf(__('Uploaded on %s', 'cuar'), get_the_date());
$extra_class = ' ' . get_post_type();
$extra_class = apply_filters('cuar/templates/list-item/extra-class?post-type=' . get_post_type(), $extra_class, $post);
?>

<div class="cuar-private-file cuar-item cuar-item-large<?php 
echo $extra_class;
?>