• Craig

    (@spedadvocate)


    I was looking for documentation on hooks or filters and the assistant on your site basically told me to look at the code. I did.
    I need to add a timestamp to the start of every prompt. I hacked this into the code (the absolute last way I want to do this, but need to test it) and it works. How can I do this properly?

    function AI24AI_handle_chat_request() {
    date_default_timezone_set(‘America/New_York’); // optional but recommended
    $time = date(‘Y-m-d\TH:iP’);
    $current_time = ‘[Time: ‘ . $time . ‘] ‘;

    // Extract & Sanitize User Input
    $user_input = sanitize_text_field($_POST['user_input']);

    $user_input = $current_time . $user_input;


The topic ‘Modifying a prompt’ is closed to new replies.