HEX
Server: nginx/1.27.1
System: Linux in-4 5.15.0-131-generic #141-Ubuntu SMP Fri Jan 10 21:18:28 UTC 2025 x86_64
User: ilikadirect (1186)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v6964/gopalak/public_html/wp-content/plugins/buddypress/cli/src/activity-fetcher.php
<?php

namespace Buddypress\CLI\Command;

use WP_CLI\Fetchers\Base;

/**
 * Fetch a BuddyPress activity based on one of its attributes.
 *
 * @since 2.0.0
 */
class Activity_Fetcher extends Base {

	/**
	 * @var string $msg Error message to use when invalid data is provided.
	 */
	protected $msg = 'Could not find the activity with ID %d.';

	/**
	 * Get an activity ID.
	 *
	 * @param int $activity_id Activity ID.
	 * @return BP_Activity_Activity|bool
	 */
	public function get( $activity_id ) {
		$activity = new \BP_Activity_Activity( $activity_id );

		if ( empty( $activity->id ) ) {
			return false;
		}

		return $activity;
	}
}