Automattic\WooCommerce\Internal\Admin
WCAdminAssets::get_url
Gets the URL to an asset file.
Method of the class: WCAdminAssets{}
No Hooks.
Returns
String. URL to asset.
Usage
$result = WCAdminAssets::get_url( $file, $ext );
- $file(string) (required)
- File name (without extension).
- $ext(string) (required)
- File extension.
WCAdminAssets::get_url() WCAdminAssets::get url code WC 10.6.2
public static function get_url( $file, $ext ) {
$suffix = '';
// Potentially enqueue minified JavaScript.
if ( $ext === 'js' ) {
$script_debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
$suffix = self::should_use_minified_js_file( $script_debug ) ? '.min' : '';
}
return plugins_url( self::get_path( $ext ) . $file . $suffix . '.' . $ext, WC_ADMIN_PLUGIN_FILE );
}