PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.3
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.3
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
← All changes | includes/core/AI/ToolGateway.php +12 -0 3.13.2 → 3.13.3 View file →
@@ -169,8 +169,9 @@
169 169
170 170 if ( function_exists( 'wp_get_ability' ) ) {
171 171 $ability = wp_get_ability( $tool_name );
172 172 if ( ! $ability || ! str_starts_with( $tool_name, 'wpfunnels/' ) ) {
173 + do_action( 'wpfnl_ai_tool_failed', $tool_name, 'unknown_tool' );
173 174 return [
174 175 'content' => sprintf( 'Unknown tool "%s".', $tool_name ),
175 176 'is_error' => true,
176 177 ];
@@ -200,8 +201,19 @@
200 201 }
201 202 }
202 203
203 204 if ( is_wp_error( $result ) ) {
205 + /**
206 + * Fires when a copilot tool call fails (the counterpart of
207 + * `wpfnl_ai_tool_executed`).
208 + *
209 + * @since 3.14.0
210 + *
211 + * @param string $tool_name Ability name.
212 + * @param string $error_code WP_Error code.
213 + */
214 + do_action( 'wpfnl_ai_tool_failed', $tool_name, $result->get_error_code() );
215 +
204 216 return [
205 217 'content' => wp_json_encode(
206 218 [
207 219 'error' => $result->get_error_code(),