Thanks for the suggestion. This something I have considered before, but when adding new database table columns I always need to weigh up the cost to sites to how useful they will be to the plugin. So far, I don’t feel that having a modified and created date is super necessary, but if there is enough push to add them then I will certainly do so.
If you really want to, you can actually add these yourself without modifying the plugin. Simply run this SQL code (you may need to change the table name if you are running WordPress multisite or use a different table prefix):
ALTER TABLE wp_snippets
ADD COLUMN created datetime NOT NULL DEFAULT current_timestamp(),
ADD COLUMN modified datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp();
The nice thing about this is that the columns will automatically update when the table is written to by either the plugin or if you make manual alterations through a database administration tool.
]]>This feature request is actually more of a prerequisite for building out a master/client “repository” functionality that I’ve been working on, where one “master” site can run the most up-to-date versions of the snippets, and the “client” sites can pull down the most recent version from master. It may not be super useful for a single-site user, but for those of us who use Code Snippets as an extremely important (read: crucial) dev tool in managing many client sites, this would be a huge help in keeping things updated across the board.
I’m actually about 80% done coding this already; is there a good way to contact you directly about how to possibly implement this power-user functionality while still keeping things lightweight for most users? I looked around for an email address but didn’t find anything. Thanks again for your time.
]]>The master/client feature is also one I have heard before, so clearly it would be useful to a number of people. It would be great to get more input on what it could look like – you can find my email address here.
]]>I’ll send you a separate message with some ideas on the master/client feature and share what I’ve experimented with so far. Thanks!
]]>