triggers = $triggers; } public function register() { add_action( 'init', array( $this, 'block' ) ); } public function block() { register_block_type( artbees_QV_PATH . 'blocks/quick-view', array( 'render_callback' => array( $this, 'render' ) ) ); } public function render( $attributes ) { $id = absint( $attributes['productId'] ?? 0 ); if ( ! $id ) { global $product; $id = $product instanceof \WC_Product ? $product->get_id() : 0; } return $this->triggers->trigger( $id, 'manual', true, sanitize_text_field( $attributes['label'] ?? '' ), sanitize_html_class( $attributes['className'] ?? '' ) ); } }