1

The post editor helpfully removes default arguments like columns="3" from the [gallery] shortcode. How do you tell it to remove a custom attribute that has a default value?

The answer at Enhance Media Manager for Gallery shows how to add a custom attribute to the Wordpress 4.0 media manager. That code extends the backbone stuff in wp-includes/js/media-views.js. The shortcode is actually constructed in wp-admin/js/gallery.js, a tinyMCE plugin.

It's not purely an aesthetic goal to remove the default attribute. It would also help my plugin leave behind less cruft in the posts.

  • The file to construct the shortcode doesn't seem to be used anymore, I can't see it loaded. Were you able to do this? – Nicola Peluchetti Dec 31 '15 at 14:51

Your Answer

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

Browse other questions tagged or ask your own question.