You can hijack the shortcode handler and set the attribute to a value of your choice. Then call the native callback for this shortcode.
add_shortcode( 'gallery', 'file_gallery_shortcode' );
function file_gallery_shortcode( $atts )
{
$atts['link'] = 'file';
return gallery_shortcode( $atts );
}
Related Posts:
- Remove width and height attributes from [gallery] output
- Replace custom gallery shortcode with default gallery shortcode
- Remove width and height attributes from [gallery] output
- Conditionally Loading JavaScript/CSS for Shortcodes
- Pass boolean value in shortcode
- Check if post/page has gallery?
- Escaping quotes from shortcode attributes
- how to have the gallery shortcode output one single UL list instead of several DL?
- Allowing for multiple template views on the Gallery Settings page when using the Visual Editor
- How to add ‘class’ attribute into shortcode [audio]?
- Customizing gallery shortcode in 3.5
- How to handle valueless attributes in shortcodes?
- Get multiple shortcode attribute values
- wpautop() when shortcode attributes are on new lines break args array
- How do i link gallery thumbnails to different url’s using the wp native gallery?
- WordPress gallery ‘post_gallery’ filter doesn’t work with feeds?
- conditional shortcode not working
- Add attribute to existing Shortcode
- Gallery shortcode menu order fix no longer working on WordPress 4.0
- conditional shortcode not working
- Some doubts about gallery shortcode in WordPress
- Shortcode displays only default attribute values
- Extending Shortcode attributes
- Remove HTML content if attribute is not set / variable attributes
- Global, network-wide shortcodes or text replace functions
- getting values from a shortcode with an include
- Should I cache default WordPress gallery shortcode output?
- Numbering Image List in Gallery
- Rewriting WordPress Gallery Shortcode with Bootstrap Carousel
- change wordpress gallery shortcode to slider
- Why are Shortcodes Disabled in Widgets by Default?
- Add attribute to shortcode dynamically
- Remove hyperlink on gallery shortcode
- Add custom setting that uses radio button to WP Gallery
- Replace / Remove Shortcode after 1st run / post
- WordPress Gallery shortcode: Display one category ID only
- How to get gallery id inserted to a post?
- Check if post has gallery images/media
- Caption shortcodes not including caption as attribute
- Gallery IDS and Captions: hide/show on a per ID basis
- How to Modify WordPress Default Image Gallery Shortcode
- Change WordPress Shortcode added in to post
- Gallery shortcode – change link file image size? (not using default fullsize image)
- add action only if gallery shortcode attribute is equal to?
- Unable to the get the gallery inserted between shortcodes
- Conditionally Loading JavaScript/CSS for Shortcodes
- Adding shortcode field to edit gallery / Gallery Settings
- How to change the output of gallery shortcode
- Replacement for gallery_shortcode function not taking all attributes
- Check if CTP category taxonomy is set in shortcode
- Passing variable in nested shortcodes
- How to use a nested shortcode to render the value of an attribute in parent shortcode
- Which wordpress function is the caption shortcode linked to?
- How to Retrieve data of Gallery Shortcode and display it above a post
- How to copy [gallery] shortcode between posts using polylang [closed]
- Which file renders the “Edit Gallery” Settings page?
- How to display NextGEN gallery in templates?
- Use full size images in a specific gallery
- How to Enable embedding WordPress default gallery in comments?
- How to add new images to existing shortcode configuration?
- Gallery shortcode is empty but magically creates a gallery
- Can we add a single caption to the gallery shortcode?
- How to process a single attribute in a SQL request twice times?
- shortcode atts not working
- Second attribute of shortcode is not changing why?
- Automatically add class-attribute to gallery?
- Shortcode Attribute contains clone of all shortcode attributes
- WordPress Gallery with ID’s Shortcode not Working
- How can I define the output of shortcode attribute value?
- Changing layout of defaul gallery output to masonry
- What makes a placeholder resizable in Tinymce?
- how to show last 5 images from the one post gallery
- Gallery Shortcode: using size=”full” doesn’t call the actual thumbnail image size
- Shortcode always displaying at the top of the page
- short code output too early
- Using audio shortcode for .mp3 URLs with a query string
- has_shortcode for content added after the content
- Creating a Slider Shortcode Based on Nivo Slider
- Why isn’t this youtube shortcode working?
- Gist shortcode is not working
- How to set Contact Form 7 fields default value using shortcode attribute? [closed]
- Display post metadata: “title, category, author, date” with shortcode
- How can I escape a section of my page which contains multiple shortcodes?
- Redirect to another page using contact form 7? [closed]
- Function result goes outside div
- Displaying shortcode in footer
- Use another action instead of the shortcode API to display the last time a user logged in
- contact form 7 database short codes [closed]
- Adding Author URL to Nav Menu via Shortcode
- Displaying an interactive web map on my wordpress site
- May an attribute have no value?
- SQL query to bulk change short code in all posts
- Display shortcode in text field with wordpress settings api
- shortcode display metainformation as linked image
- How To Show Shortcodes In WordPress Custom Fields?
- WordPress plugin shortcodes not outputting anything
- Inserting shortcode is blanking excerpt – any ideas?
- Previous/Next with the same category
- I’ve broken the short code for Contact Form 7!
- wordpress how to sort posts on custom data with plug-in “Search & Filter”