I think you’re looking for the img_caption_shortcode_width
filter, within the img_caption_shortcode()
:
/**
* Filters the width of an image's caption.
*
* By default, the caption is 10 pixels greater than the width of the image,
* to prevent post content from running up against a floated image.
*
* @since 3.7.0
*
* @see img_caption_shortcode()
*
* @param int $width Width of the caption in pixels. To remove this inline style,
* return zero.
* @param array $atts Attributes of the caption shortcode.
* @param string $content The image element, possibly wrapped in a hyperlink.
*/
$caption_width = apply_filters( 'img_caption_shortcode_width', $width, $atts, $content );
So it looks like this should disable the inline style:
add_filter( 'img_caption_shortcode_width', '__return_zero' );
Related Posts:
- How to load scripts/styles specific for a page
- remove links from images using functions.php
- functions.php inject inline css
- How do I create a new WP admin color scheme?
- How to add classes to images based on their categories?
- Logout/login redirect CSS issue
- Add attribute to link tag that’s generated through wp_register_style?
- Auto delete WordPress images/thumbnails (all sizes) and featured after X days/hours, or similar?
- TinyMCE custom stylesheets for different post types
- Remove “says” from comments
- Simple/basic use of get_current_screen
- How to add a rel attribute to images that contains their categories?
- Is it possible to be more page/post specific with admin_enqueue_script?
- Child Theme Not Overriding Parent Theme
- CSS stylesheet not loading
- Enqueue styles after a plugin
- What is the “icon” parameter in wp_get_attachment_image_src used for?
- Find first image on paginated post for Pinterest
- Add class or ID to any WordPress function
- Register and enqueue style.css custom theme
- Multiple CSS body classes to specific page I.D.’s – is this possible?
- How do I permanently Disable Attachment Post URL
- Can’t check if a post has thumbnail adding filter to get_post_metadata()
- Enqueue Style Only On Certain Pages Not Working
- Why does the ‘wp_nav_menu’ function work only until a menu is created?
- Child Theme files – what is needed?
- How do I add Bootstrap and LESS to my migrated WordPress site?
- How to Display Frontend CSS for Administrator only
- Display images that are not in the content
- WordPress Menuing Question :focus
- change the url paths in the stylesheet dynamically
- Can’t filter wp_get_attachment_link
- Change CSS for logged in users
- Get ID of first image attached to a post
- Custom styles.css sheet for visual editor
- Is my code correct to enqueue CSS on a specific page?
- header_image() with CSS
- Not all CSS elements transferring via parent to child?
- Split Media Queries in different files!
- Some questions about how proper add 2 CSS file in a WordPress theme?
- How to hide image-url if no attachment?
- problem loading stylesheets to wp_head dynamically
- attachment page template? only show attachments for current post?
- How to get an attachment id from a filename
- What are the meta fields for an attachment?
- How to insert class in each list of categories?
- Parent theme styles overriding child theme CSS [closed]
- I can’t add CSS with functions.php
- Theme JS is available but theme CSS isn’t
- Proper Way to Load stylesheet on Condition
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- Default Nav Highlight
- Custom styles in Tiny MCE with an external CSS file
- why can’t i add front.css to my frontpage.php
- get_template_directory_uri() links to child theme not parent
- Remove attachment page for audio media type only
- Get Attachment Category Name
- remove/hide wp-editor
- Getting out side of wp root folder from function.php using absolute path
- current_page_item is missing inside wp_nav_menu
- How d0 i get the number of attachments in the post
- Different image using srcset function
- Advanced method to control cache of enqueued style/script
- Auto delete content in specific folder inside media library
- WP_Query for Attachments not working as expected
- Combine page types and Custom Taxonomy in a functions.php command
- Can’t load assets
- How to update an image attachment’s alt text from a custom field when saving a post?
- How to reference different css (bootstrap) stylesheets for the header and body of a page?
- Can we have conditional CSS styling?
- CSS style and app.js not loading
- Post content overflows on my mobile phone
- Remove clickable Link of WordPress Site Logo from Woocommerce Single Product page
- How do I make a custom “Read More Blogs” button for my blog page
- function class doesnt work
- Setting Up Child Theme To Take Priority
- how to remove a tag in the_category function
- Reference multiple style sheets, clearing styles for permalink page, custom fields for css
- CSS disabled after getting rid of emoji
- How to add styles in existing function?
- Woocommerce – Switching Price for Category
- Remove all video attachment, both files and post/postmeta from database?
- Adding a class to the body of an inactive site using multisite
- How do I dequeue a Stylesheet, stored in an ‘Assets’ folder?
- Child Theme not loading multiple stylesheets
- Correct way of Enqueue self hosted fonts in sass project
- Help with is_page() and calling css for specific pages in a Child Theme
- Child theme style.css didn’t work properly but the Customize Additional CSS did [closed]
- How to automatically add custom classes to headings in content area
- Preventing PHP Execution in Parent Theme
- Open image size links in a page instead of direct image link
- Functions.php in child theme that loads CSS file breaks website
- Set thumbnail from URL, by grabbing image in functions.php
- Syling Custom Fields echo’s from from functions.php
- functions.php / replacing div’s with new ones?
- Should I use `get_stylesheet_uri()` or `get_template_directory_uri()` when calling my CSS Stylesheet?
- How can I append and prepend something to all post hyperlinks without using ::before or ::after? PHP hook solution?
- Why don’t ‘wp_nav_menu’ CSS classes work until a menu is created?
- wp_head not injecting css
- Disable Attachment Page Except for Category