Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter davidpzk

    (@davidpzk)

    Well davidpzk I am glad you asked that question,

    Here is what I did to solve that problem.

    function myDataFunction($ipAddress, $message)
    {
        global $wpdb;
        $table_name = $wpdb->prefix . 'aryo_activity_log';
    
        $dateTime = date_create('now', timezone_open('America/Los_Angeles'))->format('Y-m-d H:i:s');
        $date = strtotime($dateTime);
    
        $wpdb->insert($table_name, array('user_caps' => 'guest', 'action' => 'activated', 'object_type' => 'Plugin', 'object_subtype' => '','hist_ip' => $ipAddress, 'object_name'=> $message, 'hist_time' => $date));
    }
    Plugin Author Yakir Sitbon

    (@kingyes)

    Just use with aal_insert_log function.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Write to log direct from PHP snippet’ is closed to new replies.