[wp-trac] [WordPress Trac] #33542: User preferences API idea

WordPress Trac noreply at wordpress.org
Tue Aug 25 15:39:54 UTC 2015


#33542: User preferences API idea
-----------------------------+-----------------------------
 Reporter:  johnjamesjacoby  |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Users            |    Version:
 Severity:  normal           |   Keywords:  2nd-opinion
  Focuses:                   |
-----------------------------+-----------------------------
 When setting up a new site, many site Settings seem at first like user
 preferences even though they aren't. For sites with 1 user blogging out to
 the world, this makes sense, but for more robust installations a single
 set of site settings does not satisfy all users.

 I'd like to propose a user preferences API be invented. This API would
 consist of a series of functions that connect usermeta to site & network
 options, and when invoked, will traverse the user/site/network hierarchy
 and use the first available setting. Something like:

 {{{
 $language = wp_get_user_preference( $user_id, 'WPLANG' );
 }}}

 Imagine then, that `wp_get_user_preference()` would first look in
 `wp_usermeta`, then in `wp_options` and then in `wp_sitemeta` if
 multisite. This is obviously a fuzzy example, and there are less obvious
 caveats (like what to do when usermeta keys do not match option keys,
 etc...) which can all be conditionally addressed as we poke holes in the
 idea.

 ----

 Here are a few settings that could be candidates, taken from their
 verbiage in various administration screens:

 General
 * Timezone
 * Date format
 * Time format
 * Start of week
 * Language

 Writing
 * Formatting
 * Default Post Category
 * Default Post Format

 Reading
 * Blog pages show at most
 * Syndication feeds show the most recent

 Discussion
 * Default article settings
 * Email me whenever
 * Avatar Display

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33542>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list