当前位置: 首页>>代码示例>>PHP>>正文


PHP bbp_topic_post_count函数代码示例

本文整理汇总了PHP中bbp_topic_post_count函数的典型用法代码示例。如果您正苦于以下问题:PHP bbp_topic_post_count函数的具体用法?PHP bbp_topic_post_count怎么用?PHP bbp_topic_post_count使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了bbp_topic_post_count函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: test_bbp_get_topic_post_count

 /**
  * @covers ::bbp_topic_post_count
  * @covers ::bbp_get_topic_post_count
  */
 public function test_bbp_get_topic_post_count()
 {
     $f = $this->factory->forum->create();
     $int_topics = 1;
     $int_replies = 3;
     $int_value = $int_topics + $int_replies;
     $formatted_value = bbp_number_format($int_value);
     $t = $this->factory->topic->create(array('post_parent' => $f, 'topic_meta' => array('forum_id' => $f)));
     $this->factory->reply->create_many($int_replies, array('post_parent' => $t, 'reply_meta' => array('forum_id' => $f, 'topic_id' => $t)));
     bbp_update_topic_reply_count($t);
     // Output
     $this->expectOutputString($formatted_value);
     bbp_topic_post_count($t);
     // Formatted string
     $count = bbp_get_topic_post_count($t, false);
     $this->assertSame($formatted_value, $count);
     // Integer
     $count = bbp_get_topic_post_count($t, true);
     $this->assertSame($int_value, $count);
 }
开发者ID:joeyblake,项目名称:bbpress,代码行数:24,代码来源:counts.php

示例2: do_action

do_action('bbp_theme_after_topic_meta');
?>

		<?php 
bbp_topic_row_actions();
?>

	</li>

	<li class="bbp-topic-voice-count"><?php 
bbp_topic_voice_count();
?>
</li>

	<li class="bbp-topic-reply-count"><?php 
bbp_show_lead_topic() ? bbp_topic_reply_count() : bbp_topic_post_count();
?>
</li>

	<li class="bbp-topic-freshness">

		<?php 
do_action('bbp_theme_before_topic_freshness_link');
?>

		<?php 
bbp_topic_freshness_link();
?>

		<?php 
do_action('bbp_theme_after_topic_freshness_link');
开发者ID:berniecultess,项目名称:infirev,代码行数:31,代码来源:loop-single-topic.php

示例3: edd_bbp_dashboard_shortcode


//.........这里部分代码省略.........
                $parent = get_post_field('post_parent', get_the_ID());
                ?>
							<?php 
                $row_class = $parent == 499 ? 'danger' : '';
                ?>
							<?php 
                $last_reply_id = bbp_get_topic_last_reply_id(get_the_ID());
                ?>
							<?php 
                $last_reply_data = get_post($last_reply_id);
                ?>
							<tr class = "<?php 
                echo $row_class;
                ?>
">
								<td>
								<a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a>
								</td>
								<td><?php 
                the_author_meta('display_name', $last_reply_data->post_author);
                ?>
</td>
								<td><?php 
                bbp_topic_freshness_link();
                ?>
</td>
								<td><?php 
                bbp_topic_post_count(get_the_ID());
                ?>
</td>
							</tr>
						<?php 
            }
            ?>
					<?php 
            wp_reset_postdata();
            ?>
					</table>
			<?php 
        } else {
            ?>
				<div>This mod has no assigned tickets.</div>
			<?php 
        }
        ?>
		</div>
		<?php 
        return ob_get_clean();
    }
    // Get tickets awaiting answer
    $args = array('post_type' => 'topic', 'meta_query' => array('relation' => 'AND', array('key' => '_bbps_topic_pending'), array('key' => '_bbps_topic_status', 'value' => '1'), array('key' => 'bbps_topic_assigned', 'value' => $user_ID)), 'order' => 'ASC', 'orderby' => 'meta_value', 'meta_key' => '_bbp_last_active_time', 'posts_per_page' => -1, 'post_parent__not_in' => array(318));
    $waiting_tickets = new WP_Query($args);
    // Get open, assigned tickets
    $args = array('post_type' => 'topic', 'meta_query' => array('relation' => 'AND', array('key' => '_bbps_topic_status', 'value' => '1'), array('key' => 'bbps_topic_assigned', 'value' => $user_ID)), 'order' => 'ASC', 'orderby' => 'meta_value', 'meta_key' => '_bbp_last_active_time', 'posts_per_page' => -1, 'post_parent__not_in' => array(318));
    $assigned_tickets = new WP_Query($args);
    // Get unassigned tickets
    $args = array('post_type' => 'topic', 'meta_query' => array('relation' => 'AND', array('key' => 'bbps_topic_assigned', 'compare' => 'NOT EXISTS', 'value' => '1'), array('key' => '_bbps_topic_status', 'value' => '1')), 'order' => 'ASC', 'orderby' => 'meta_value', 'meta_key' => '_bbp_last_active_time', 'posts_per_page' => -1, 'post_status' => 'publish', 'post_parent__not_in' => array(318));
    $unassigned_tickets = new WP_Query($args);
    // Get tickets with no replies
    $args = array('post_type' => 'topic', 'meta_query' => array('relation' => 'AND', array('key' => '_bbp_voice_count', 'value' => '1'), array('key' => '_bbps_topic_status', 'value' => '1')), 'posts_per_page' => -1, 'post_status' => 'publish');
开发者ID:Section214,项目名称:EDD-bbPress-Support,代码行数:67,代码来源:shortcodes.php

示例4: bbp_forum_permalink

				in <a class="topic-location" href="<?php 
    bbp_forum_permalink(bbp_get_topic_forum_id());
    ?>
" title="Browse this forum"><?php 
    bbp_forum_title(bbp_get_topic_forum_id());
    ?>
</a>
			<?php 
}
?>
		</p>
	</div>
	
	<div class="forum-count">
		<?php 
bbp_topic_post_count();
?>
	</div>
	
	<div class="forum-freshness">
		<?php 
echo apoc_get_avatar(array('user_id' => bbp_get_reply_author_id(bbp_get_topic_last_active_id()), 'link' => true, 'size' => 50));
?>
		<div class="freshest-meta">
			<span class="freshest-author">By <?php 
bbp_author_link(array('post_id' => bbp_get_topic_last_active_id(), 'type' => 'name'));
?>
</span>
			<span class="freshest-time"><?php 
bbp_topic_last_active_time();
?>
开发者ID:tamriel-foundry,项目名称:apoc2,代码行数:31,代码来源:loop-single-topic.php


注:本文中的bbp_topic_post_count函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。