Open khuyennguyen7007 opened 4 years ago
I hope in next version, fallback url filter will be added for more customization. Eg: custom or moving the script to another directory.
In class Lazy_Load_Script::get_fallback_script_url(), we can change the method body to something like that:
Lazy_Load_Script::get_fallback_script_url()
protected function get_fallback_script_url() : string { $path = static::FALLBACK_SCRIPT_PATH; if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) { $path = str_replace( '/js/', '/js/src/', static::FALLBACK_SCRIPT_PATH ); } $path = apply_filters('native_lazyload_fallback_script_path', $path); return apply_filters('native_lazyload_fallback_script_url', $this->context->url( $path ));; }
Issue Overview
I hope in next version, fallback url filter will be added for more customization. Eg: custom or moving the script to another directory.
Steps to Reproduce
In class
Lazy_Load_Script::get_fallback_script_url()
, we can change the method body to something like that: