moneymaker
Medlem
Har ikke peiling.
function theme_get_metadata_icons($icons = '', $class = '') {
global $post;
if (!is_string($icons) || theme_strlen($icons) == 0)
return;
$icons = explode(",", str_replace(' ', '', $icons));
if (!is_array($icons) || count($icons) == 0)
return;
$result = array();
for ($i = 0; $i < count($icons); $i++) {
$icon = $icons[$i];
switch ($icon) {
case 'date':
$result[] = '<span class="art-postdateicon">' . sprintf(__('<span class="%1$s">Published</span> %2$s', THEME_NS),
'date',
sprintf( '<span class="entry-date" title="%1$s">%2$s</span>',
esc_attr( get_the_time() ),
get_the_date()
)
) . '</span>';
break;
case 'author':
$result[] = '<span class="art-postauthoricon">' . sprintf(__('<span class="%1$s">By</span> %2$s', THEME_NS),
'author',
sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>',
get_author_posts_url( get_the_author_meta( 'ID' ) ),
sprintf( esc_attr(__( 'View all posts by %s', THEME_NS )), get_the_author() ),
get_the_author()
)
) . '</span>';
break;
case 'category':
$categories = get_the_category_list(', ');
if (theme_strlen($categories) == 0)
break;
$result[] = '<span class="art-postcategoryicon">' . sprintf(__('<span class="%1$s">Posted in</span> %2$s', THEME_NS), 'categories', get_the_category_list(', ')) . '</span>';
break;
case 'tag':
$tags_list = get_the_tag_list('', ', ');
if (!$tags_list)
break;
$result[] = '<span class="art-posttagicon">' . sprintf(__('<span class="%1$s">Tagged</span> %2$s', THEME_NS), 'tags', $tags_list) . '</span>';
break;
case 'comments':
if (!comments_open() || !theme_get_option('theme_allow_comments'))
break;
theme_ob_start();
comments_popup_link(__('Leave a comment', THEME_NS), __('1 Comment', THEME_NS), __('% Comments', THEME_NS));
$result[] = '<span class="art-postcommentsicon">' . theme_ob_get_clean() . '</span>';
break;
case 'edit':
if (!current_user_can('edit_post', $post->ID))
break;
theme_ob_start();
edit_post_link(__('Edit', THEME_NS), '');
$result[] = '<span class="art-postediticon">' . theme_ob_get_clean() . '</span>';
break;
}
}
$result = implode(theme_get_option('theme_metadata_separator'), $result);
if (theme_is_empty_html($result))
return;
return "<div class=\"art-post{$class}icons art-metadata-icons\">{$result}</div>";
}
switch ($icon) {
}