[wp-trac] [WordPress Trac] #17863: HTML5 input type=number in admin settings

WordPress Trac wp-trac at lists.automattic.com
Sat Mar 17 18:23:36 UTC 2012


#17863: HTML5 input type=number in admin settings
--------------------------------+------------------------------
 Reporter:  niallkennedy        |       Owner:  georgestephanis
     Type:  task (blessed)      |      Status:  reopened
 Priority:  normal              |   Milestone:  3.4
Component:  Administration      |     Version:
 Severity:  normal              |  Resolution:
 Keywords:  needs-patch revert  |
--------------------------------+------------------------------

Comment (by azaozz):

 Replying to [comment:42 nacin]:
 > ... In fact we explicitly don't want it to be an absolute URL; see
 wp_upload_dir().

 Maybe we are reading that differently but in wp_upload_dir() we do:

 {{{
 if ( !$url = get_option( 'upload_url_path' ) ) {
   if ( empty($upload_path) || ( 'wp-content/uploads' == $upload_path ) ||
 ( $upload_path == $dir ) )
     $url = WP_CONTENT_URL . '/uploads';
   else
     $url = trailingslashit( $siteurl ) . $upload_path;
 }
 }}}

 which seems to expect `upload_url_path` to be an absolute url and if empty
 it sets it to an absolute url (WP_CONTENT_URL is the absolute url to wp-
 content).

 > In making the decisions in [20196] [20198] [20199] [20200] [20201]
 [20202] [20203] I simply consulted the code, both for sanitize_option()
 and whether any validation or resetting occurred in core code. In many
 cases, a field may be left blank or 0 and it is treated specially, such as
 with a fallback, or by turning off something (like paging, or comment
 moderation link counting). We need to be careful here.

 Agreed. It is more of a UX question if we should consider entering 0
 (zero) to be the same as leaving the field empty. Since that's the current
 behavior in many places perhaps it's better to leave it as is.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17863#comment:45>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list