Sticky Posts
Jun 26, 2009
set/get/remove_theme_mod(s): Wordpress, something’s missing!
I was working on a bunch of plugins and realised that Wordpress is missing a function for theme mods (theme related options). Let's say I have a plugin that sets mods on all themes like this: set_theme_mod('mod', 'value); Once you set the value you can retrieve it using get_theme_mod('mod', null); and you can remove it using remove_theme_mod('mod');
These three functions all work on the current theme but a plugin can mod all themes on one blog. Do you start to notice the problem?
What if, on uninstall, you want to remove mods from all themes your plugin has moded in one shot. Searched and searched and could not find a function to do this in Wordpress ... so ... here it is. I think this will help Wordpress Plugin Developers quite a bit.
Registration is quick, painless and worth its weight in gold.
Have fun.
PS: I'm almost done converting my about 100 plugins to Wp/2.8 (and objects) and, once done, I'll publish a new ... let's say ... product.
I was going to do it a few days ago but Wp/2.8 came up and got my attention.

