I'm developing a company Website using Wordpress 4. This website needs some special, customized pages - with forms and
POST and a lot of stuff, so a lot of PHP code.
Now, a CMS' main purpose is to separate content and code and design and provide easy extension capabilities. How can I separate the logic of the custom templates from the raw text that these templates give out?
Example: Somewhere the template code needs to give out the text "Dear customer, please select the colour your wish to use:". Sadly, I as the web developer did some typos in this text. Now the content-authors (non-technicans) want to fix my typos. They would have to enter all the PHP code, which they never learned. Or they would have to ask me to fix it, but it's not really my job to fix typos. So, I actually need a logic to be able to do this:
echo $colour_select_text, with
$colour_select_text being easily changable in the regular Wordpress backend (just like editing regular Wordpress pages/posts).
What is a good way in Wordpress to separate custom PHP logic and custom content, so that non-coding authors can edit the texts outside the code and the actual coders can adjust the logic without breaking the actual content of the custom templates? Do I need to write a custom plugin for this as well (i.e. creating a MySQL table holding the texts, providing a backend form for changing them and write an PHP API to access them), or does Wordpress provide some kind of mechanism for this kind of tasks already?