<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[12616] trunk: Deprecate argument.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12616">12616</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-01-07 00:01:52 +0000 (Thu, 07 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Deprecate argument. Never fallback to options table for user option requests. Props nacin. fixes <a href="http://trac.wordpress.org/ticket/11615">#11615</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincategoriesphp">trunk/wp-admin/categories.php</a></li>
<li><a href="#trunkwpadmineditcommentsphp">trunk/wp-admin/edit-comments.php</a></li>
<li><a href="#trunkwpadmineditpagesphp">trunk/wp-admin/edit-pages.php</a></li>
<li><a href="#trunkwpadminedittagsphp">trunk/wp-admin/edit-tags.php</a></li>
<li><a href="#trunkwpadminincludespostphp">trunk/wp-admin/includes/post.php</a></li>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
<li><a href="#trunkwpadminpluginsphp">trunk/wp-admin/plugins.php</a></li>
<li><a href="#trunkwpadminuploadphp">trunk/wp-admin/upload.php</a></li>
<li><a href="#trunkwpincludesfunctionsphp">trunk/wp-includes/functions.php</a></li>
<li><a href="#trunkwpincludesuserphp">trunk/wp-includes/user.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincategoriesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/categories.php (12615 => 12616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/categories.php        2010-01-06 23:57:35 UTC (rev 12615)
+++ trunk/wp-admin/categories.php        2010-01-07 00:01:52 UTC (rev 12616)
</span><span class="lines">@@ -166,7 +166,7 @@
</span><span class="cx"> if ( empty($pagenum) )
</span><span class="cx">         $pagenum = 1;
</span><span class="cx">
</span><del>-$cats_per_page = (int) get_user_option( 'categories_per_page', 0, false );
</del><ins>+$cats_per_page = (int) get_user_option( 'categories_per_page' );
</ins><span class="cx"> if ( empty( $cats_per_page ) || $cats_per_page < 1 )
</span><span class="cx">         $cats_per_page = 20;
</span><span class="cx"> $cats_per_page = apply_filters( 'edit_categories_per_page', $cats_per_page );
</span></span></pre></div>
<a id="trunkwpadmineditcommentsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-comments.php (12615 => 12616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-comments.php        2010-01-06 23:57:35 UTC (rev 12615)
+++ trunk/wp-admin/edit-comments.php        2010-01-07 00:01:52 UTC (rev 12616)
</span><span class="lines">@@ -226,7 +226,7 @@
</span><span class="cx"> </p>
</span><span class="cx">
</span><span class="cx"> <?php
</span><del>-$comments_per_page = (int) get_user_option( 'edit_comments_per_page', 0, false );
</del><ins>+$comments_per_page = (int) get_user_option( 'edit_comments_per_page' );
</ins><span class="cx"> if ( empty( $comments_per_page ) || $comments_per_page < 1 )
</span><span class="cx">         $comments_per_page = 20;
</span><span class="cx"> $comments_per_page = apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
</span></span></pre></div>
<a id="trunkwpadmineditpagesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-pages.php (12615 => 12616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-pages.php        2010-01-06 23:57:35 UTC (rev 12615)
+++ trunk/wp-admin/edit-pages.php        2010-01-07 00:01:52 UTC (rev 12616)
</span><span class="lines">@@ -228,7 +228,7 @@
</span><span class="cx"> $pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
</span><span class="cx"> if ( empty($pagenum) )
</span><span class="cx">         $pagenum = 1;
</span><del>-$per_page = (int) get_user_option( 'edit_pages_per_page', 0, false );
</del><ins>+$per_page = (int) get_user_option( 'edit_pages_per_page' );
</ins><span class="cx"> if ( empty( $per_page ) || $per_page < 1 )
</span><span class="cx">         $per_page = 20;
</span><span class="cx"> $per_page = apply_filters( 'edit_pages_per_page', $per_page );
</span></span></pre></div>
<a id="trunkwpadminedittagsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-tags.php (12615 => 12616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-tags.php        2010-01-06 23:57:35 UTC (rev 12615)
+++ trunk/wp-admin/edit-tags.php        2010-01-07 00:01:52 UTC (rev 12616)
</span><span class="lines">@@ -194,7 +194,7 @@
</span><span class="cx"> if ( empty($pagenum) )
</span><span class="cx">         $pagenum = 1;
</span><span class="cx">
</span><del>-$tags_per_page = (int) get_user_option( 'edit_tags_per_page', 0, false );
</del><ins>+$tags_per_page = (int) get_user_option( 'edit_tags_per_page' );
</ins><span class="cx"> if ( empty($tags_per_page) || $tags_per_page < 1 )
</span><span class="cx">         $tags_per_page = 20;
</span><span class="cx"> $tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
</span></span></pre></div>
<a id="trunkwpadminincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/post.php (12615 => 12616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/post.php        2010-01-06 23:57:35 UTC (rev 12615)
+++ trunk/wp-admin/includes/post.php        2010-01-07 00:01:52 UTC (rev 12616)
</span><span class="lines">@@ -851,7 +851,7 @@
</span><span class="cx">                 $post_type_q = 'post_type=' . $q['post_type'];
</span><span class="cx">
</span><span class="cx">
</span><del>-        $posts_per_page = (int) get_user_option( 'edit_per_page', 0, false );
</del><ins>+        $posts_per_page = (int) get_user_option( 'edit_per_page' );
</ins><span class="cx">         if ( empty( $posts_per_page ) || $posts_per_page < 1 )
</span><span class="cx">                 $posts_per_page = 15;
</span><span class="cx">         $posts_per_page = apply_filters( 'edit_posts_per_page', $posts_per_page );
</span><span class="lines">@@ -909,7 +909,7 @@
</span><span class="cx">         $q['cat'] = isset( $q['cat'] ) ? (int) $q['cat'] : 0;
</span><span class="cx">         $q['post_type'] = 'attachment';
</span><span class="cx">         $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : 'inherit';
</span><del>-        $media_per_page = (int) get_user_option( 'upload_per_page', 0, false );
</del><ins>+        $media_per_page = (int) get_user_option( 'upload_per_page' );
</ins><span class="cx">         if ( empty( $media_per_page ) || $media_per_page < 1 )
</span><span class="cx">                 $media_per_page = 20;
</span><span class="cx">         $q['posts_per_page'] = apply_filters( 'upload_per_page', $media_per_page );
</span><span class="lines">@@ -939,7 +939,7 @@
</span><span class="cx">         if ( isset( $_GET['edit'] ) && $_GET['edit'] == $id )
</span><span class="cx">                 return '';
</span><span class="cx">         $current_user = wp_get_current_user();
</span><del>-        if ( $closed = get_user_option('closedpostboxes_'.$page, 0, false ) ) {
</del><ins>+        if ( $closed = get_user_option('closedpostboxes_'.$page ) ) {
</ins><span class="cx">                 if ( !is_array( $closed ) ) {
</span><span class="cx">                         return '';
</span><span class="cx">                 }
</span></span></pre></div>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (12615 => 12616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2010-01-06 23:57:35 UTC (rev 12615)
+++ trunk/wp-admin/includes/template.php        2010-01-07 00:01:52 UTC (rev 12616)
</span><span class="lines">@@ -983,7 +983,7 @@
</span><span class="cx"> */
</span><span class="cx"> function get_hidden_columns($page) {
</span><span class="cx">         $page = str_replace('.php', '', $page);
</span><del>-        return (array) get_user_option( 'manage-' . $page . '-columns-hidden', 0, false );
</del><ins>+        return (array) get_user_option( 'manage-' . $page . '-columns-hidden' );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -2987,7 +2987,7 @@
</span><span class="cx">         $i = 0;
</span><span class="cx">         do {
</span><span class="cx">                 // Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose
</span><del>-                if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page", 0, false ) ) {
</del><ins>+                if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) {
</ins><span class="cx">                         foreach ( $sorted as $box_context => $ids )
</span><span class="cx">                                 foreach ( explode(',', $ids) as $id )
</span><span class="cx">                                         if ( $id )
</span><span class="lines">@@ -3081,7 +3081,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> function get_hidden_meta_boxes($page) {
</span><del>-        $hidden = (array) get_user_option( "meta-box-hidden_$page", 0, false );
</del><ins>+        $hidden = (array) get_user_option( "meta-box-hidden_$page" );
</ins><span class="cx">
</span><span class="cx">         // Hide slug boxes by default
</span><span class="cx">         if ( empty($hidden[0]) ) {
</span><span class="lines">@@ -3737,7 +3737,7 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         $option = str_replace( '-', '_', "${screen}_per_page" );
</span><del>-        $per_page = (int) get_user_option( $option, 0, false );
</del><ins>+        $per_page = (int) get_user_option( $option );
</ins><span class="cx">         if ( empty( $per_page ) || $per_page < 1 ) {
</span><span class="cx">                 if ( 'plugins' == $screen )
</span><span class="cx">                         $per_page = 999;
</span></span></pre></div>
<a id="trunkwpadminpluginsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/plugins.php (12615 => 12616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/plugins.php        2010-01-06 23:57:35 UTC (rev 12615)
+++ trunk/wp-admin/plugins.php        2010-01-07 00:01:52 UTC (rev 12616)
</span><span class="lines">@@ -354,7 +354,7 @@
</span><span class="cx"> //Paging.
</span><span class="cx"> $total_this_page = "total_{$status}_plugins";
</span><span class="cx"> $total_this_page = $$total_this_page;
</span><del>-$plugins_per_page = (int) get_user_option( 'plugins_per_page', 0, false );
</del><ins>+$plugins_per_page = (int) get_user_option( 'plugins_per_page' );
</ins><span class="cx"> if ( empty( $plugins_per_page ) || $plugins_per_page < 1 )
</span><span class="cx">         $plugins_per_page = 999;
</span><span class="cx"> $plugins_per_page = apply_filters( 'plugins_per_page', $plugins_per_page );
</span></span></pre></div>
<a id="trunkwpadminuploadphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/upload.php (12615 => 12616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/upload.php        2010-01-06 23:57:35 UTC (rev 12615)
+++ trunk/wp-admin/upload.php        2010-01-07 00:01:52 UTC (rev 12616)
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx">
</span><span class="cx"> if ( isset($_GET['detached']) ) {
</span><span class="cx">
</span><del>-        $media_per_page = (int) get_user_option( 'upload_per_page', 0, false );
</del><ins>+        $media_per_page = (int) get_user_option( 'upload_per_page' );
</ins><span class="cx">         if ( empty($media_per_page) || $media_per_page < 1 )
</span><span class="cx">                 $media_per_page = 20;
</span><span class="cx">         $media_per_page = apply_filters( 'upload_per_page', $media_per_page );
</span></span></pre></div>
<a id="trunkwpincludesfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/functions.php (12615 => 12616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/functions.php        2010-01-06 23:57:35 UTC (rev 12615)
+++ trunk/wp-includes/functions.php        2010-01-07 00:01:52 UTC (rev 12616)
</span><span class="lines">@@ -770,7 +770,7 @@
</span><span class="cx">         if ( ! $user = wp_get_current_user() )
</span><span class="cx">                 return;
</span><span class="cx">
</span><del>-        $settings = get_user_option( 'user-settings', $user->ID, false );
</del><ins>+        $settings = get_user_option( 'user-settings', $user->ID );
</ins><span class="cx">
</span><span class="cx">         if ( isset( $_COOKIE['wp-settings-' . $user->ID] ) ) {
</span><span class="cx">                 $cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', $_COOKIE['wp-settings-' . $user->ID] );
</span><span class="lines">@@ -779,7 +779,7 @@
</span><span class="cx">                         if ( $cookie == $settings )
</span><span class="cx">                                 return;
</span><span class="cx">
</span><del>-                        $last_time = (int) get_user_option( 'user-settings-time', $user->ID, false );
</del><ins>+                        $last_time = (int) get_user_option( 'user-settings-time', $user->ID );
</ins><span class="cx">                         $saved = isset( $_COOKIE['wp-settings-time-' . $user->ID]) ? preg_replace( '/[^0-9]/', '', $_COOKIE['wp-settings-time-' . $user->ID] ) : 0;
</span><span class="cx">
</span><span class="cx">                         if ( $saved > $last_time ) {
</span></span></pre></div>
<a id="trunkwpincludesuserphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/user.php (12615 => 12616)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/user.php        2010-01-06 23:57:35 UTC (rev 12615)
+++ trunk/wp-includes/user.php        2010-01-07 00:01:52 UTC (rev 12616)
</span><span class="lines">@@ -214,12 +214,15 @@
</span><span class="cx"> *
</span><span class="cx"> * @param string $option User option name.
</span><span class="cx"> * @param int $user Optional. User ID.
</span><del>- * @param bool $check_blog_options Whether to check for an option in the options table if a per-user option does not exist. Default is true.
</del><ins>+ * @param bool $deprecated Use get_option() to check for an option in the options table.
</ins><span class="cx"> * @return mixed
</span><span class="cx"> */
</span><del>-function get_user_option( $option, $user = 0, $check_blog_options = true ) {
</del><ins>+function get_user_option( $option, $user = 0, $deprecated = '' ) {
</ins><span class="cx">         global $wpdb;
</span><span class="cx">
</span><ins>+        if ( !empty( $deprecated ) )
+                _deprecated_argument( __FUNCTION__, '3.0' );
+
</ins><span class="cx">         $option = preg_replace('|[^a-z0-9_]|i', '', $option);
</span><span class="cx">         if ( empty($user) )
</span><span class="cx">                 $user = wp_get_current_user();
</span><span class="lines">@@ -230,8 +233,6 @@
</span><span class="cx">                 $result = $user->{$wpdb->prefix . $option};
</span><span class="cx">         elseif ( isset( $user->{$option} ) ) // User specific and cross-blog
</span><span class="cx">                 $result = $user->{$option};
</span><del>-        elseif ( $check_blog_options ) // Blog global
-                $result = get_option( $option );
</del><span class="cx">         else
</span><span class="cx">                 $result = false;
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>