redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

Loading styles and scripts

Open Webcreations907 opened this issue 10 years ago • 2 comments

Hello,

I noticed that the wp_enqueue_script() & wp_enqueue_style use time() for the version in the fields and framework for Redux, which seems to cause each css/js file to reload on every page load and not use the cached one.

I've changed them to ReduxFramework::$_version instead of time() which seems to increase the loading time a bit.

Example from one of the fields below, from Here so you know what I'm referring to.

wp_enqueue_script(
    'redux-field-dimensions-js',
    ReduxFramework::$_url . 'inc/fields/dimensions/field_dimensions' . Redux_Functions::isMin() . '.js',
    array( 'jquery', 'select2-js', 'redux-js' ),
    time(),
    true
);
if ( $this->parent->args['dev_mode'] ) {
    wp_enqueue_style(
        'redux-field-dimensions-css',
        ReduxFramework::$_url . 'inc/fields/dimensions/field_dimensions.css',
        array(),
        time(),
        'all'
    );
}

Was just curious if there is any plans to update those in the future?

Thanks for your time :smile:

Webcreations907 avatar Mar 11 '16 05:03 Webcreations907

Maybe, eventually. dev_mode should have time, at the minimum. If you feel like editing every instance of this (there are many, one for each field and those in framework), you're free to submit a pull request. But we'd prefer to have to time() for dev_mode on, at the minimum. :)

kprovance avatar Mar 11 '16 05:03 kprovance

Great, will do that then.

Thanks for your blazing fast reply :)

Webcreations907 avatar Mar 11 '16 08:03 Webcreations907