BP_Activity_Activity::check_exists_by_content( string $content )
Check whether an activity item exists with a given string content.
Description Description
Parameters Parameters
- $content
-
(Required) The content to filter by.
Return Return
(int|false) The ID of the first matching item if found, otherwise false.
Source Source
File: bp-activity/classes/class-bp-activity-activity.php
public static function check_exists_by_content( $content ) {
global $wpdb;
$bp = buddypress();
$result = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} WHERE content = %s", $content ) );
return is_numeric( $result ) ? (int) $result : false;
}
Changelog Changelog
| Version | Description |
|---|---|
| 1.1.0 | Introduced. |