ClassifAI Developer Documentation
Documentation for actions, filters, and WP-CLI commands found in the ClassifAI plugin
Available Hooks
This plugin provides the following hooks:
Actions
- after_classifai_init - Fires after ClassifAI services are loaded.
- before_classifai_init - Fires before ClassifAI services are loaded.
- classifai_ . static::ID . _render_provider_fields - Allows more Provider specific settings to be rendered.
- classifai_after_feature_settings_form - Fires after the settings form for a feature.
- classifai_after_onboarding_feature_settings_form - Fires after the settings form for a feature.
- classifai_azure_openai_embeddings_post_sort_embeddings_similarity - Fires after the embeddings similarity has been run and sorted.
- classifai_azure_openai_embeddings_pre_sort_embeddings_similarity - Fires after the embeddings similarity has been run but before results are sorted.
- classifai_azure_openai_embeddings_single_embedding_similarity - Fires after the embeddings similarity has been run for a single chunk.
- classifai_azure_read_after_request - Fires after the request to the read endpoint has run.
- classifai_before_feature_nav - Fires before the feature tab navigation.
- classifai_before_feature_settings_form - Fires before the settings form for a feature.
- classifai_before_onboarding_feature_settings_form - Fires before the settings form for a feature.
- classifai_computer_vision_caption_failed - Fires if there were no captions returned.
- classifai_computer_vision_image_tag_failed - Fires if there were no tags added.
- classifai_credentials_copied - Fires after credentials are copied between features.
- classifai_feature_term_cleanup_generate_embedding - Fires when an embedding is generated for a term.
- classifai_feature_term_cleanup_get_similar_terms - Fires when a batch of similar terms are calculated.
- classifai_feature_term_cleanup_post_merge_term - Fires after terms are merged together.
- classifai_feature_term_cleanup_post_skip_term - Fires after a term is skipped.
- classifai_feature_term_cleanup_pre_merge_term - Fires before terms are merged together.
- classifai_feature_term_cleanup_pre_skip_term - Fires before a term is skipped.
- classifai_ollama_embeddings_post_sort_embeddings_similarity - Fires after the embeddings similarity has been run and sorted.
- classifai_ollama_embeddings_pre_sort_embeddings_similarity - Fires after the embeddings similarity has been run but before results are sorted.
- classifai_ollama_embeddings_single_embedding_similarity - Fires after the embeddings similarity has been run for a single chunk.
- classifai_openai_embeddings_post_sort_embeddings_similarity - Fires after the embeddings similarity has been run and sorted.
- classifai_openai_embeddings_pre_sort_embeddings_similarity - Fires after the embeddings similarity has been run but before results are sorted.
- classifai_openai_embeddings_single_embedding_similarity - Fires after the embeddings similarity has been run for a single chunk.
- classifai_openai_embeddings_single_post_embedding_similarity - Fires after the embeddings similarity has been run for a single chunk.
- classifai_render_attachment_metabox - Allows more fields to be rendered in attachment metabox.
- classifai_render_attachment_metabox - Allows more fields to be rendered in attachment metabox.
- classifai_render_attachment_metabox - Allows more fields to be rendered in attachment metabox.
- classifai_render_attachment_metabox - Allows more fields to be rendered in attachment metabox.
- classifai_smart_cropping_after_request - Fires after the request to the generateThumbnail smart-cropping endpoint has run.
- classifai_smart_cropping_unsuccessful_response - Fires when the generateThumbnail smart-cropping API response did not have a 200 status code.
Filters
- classifai_ . self::ID . _debug_information - Filter to add feature-level debug information.
- classifai_ . self::ID . _pre_connect_to_service - Filters the return value of the connect to services function.
- classifai_ . self::ID . _pre_synthesize_speech - Filters the return value of the synthesize speech function.
- classifai_ . self::ID . _scan_image_timeout - Filters the timeout for the image scan request.
- classifai_ . self::ID . _synthesize_speech_args - Filter Synthesize speech args.
- classifai_ . static::ID . _embeddings_meta_key - Filter the meta key for embeddings.
- classifai_ . static::ID . _get_default_settings - Filter the default settings for a feature.
- classifai_ . static::ID . _has_access - Filter to override user access to a ClassifAI feature.
- classifai_ . static::ID . _is_enabled - Filter to override a specific classifai feature enabled.
- classifai_ . static::ID . _is_feature_enabled - Filter to override permission to a specific classifai feature.
- classifai_ . static::ID . _label - Filter the feature label.
- classifai_ . static::ID . _post_statuses - Filter post statuses supported for a feature.
- classifai_ . static::ID . _post_types - Filter post types supported for a feature.
- classifai_ . static::ID . _pre_save_results - Filter results to be saved.
- classifai_ . static::ID . _providers - Filter the feature providers.
- classifai_ . static::ID . _read_status - Filter the status of the PDF read operation.
- classifai_ . static::ID . rest_route{$route}_args - Filter the arguments for the REST route.
- classifai_ . static::ID . _roles - Filter the allowed WordPress roles for a feature.
- classifai_ . static::ID . _roles - Filter the allowed WordPress roles for image generation.
- classifai_ . static::ID . _run - Filter the results of running the feature.
- classifai_ . static::ID . _sanitize_settings - Filter to change settings before they're saved.
- classifai_ . static::ID . _setting_taxonomies - Filter taxonomies shown in settings.
- classifai_ . static::ID . _setting_taxonomies - Filter taxonomies shown in settings.
- classifai_all_post_statuses - Hook to filter post statuses.
- classifai_audio_generation_initial_state - Initial state of the audio generation toggle when no audio already exists for the post.
- classifai_audio_generation_subsequent_state - Subsequent state of the audio generation toggle when audio exists for the post.
- classifai_azure_openai_{$args[resize_type]}_content_prompt - Filter the resize prompt we will send to Azure OpenAI.
- classifai_azure_openai_content - Filter content that will get sent to Azure OpenAI.
- classifai_azure_openai_content_prompt - Filter the prompt we will send to Azure OpenAI.
- classifai_azure_openai_content_request_body - Filter the request body before sending to Azure OpenAI.
- classifai_azure_openai_embeddings_content - Filter content that will get sent to OpenAI.
- classifai_azure_openai_embeddings_dimensions - Filter the dimensions we want for each embedding.
- classifai_azure_openai_embeddings_max_terms - Filter the max number of terms.
- classifai_azure_openai_embeddings_max_tokens - Filter the max number of tokens.
- classifai_azure_openai_embeddings_request_body - Filter the request body before sending to OpenAI.
- classifai_azure_openai_embeddings_request_body - Filter the request body before sending to OpenAI.
- classifai_azure_openai_embeddings_should_classify - Filter whether ClassifAI should classify an item.
- classifai_azure_openai_embeddings_should_classify - Filter whether ClassifAI should classify an item.
- classifai_azure_openai_embeddings_terms_per_job - Filter the number of terms to process in a batch.
- classifai_azure_openai_excerpt_prompt - Filter the prompt we will send to Azure OpenAI.
- classifai_azure_openai_excerpt_request_body - Filter the request body before sending to Azure OpenAI.
- classifai_azure_openai_key_takeaways_auto_run - Decide if we should automatically run the key takeaways generation.
- classifai_azure_openai_key_takeaways_prompt - Filter the prompt we will send to Azure OpenAI.
- classifai_azure_openai_key_takeaways_request_body - Filter the request body before sending to Azure OpenAI.
- classifai_azure_openai_resize_content_request_body - Filter the resize request body before sending to Azure OpenAI.
- classifai_azure_openai_title_prompt - Filter the prompt we will send to Azure OpenAI.
- classifai_azure_openai_title_request_body - Filter the request body before sending to Azure OpenAI.
- classifai_azure_read_request_args - Filters the request arguments sent to Read endpoint.
- classifai_azure_read_result_max_page - Filter the max pages that can be processed.
- classifai_azure_read_retry_interval - Filters the Read retry interval.
- classifai_azure_read_should_process - Filters whether to run Read processing on this attachment item
- classifai_azure_read_text_result - Filter the text result returned from Read API.
- classifai_chatgpt_{$args[resize_type]}_content_prompt - Filter the resize prompt we will send to ChatGPT.
- classifai_chatgpt_content - Filter content that will get sent to ChatGPT.
- classifai_chatgpt_content_prompt - Filter the prompt we will send to ChatGPT.
- classifai_chatgpt_content_request_body - Filter the request body before sending to ChatGPT.
- classifai_chatgpt_descriptive_text_prompt - Filter the prompt we will send to ChatGPT.
- classifai_chatgpt_descriptive_text_request_body - Filter the request body before sending to ChatGPT.
- classifai_chatgpt_excerpt_prompt - Filter the prompt we will send to ChatGPT.
- classifai_chatgpt_excerpt_request_body - Filter the request body before sending to ChatGPT.
- classifai_chatgpt_image_tag_prompt - Filter the prompt we will send to ChatGPT.
- classifai_chatgpt_image_tag_request_body - Filter the request body before sending to ChatGPT.
- classifai_chatgpt_key_takeaways_auto_run - Decide if we should automatically run the key takeaways generation.
- classifai_chatgpt_key_takeaways_prompt - Filter the prompt we will send to ChatGPT.
- classifai_chatgpt_key_takeaways_request_body - Filter the request body before sending to ChatGPT.
- classifai_chatgpt_ocr_prompt - Filter the prompt we will send to ChatGPT.
- classifai_chatgpt_ocr_request_body - Filter the request body before sending to ChatGPT.
- classifai_chatgpt_resize_content_request_body - Filter the resize request body before sending to ChatGPT.
- classifai_chatgpt_title_prompt - Filter the prompt we will send to ChatGPT.
- classifai_chatgpt_title_request_body - Filter the request body before sending to ChatGPT.
- classifai_chrome_ai_{$args[resize_type]}_content_prompt - Filter the resize prompt we will send to Chrome AI.
- classifai_chrome_ai_content - Filter content that will get sent to Chrome AI.
- classifai_chrome_ai_excerpt_prompt - Filter the prompt we will send to Chrome AI.
- classifai_chrome_ai_excerpt_request_body - Filter the request body before sending to Chrome AI.
- classifai_chrome_ai_resize_content_request_body - Filter the resize request body before sending to Chrome AI.
- classifai_chrome_ai_title_prompt - Filter the prompt we will send to Chrome AI.
- classifai_chrome_ai_title_request_body - Filter the request body before sending to Azure OpenAI.
- classifai_classified_data - Filter the classified data returned from the API call.
- classifai_computer_vision_captions - Filter the caption returned from the API.
- classifai_computer_vision_image_tags - Filter the tags returned from the API.
- classifai_computer_vision_max_filesize - Filters the Computer Vision maximum allowed filesize.
- classifai_dalle_caption - Filter the default attribution added to generated images.
- classifai_dalle_prompt - Filter the prompt we will send to OpenAI.
- classifai_dalle_request_body - Filter the request body before sending to OpenAI.
- classifai_debug_information - Filters debug information displayed on the Site Health screen for the ClassifAI plugin.
- classifai_disable_post_to_audio_block - Filter to disable the rendering of the Text to Speech block.
- classifai_excerpt_generation_author_name - Filter the author name used in excerpt generation.
- classifai_feature_classification_taxonomy_for_feature - Filter the Taxonomy for the specified NLU feature.
- classifai_feature_threshold - Filter the threshold for a specific feature. Any results below the threshold will be ignored.
- classifai_generate_image_alt_tags_source_url - Filter to modify image source URL in order to allow scanning images, stored on third party storages that cannot be used by helper function
get_largest_acceptable_image_url()
to determinefilesize()
locally. - classifai_googleai_api_request_get_options - Filter the options for the get request.
- classifai_googleai_api_request_get_url - Filter the URL for the get request.
- classifai_googleai_api_request_post_options - Filter the options for the post request.
- classifai_googleai_api_request_post_url - Filter the URL for the post request.
- classifai_googleai_api_response_get - Filter the response from Google AI for a get request.
- classifai_googleai_api_response_post - Filter the response from Google AI for a post request.
- classifai_googleai_gemini_api_{$args[resize_type]}_content_prompt - Filter the resize prompt we will send to Gemini API.
- classifai_googleai_gemini_api_content - Filter content that will get sent to GoogleAI.
- classifai_googleai_gemini_api_excerpt_prompt - Filter the prompt we will send to Gemini API.
- classifai_googleai_gemini_api_excerpt_request_body - Filter the request body before sending to Gemini API.
- classifai_googleai_gemini_api_model - Filter the model name.
- classifai_googleai_gemini_api_resize_content_request_body - Filter the resize request body before sending to Gemini API.
- classifai_googleai_gemini_api_title_prompt - Filter the prompt we will send to Gemini API.
- classifai_googleai_gemini_api_title_request_body - Filter the request body before sending to Gemini API.
- classifai_googleai_images_api_url - Filter the API URL.
- classifai_googleai_images_aspect_ratio_options - Filter the image aspect ratio options that are available.
- classifai_googleai_images_max_prompt_chars - Filter the max number of characters the prompt can have.
- classifai_googleai_images_model - Filter the model name.
- classifai_googleai_images_prompt - Filter the prompt we will send to Google AI.
- classifai_googleai_images_request_body - Filter the request body before sending to Google AI.
- classifai_googleai_models - Filter the models returned by the Google AI API.
- classifai_image_processing_service_providers - Filter the service providers for Image Processing service.
- classifai_language_processing_service_providers - Filter the service providers for Language Processing service.
- classifai_language_settings_post_statuses - Filter post statuses shown in language processing settings.
- classifai_language_settings_post_types - Filter post types shown in language processing settings.
- classifai_listen_to_this_post_text - Hook to filter the text next to the audio controls on the frontend.
- classifai_normalize - Filters the normalized content to allow for additional cleanup.
- classifai_ocr_text - Filter the text returned from the API.
- classifai_ocr_text_post_args - Filter the post arguments before saving the text to post_content.
- classifai_ollama_{$args[resize_type]}_content_prompt - Filter the resize prompt we will send to Ollama.
- classifai_ollama_content - Filter content that will get sent to Ollama.
- classifai_ollama_content_prompt - Filter the prompt we will send to Ollama.
- classifai_ollama_content_request_body - Filter the request body before sending to Ollama.
- classifai_ollama_descriptive_text_prompt - Filter the prompt we will send to Ollama.
- classifai_ollama_descriptive_text_request_body - Filter the request body before sending to Ollama.
- classifai_ollama_embeddings_content - Filter content that will get sent to Ollama.
- classifai_ollama_embeddings_dimensions - Filter the dimensions we want for each embedding.
- classifai_ollama_embeddings_max_terms - Filter the max number of terms.
- classifai_ollama_embeddings_max_tokens - Filter the max number of tokens.
- classifai_ollama_embeddings_request_body - Filter the request body before sending to Ollama.
- classifai_ollama_embeddings_request_body - Filter the request body before sending to Ollama.
- classifai_ollama_embeddings_should_classify - Filter whether ClassifAI should classify an item.
- classifai_ollama_embeddings_should_classify - Filter whether ClassifAI should classify an item.
- classifai_ollama_embeddings_terms_per_job - Filter the number of terms to process in a batch.
- classifai_ollama_excerpt_prompt - Filter the prompt we will send to Ollama.
- classifai_ollama_excerpt_request_body - Filter the request body before sending to Ollama.
- classifai_ollama_image_tag_prompt - Filter the prompt we will send to Ollama.
- classifai_ollama_image_tag_request_body - Filter the request body before sending to Ollama.
- classifai_ollama_key_takeaways_auto_run - Decide if we should automatically run the key takeaways generation.
- classifai_ollama_key_takeaways_prompt - Filter the prompt we will send to Ollama.
- classifai_ollama_key_takeaways_request_body - Filter the request body before sending to Ollama.
- classifai_ollama_ocr_processing_prompt - Filter the prompt we will send to Ollama.
- classifai_ollama_ocr_processing_request_body - Filter the request body before sending to Ollama.
- classifai_ollama_resize_content_request_body - Filter the resize request body before sending to Ollama.
- classifai_ollama_title_prompt - Filter the prompt we will send to Ollama.
- classifai_ollama_title_request_body - Filter the request body before sending to Ollama.
- classifai_openai_api_request_get_options - Filter the options for the get request.
- classifai_openai_api_request_get_url - Filter the URL for the get request.
- classifai_openai_api_request_post_form_options - Filter the options for the post form request.
- classifai_openai_api_request_post_form_url - Filter the URL for the post form request.
- classifai_openai_api_request_post_options - Filter the options for the post request.
- classifai_openai_api_request_post_url - Filter the URL for the post request.
- classifai_openai_api_response_get - Filter the response from OpenAI for a get request.
- classifai_openai_api_response_post - Filter the response from OpenAI for a post request.
- classifai_openai_api_response_post_form - Filter the response from OpenAI for a post form request.
- classifai_openai_characters_in_token - How many characters in one token (roughly)
- classifai_openai_dalle_api_url - Filter the API URL.
- classifai_openai_dalle_max_prompt_chars - Filter the max number of characters the prompt can have.
- classifai_openai_dalle_model - Filter the model name.
- classifai_openai_dalle_quality_options - Filter the image quality options that are available.
- classifai_openai_dalle_size_options - Filter the image size options that are available.
- classifai_openai_dalle_style_options - Filter the image style options that are available.
- classifai_openai_embeddings_api_url - Filter the API URL.
- classifai_openai_embeddings_content - Filter content that will get sent to OpenAI.
- classifai_openai_embeddings_dimensions - Filter the dimensions we want for each embedding.
- classifai_openai_embeddings_items_per_job - Filter the number of post items to process in a batch.
- classifai_openai_embeddings_max_posts - Filter the max number of posts.
- classifai_openai_embeddings_max_terms - Filter the max number of terms.
- classifai_openai_embeddings_max_tokens - Filter the max number of tokens.
- classifai_openai_embeddings_model - Filter the model name.
- classifai_openai_embeddings_request_body - Filter the request body before sending to OpenAI.
- classifai_openai_embeddings_request_body - Filter the request body before sending to OpenAI.
- classifai_openai_embeddings_should_classify - Filter whether ClassifAI should classify an item.
- classifai_openai_embeddings_should_classify - Filter whether ClassifAI should classify an item.
- classifai_openai_embeddings_terms_per_job - Filter the number of terms to process in a batch.
- classifai_openai_moderation_model - Filter the model name.
- classifai_openai_moderation_request_body - Filter the request body before sending to OpenAI.
- classifai_openai_settings_post_statuses - Filter post statuses shown in settings.
- classifai_openai_settings_post_types - Filter post types shown in settings.
- classifai_openai_settings_taxonomies - Filter taxonomies shown in settings.
- classifai_openai_speech_to_text_api_url - Filter the API URL.
- classifai_openai_speech_to_text_model - Filter the model name.
- classifai_openai_text_to_speech_api_url - Filter the API URL.
- classifai_openai_text_to_speech_model - Filter the model name.
- classifai_openai_tokens_per_word - How many tokens a word will take (roughly)
- classifai_pre_normalize - Hook to filter post content before stripping HTML tags.
- classifai_pre_render_post_audio_controls - Filters the audio player markup before display.
- classifai_recommendation_service_providers - Filter the service providers for Recommendation service.
- classifai_recommended_block_attributes - Filter the recommended content block attributes
- classifai_recommended_block_markup - Filter the recommended content block markup
- classifai_recommended_content_post_args - Filters Recommended content post arguments.
- classifai_reusable_credentials - Filter the reusable credentials for a feature.
- classifai_services - Filter available Services.
- classifai_settings_ibm_watson_nlu_taxonomies - Filter IBM Watson NLU taxonomies shown in settings.
- classifai_should_classify_post - Filter whether ClassifAI should classify a post.
- classifai_should_crop_size - Filters whether to smart crop images of a given size.
- classifai_should_ocr_scan_image - Filters whether to run OCR scanning on the current image.
- classifai_should_smart_crop_image - Filters whether to apply smart cropping to the current image.
- classifai_smart_404_exact_knn_search_args - Filter the arguments before running the search.
- classifai_smart_crop_max_pixel_dimension - Filters the maximum allowable width or height of an image to be cropped. Default 1024.
- classifai_smart_crop_wp_filesystem - Filters the filesystem class instance used to save image files.
- classifai_smart_cropping_source_url - Filters the image URL to send to AI Vision for smart cropping.
- classifai_smart_cropping_thumb_file_name - Filters the file name of the smart-cropped image.
- classifai_stable_diffusion_prompt - Filter the prompt we will send to Stable Diffusion.
- classifai_stable_diffusion_request_body - Filter the request body before sending to Stable Diffusion.
- classifai_stable_diffusion_size_options - Filter the image size options that are available.
- classifai_threshold - Filter the threshold for the similarity calculation.
- classifai_threshold - Filter the threshold for the similarity calculation.
- classifai_threshold - Filter the threshold for the similarity calculation.
- classifai_togetherai_api_url - Filter the Together AI API URL.
- classifai_togetherai_image_prompt - Filter the prompt we will send to Together AI.
- classifai_togetherai_image_request_body - Filter the request body before sending to Together AI.
- classifai_togetherai_image_size_options - Filter the image size options that are available.
- classifai_use_legacy_settings_panel - Filter to determine if the legacy settings panel should be used.
- classifai_whisper_transcribe_request_body - Filter the request body before sending to OpenAI.
- classifai_whisper_transcribe_result - Filter the text result returned from OpenAI Audio API.
- classifai_xai_api_request_get_options - Filter the options for the get request.
- classifai_xai_api_request_get_url - Filter the URL for the get request.
- classifai_xai_api_request_post_options - Filter the options for the post request.
- classifai_xai_api_request_post_url - Filter the URL for the post request.
- classifai_xai_api_response_get - Filter the response from xAI for a get request.
- classifai_xai_api_response_post - Filter the response from xAI for a post request.
- classifai_xai_grok_{$args[resize_type]}_content_prompt - Filter the resize prompt we will send to xAI Grok.
- classifai_xai_grok_content - Filter content that will get sent to xAI Grok.
- classifai_xai_grok_descriptive_text_prompt - Filter the prompt we will send to xAI Grok.
- classifai_xai_grok_descriptive_text_request_body - Filter the request body before sending to xAI Grok.
- classifai_xai_grok_excerpt_prompt - Filter the prompt we will send to xAI Grok.
- classifai_xai_grok_excerpt_request_body - Filter the request body before sending to xAI Grok.
- classifai_xai_grok_model - Filter the model name.
- classifai_xai_grok_models - Filter the models returned by the xAI Grok API.
- classifai_xai_grok_resize_content_request_body - Filter the resize request body before sending to xAI Grok.
- classifai_xai_grok_title_prompt - Filter the prompt we will send to xAI Grok.
- classifai_xai_grok_title_request_body - Filter the request body before sending to xAI Grok.
- classifai_xai_grok_vision_model - Filter the vision model name (The model with image and text capabilities).
- {$this->menu_slug}_features - Filter the list of features for the service.
- {$this->menu_slug}_providers - Filter the list of providers for the service.