Changeset 51816
- Timestamp:
- 09/15/2021 07:05:20 PM (21 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r51230 r51816 2086 2086 * @since 3.9.0 The `class` attribute was added. 2087 2087 * @since 5.1.0 The `caption_id` attribute was added. 2088 * @since 5.9.0 The `$content` parameter default value changed from `null` to `''`. 2088 2089 * 2089 2090 * @param array $attr { … … 2098 2099 * @type string $class Additional class name(s) added to the caption container. 2099 2100 * } 2100 * @param string $content Shortcode content.2101 * @param string $content Optional. Shortcode content. Default empty string. 2101 2102 * @return string HTML content to display the caption. 2102 2103 */ 2103 function img_caption_shortcode( $attr, $content = null) {2104 function img_caption_shortcode( $attr, $content = '' ) { 2104 2105 // New-style shortcode with the caption inside the shortcode with the link and image tags. 2105 2106 if ( ! isset( $attr['caption'] ) ) { -
trunk/tests/phpunit/tests/media.php
r51587 r51816 85 85 function test_img_caption_shortcode_with_empty_params() { 86 86 $result = img_caption_shortcode( array() ); 87 $this->assert Null($result );87 $this->assertSame( '', $result ); 88 88 } 89 89 … … 135 135 ) 136 136 ); 137 $this->assert Null($result );137 $this->assertSame( '', $result ); 138 138 } 139 139
Note: See TracChangeset
for help on using the changeset viewer.