本文整理汇总了PHP中bp_activity_has_more_items函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_activity_has_more_items函数的具体用法?PHP bp_activity_has_more_items怎么用?PHP bp_activity_has_more_items使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_activity_has_more_items函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_activity
/**
* get_activity function.
*
* @access public
* @param mixed $filter
* @return void
*/
public function get_activity($filter)
{
$args = $filter;
if (bp_has_activities($args)) {
while (bp_activities()) {
bp_the_activity();
$activity = array('avatar' => bp_core_fetch_avatar(array('html' => false, 'item_id' => bp_get_activity_id())), 'action' => bp_get_activity_action(), 'content' => bp_get_activity_content_body(), 'activity_id' => bp_get_activity_id(), 'activity_username' => bp_core_get_username(bp_get_activity_user_id()), 'user_id' => bp_get_activity_user_id(), 'comment_count' => bp_activity_get_comment_count(), 'can_comment' => bp_activity_can_comment(), 'can_favorite' => bp_activity_can_favorite(), 'is_favorite' => bp_get_activity_is_favorite(), 'can_delete' => bp_activity_user_can_delete());
$activity = apply_filters('bp_json_prepare_activity', $activity);
$activities[] = $activity;
}
$data = array('activity' => $activities, 'has_more_items' => bp_activity_has_more_items());
$data = apply_filters('bp_json_prepare_activities', $data);
} else {
return new WP_Error('bp_json_activity', __('No Activity Found.', 'buddypress'), array('status' => 200));
}
$response = new WP_REST_Response();
$response->set_data($data);
$response = rest_ensure_response($response);
return $response;
}
示例2: while
<?php
while (bp_activities()) {
bp_the_activity();
?>
<?php
locate_template(array('activity/entry.php'), true, false);
?>
<?php
}
?>
<?php
if (bp_activity_has_more_items()) {
?>
<li class="load-more">
<a href="#more"><?php
_e('Load More', 'buddypress');
?>
</a>
</li>
<?php
}
?>
<?php
if (empty($_POST['page'])) {
示例3: test_bp_activity_has_more_items_count_total_true
/**
* @group bp_activity_has_more_items
*/
public function test_bp_activity_has_more_items_count_total_true()
{
$a1 = $this->factory->activity->create();
$a2 = $this->factory->activity->create();
$a3 = $this->factory->activity->create();
$a4 = $this->factory->activity->create();
$args = array('count_total' => 'count_query', 'per_page' => 2);
if (bp_has_activities($args)) {
global $activities_template;
$this->assertTrue(bp_activity_has_more_items());
$activities_template = null;
}
}
示例4: widget
//.........这里部分代码省略.........
}
?>
<?php
do_action('bp_before_directory_activity_list');
?>
<!-- loop -->
<?php
do_action('bp_before_activity_loop');
?>
<?php
//echo $query_string;
?>
<?php
if (bp_has_activities(bp_ajax_querystring('activity') . $query_string)) {
?>
<ul id="activity-stream" class="activity-list item-list">
<?php
while (bp_activities()) {
bp_the_activity();
?>
<?php
bp_get_template_part('activity/entry');
?>
<?php
}
?>
<?php
if (bp_activity_has_more_items()) {
?>
<li class="load-more">
<a href="<?php
bp_activity_load_more_link();
?>
"><?php
_e('Load More', 'buddypress');
?>
</a>
</li>
<?php
}
?>
</ul>
<?php
} else {
?>
<div id="message" class="info">
<p><?php
_e('Sorry, there was no activity found. Please try a different filter.', 'buddypress');
?>
</p>
</div>
<?php
}
?>
<?php
do_action('bp_after_activity_loop');
?>
<!-- endloop -->
<?php
do_action('bp_after_directory_activity_list');
?>
<?php
do_action('bp_after_directory_activity_content');
?>
</div>
</div>
<?php
do_action('bp_after_directory_activity');
?>
<?php
/* aqui termina a parte do buddypress */
print $after_body;
print $after_widget;
}
示例5: while
<?php
while (humcore_deposits()) {
humcore_the_deposit();
?>
<?php
locate_template(array('deposits/entry.php'), true, false);
?>
<?php
}
?>
<?php
if (1 == 2 && bp_activity_has_more_items()) {
?>
<li class="load-more">
<a href="#more"><?php
_e('Load More', 'humcore_domain');
?>
</a>
</li>
<?php
}
?>
<?php
if (1 == 1 || empty($_POST['page'])) {