Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
srtfisher committed Jul 24, 2023
1 parent 63856a8 commit 77ddeb8
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ the main plugin file from and load.

See [APCu Caching](#apcu-caching) for more information on caching.

### Plugin Directories

Out of the box, the package will attempt to load your plugin from
`wp-content/plugins`. When it is found, the package will attempt to load your
plugin from `wp-content/client-mu-plugins`. For non-WordPress VIP sites, the
plugin will also load plugins from `wp-content/mu-plugins`.

### Preventing Activations

The package supports preventing activations of plugins via the plugins screen
Expand All @@ -46,19 +53,16 @@ capability check.

### APCu Caching

When a plugin is loaded by a folder name the package will attempt to determine
the main plugin file from the folder. This can be a semi-expensive operation
that can be cached with APCu. To enable caching, call `enable_caching()` or
`set_cache_prefix( $prefix )` to specify a custom cache prefix.
When a plugin is loaded by a directory name the package will attempt to
determine the main plugin file from the directory. This can be a semi-expensive
operation that can be cached with APCu. To enable caching, call
`enable_caching()` or `set_cache_prefix( $prefix )` to specify a custom cache
prefix.

```php
use Alley\WP\WP_Plugin_Loader;

( new WP_Plugin_Loader( [ ... ] ) )->enable_caching();
```

```php
use Alley\WP\WP_Plugin_Loader;

( new WP_Plugin_Loader( [ ... ] ) )->set_cache_prefix( 'my-prefix' );
```
Expand Down

0 comments on commit 77ddeb8

Please sign in to comment.