Make WordPress Core


Ignore:
Timestamp:
10/17/2023 04:06:01 PM (14 months ago)
Author:
hellofromTonya
Message:

Editor: Bugfixes npm packages updates for 6.4 RC1.

Updates for needed bugfixes in RC1:

Follow-up to [56849], [56818], [56816].

Props artemiosans, jameskoster, SantosGuillamot, aristath, czapla, joen, afercia, richtabor, peterwilsoncc, andraganescu, hellofromTonya, siobhyb.
See #59411.

File:
1 edited

Legend:

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

    r56945 r56961  
    219219    );
    220220    $w->next_tag( 'img' );
    221     $w->set_attribute( 'data-wp-init', 'effects.core.image.setCurrentSrc' );
     221    $w->set_attribute( 'data-wp-init', 'effects.core.image.initOriginImage' );
    222222    $w->set_attribute( 'data-wp-on--load', 'actions.core.image.handleLoad' );
    223223    $w->set_attribute( 'data-wp-effect', 'effects.core.image.setButtonStyles' );
     224    // We need to set an event callback on the `img` specifically
     225    // because the `figure` element can also contain a caption, and
     226    // we don't want to trigger the lightbox when the caption is clicked.
     227    $w->set_attribute( 'data-wp-on--click', 'actions.core.image.showLightbox' );
    224228    $w->set_attribute( 'data-wp-effect--setStylesOnResize', 'effects.core.image.setStylesOnResize' );
    225229    $body_content = $w->get_updated_html();
    226230
    227     // Wrap the image in the body content with a button.
     231    // Add a button alongside image in the body content.
    228232    $img = null;
    229233    preg_match( '/<img[^>]+>/', $body_content, $img );
     
    236240            aria-label="' . esc_attr( $aria_label ) . '"
    237241            data-wp-on--click="actions.core.image.showLightbox"
    238             data-wp-style--width="context.core.image.imageButtonWidth"
    239             data-wp-style--height="context.core.image.imageButtonHeight"
    240             data-wp-style--left="context.core.image.imageButtonLeft"
     242            data-wp-style--right="context.core.image.imageButtonRight"
    241243            data-wp-style--top="context.core.image.imageButtonTop"
    242         ></button>';
     244            style="background: #000"
     245        >
     246            <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
     247                <path d="M9 5H5V9" stroke="#FFFFFF" stroke-width="1.5"/>
     248                <path d="M15 19L19 19L19 15" stroke="#FFFFFF" stroke-width="1.5"/>
     249                <path d="M15 5H19V9" stroke="#FFFFFF" stroke-width="1.5"/>
     250                <path d="M9 19L5 19L5 15" stroke="#FFFFFF" stroke-width="1.5"/>
     251            </svg>
     252        </button>';
    243253
    244254    $body_content = preg_replace( '/<img[^>]+>/', $button, $body_content );
Note: See TracChangeset for help on using the changeset viewer.