mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
Use plugin version as asset version
This commit is contained in:
parent
651099705a
commit
0c07ebd629
11 changed files with 72 additions and 24 deletions
|
@ -14,8 +14,14 @@ use Psr\Container\ContainerInterface;
|
|||
use WpOop\WordPress\Plugin\PluginInterface;
|
||||
|
||||
return array(
|
||||
'ppcp.plugin' => function( ContainerInterface $container ) : PluginInterface {
|
||||
'ppcp.plugin' => function( ContainerInterface $container ) : PluginInterface {
|
||||
$factory = new FilePathPluginFactory( new StringVersionFactory() );
|
||||
return $factory->createPluginFromFilePath( dirname( realpath( __FILE__ ), 2 ) . '/woocommerce-paypal-payments.php' );
|
||||
},
|
||||
'ppcp.asset-version' => function( ContainerInterface $container ) : string {
|
||||
$plugin = $container->get( 'ppcp.plugin' );
|
||||
assert( $plugin instanceof PluginInterface );
|
||||
|
||||
return (string) $plugin->getVersion();
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue