Code Monkey home page Code Monkey logo

asset's Introduction

Jankx Assets is used to manage CSS, JS, libraries with beautiful syntax.

WordPress syntax

// JS
wp_register_script('jankx-global-filter', $this->asset_url('js/global-filter.js'), array('choices', 'jankx-post-layout'), static::VERSION, true);
wp_localize_script('jankx-global-filter', 'jkx_global_filter', array(
  'ajax_url' => admin_url('admin-ajax.php'),
  'action' => 'request-post',
));
wp_enqueue_script('jankx-global-filter');


// CSS
wp_register_style('jankx-global-filter', $this->asset_url('css/global-filter.css'), array('choices'), static::VERSION);
wp_enqueue_style('jankx-global-filter');

Jankx assets syntax

js(
    'jankx-global-filter',
    $this->asset_url('js/global-filter.js'),
    array('choices', 'jankx-post-layout'),
    static::VERSION,
    true
  )
  ->localize('jkx_global_filter', array(
    'ajax_url' => admin_url('admin-ajax.php'),
    'action' => 'request-post',
  ))
  ->enqueue();

css(
  'jankx-global-filter',
  $this->asset_url('css/global-filter.css'),
  array('choices'),
  static::VERSION
)->enqueue();

asset's People

Contributors

puleeno avatar dependabot[bot] avatar

Watchers

James Cloos avatar

asset's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.