Pull User Meta
-
I tried this code to append my users school name to the query and the ai just said “There has been a critical error on your website” so it looks like that didn’t work!
// Add a filter to modify the AI query add_filter('mwai_ai_query', 'modify_mwai_query_with_school_name'); function modify_mwai_query_with_school_name($query) { // Get the current user's ID $current_user_id = get_current_user_id(); // Get the school_name attribute of the current user $school_name = get_user_meta($current_user_id, 'school_name', true); // Append or modify the query to include the school name // You might adjust this depending on the original query and desired format $query = $query . ' at ' . $school_name; return $query; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Pull User Meta’ is closed to new replies.