The shortcode is parsed by
gallery_shortcode()
, which calls wp_get_attachment_link()
, which in turns calls wp_get_attachment_image()
. This latter function writes the <img>
tag with the title
attribute. You’re lucky, because the attributes are filtered through wp_get_attachment_image_attributes
, so you can hook into that and remove the title
.
To do this, you attach the hook before you call the shortcode and remove it after you did this. You can either do this in your template if it’s a one-off, or, if you are more advanced, you “hijack” the shortcode with your own function that adds the hook, calls the original
gallery_shortcode()
function, and removes the hook.
Related Posts:
- add_filter and changing output captions of image gallery
- Using variable from one filter in another filter
- Change default settings used by gallery shortcode
- Ajax, filters and shortcodes
- How to filter ‘post_gallery’ after all other filters/plugins etc
- WP Filter to change the URL of an Anchor wrapping the last gallery image
- Add Lightbox To WordPress Native Gallery
- add img class to native wordpress galleries
- How to display the content HTML of a page without displaying the gallery code as well
- Is it possible to override the default Gallery Settings form?
- get_post() containing gallery is outputting an unmatched closing div at the end of the content
- Get_template_part inside filter?
- custom gallery filter with image caption as link title?
- Gallery stripped from excerpt of post
- Hooked into wp_get_attachment_caption to add content to the default description; not working for jetpack slideshow. Why?
- Add Index to Item in WordPress Gallery
- How to stop echoing gallery inside content?
- Changing WooCommerce Display Price Based on User Role & Category [closed]
- Not able to change wp_title using add_filter
- How to hook a filter to catch get_post_meta when alternate a custom field output?
- Changing JPEG compression depending on image size
- Advanced Custom Fields and Yoast SEO keyword analysis [closed]
- Insert Custom HTML After Shortcode
- Is there a way to add another row to the tinyMCE kitchen sink toggle?
- What do add_filters() and apply_filter() do?
- add_filter to youtube embeds?
- SSL certificate for the host could not be verified
- Store source permalink on XMLRPC calls
- What to use instead of the content_save_pre filter?
- How to limit the pages displayed for choosing parent page on page attribute’s menu?
- How can I customize the wp_list_categories
- How can I reliably and globally disable wptexturize?
- Customise Jetpack Publicize text
- Can’t change a label in woocommerce with the normal filter
- WordPress RSS feed – filter RSS content by custom field value
- What is the filter hook for custom fields content?
- Filter keywords from search query
- Add class to woocommerce checkout body based on filter [closed]
- Add classname to the_category() function?
- Filter the URL of next_posts_link & previous_posts_link
- Explanation for remove_filter used in the below code [closed]
- How to change the blog title with add_filter? details below
- How To Get User Data in Callback Function for pre_user_nicename?
- What’s the best way to split admin-only functionality in the theme’s functions.php file?
- Gutenberg disable the “block” tab in right sidebar
- remove_action in plugin file
- How to apply filter at search of woocommerce products?
- Variables in post title
- Filtering post-formats from the loop using new WP-Query();
- How to edit dashboard search posts button texts for my CPT?
- How to add a filter to get_the_author_meta?
- When does a function assigned to the content_filtered_edit_pre filter hook fire?
- Capture post content before page renders
- How can I remove the kses filters when saving a specific post type ? (it breaks my JSON)
- What different ways can a plugin add a filter to a WordPress site?
- Make an array filterable per hook
- How to pass variables to custom filter from multiple functions
- the_content filter together with require_once returns 1 instead of the content of the included file
- Missing Argument 2 for apply_filter
- Filter an array with a callback – for single & multidimensional arrays
- Detect when gutenberg editor title is available in Dom after editor load
- How to apply a filter to an ACF wysiwig editor field output?
- Are href attributes of a elements filtered on output to add the current path?
- Is it possible to bind a function to a filter hook via Ajax?
- Add a filter to an action [closed]
- Why template_include filter does not work with WPML plugin?
- Hide Posts In Back-end/Admin Based On User’s (Pseudo) Privileges Controlled by ACF
- Filter Pages by Custom Field (ACF) in admin area
- Most performant/functional way to add actions/filters?
- Remove tags without a specific meta key from “choose from the most used tags”
- Which Filter Do I Use To Modify The Subject Of The Retrieve Password Notification Email?
- Making an add_filter() call from within an add_filter() call
- automatic title through filter
- Finding actual functions added to hooks and filters
- Buddypress Filter Multiple Activities [closed]
- How to apply filter on get_the_post_thumbnail()
- How do I check if I can use the allowed_block_types filter?
- Setting the page title in a plugin, but not outside my plugin
- oembed_dataparse filter not running at all for standard YouTube embed
- Action for opening attachment or manipulating all attachment links
- How to generate customized filtered output for the gallery
- Filter wp_mail based on content type
- Remove the post_content search from WHERE clause (and CONCAT sql function)
- mu-plugins body_class filter not working
- How to apply a filter to everything?
- WP Job Manager – display search results from custom search form in taxonomy-job_listing_category page
- Conditionally (cpt) filter previous and next_post_link
- Post filter Month dropdown at front-end like wordpress backend
- shortcode function outputs multiple anchor tags
- changing size image within the content
- WP Dashboard -> Posts-> Filter by Category -> Form Method Change : Which Hook
- Show child theme for users on specific IP
- wp.getPosts with status = ‘trash’ using node.js
- Is there a way to overwrite a filter used in canonical.php?
- How do I remove certain HTML elements with specific classes from the feed?
- Adding an orderby filter, casting postmeta with multiple keys
- How can I display wp_link_pages before a shortcode, if it is used, or display after content?
- confusion with add_filter
- post->post_content filter
- How to change this WP logo and posts url in block editor?