PHP code example of teppokoivula / process-changelog

1. Go to this page and download the library: Download teppokoivula/process-changelog library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

teppokoivula / process-changelog example snippets


// add header row for our new column
$wire->addHookAfter('ProcessChangelog::getHeaderRow', function($event) {
	$event->return = array_merge($event->arguments[0], ['Fields']);
});

// add data for our new column
$wire->addHookAfter('ProcessChangelog::parseTableRow', function($event) {
	$details = json_decode($event->arguments[0]['data'], true) ?: [];
	$event->return = array_merge($event->return, [$details['Fields edited'] ?? '']);
});



// place this script in your site's root directory, at the same level as the
// ProcessWire index.php file, and execute via the php command.