afragen / wp-dependency-installer

A lightweight class to add to WordPress plugins/themes to automatically install plugin dependencies.
MIT License
205 stars 32 forks source link

Dependency late config filter #61

Closed Raruto closed 4 years ago

Raruto commented 4 years ago

This is just a general purpose configuration filter:

Example of usage:

add_filter(
  "wp_dependency_config",
  function( $config ) {
    if ( "github" === $config['host'] ) {
      $config['token'] = "blah blah blah"; // <-- i.e. force to use specific Github Token ( prevent null values )
    }
    return $config;
  }
);

This filter is defined as late as possible within the apply_config function