本文整理汇总了PHP中WP_List_Table::comments_bubble方法的典型用法代码示例。如果您正苦于以下问题:PHP WP_List_Table::comments_bubble方法的具体用法?PHP WP_List_Table::comments_bubble怎么用?PHP WP_List_Table::comments_bubble使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WP_List_Table
的用法示例。
在下文中一共展示了WP_List_Table::comments_bubble方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: manage_posts_column_value
//.........这里部分代码省略.........
$post_type = get_post_type($post_id);
foreach ($tags as $tag) {
// sanatize title
if (isset($tag->term_id)) {
$tax_title = esc_html(sanitize_term_field('name', $tag->name, $tag->term_id, $tag->taxonomy, 'edit'));
$tarr[] = "<a href='edit.php?post_type={$post_type}&{$tag->taxonomy}={$tag->slug}'>{$tax_title}</a>";
}
}
$result = implode(', ', $tarr);
}
break;
// Custom Field
// Custom Field
case "column-post-meta":
$result = $this->get_column_value_custom_field($post_id, $column_name, 'post');
break;
// Attachment
// Attachment
case "column-attachment":
$result = $this->get_column_value_attachments($post_id);
break;
// Attachment count
// Attachment count
case "column-attachment-count":
$result = count($this->get_attachment_ids($post_id));
break;
// Roles
// Roles
case "column-roles":
$user_id = get_post($post_id)->post_author;
$userdata = get_userdata($user_id);
if (!empty($userdata->roles[0])) {
$result = implode(', ', $userdata->roles);
}
break;
// Post status
// Post status
case "column-status":
$p = get_post($post_id);
$result = $this->get_post_status_friendly_name($p->post_status);
if ($p->post_status == 'future') {
$result = $result . " <p class='description'>" . date_i18n(get_option('date_format') . ' ' . get_option('time_format'), strtotime($p->post_date)) . "</p>";
}
break;
// Post comment status
// Post comment status
case "column-comment-status":
$p = get_post($post_id);
$result = $this->get_asset_image('no.png', $p->comment_status);
if ($p->comment_status == 'open') {
$result = $this->get_asset_image('checkmark.png', $p->comment_status);
}
break;
// Post ping status
// Post ping status
case "column-ping-status":
$p = get_post($post_id);
$result = $this->get_asset_image('no.png', $p->ping_status);
if ($p->ping_status == 'open') {
$result = $this->get_asset_image('checkmark.png', $p->ping_status);
}
break;
// Post actions ( delete, edit etc. )
// Post actions ( delete, edit etc. )
case "column-actions":
$result = $this->get_column_value_actions($post_id);
break;
// Post Last modified
// Post Last modified
case "column-modified":
$p = get_post($post_id);
$result = $this->get_date($p->post_modified) . ' ' . $this->get_time($p->post_modified);
break;
// Post Comment count
// Post Comment count
case "column-comment-count":
$result = WP_List_Table::comments_bubble($post_id, get_pending_comments_num($post_id));
$result .= $this->get_comment_count_details($post_id);
break;
// Author Name
// Author Name
case "column-author-name":
$result = $this->get_column_value_authorname($post_id, $column_name);
break;
// Before More Tag
// Before More Tag
case "column-before-moretag":
$p = get_post($post_id);
$extended = get_extended($p->post_content);
if (!empty($extended['extended'])) {
$result = $this->get_shortened_string($extended['main'], $this->excerpt_length);
}
break;
default:
$result = '';
}
// Filter for customizing the result output
apply_filters('cpac-posts-column-result', $result, $type, $column_name, $post_id);
echo $result;
}