Tribe__Events__Aggregator__Record__Activity::register( string $slug, array $map = array() )
Register a Specific Activity and it’s mappings
Contents
Parameters
- $slug
-
(string) (Required) Name of this Activity
- $map
-
(array) (Optional) (optional) Other names in which you can access this activity
Default value: array()
Return
(boolean) [description]
Source
File: src/Tribe/Aggregator/Record/Activity.php
public function register( $slug, $map = array() ) {
if ( empty( $this->items[ $slug ] ) ) {
// Clone the Default action values
$this->items[ $slug ] = (object) self::$actions;
} else {
$this->items[ $slug ] = (object) array_merge( (array) self::$actions, (array) $this->items[ $slug ] );
}
// Add the base mapping
$this->map[ $slug ] = $slug;
// Allow short names for the activities
foreach ( $map as $to ) {
$this->map[ $to ] = $slug;
}
$this->prevent_duplicates_between_item_actions( $slug );
return true;
}