Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You shouldn’t edit core files, but in a way, you have to.

    The way the ‘post_gallery’ filter is used in the default gallery_shortcode function requires you to replace it’s functionality in entirety to alter any of the gallery output.

    You could copy the gallery_shortcode() code to your theme’s functions.php, renaming the function to something unique. Then hook the ‘post_gellery’ filter to point to your copied gallery function. Then edit the copied code to do what you want.

    You haven’t edited core files this way, but if the default function gets updated in the future, your version will not reflect any updates.

Viewing 1 replies (of 1 total)
  • The topic ‘Gallery Shortcode Modification’ is closed to new replies.