/**
  * @group check_exists_by_content
  */
 public function test_check_exists_by_content()
 {
     $content = 'A classy girl who know how to enjoy the freedom of a cup of coffee';
     $activity = $this->factory->activity->create(array('content' => $content, 'type' => 'activity_update'));
     $result = BP_Activity_Activity::check_exists_by_content($content);
     $this->assertEquals($activity, $result);
 }
Esempio n. 2
0
/**
 * Check whether an activity item exists with a given content string.
 *
 * @since BuddyPress (1.1.0)
 *
 * @uses BP_Activity_Activity::check_exists_by_content() {@link BP_Activity_Activity}
 * @uses apply_filters() To call the 'bp_activity_check_exists_by_content' hook.
 *
 * @param string $content The content to filter by.
 * @return int|null The ID of the located activity item. Null if none is found.
 */
function bp_activity_check_exists_by_content($content)
{
    return apply_filters('bp_activity_check_exists_by_content', BP_Activity_Activity::check_exists_by_content($content));
}
/**
 * Check whether an activity item exists with a given content string.
 *
 * @since 1.1.0
 *
 * @uses BP_Activity_Activity::check_exists_by_content() {@link BP_Activity_Activity}
 * @uses apply_filters() To call the 'bp_activity_check_exists_by_content' hook.
 *
 * @param string $content The content to filter by.
 * @return int|null The ID of the located activity item. Null if none is found.
 */
function bp_activity_check_exists_by_content($content)
{
    /**
     * Filters the results of the check for whether an activity item exists by specified content.
     *
     * @since 1.1.0
     *
     * @param BP_Activity_Activity $content_exists ID of the activity if found, else null.
     */
    return apply_filters('bp_activity_check_exists_by_content', BP_Activity_Activity::check_exists_by_content($content));
}