ap_activity_parse( object $activity )
Description #
Parse raw activity returned from database. Rename column name append action data.
Parameters #
- $activityobject (Required) Activity object returned from database.
Source #
File: includes/activity.php
function ap_activity_parse( $activity ) { if ( ! is_object( $activity ) ) { return false; } $new = array(); // Rename keys. foreach ( $activity as $key => $value ) { $new[ str_replace( 'activity_', '', $key ) ] = $value; } $new = (object) $new; // Append actions data if exists. if ( ap_activity_object()->action_exists( $new->action ) ) { $new->action = ap_activity_object()->get_action( $new->action ); } return $new; }
Expand full source code Collapse full source code View on GitHub: includes/activity.php:115
Add your comment