htmlspecialchars decode for mwai_ai_exception
-
Hello!
Thanks for the great plugin! PRO version is just super!
Please tell me, is it possible to make it possible to return html in mwai_ai_exception and other filters?For example, I want to insert the text in the mwai_ai_exception response with a link There was an AI system error. <a href=”https://site.com/contacts/”>Please contact us.</a>. But it doesn’t output html characters.
I tried using htmlspecialchars_decode for the answer, but that doesn’t work either.
$message = ‘There was an AI system error. There was an AI system error. <a href=”https://site.com/contacts/”>Please contact us.</a>’;
$message = htmlspecialchars_decode($message);
return $message;How can this be resolved? Thank you in advance!
add_filter( ‘mwai_ai_exception’, function ( $exception ) { try { if ( substr( $exception, 0, 26 ) === “Error while calling OpenAI” ) { error_log( $exception ); return “There was an AI system error. <a href=”https://site.com/contacts/”Please contact us.</a>”; } return $exception; } catch ( Exception $e ) { error_log( $e->getMessage() ); } return $exception; } );
The topic ‘htmlspecialchars decode for mwai_ai_exception’ is closed to new replies.