IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
|
| 875 | 875 | $caption_width = apply_filters( 'img_caption_shortcode_width', $caption_width, $atts, $content ); |
| 876 | 876 | |
| 877 | 877 | $style = ''; |
| 878 | | if ( $caption_width ) |
| 879 | | $style = 'style="width: ' . (int) $caption_width . 'px" '; |
| | 878 | if ( $caption_width ) { |
| | 879 | $margin = ''; |
| | 880 | $caption_width_unit = 'px'; |
| | 881 | if ( '%' == substr( $caption_width, - 1 ) ) { |
| | 882 | $caption_width = (int) substr( $caption_width, 0, - 1 ); |
| | 883 | $caption_width_unit = '%'; |
| | 884 | // for widths less than 100% we need to add a right margin of 10 pixels |
| | 885 | // to prevent post content from running up against a floated image |
| | 886 | if ( $caption_width < 100 ) { |
| | 887 | $margin = ' margin-right: 10px;'; |
| | 888 | } |
| | 889 | } |
| | 890 | $style = 'style="width: ' . (int) $caption_width . $caption_width_unit . ';' . $margin . '" '; |
| | 891 | } |
| 880 | 892 | |
| 881 | 893 | return '<div ' . $atts['id'] . $style . 'class="' . esc_attr( $class ) . '">' |
| 882 | 894 | . do_shortcode( $content ) . '<p class="wp-caption-text">' . $atts['caption'] . '</p></div>'; |