當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WP_List_Table::comments_bubble方法代碼示例

本文整理匯總了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;
 }
開發者ID:adisonc,項目名稱:MaineLearning,代碼行數:101,代碼來源:posts.php


注:本文中的WP_List_Table::comments_bubble方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。