• Hi,

    I just need to change the default checked state for this checkbox from “unchecked” to “checked” in the WordPress code, so that all images I upload, by default, will have the box checked in its advanced “edit” options.

    There are plenty of plugin options to force EVERY link and image to be forced open in a new window, but for some, I don’t want that. I still want to maintain control over whether or not a particular image doesn’t open in a new window, for example.

    I just need to know where WordPress stores the state for that boolean.

    I understand that since this code is in the wp-admin folder (most likely, just guessing) that I will need to change it again every time I do an update to WP. That doesn’t bother me.

Viewing 3 replies - 1 through 3 (of 3 total)
  • There isn’t a binary or Boolean for how an image opens. Alter your theme by way of child theme to make an image behave the way you want.
    You should never alter core files.

    Thread Starter heiseheise

    (@heiseheise)

    Thank you for replying, unfinishedcode. So you’re saying that the code to change the default status of the checkbox in this image below from “unchecked by default when a new image is added into a post” to “checked by default” is not in the core files, but instead in themes?

    Because wordpress is open source, I assumed there must be a way to change every single thing – for better or for worse. I started using wordpress 13 years ago and have been looking for a simple, GUI based option for this with every update, and have never found one.

    To me, this seems like it should be simple to change, not even worth a plugin, since all I’m doing is changing a true to a false, or a 1 to a 0. I just need to figure out where this parameter is stored.

    Thank you again for any insights you can provide.

    Image

    • This reply was modified 7 years, 2 months ago by heiseheise.

    It’s not part of themes, it’s in WordPress core, but there isn’t a 0 or 1 to change, because it’s not a binary option when inserting the image. When the image is inserted HTML is generated for the image link, but since at that stage there is no option for adding ‘target=”_blank”‘ the code doesn’t have a ‘switch’ adding it that you could change. You would need to modify wp-includes/js/media-editor.js to include that attribute, but you should never be editing WordPress core and there’s no filters for changing this behaviour.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Where is the binary option stored for “Open images in new window” checkbox’ is closed to new replies.