Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[WordPress] WooCommerce Integrations with WordPress Namespaces
<?php
namespace Acme\Inc\Integration;
class Acme_Integration_Bootstrap {
public function init() {
if ( class_exists( 'WC_Integration' ) ) {
include_once 'class-acme-integration.php';
add_filter(
'woocommerce_integrations',
array( $this, 'add_integration' )
);
}
}
public function add_integration( $integrations ) {
// Notice that you must provide the fully-qualified class name.
$integrations[] = 'Acme\\Inc\\Integration\\Acme_Integration';
return $integrations;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.