Use simpler function for retrieving last array item

Also avoids array dereferencing syntax incompatible with PHP <5.4.
This commit is contained in:
Paul Dechov 2018-05-07 14:48:18 -04:00
parent 660a7eea0e
commit d7dc2d45a4
1 changed files with 1 additions and 1 deletions

View File

@ -1079,7 +1079,7 @@ CREATE TABLE {$wpdb->prefix}woocommerce_termmeta (
*/
private static function associate_plugin_file( $plugins, $key ) {
$path = explode( '/', $key );
$filename = array_slice( $path, -1 )[0];
$filename = end( $path );
$plugins[ $filename ] = $key;
return $plugins;
}