Skip to content
This repository has been archived by the owner on Oct 19, 2020. It is now read-only.

Get versioned Laravel Elixir file paths in WordPress.

License

Notifications You must be signed in to change notification settings

sourceboat/wp-laravel-elixir

Repository files navigation

⚠️ Deprecated: This project is not actively maintained anymore. Use it at your own risk.

WP Laravel Elixir

Packagist Packagist Downloads Build Status

Get versioned Laravel Elixir file paths in WordPress.

Installation

To use this plugin you need to setup your WordPress installation via a Composer setup like Bedrock. Then you can install it via:

$ composer require sourceboat/wp-laravel-elixir

Usage

This plugin exposes the elixir('path/to/file.ext') helper method, known from the Laravel Framework. It expects your files in the dist directory of the active theme.

You can use the helper method like this:

add_action('wp_enqueue_scripts', function () {
    wp_register_style('main-css', elixir('css/main.css'), null, null);
    wp_enqueue_style('main-css');
    
    wp_register_script('main-js', elixir('js/main.js'), null, null, true);
    wp_enqueue_script('main-js');
});