I have built a plugin that uses a custom post type and a single-.php file for a template. My issue is the custom post type template needs to take on the name of the post type and I need to change that. For example if my post type is called Movies then the template I call is single-movies.php. Also the permalink would be mydomain.com/movies.
I am providing a plugin options page that allows the user to change the name from Movies to say Films.
What is the best approach? Initially I thought about changing the custom post type name dynamically and renaming the file with the rename(). I kept getting an error "cURL wrapper does not support renaming"
I got to thinking . Is it easier to just rename the permalink with a mod rewrite and if so how would I do that. I'm trying to avoid a naming issue. If the user already has a permalink of Movies then I want them to be able to rename the post type to film or what ever they want.
The default of Movies will be stored as an option upon plugin activation and displayed in the options panel. If the user decides to change to "Films" the option is updated but how to I associate it to the custom post type template?
Any help on this is greatly appreciated. Phil