whitelist-acf

0.0.3 • Public • Published

Whitelist ACF-Fields

Script that filter all css classes from acf-json folder generated by WP Advanced Custom Field Plugin.

Prerequisites

ACF plugin and taskrunner for whitelisting classes like purgeCSS

Installing

npm install whitelist-acf

Usage

Generate JSON

const WhitelistACF = require("whitelist-acf");

WhitelistACF.getClasses()

Include

In your wordpress theme root you will get a build folder with whitelistacf.json file. Use this file in your css taskrunner (in this example purgeCSS)

new PurgecssPlugin({
    paths: glob.sync(
        ["**/*.php", "!node_modules/**/*"],
        { nodir: true }
    ),
    whitelist: [require(`${paths.appBuild}/whitelistacf.json`)],
})

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Readme

Keywords

Package Sidebar

Install

npm i whitelist-acf

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

4.26 kB

Total Files

3

Last publish

Collaborators

  • eugen_re