overwrite wordpress gallery with custom gallery shortcode


I want to overwrite the default WordPress gallery shortcode with a custom one. This because I need to add a field that will contain an url for each image I want to add inside a gallery. I’m not sure how to proceed, but for now I wrote this prototype of the code I want to use for the shortcode, I’m not sure how to proceed for the custom link field. Also I need to understand how to open the media library modal to multiselect the images and add to the shortcode id param, the various ids of the images and their relative links. Any suggestion or help will be appreciated.

function custom_gallery( $atts ){
  extract(shortcode_atts('id' => '','links' => '')); 
  // here I need to implement code for link and image selection
add_shortcode( 'gallery', 'custom_gallery');

, , , , sialfa 4 years 2019-11-03T07:22:04-05:00 0 Answers 86 views 0

Leave an answer