BuddyDev

Search

mpp_log( $args )

Save log info to database.

Description

This function allows developers to save log data to the database.

Parameters

$args

  • user_id (int) (Required) the user for which we are creating this log
  • item_id (int) (Required) gallery or media id to which we associate this action
  • action (string) (required, max 16 characters) Unique name to identify action ( e.g. ”view”, “like” etc)
  • value ( int|string) ( optional ) any value you want to associate with this action log ( e.g. view count or like count or rating value etc )

 Examples

The code shows how we log when a user views the Media( It is not part of core )

 

 Changelog

  • Since 1.0.0

Source

medisapress/core/logger/functions.php