I have an idea for a plugin that would greatly improve the productivity on a website that I run. I searched to see if anyone else has made a plugin to do what I have in mind and haven't found anything, so I want to see if I can do it myself.
I haven't ever written a plugin before and need some advice as to what WP functions and API hooks I could use to accomplish the following:
Upon the saving of a particular post, the content of the post is scanned for category slugs. For each category slug found, the corresponding category is automatically selected for that post.
I would like to write a plugin to do this because I use over four hundred categories on this particular website, and I use the category slugs as CSS class names to define the style of different words in a post's content, like so:
<span class="uf">Behold, it was <span class="ps">all grown over with</span> <span class="pfv">thorns</span>. <span class="pds">Its surface was covered with</span> <span class="pfv">nettles</span>, <span class="stf">and its stone wall was broken down</span>. </span>
[I hope that excerpt shows up properly.]
If I could classify the words in each post and then just save the post and have WordPress automatically pick the categories, it could easily double my productivity because I wouldn't have to pick out each category manually.
Is this a feasible idea for a plugin? What WordPress functions should I use? Is there a search function that I could use in the plugin to scan the post content? Any advice would be very helpful.
Thanks.