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

WordPress Trac noreply at wordpress.org
Thu Jan 7 17:35:15 UTC 2016


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

Comment (by chrisborgman):

 Replying to [comment:18 wetapplemedia]:
 > Hmmm... I have placed the snippet code directly after my original
 image_default_ settings code in my functions.php file, but for some reason
 it only works the same way as my original code. It doesn't seem to
 override the "last setting used" as default. Is there a specific spot you
 place it? (maybe before or after something else?)


 Why are you using original image_default_settings code?  For me, that used
 to work but after updates it no longer does anything, from what I can
 tell.  The last snippet posted is working for my purposes; every time the
 user wants to embed an image they always get the settings I've chosen.  I
 do this mostly because some lightboxes don't work well with single images.

 Just use this (make appropriate changes for your needs) and see how it
 works out for you.


 {{{
 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:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list