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.


Top ↑

Return Return

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


Top ↑

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;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
1.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.