[wp-trac] [WordPress Trac] #35101: image_default_link_type option not being respected

WordPress Trac noreply at wordpress.org
Thu Dec 31 06:25:35 UTC 2015


#35101: image_default_link_type option not being respected
-------------------------------------------+-----------------------
 Reporter:  ben1390                        |       Owner:  azaozz
     Type:  defect (bug)                   |      Status:  assigned
 Priority:  normal                         |   Milestone:  4.4.1
Component:  Media                          |     Version:  4.4
 Severity:  normal                         |  Resolution:
 Keywords:  has-patch needs-testing close  |     Focuses:
-------------------------------------------+-----------------------
Changes (by azaozz):

 * keywords:  has-patch needs-testing => has-patch needs-testing close


Comment:

 There is some "history" about these options going a long way back. Before
 2.6 the options were shown on the Settings => Media screen. Then
 getUserSetting() was added to keep the last selected value, then in 2.7
 the options were removed from the settings screen.

 At the time it was decided to still honor these options and override the
 last used value mostly as back-compat. Since then I've seen questions and
 confusion why some of the image insert settings keep their last used
 values and some do not.

 Think we should keep the current behaviour to (finally) remove that
 confusion. For users that prefer to always reset the image insert options,
 they can be set with setUserSetting():

 {{{
 add_action( 'admin_head-post.php', '_my_reset_image_insert_settings' );
 add_action( 'admin_head-post-new.php', '_my_reset_image_insert_settings'
 );
 function _my_reset_image_insert_settings() {
   ?>
     <script>
       if ( typeof setUserSetting !== 'undefined' ) {
         setUserSetting( 'align', 'none' ); // none || left || center ||
 right
         setUserSetting( 'imgsize', 'medium' ); // thumbnail || medium ||
 large || full
         setUserSetting( 'urlbutton', 'none' ); // none || file || post
       }
     </script>
   <?php
 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35101#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list