Skip to main content

Timeline for How to set default screen options?

Current License: CC BY-SA 3.0

9 events
when toggle format what by license comment
Nov 30, 2016 at 18:34 comment added squarecandy I think @toscho is right in the context of building robust themes and plugins for wide distribution. However, it's important to consider that in addition to thousands of novices trying to hack at prebuilt themes there are also a lot of developers creating custom themes from scratch for a single client meant to work in a single context. Sometimes in that case you have admin features that are intrinsically tied to the custom theme. Doesn't seem the worst idea to include in the theme code if that's the case.
Mar 1, 2013 at 17:05 comment added WraithKenny A couple months after this Answer was written, filters where added to core making this answer obsolete.
May 5, 2012 at 12:48 comment added brasofilo Does people want that their shortcodes keep working even if they swap themes? The same goes to this kind of function... Even more, I drop the plugin inside mu-plugins folder, so it's not easily disabled by the client (this works for WP single installs as well:).
Apr 8, 2012 at 16:14 vote accept developdaly
Nov 3, 2011 at 14:54 comment added cwd +1 Good answer - sometimes you do want to set these explicitly. It's a good base, and of course this code can be modified easily to be called when necessary (adding a new user, for example), so that you really are setting the "default" options and not forcing options on users who change them. I will be adding this code to my theme's functions.php file because the default options are for a specific project, which is represented / housed by the theme that I'm developing.
Jun 29, 2011 at 17:15 comment added fuxia There is no overhead by using a plugin. That’s a myth which has to die instantly. Plus, your usage restriction was not part of the question. Your answer is read by thousands of novices. You’ll help them with the best code you can write, not with something that kinda works in some specific situations. :)
Jun 29, 2011 at 12:32 comment added drebabels @toscho I don't really agree with that. Naturally you could put this into a plugin but if for instance you are building a theme for yourself or perhaps for a client that has no need to see certain boxes then why add the additional management overhead that comes with including this into a plugin. By dropping it into the functions.php file you ensure that the experience for the theme is consistent without having to make sure a plugin is installed and activated.
Jun 14, 2011 at 13:05 comment added fuxia This is not a theme job and doesn’t belong into a functions.php.
Jun 14, 2011 at 8:32 history answered drebabels CC BY-SA 3.0