Skip to content

Commit

Permalink
style(Assets) correct
Browse files Browse the repository at this point in the history
  • Loading branch information
lucatume committed Jun 5, 2024
1 parent 29b189a commit 644a5b9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Tribe/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,16 +347,17 @@ public function register( $origin, $slug, $file, $deps = [], $action = null, $ar
return false;
}

$extension = substr( $file, strrpos( $file, '.' ) + 1 );
$extension = substr( $file, strrpos( $file, '.' ) + 1 );
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$plugin_path = ! empty( $origin->plugin_path ) ? $origin->plugin_path : $origin->pluginPath;

// Infer the type from the file extension, if not passed.
$type = empty( $arguments['type'] ) ? $extension : $arguments['type'];
$type = empty( $arguments['type'] ) ? $extension : $arguments['type'];

// Try to enqueue the minified version of the file if not debugging scripts or the file is not available.
if ( ! str_contains( $file, '.min.' ) ) {
// From `something.js` to `something.min.js`.
$minified_file = substr( $file, 0, - ( strlen( $extension ) + 1 ) ) . '.min.' . $extension;
$minified_file = substr( $file, 0, - ( strlen( $extension ) + 1 ) ) . '.min.' . $extension;
$min_file_abspath = $plugin_path . $minified_file;

if (
Expand Down

0 comments on commit 644a5b9

Please sign in to comment.