Modified wp.media.view.Settings.Gallery in Backbone JS, but editing doesn’t work

I’ve added to the normal WordPress gallery popup (when clicking “Add Media” in the WordPress editor), in order to allow my custom gallery type to be selected (which interacts with / uses the main WordPress gallery shortcode). I’m able to select my custom gallery types (I have two) or “Native” (which is the normal WordPress … Read more

Add custom fields to wp native gallery settings

i already searched for solution and found a lot of unsolved or obsolete topics. Custom wordpress gallery option | Custom field for default gallery However, I´d like to add some custom fields (checkboxes, cyclebuttons etc.) to add attributes to the gallery shortcut. Does anyone have some snippes? EDIT: Finally Ive found this https://wordpress.org/support/topic/how-to-add-fields-to-gallery-settings and its … Read more

How to manually fix the WordPress gallery code using PHP in functions.php?

It’s been talked many times that WordPress outputs some really bad code for the built-in gallery function. This is the core code responsible for the gallery output (in /wp-includes/media.php): function gallery_shortcode($attr) { global $post; static $instance = 0; $instance++; // Allow plugins/themes to override the default gallery template. $output = apply_filters(‘post_gallery’, ”, $attr); if ( … Read more

Split Content and Gallery

Is there a way to split up the post content and the gallery short code. I want to display the gallery outside my normal content no matter how or where it is placed. I can use this to get the shortcode itself: if(has_shortcode(get_the_content(), ‘gallery’)){ $pattern = get_shortcode_regex(); preg_match(“/$pattern/s”, get_the_content(), $matches); echo do_shortcode($matches[0]); } But this … Read more