Media Manager once again.
This time I’m looking for a simple hack/hook/filter to change default “Attachment Display Settings” from media manager. The option is “Link To” that is default set to “Media File” and I would like to force it for all users to be default set to “none”.
If there is no way to do it with hook/filter (media-template.php lines 282 – 306) – is there a way to attach jQuery file to Media Manager and use it to force change option after Media Manager is loaded?
You can do what you want by overriding appropriate Backbone view, which is responsible for rendering attachments display settings form.
plugin.php
media.js
I know this is an old question, but I believe this answer is better suited now, as WordPress does now allow you to hook into this.
The default image size, align and “link to” properties for inserting an image are set through the options
image_default_size
,image_default_link_type
andimage_default_align
, respectively. You can change this beahviour in a couple of ways:/wp-admin/options.php
update_option( 'default_image_link_type', 'none' )
pre_option_[option]
filterYou can hook into the
pre_option_[option]
filter like this: