PluginProbe
BuddyPress / trunk
BuddyPress vtrunk
11.6.2 12.7.2 14.5.2 11.6.0 12.7.0 2.5.0-rc1 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.0-beta1 2.6.0-rc1 2.6.1 2.6.1.1 2.6.2 2.6.3 2.6.4 2.7.0 2.7.0-beta1 2.7.0-rc1 2.7.0-rc2 2.7.1 2.7.2 All 274 releases
buddypress / cli / src / activity-fetcher.php

activity-fetcher.php in BuddyPress trunk, at cli/src/activity-fetcher.php

35 lines 638 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Buddypress\CLI\Command;
4
5 use WP_CLI\Fetchers\Base;
6
7 /**
8 * Fetch a BuddyPress activity based on one of its attributes.
9 *
10 * @since 2.0.0
11 */
12 class Activity_Fetcher extends Base {
13
14 /**
15 * @var string $msg Error message to use when invalid data is provided.
16 */
17 protected $msg = 'Could not find the activity with ID %d.';
18
19 /**
20 * Get an activity ID.
21 *
22 * @param int $activity_id Activity ID.
23 * @return BP_Activity_Activity|bool
24 */
25 public function get( $activity_id ) {
26 $activity = new \BP_Activity_Activity( $activity_id );
27
28 if ( empty( $activity->id ) ) {
29 return false;
30 }
31
32 return $activity;
33 }
34 }
35