reduxframework / redux-framework

Redux is a simple, truly extensible options framework for WordPress themes and plugins!

Home Page:http://redux.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to Add custom JS file to redux framework ?

daghash opened this issue · comments

How to Add custom JS file to redux framework ?

Is there any method similar to add_panel_css() but for js scripts ?

You would use the same concept and load your JS file instead.

$opt_name = 'OPT_NAME'; # TODO - Replace with your opt_name
function add_panel_js() {
    wp_enqueue_script(
        'redux-custom-js',
        'http://urltomyfile',
        array( 'redux-js' ),
        'your-project-version',
        true
    );  
}
// This example assumes your opt_name is set to OPT_NAME, replace with your opt_name value
add_action( 'redux/page/' . $opt_name . '/enqueue', 'add_panel_js' );