diff --git a/includes/Classifai/Features/Classification.php b/includes/Classifai/Features/Classification.php index 707da8bbc..d429d720e 100644 --- a/includes/Classifai/Features/Classification.php +++ b/includes/Classifai/Features/Classification.php @@ -227,6 +227,21 @@ public function rest_endpoint_callback( WP_REST_Request $request ) { public function save( int $post_id, array $results, bool $link = true ) { $provider_instance = $this->get_feature_provider_instance(); + /** + * Filter results to be saved. + * + * @since 3.1.0 + * @hook classifai_feature_classification_pre_save_results + * + * @param {array} $supported Term results. + * @param {int} $post_id Post ID. + * @param {bool} $link Whether to link the terms or not. + * @param {object} $this Current instance of the class. + * + * @return {array} Term results. + */ + $results = apply_filters( 'classifai_' . static::ID . '_pre_save_results', $results, $post_id, $link, $this ); + switch ( $provider_instance::ID ) { case NLU::ID: $results = $provider_instance->link( $post_id, $results, $link ); diff --git a/src/js/language-processing.js b/src/js/language-processing.js index 47e22bcda..88a1e9d14 100644 --- a/src/js/language-processing.js +++ b/src/js/language-processing.js @@ -202,7 +202,7 @@ import '../scss/language-processing.scss'; previewWatson(); const previewEmbeddings = () => { - if ( 'openai_embeddings' !== provider ) { + if ( 'ibm_watson_nlu' === provider ) { return; }