Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Adding fallback url filter for more customization #19

Open
khuyennguyen7007 opened this issue Dec 17, 2019 · 0 comments
Open

Adding fallback url filter for more customization #19

khuyennguyen7007 opened this issue Dec 17, 2019 · 0 comments

Comments

@khuyennguyen7007
Copy link

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:

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 ));;
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant