本文整理汇总了PHP中bp_activity_current_comment函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_activity_current_comment函数的具体用法?PHP bp_activity_current_comment怎么用?PHP bp_activity_current_comment使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_activity_current_comment函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bp_activity_comment_delete_link
?>
<?php
if (bp_activity_user_can_delete()) {
?>
<a href="<?php
bp_activity_comment_delete_link();
?>
" class="delete acomment-delete confirm bp-secondary-action" rel="nofollow"><?php
_e('Delete', 'buddypress');
?>
</a>
<?php
}
?>
<?php
do_action('bp_activity_comment_options');
?>
</div>
<?php
bp_activity_recurse_comments(bp_activity_current_comment());
?>
</li>
<?php
do_action('bp_after_activity_comment');
示例2: bp_blogs_setup_comment_loop_globals_on_ajax
/**
* Set up some globals used in the activity comment loop when AJAX is used.
*
* @since BuddyPress (2.0.0)
*
* @see bp_blogs_setup_activity_loop_globals()
*/
function bp_blogs_setup_comment_loop_globals_on_ajax() {
// not AJAX? stop now!
if ( ! defined( 'DOING_AJAX' ) ) {
return;
}
if ( false === (bool) constant( 'DOING_AJAX' ) ) {
return;
}
// get the parent activity item
$comment = bp_activity_current_comment();
$parent_activity = new BP_Activity_Activity( $comment->item_id );
// setup the globals
bp_blogs_setup_activity_loop_globals( $parent_activity );
}
示例3: bp_activity_can_comment_reply
/**
* Determine whether a comment can be made on an activity reply item.
*
* @since BuddyPress (1.5.0)
*
* @param object $comment Activity comment.
* @return bool $can_comment True if comment can receive comments, otherwise
* false.
*/
function bp_activity_can_comment_reply($comment = '')
{
// Assume activity can be commented on
$can_comment = true;
// Check that comment exists
if (empty($comment)) {
$comment = bp_activity_current_comment();
}
if (!empty($comment)) {
// Fall back on current comment in activity loop
$comment_depth = isset($comment->depth) ? intval($comment->depth) : bp_activity_get_comment_depth();
// Threading is turned on, so check the depth
if (get_option('thread_comments')) {
$can_comment = (bool) ($comment_depth < get_option('thread_comments_depth'));
// No threading for comment replies if no threading for comments
} else {
$can_comment = false;
}
}
/**
* Filters whether a comment can be made on an activity reply item.
*
* @since BuddyPress (1.5.0)
*
* @param bool $can_comment Status on if activity reply can be commented on.
* @param string $comment Current comment being checked on.
*/
return (bool) apply_filters('bp_activity_can_comment_reply', $can_comment, $comment);
}
示例4: add_activity_comment_spam_button
/**
* Adds a "mark as spam" button to each activity COMMENT item for site admins.
*
* This function is intended to be used inside the activity stream loop.
*
* @since BuddyPress (1.6)
*/
public function add_activity_comment_spam_button()
{
if (!bp_activity_user_can_mark_spam()) {
return;
}
// By default, only handle activity updates and activity comments.
$current_comment = bp_activity_current_comment();
if (empty($current_comment) || !in_array($current_comment->type, BP_Akismet::get_activity_types())) {
return;
}
bp_button(array('block_self' => false, 'component' => 'activity', 'id' => 'activity_make_spam_' . bp_get_activity_comment_id(), 'link_class' => 'bp-secondary-action spam-activity-comment confirm', 'link_href' => wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_slug() . '/spam/' . bp_get_activity_comment_id() . '/?cid=' . bp_get_activity_comment_id(), 'bp_activity_akismet_spam_' . bp_get_activity_comment_id()), 'link_text' => __('Spam', 'buddypress'), 'wrapper' => false));
}
示例5: bp_activity_can_comment_reply
/**
* Determine whether a comment can be made on an activity reply item.
*
* @since BuddyPress (1.5.0)
*
* @param object $comment Activity comment.
* @return bool $can_comment True if comment can receive comments, otherwise
* false.
*/
function bp_activity_can_comment_reply($comment = '')
{
// Assume activity can be commented on
$can_comment = true;
// Check that comment exists
if (empty($comment)) {
$comment = bp_activity_current_comment();
}
if (!empty($comment)) {
// Fall back on current comment in activity loop
$comment_depth = isset($comment->depth) ? intval($comment->depth) : bp_activity_get_comment_depth();
// Threading is turned on, so check the depth
if (get_option('thread_comments')) {
$can_comment = (bool) ($comment_depth < get_option('thread_comments_depth'));
// No threading for comment replies if no threading for comments
} else {
$can_comment = false;
}
}
return (bool) apply_filters('bp_activity_can_comment_reply', $can_comment, $comment);
}