Fix the plugin main file path

This commit is contained in:
Narek Zakarian 2025-07-04 20:18:23 +04:00
parent 86cae6ca4a
commit 238ebc0949
No known key found for this signature in database
GPG key ID: 07AFD7E7A9C164A7
2 changed files with 5 additions and 2 deletions

View file

@ -32,7 +32,7 @@ return function (
$modules = apply_filters( 'woocommerce_paypal_payments_modules', $modules );
// Initialize plugin.
$properties = PluginProperties::new( __FILE__ );
$properties = PluginProperties::new( "$root_dir/woocommerce-paypal-payments.php" );
$bootstrap = Package::new( $properties );
foreach ( $modules as $module ) {

View file

@ -39,6 +39,9 @@ return array(
return $properties->basePath();
},
'ppcp.path-to-plugin-main-file' => function( ContainerInterface $container ) : string {
return $container->get( 'ppcp.path-to-plugin-folder' ) . '/woocommerce-paypal-payments.php';
/** @var Properties $properties */
$properties = $container->get( Package::PROPERTIES );
return $properties->pluginMainFile();
},
);