Make WordPress Core

Changeset 56488


Ignore:
Timestamp:
08/29/2023 03:33:43 PM (11 months ago)
Author:
swissspidy
Message:

Media: Prevent warning if [caption] shortcode is used without attributes.

Props maltfield, aslamdoctor.
Fixes #59206.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r56482 r56488  
    23622362 */
    23632363function img_caption_shortcode( $attr, $content = '' ) {
     2364    if ( ! $attr ) {
     2365        $attr = array();
     2366    }
     2367
    23642368    // New-style shortcode with the caption inside the shortcode with the link and image tags.
    23652369    if ( ! isset( $attr['caption'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.