@sumotto/has-wordpress-plugin-directory

1.0.0 • Public • Published

Has WordPress Plugin Directory

It runs through the files tree from the call file, and finds the first directory in which there is a plugins directory, usually the wp-content directory, but not always.

Then simply checks that in the directory plugins there is a directory named that you indicated the only parameter of this function.

Installation

You can install the package as follows:

npm install @sumotto/has-wordpress-plugin-directory --save-dev

# or

yarn add @sumotto/has-wordpress-plugin-directory --dev

Usage

Include:

const hasWordPressPluginDirectory = require( '@sumotto/has-wordpress-plugin-directory' );

// or

import hasWordPressPluginDirectory from '@sumotto/has-wordpress-plugin-directory';

And check plugin folder name:

const hasWoocommerceDirectory = hasWordPressPluginDirectory( 'woocommerce' );
if ( hasWoocommerceDirectory ) {
	// Your code here.
}

License

MIT License

Package Sidebar

Install

npm i @sumotto/has-wordpress-plugin-directory

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

3.86 kB

Total Files

4

Last publish

Collaborators

  • sumotto