yard/config-expander
Yard Config Expander
This repository provides a scaffold for creating an Acorn package. For more detailed information, please refer to the Acorn Package Development documentation.
Installation
To install this package using Composer, follow these steps:
-
Add the following to the
requiresection of yourcomposer.json:{ "yard/config-expander": "*" } -
Run the following command to install the package:
composer update
You can publish the config file with:
wp acorn vendor:publish --provider="Yard\ConfigExpander\ConfigExpanderServiceProvider"
Configuration
After the configuration file has been published, you can customize the package settings by overwriting them. The location of the published configuration file is: 'web/app/themes/{theme-name}/config/yard-config-expander.php
Calling Service Providers
Service providers are defined in a configuration file yard-config-expander.php. Each provider has an enabled flag to indicate whether it should be invoked.
Example Configuration for Service Providers
$config = [
'providers' => [
'Yard\ConfigExpander\ACF\ACFServiceProvider' => [
'enabled' => true,
],
'Yard\ConfigExpander\BranchViewer\BranchViewerServiceProvider' => [
'enabled' => true,
],
'Yard\ConfigExpander\Protection\ProtectionServiceProvider' => [
'enabled' => true,
],
'Yard\ConfigExpander\Disable\DisableServiceProvider' => [
'enabled' => true,
],
'Yard\ConfigExpander\Cleanup\CleanupServiceProvider' => [
'enabled' => true,
],
'Yard\ConfigExpander\Licenses\LicensesServiceProvider' => [
'enabled' => true,
],
'Yard\ConfigExpander\LoginScreenCustomization\LoginScreenCustomizationServiceProvider' => [
'enabled' => true,
],
]
];
Settings
Additional settings are also defined in the same configuration file yard-config-expander.php.
These settings can be customized to fit your specific needs.
$config = [
'defaults' => [
'admin' => [
'AUTOMATIC_UPDATER_DISABLED' => true,
'AUTOSAVE_INTERVAL' => 900,
'DISABLE_COMMENTS' => true,
'DISABLE_POSTS' => true,
'DISALLOW_FILE_EDIT' => true,
'DISABLE_ADMIN_NOTICES_FOR_NON_ADMINS' => true,
'UNSET_ADMIN_ROLE_FOR_NON_ADMINS' => true,
'WP_CACHE' => false,
],
'api' => [
'DISABLE_REST_API_USERS' => true,
'DISABLE_REST_API_OEMBED' => true,
],
'public' => [
'FEEDS_ENABLED' => false,
'XMLRPC_ENABLED' => false,
'XMLRPC_ALLOWED_METHODS' => [],
'CLEANUP_HEADERS' => true,
'DISABLE_EMOJICONS' => true,
],
],
];
Plugin defaults
Considering the following section of the configuration file yard-config-expander.php:
$config = [
'cleanup' => [
'plugins' => [
Yard\ConfigExpander\Cleanup\Plugins\Stream::class,
Yard\ConfigExpander\Cleanup\Plugins\SearchWP::class
]
]
]
The provided classes are designed to manage the settings and cleanup tasks for various plugins within a WordPress environment.
These classes must extend the common base class BaseAbstract and include methods to handle both single-site and multi-site configurations.
Hooks
The hooks are divided by sections based on the package directories.
Clean-up
Allow 'unfiltered_html' capability for administrators, superusers and editors only
add_filter('yard::config-expander/cleanup/allow-unfiltered-html', '__return_true');
Login screen customization
Overwrite the stylesheet file (URL)
add_filter('yard::config-expander/login/style-file', function(string $source) {
return $source;
}, 10, 1);
Overwrite the logo above the login form (URL)
add_filter('yard::config-expander/login/logo', function(string $logo){
return $logo;
}, 10, 1);
Customize the URL of the anchor around the logo
add_filter('yard::config-expander/login/logo-url', function(string $logo){
return $logo;
}, 10, 1);
Overwrite the title of the link (value inside the anchor)
add_filter('yard::config-expander/login/logo-name', function(string $logo){
return $logo;
}, 10, 1);
About us
Related Packages
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| v1.6.0 | >=8.2 | MIT | |
| v1.5.2 | >=8.2 | MIT | |
| v1.5.1 | >=8.2 | MIT | |
| v1.5.0 | >=8.2 | MIT | |
| v1.4.2 | >=8.2 | MIT | |
| v1.4.1 | >=8.2 | MIT | |
| v1.4.0 | >=8.2 | MIT | |
| v1.3.0 | >=8.2 | MIT | |
| v1.2.17 | >=8.1 | MIT | |
| v1.2.16 | >=8.1 | MIT | |
| v1.2.15 | >=8.1 | MIT | |
| v1.2.14 | >=8.1 | MIT | |
| v1.2.13 | >=8.1 | MIT | |
| v1.2.12 | >=8.1 | MIT | |
| v1.2.11 | >=8.1 | MIT | |
| v1.2.10 | >=8.1 | MIT | |
| v1.2.9 | >=8.1 | MIT | |
| v1.2.8 | >=8.1 | MIT | |
| v1.2.7 | >=8.1 | MIT | |
| v1.2.6 | >=8.1 | MIT | |
| 1.2.5 | >=8.1 | MIT | |
| 1.2.4 | >=8.1 | MIT | |
| 1.2.3 | >=8.1 | MIT | |
| 1.2.2 | >=8.1 | MIT | |
| 1.2.1 | >=8.1 | MIT | |
| 1.2.0 | >=8.1 | MIT | |
| 1.1.0 | ^8.0 | MIT | |
| 1.0.9 | ^8.0 | MIT | |
| 1.0.8 | ^8.0 | MIT | |
| 1.0.7 | ^8.0 | MIT |
Showing the latest 30 of 36. See every release on Packagist