进行了一些小修复
This commit is contained in:
1 parent
02cbff1ddf
commit
fbada8bd6a
20 files changed
+294
-191
No files matched your search
@@ -26,31 +26,12 @@ if (!function_exists('aksrt_single_build_context')) :
|
||||
$comment_count = (int) get_comments_number($post_id);
|
||||
$like_count = function_exists('aksrt_get_post_likes') ? (int) aksrt_get_post_likes($post_id) : 0;
|
||||
$favorite_count = function_exists('aksrt_get_post_favorites') ? (int) aksrt_get_post_favorites($post_id) : 0;
|
||||
$word_count = function_exists('aksrt_post_word_count') && !empty($settings['word_count_enabled'])
|
||||
? aksrt_post_word_count($post_id)
|
||||
: 0;
|
||||
$reading_minutes = function_exists('aksrt_reading_minutes') && !empty($settings['reading_time_enabled'])
|
||||
? aksrt_reading_minutes($post_id)
|
||||
: 0;
|
||||
|
||||
// legacy primary meta = comment/views/likes via meta_box_html.
|
||||
$meta_items = [];
|
||||
$meta_box_html = function_exists('aksrt_get_single_meta_box')
|
||||
? aksrt_get_single_meta_box('abs-right', 'down', $post_id)
|
||||
? aksrt_get_single_meta_box($post_id)
|
||||
: '';
|
||||
$meta_items_secondary = [];
|
||||
if ($word_count > 0) {
|
||||
$meta_items_secondary[] = [
|
||||
'icon' => 'fa fas fa-file-word',
|
||||
'text' => sprintf(__('约 %s 字', 'aksrt'), number_format_i18n($word_count)),
|
||||
];
|
||||
}
|
||||
if ($reading_minutes > 0) {
|
||||
$meta_items_secondary[] = [
|
||||
'icon' => 'fa fas fa-hourglass',
|
||||
'text' => sprintf(_n('约 %d 分钟', '约 %d 分钟', $reading_minutes, 'aksrt'), $reading_minutes),
|
||||
];
|
||||
}
|
||||
|
||||
$copyright = trim((string) ($settings['copyright_text'] ?? ''));
|
||||
if ($copyright === '') {
|
||||
@@ -121,7 +102,6 @@ if (!function_exists('aksrt_single_build_context')) :
|
||||
'video_episodes' => is_array($settings['video_episodes'] ?? null) ? array_values($settings['video_episodes']) : [],
|
||||
'video_poster' => (string) ($settings['video_poster'] ?? ''),
|
||||
'meta_items' => $meta_items,
|
||||
'meta_items_secondary' => $meta_items_secondary,
|
||||
'meta_box_html' => $meta_box_html,
|
||||
'title_html' => function_exists('aksrt_get_single_title_html') ? aksrt_get_single_title_html($post_id) : esc_html(get_the_title($post_id)),
|
||||
'allow_view' => $allow_view,
|
||||
|
||||
Reference in new issue
Block a user