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

WordPress Trac noreply at wordpress.org
Thu Jan 7 18:19:57 UTC 2016


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

 * status:  closed => reopened
 * resolution:  worksforme =>


Comment:

 Replying to [comment:19 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
 > }
 > }}}

 I removed my old code and added the new code... and it still doesn't work.
 I restarted the server and cleared all caches, and can even see the new
 code in the source of the edit-post page.

 When you say "This snippet is working perfectly, thank you!!!" what
 exactly do you mean? Is it defaulting to your snippet settings for every
 image import no matter what the last one was set to? Mine is not.

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


More information about the wp-trac mailing list