Reference

Guide

file.changeSort:before

$file, $position

Example

/site/config/config.php
return [
    'hooks' => [
        'file.changeSort:before' => function ($file, $position) {
            // your code goes here
        }
    ]
]