0

I need to change the values and hide some of the default media manager Attachment Display settings. Like setting the "Link to" to none, and hiding it so that the registered user can't change it. It would also be nice if I could delete the "size" option "original size from the dropdown.

I googled a bit and it seems to be very tricky to make changes to the new media manager, therefore I found no solution so far.. I hope you can help me with some insights.

Thank you!

0

I got the solution. I used the following script: Wordpress Media Manager 3.5 - default link to

and altered it to my needs with this modification:

(function() {
var _AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay;
wp.media.view.Settings.AttachmentDisplay = _AttachmentDisplay.extend({
    render: function() {
        _AttachmentDisplay.prototype.render.apply(this, arguments);
        this.$el.find('select.link-to').val('none');
        this.model.set('link', 'none');
        this.updateLinkTo();
        this.$el.find('select.link-to').parent('label').hide();

        this.$el.find('select.size option[value=full]').hide();
        this.model.set('size', 'medium');
        this.updateLinkTo();

    }
});
})();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.