2259 | | /** |
2260 | | * Filters the default gallery shortcode output. |
2261 | | * |
2262 | | * If the filtered output isn't empty, it will be used instead of generating |
2263 | | * the default gallery template. |
2264 | | * |
2265 | | * @since 2.5.0 |
2266 | | * @since 4.2.0 The `$instance` parameter was added. |
2267 | | * |
2268 | | * @see gallery_shortcode() |
2269 | | * |
2270 | | * @param string $output The gallery output. Default empty. |
2271 | | * @param array $attr Attributes of the gallery shortcode. |
2272 | | * @param int $instance Unique numeric ID of this gallery shortcode instance. |
2273 | | */ |
2274 | | $output = apply_filters( 'post_gallery', '', $attr, $instance ); |
2275 | | |
2276 | | if ( ! empty( $output ) ) { |
2277 | | return $output; |
2278 | | } |
2279 | | |
| 2278 | /** |
| 2279 | * Filters the shortcode attributes. |
| 2280 | * |
| 2281 | * @since 5.7.0 |
| 2282 | * |
| 2283 | * @see gallery_shortcode() |
| 2284 | * |
| 2285 | * @param array $atts Merged attributes of the gallery shortcode. |
| 2286 | * @param array $attr User attributes of the gallery shortcode. |
| 2287 | * @param int $instance Unique numeric ID of this gallery shortcode instance. |
| 2288 | */ |
| 2289 | $atts = apply_filters( 'post_gallery_attributes', $atts, $attr, $instance ); |
| 2290 | |
| 2291 | /** |
| 2292 | * Filters the default gallery shortcode output. |
| 2293 | * |
| 2294 | * If the filtered output isn't empty, it will be used instead of generating |
| 2295 | * the default gallery template. |
| 2296 | * |
| 2297 | * @since 2.5.0 |
| 2298 | * @since 4.2.0 The `$instance` parameter was added. |
| 2299 | * @since 5.7.0 The `$atts` parameter was added. |
| 2300 | * |
| 2301 | * @see gallery_shortcode() |
| 2302 | * |
| 2303 | * @param string $output The gallery output. Default empty. |
| 2304 | * @param array $attr User attributes of the gallery shortcode. |
| 2305 | * @param int $instance Unique numeric ID of this gallery shortcode instance. |
| 2306 | * @param array $atts Merged attributes of the gallery shortcode. |
| 2307 | */ |
| 2308 | $output = apply_filters( 'post_gallery', '', $attr, $instance, $atts ); |
| 2309 | |
| 2310 | if ( ! empty( $output ) ) { |
| 2311 | return $output; |
| 2312 | } |
| 2313 | |