Ticket #24270: 24270.4.diff
| File 24270.4.diff, 1.9 KB (added by , 13 years ago) |
|---|
-
wp-includes/media.php
2060 2060 * @since 3.6.0 2061 2061 * 2062 2062 * @param string $content A string which might contain image data. 2063 * @param boolean $html Whether to return HTML or URLs 2063 * @param boolean $html Whether to return HTML or URLs in the array 2064 2064 * @param int $limit Optional. The number of image srcs to return 2065 2065 * @return array The found images or srcs 2066 2066 */ … … 2145 2145 * @since 3.6.0 2146 2146 * 2147 2147 * @param string $content A string which might contain image data. 2148 * @param boolean $html Whether to return HTML or data 2148 * @param boolean $html Whether to return HTML or data in the array 2149 2149 * @param int $limit Optional. The number of galleries to return 2150 2150 * @return array A list of galleries, which in turn are a list of their srcs in order 2151 2151 */ … … 2188 2188 * @since 3.6.0 2189 2189 * 2190 2190 * @param int $post_id Optional. Post ID. 2191 * @param boolean $html Whether to return HTML or data 2191 * @param boolean $html Whether to return HTML or data in the array 2192 2192 * @return array A list of arrays, each containing gallery data and srcs parsed 2193 2193 * from the expanded shortcode 2194 2194 */ … … 2229 2229 * 2230 2230 * @param int $post_id Optional. Post ID. 2231 2231 * @param boolean $html Whether to return HTML or data 2232 * @return array Gallery data and srcs parsed from the expanded shortcode2232 * @return string|array Gallery data and srcs parsed from the expanded shortcode 2233 2233 */ 2234 2234 function get_post_gallery( $post_id = 0, $html = true ) { 2235 2235 if ( ! $post = get_post( $post_id ) ) 2236 return array();2236 return $html ? '' : array(); 2237 2237 2238 2238 if ( ! has_shortcode( $post->post_content, 'gallery' ) ) 2239 return array();2239 return $html ? '' : array(); 2240 2240 2241 2241 $data = get_content_galleries( $post->post_content, $html, false, 1 ); 2242 2242 return reset( $data );