[wp-trac] [WordPress Trac] #22841: New media uploader ignores option image_default_link_type

WordPress Trac noreply at wordpress.org
Fri Dec 28 20:22:55 UTC 2012


#22841: New media uploader ignores option image_default_link_type
--------------------------+--------------------
 Reporter:  Ipstenu       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.5.1
Component:  Media         |     Version:  3.5
 Severity:  major         |  Resolution:
 Keywords:                |
--------------------------+--------------------

Comment (by nacin):

 How 3.4 worked:

  * image_default_link_type defaults to 'file' in the database. It seems
 that the `urlbutton` user setting then incorrectly defaults to 'post',
 though that doesn't often come into play because there happens to be a
 default value in the DB here.

  * image_default_align defaults to `''` in the database, which is then
 converted to 'none', which is the `align` user setting default.

  * image_default_size defaults to `''` in the database, which is then
 converted to 'medium', which is the `imgsize` user setting default.
 Notably, if the size is missing from the database entirely, "medium" is
 used and then overrides the user setting.

 Neither 3.4 nor 3.5 is completely optimal. To make this behavior sane for
 3.5.1:

  * Look at image_default_link_type (which would pretty much always be
 'file') before looking at the urlbutton user setting, which should default
 to 'file' rather than 'post', and which would hardly ever be consulted
 anyway because of the image_default_link_type.

  * Look at image_default_align before looking at the `align` user setting.
 In practice, this means the user setting will be obeyed, unless someone
 puts a non-empty value into the option.

  * Look at image_default_size before looking at the `imgsize` user
 setting. If the size is missing from the database entirely, treat it as
 empty, thus allowing the user setting to hold, and not as 'medium', which
 does not. This means the user setting will be obeyed, unless someone puts
 a non-empty value into the option.

 All of this behavior needs to be triple-checked in 3.4, in 3.5, and then
 with this patch.

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


More information about the wp-trac mailing list