sourceboat / wp-laravel-elixir

Get versioned Laravel Elixir file paths in WordPress.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⚠️ 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');
});

About

Get versioned Laravel Elixir file paths in WordPress.

License:MIT License


Languages

Language:PHP 100.0%