BP_Activity_Activity::check_exists_by_content( string $content )

Check whether an activity item exists with a given string content.

Description

Parameters

$content

(string) (Required) The content to filter by.

Return

(int|false) The ID of the first matching item if found, otherwise false.

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
BuddyPress 1.1.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.