Site icon CodeRevolution Knowledge Base

Aiomatic Plugin Custom Filters Documentation

My goal is to build the Aiomatic plugin, so it offers unparalleled customization, enabling you to accomplish any task you desire. Because of this, I added the ability to use custom filters to modify the prompts and the AI generated content, during the plugin’s execution.

Introduction to Custom Filters

Custom filters in the Aiomatic plugin are PHP functions that allow you to intercept and modify different stages of the AI writing process. These filters act as hooks, enabling you to insert your custom logic and manipulate the AI’s queries, replies, embeddings, images, voice texts, video texts, and more. By utilizing these filters, you can tailor the plugin to meet your unique requirements and achieve a highly customizable AI writing experience.

List of Custom Filters

1. aiomatic_is_ai_query_allowed

2. aiomatic_modify_ai_query

3. aiomatic_modify_ai_reply

4. aiomatic_modify_ai_error

5. aiomatic_modify_ai_embeddings

6. aiomatic_is_ai_edit_allowed

7. aiomatic_modify_ai_edit_instruction

8. aiomatic_modify_ai_edit_content

9. aiomatic_is_ai_image_allowed

10. aiomatic_modify_ai_image_query

11. aiomatic_modify_ai_voice_text

12. aiomatic_modify_ai_video_text

13. aiomatic_embeddings_reply_raw

14. aiomatic_ai_reply_raw

15. aiomatic_edit_reply_raw

16. aiomatic_dalle_reply_raw

17. aiomatic_stability_reply_raw

How to Use Custom Filters

To utilize the custom filters provided by the Aiomatic plugin, follow these steps:

  1. Identify the filter that corresponds to the aspect you want to modify or intercept.
  2. Create a custom PHP function in your theme’s functions.php file or in a custom plugin file.
  3. Inside your custom function, implement the desired logic to modify the data as required.
  4. Hook your custom function into the corresponding filter using the add_filter function.

Here’s an example of how to use a custom filter:

// Custom function to modify AI reply before processing further
function custom_modify_ai_reply($reply) {
    // Add custom logic here to modify the AI reply
    $modified_reply = $reply . " (modified)";
    return $modified_reply;
}
// Hook the custom function into the aiomatic_modify_ai_reply filter
add_filter('aiomatic_modify_ai_reply', 'custom_modify_ai_reply');

By using custom filters, you can tailor the AI writing process to meet your specific needs and create a more personalized experience for your users.

Exit mobile version