You can use this for example to enforce a specific template for a custom post type. This way you can keep all the code in a plugin.
This database has information for all major versions from WP 1.2.1 through 5.7.
|3.0||wp-includes/theme.php||979||View in context||filter|
This hook does not occur in the most recent version of WordPress (5.7). Do not use it. It is deprecated. You should look at the list of "related hooks" below to see if you can figure out what replaced it.
We find related hooks using word stems. single_template has 2 significant word stem(s):
template. Note that some of the hooks below may not appear in all versions of WP.