You've already forked wp-fedistream
fix: WooCommerce product types not appearing in selector
Fixed timing issue where WooCommerce integration hooks were registered too late during plugins_loaded. The constructor now calls check_woocommerce() directly instead of hooking it at priority 5 (which had already passed). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,8 +28,16 @@ class Integration {
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
add_action( 'plugins_loaded', array( $this, 'check_woocommerce' ), 5 );
|
||||
add_action( 'plugins_loaded', array( $this, 'init' ), 20 );
|
||||
// Check WooCommerce immediately since we're instantiated during plugins_loaded.
|
||||
$this->check_woocommerce();
|
||||
|
||||
// If plugins_loaded hasn't fully completed, hook init at priority 20.
|
||||
// Otherwise, run init directly.
|
||||
if ( ! did_action( 'plugins_loaded' ) || doing_action( 'plugins_loaded' ) ) {
|
||||
add_action( 'plugins_loaded', array( $this, 'init' ), 20 );
|
||||
} else {
|
||||
$this->init();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user