Problem
The fill_form endpoint currently calls get_template() twice:
- Once to check if the template exists
- Once again to fetch the template
This results in redundant database queries.
Proposed Solution
- Call
get_template() once
- Store the result in a variable
- Reuse it for both validation and processing
Benefits
- Reduces unnecessary database calls
- Improves performance
- Enhances code readability
I can work on this and submit a PR.