2017 © Pedro Peláez
 

wordpress-plugin append-file-hash

Append a file hash to file names for media library uploads.

image

lonelyplanet/append-file-hash

Append a file hash to file names for media library uploads.

  • Wednesday, March 21, 2018
  • by webdeveric
  • Repository
  • 3 Watchers
  • 0 Stars
  • 86 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 105 % Grown

The README.md

Append File Hash

This WordPress plugin will append a file hash to file names for media library uploads., (*1)

Installation

composer require lonelyplanet/append-file-hash

Filters

Customize the file hash

By default, this plugin will use the md5_file hash and append it to the filename. If you'd like to customize the hash, you can use the afh-file-hash filter., (*2)

In this example, the sha1 file hash is returned., (*3)

function sha1FileHash($hash, $data, $filepath, $filename, $mimes)
{
    return sha1_file($filepath);
}

add_filter('afh-file-hash', 'sha1FileHash', 10, 5);

Customize the proper filename

function customProperFilename($properFilename, $cleanFilename, $hash, $ext, $filepath, $mimes)
{
    // Build your filename here.

    return $properFilename;
}

add_filter('afh-proper-filename', 'customProperFilename', 10, 6);

The Versions

21/03 2018

dev-master

9999999-dev

Append a file hash to file names for media library uploads.

  Sources   Download

GPL-3.0-or-later

The Requires

 

wordpress file library media hash

31/01 2018

1.0.2

1.0.2.0

Append a file hash to file names for media library uploads.

  Sources   Download

GPL-3.0-or-later

The Requires

 

wordpress file library media hash

06/09 2016

1.0.1

1.0.1.0

Append a file hash to file names for media library uploads.

  Sources   Download

proprietary

The Requires

 

wordpress file hash media library lonely planet

16/05 2016

1.0.0

1.0.0.0

Append a file hash to file names for media library uploads.

  Sources   Download

proprietary

The Requires

 

wordpress file hash media library lonely planet