Can the wp-plugins (Must Use Plugins) URL be targeted for use in functions.php?

EDIT: this solution is not a best-practice. Please use the solution submitted by Nathan below!

Use the WPMU_PLUGIN_DIR and WPMU_PLUGIN_URL constants 🙂

function load_my_alerts(){
    wp_register_script( 
        'my_alerts', 
        WPMU_PLUGIN_URL . '/js/alerts.js', 
        array( 'jquery' )
    );
    wp_enqueue_script( 'my_alerts' );
}
add_action('admin_enqueue_scripts', 'load_my_alerts');

Leave a Comment