PHP code example of yard / config-expander

1. Go to this page and download the library: Download yard/config-expander library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yard / config-expander example snippets


$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,
    ],
  ]
];

$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,
    ],
  ],
];

$config = [
  'cleanup' => [
    'plugins' => [
      Yard\ConfigExpander\Cleanup\Plugins\Stream::class,
      Yard\ConfigExpander\Cleanup\Plugins\SearchWP::class
    ]
  ]
]

add_filter('yard::config-expander/cleanup/allow-unfiltered-html', '__return_true');

add_filter('yard::config-expander/login/style-file', function(string $source) {
  return $source;
}, 10, 1);

add_filter('yard::config-expander/login/logo', function(string $logo){
  return $logo;
}, 10, 1);

add_filter('yard::config-expander/login/logo-url', function(string $logo){
  return $logo;
}, 10, 1);

add_filter('yard::config-expander/login/logo-name', function(string $logo){
  return $logo;
}, 10, 1);