mirror of
git://develop.git.wordpress.org/
synced 2025-01-17 04:48:25 +01:00
Update npm packages to latest versions for 6.4 beta 3.
The npm packages needed a further update for beta 3 in preparation for 6.4. Props @richtabor, @mmaattiiaass, @tellthemachines, @mamaduka, @swissspidy, @scruffian, @andraganescu, @andrewserong, @mujuonly, @get_dave, @ntsekouras, @carlosgprim, @ramonopoly, @jameskoster, @wildworks, @aaronrobertshaw, @czapla, @santosguillamot, @artemiosans, @afercia, @glendaviesnz, @kevin940726, @mikachan, @siobhyb. See #59411. git-svn-id: https://develop.svn.wordpress.org/trunk@56808 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
41cf9f0a38
commit
9ec564607c
2920
package-lock.json
generated
2920
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
136
package.json
136
package.json
@ -26,10 +26,10 @@
|
||||
"devDependencies": {
|
||||
"@lodder/grunt-postcss": "^3.1.1",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "0.5.5",
|
||||
"@wordpress/babel-preset-default": "7.26.3",
|
||||
"@wordpress/dependency-extraction-webpack-plugin": "4.25.3",
|
||||
"@wordpress/e2e-test-utils": "10.13.3",
|
||||
"@wordpress/scripts": "26.13.3",
|
||||
"@wordpress/babel-preset-default": "7.26.4",
|
||||
"@wordpress/dependency-extraction-webpack-plugin": "4.25.4",
|
||||
"@wordpress/e2e-test-utils": "10.13.4",
|
||||
"@wordpress/scripts": "26.13.4",
|
||||
"autoprefixer": "10.4.16",
|
||||
"chalk": "5.3.0",
|
||||
"check-node-version": "4.2.1",
|
||||
@ -78,70 +78,70 @@
|
||||
"dependencies": {
|
||||
"@emotion/is-prop-valid": "0.8.8",
|
||||
"@emotion/memoize": "0.7.4",
|
||||
"@wordpress/a11y": "3.42.3",
|
||||
"@wordpress/annotations": "2.42.3",
|
||||
"@wordpress/api-fetch": "6.39.3",
|
||||
"@wordpress/autop": "3.42.3",
|
||||
"@wordpress/blob": "3.42.3",
|
||||
"@wordpress/block-directory": "4.19.3",
|
||||
"@wordpress/block-editor": "12.10.3",
|
||||
"@wordpress/block-library": "8.19.3",
|
||||
"@wordpress/block-serialization-default-parser": "4.42.3",
|
||||
"@wordpress/blocks": "12.19.3",
|
||||
"@wordpress/commands": "0.13.3",
|
||||
"@wordpress/components": "25.8.3",
|
||||
"@wordpress/compose": "6.19.3",
|
||||
"@wordpress/core-commands": "0.11.3",
|
||||
"@wordpress/core-data": "6.19.3",
|
||||
"@wordpress/customize-widgets": "4.19.3",
|
||||
"@wordpress/data": "9.12.3",
|
||||
"@wordpress/data-controls": "3.11.3",
|
||||
"@wordpress/date": "4.42.3",
|
||||
"@wordpress/deprecated": "3.42.3",
|
||||
"@wordpress/dom": "3.42.3",
|
||||
"@wordpress/dom-ready": "3.42.3",
|
||||
"@wordpress/edit-post": "7.19.3",
|
||||
"@wordpress/edit-site": "5.19.3",
|
||||
"@wordpress/edit-widgets": "5.19.3",
|
||||
"@wordpress/editor": "13.19.3",
|
||||
"@wordpress/element": "5.19.3",
|
||||
"@wordpress/escape-html": "2.42.3",
|
||||
"@wordpress/format-library": "4.19.3",
|
||||
"@wordpress/hooks": "3.42.3",
|
||||
"@wordpress/html-entities": "3.42.3",
|
||||
"@wordpress/i18n": "4.42.3",
|
||||
"@wordpress/icons": "9.33.3",
|
||||
"@wordpress/interactivity": "2.3.3",
|
||||
"@wordpress/interface": "5.19.3",
|
||||
"@wordpress/is-shallow-equal": "4.42.3",
|
||||
"@wordpress/keyboard-shortcuts": "4.19.3",
|
||||
"@wordpress/keycodes": "3.42.3",
|
||||
"@wordpress/list-reusable-blocks": "4.19.3",
|
||||
"@wordpress/media-utils": "4.33.3",
|
||||
"@wordpress/notices": "4.10.3",
|
||||
"@wordpress/nux": "8.4.3",
|
||||
"@wordpress/patterns": "1.3.3",
|
||||
"@wordpress/plugins": "6.10.3",
|
||||
"@wordpress/preferences": "3.19.3",
|
||||
"@wordpress/preferences-persistence": "1.34.3",
|
||||
"@wordpress/primitives": "3.40.3",
|
||||
"@wordpress/priority-queue": "2.42.3",
|
||||
"@wordpress/private-apis": "0.24.3",
|
||||
"@wordpress/redux-routine": "4.42.3",
|
||||
"@wordpress/reusable-blocks": "4.19.3",
|
||||
"@wordpress/rich-text": "6.19.3",
|
||||
"@wordpress/router": "0.11.3",
|
||||
"@wordpress/server-side-render": "4.19.3",
|
||||
"@wordpress/shortcode": "3.42.3",
|
||||
"@wordpress/style-engine": "1.25.3",
|
||||
"@wordpress/sync": "0.4.3",
|
||||
"@wordpress/token-list": "2.42.3",
|
||||
"@wordpress/undo-manager": "0.2.3",
|
||||
"@wordpress/url": "3.43.3",
|
||||
"@wordpress/viewport": "5.19.3",
|
||||
"@wordpress/warning": "2.42.3",
|
||||
"@wordpress/widgets": "3.19.3",
|
||||
"@wordpress/wordcount": "3.42.3",
|
||||
"@wordpress/a11y": "3.42.4",
|
||||
"@wordpress/annotations": "2.42.4",
|
||||
"@wordpress/api-fetch": "6.39.4",
|
||||
"@wordpress/autop": "3.42.4",
|
||||
"@wordpress/blob": "3.42.4",
|
||||
"@wordpress/block-directory": "4.19.4",
|
||||
"@wordpress/block-editor": "12.10.4",
|
||||
"@wordpress/block-library": "8.19.4",
|
||||
"@wordpress/block-serialization-default-parser": "4.42.4",
|
||||
"@wordpress/blocks": "12.19.4",
|
||||
"@wordpress/commands": "0.13.4",
|
||||
"@wordpress/components": "25.8.4",
|
||||
"@wordpress/compose": "6.19.4",
|
||||
"@wordpress/core-commands": "0.11.4",
|
||||
"@wordpress/core-data": "6.19.4",
|
||||
"@wordpress/customize-widgets": "4.19.4",
|
||||
"@wordpress/data": "9.12.4",
|
||||
"@wordpress/data-controls": "3.11.4",
|
||||
"@wordpress/date": "4.42.4",
|
||||
"@wordpress/deprecated": "3.42.4",
|
||||
"@wordpress/dom": "3.42.4",
|
||||
"@wordpress/dom-ready": "3.42.4",
|
||||
"@wordpress/edit-post": "7.19.4",
|
||||
"@wordpress/edit-site": "5.19.4",
|
||||
"@wordpress/edit-widgets": "5.19.4",
|
||||
"@wordpress/editor": "13.19.4",
|
||||
"@wordpress/element": "5.19.4",
|
||||
"@wordpress/escape-html": "2.42.4",
|
||||
"@wordpress/format-library": "4.19.4",
|
||||
"@wordpress/hooks": "3.42.4",
|
||||
"@wordpress/html-entities": "3.42.4",
|
||||
"@wordpress/i18n": "4.42.4",
|
||||
"@wordpress/icons": "9.33.4",
|
||||
"@wordpress/interactivity": "2.3.4",
|
||||
"@wordpress/interface": "5.19.4",
|
||||
"@wordpress/is-shallow-equal": "4.42.4",
|
||||
"@wordpress/keyboard-shortcuts": "4.19.4",
|
||||
"@wordpress/keycodes": "3.42.4",
|
||||
"@wordpress/list-reusable-blocks": "4.19.4",
|
||||
"@wordpress/media-utils": "4.33.4",
|
||||
"@wordpress/notices": "4.10.4",
|
||||
"@wordpress/nux": "8.4.4",
|
||||
"@wordpress/patterns": "1.3.4",
|
||||
"@wordpress/plugins": "6.10.4",
|
||||
"@wordpress/preferences": "3.19.4",
|
||||
"@wordpress/preferences-persistence": "1.34.4",
|
||||
"@wordpress/primitives": "3.40.4",
|
||||
"@wordpress/priority-queue": "2.42.4",
|
||||
"@wordpress/private-apis": "0.24.4",
|
||||
"@wordpress/redux-routine": "4.42.4",
|
||||
"@wordpress/reusable-blocks": "4.19.4",
|
||||
"@wordpress/rich-text": "6.19.4",
|
||||
"@wordpress/router": "0.11.4",
|
||||
"@wordpress/server-side-render": "4.19.4",
|
||||
"@wordpress/shortcode": "3.42.4",
|
||||
"@wordpress/style-engine": "1.25.4",
|
||||
"@wordpress/sync": "0.4.4",
|
||||
"@wordpress/token-list": "2.42.4",
|
||||
"@wordpress/undo-manager": "0.2.4",
|
||||
"@wordpress/url": "3.43.4",
|
||||
"@wordpress/viewport": "5.19.4",
|
||||
"@wordpress/warning": "2.42.4",
|
||||
"@wordpress/widgets": "3.19.4",
|
||||
"@wordpress/wordcount": "3.42.4",
|
||||
"backbone": "1.5.0",
|
||||
"clipboard": "2.0.11",
|
||||
"core-js-url-browser": "3.6.4",
|
||||
|
File diff suppressed because one or more lines are too long
@ -9,10 +9,11 @@
|
||||
* Renders the `core/image` block on the server,
|
||||
* adding a data-id attribute to the element if core/gallery has added on pre-render.
|
||||
*
|
||||
* @param array $attributes The block attributes.
|
||||
* @param string $content The block content.
|
||||
* @param WP_Block $block The block object.
|
||||
* @return string Returns the block content with the data-id attribute added.
|
||||
* @param array $attributes The block attributes.
|
||||
* @param string $content The block content.
|
||||
* @param WP_Block $block The block object.
|
||||
*
|
||||
* @return string The block content with the data-id attribute added.
|
||||
*/
|
||||
function render_block_core_image( $attributes, $content, $block ) {
|
||||
|
||||
@ -76,12 +77,13 @@ function render_block_core_image( $attributes, $content, $block ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the lightboxEnabled flag to the block data.
|
||||
* Adds the lightboxEnabled flag to the block data.
|
||||
*
|
||||
* This is used to determine whether the lightbox should be rendered or not.
|
||||
*
|
||||
* @param array $block Block data.
|
||||
* @return array Filtered block data.
|
||||
* @param array $block Block data.
|
||||
*
|
||||
* @return array Filtered block data.
|
||||
*/
|
||||
function block_core_image_get_lightbox_settings( $block ) {
|
||||
// Get the lightbox setting from the block attributes.
|
||||
@ -113,43 +115,44 @@ function block_core_image_get_lightbox_settings( $block ) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the directives and layout needed for the lightbox behavior.
|
||||
* Adds the directives and layout needed for the lightbox behavior.
|
||||
*
|
||||
* @param string $block_content Rendered block content.
|
||||
* @param array $block Block object.
|
||||
* @return string Filtered block content.
|
||||
* @param string $block_content Rendered block content.
|
||||
* @param array $block Block object.
|
||||
*
|
||||
* @return string Filtered block content.
|
||||
*/
|
||||
function block_core_image_render_lightbox( $block_content, $block ) {
|
||||
$processor = new WP_HTML_Tag_Processor( $block_content );
|
||||
|
||||
$aria_label = __( 'Enlarge image' );
|
||||
|
||||
$processor->next_tag( 'img' );
|
||||
$alt_attribute = $processor->get_attribute( 'alt' );
|
||||
|
||||
if ( null !== $alt_attribute ) {
|
||||
// An empty alt attribute `alt=""` is valid for decorative images.
|
||||
if ( is_string( $alt_attribute ) ) {
|
||||
$alt_attribute = trim( $alt_attribute );
|
||||
}
|
||||
|
||||
// It only makes sense to append the alt text to the button aria-label when the alt text is non-empty.
|
||||
if ( $alt_attribute ) {
|
||||
/* translators: %s: Image alt text. */
|
||||
$aria_label = sprintf( __( 'Enlarge image: %s' ), $alt_attribute );
|
||||
}
|
||||
$content = $processor->get_updated_html();
|
||||
|
||||
// Currently, we are only enabling the zoom animation.
|
||||
$lightbox_animation = 'zoom';
|
||||
|
||||
// We want to store the src in the context so we can set it dynamically when the lightbox is opened.
|
||||
$z = new WP_HTML_Tag_Processor( $content );
|
||||
$z->next_tag( 'img' );
|
||||
|
||||
// Note: We want to store the `src` in the context so we
|
||||
// can set it dynamically when the lightbox is opened.
|
||||
if ( isset( $block['attrs']['id'] ) ) {
|
||||
$img_uploaded_src = wp_get_attachment_url( $block['attrs']['id'] );
|
||||
$img_metadata = wp_get_attachment_metadata( $block['attrs']['id'] );
|
||||
$img_width = $img_metadata['width'];
|
||||
$img_height = $img_metadata['height'];
|
||||
} else {
|
||||
$img_uploaded_src = $z->get_attribute( 'src' );
|
||||
$img_uploaded_src = $processor->get_attribute( 'src' );
|
||||
$img_width = 'none';
|
||||
$img_height = 'none';
|
||||
}
|
||||
@ -160,7 +163,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
||||
$scale_attr = false;
|
||||
}
|
||||
|
||||
$w = new WP_HTML_Tag_Processor( $content );
|
||||
$w = new WP_HTML_Tag_Processor( $block_content );
|
||||
$w->next_tag( 'figure' );
|
||||
$w->add_class( 'wp-lightbox-container' );
|
||||
$w->set_attribute( 'data-wp-interactive', true );
|
||||
@ -180,7 +183,8 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
||||
"imageCurrentSrc": "",
|
||||
"targetWidth": "%s",
|
||||
"targetHeight": "%s",
|
||||
"scaleAttr": "%s"
|
||||
"scaleAttr": "%s",
|
||||
"dialogLabel": "%s"
|
||||
}
|
||||
}
|
||||
}',
|
||||
@ -188,7 +192,8 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
||||
$img_uploaded_src,
|
||||
$img_width,
|
||||
$img_height,
|
||||
$scale_attr
|
||||
$scale_attr,
|
||||
__( 'Enlarged image' )
|
||||
)
|
||||
);
|
||||
$w->next_tag( 'img' );
|
||||
@ -200,19 +205,20 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
||||
// Wrap the image in the body content with a button.
|
||||
$img = null;
|
||||
preg_match( '/<img[^>]+>/', $body_content, $img );
|
||||
$button =
|
||||
'<button
|
||||
type="button"
|
||||
aria-haspopup="dialog"
|
||||
aria-label="' . esc_attr( $aria_label ) . '"
|
||||
data-wp-on--click="actions.core.image.showLightbox"
|
||||
data-wp-style--width="context.core.image.imageButtonWidth"
|
||||
data-wp-style--height="context.core.image.imageButtonHeight"
|
||||
data-wp-style--left="context.core.image.imageButtonLeft"
|
||||
data-wp-style--top="context.core.image.imageButtonTop"
|
||||
>
|
||||
</button>'
|
||||
. $img[0];
|
||||
|
||||
$button =
|
||||
$img[0]
|
||||
. '<button
|
||||
type="button"
|
||||
aria-haspopup="dialog"
|
||||
aria-label="' . esc_attr( $aria_label ) . '"
|
||||
data-wp-on--click="actions.core.image.showLightbox"
|
||||
data-wp-style--width="context.core.image.imageButtonWidth"
|
||||
data-wp-style--height="context.core.image.imageButtonHeight"
|
||||
data-wp-style--left="context.core.image.imageButtonLeft"
|
||||
data-wp-style--top="context.core.image.imageButtonTop"
|
||||
></button>';
|
||||
|
||||
$body_content = preg_replace( '/<img[^>]+>/', $button, $body_content );
|
||||
|
||||
// We need both a responsive image and an enlarged image to animate
|
||||
@ -220,7 +226,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
||||
// image is a copy of the one in the body, which animates immediately
|
||||
// as the lightbox is opened, while the enlarged one is a full-sized
|
||||
// version that will likely still be loading as the animation begins.
|
||||
$m = new WP_HTML_Tag_Processor( $content );
|
||||
$m = new WP_HTML_Tag_Processor( $block_content );
|
||||
$m->next_tag( 'figure' );
|
||||
$m->add_class( 'responsive-image' );
|
||||
$m->next_tag( 'img' );
|
||||
@ -236,7 +242,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
||||
$m->set_attribute( 'data-wp-style--object-fit', 'selectors.core.image.lightboxObjectFit' );
|
||||
$initial_image_content = $m->get_updated_html();
|
||||
|
||||
$q = new WP_HTML_Tag_Processor( $content );
|
||||
$q = new WP_HTML_Tag_Processor( $block_content );
|
||||
$q->next_tag( 'figure' );
|
||||
$q->add_class( 'enlarged-image' );
|
||||
$q->next_tag( 'img' );
|
||||
@ -252,24 +258,32 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
||||
$q->set_attribute( 'data-wp-style--object-fit', 'selectors.core.image.lightboxObjectFit' );
|
||||
$enlarged_image_content = $q->get_updated_html();
|
||||
|
||||
$background_color = esc_attr( wp_get_global_styles( array( 'color', 'background' ) ) );
|
||||
// If the current theme does NOT have a `theme.json`, or the colors are not defined,
|
||||
// we need to set the background color & close button color to some default values
|
||||
// because we can't get them from the Global Styles.
|
||||
$background_color = '#fff';
|
||||
$close_button_color = '#000';
|
||||
if ( wp_theme_has_theme_json() ) {
|
||||
$global_styles_color = wp_get_global_styles( array( 'color' ) );
|
||||
if ( ! empty( $global_styles_color['background'] ) ) {
|
||||
$background_color = esc_attr( $global_styles_color['background'] );
|
||||
}
|
||||
if ( ! empty( $global_styles_color['text'] ) ) {
|
||||
$close_button_color = esc_attr( $global_styles_color['text'] );
|
||||
}
|
||||
}
|
||||
|
||||
$close_button_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="15" height="15" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg>';
|
||||
$close_button_color = esc_attr( wp_get_global_styles( array( 'color', 'text' ) ) );
|
||||
$dialog_label = $alt_attribute ? esc_attr( $alt_attribute ) : esc_attr__( 'Image' );
|
||||
$close_button_label = esc_attr__( 'Close' );
|
||||
|
||||
$lightbox_html = <<<HTML
|
||||
<div data-wp-body="" class="wp-lightbox-overlay $lightbox_animation"
|
||||
data-wp-bind--role="selectors.core.image.roleAttribute"
|
||||
aria-label="$dialog_label"
|
||||
data-wp-bind--aria-label="selectors.core.image.dialogLabel"
|
||||
data-wp-class--initialized="context.core.image.initialized"
|
||||
data-wp-class--active="context.core.image.lightboxEnabled"
|
||||
data-wp-class--hideAnimationEnabled="context.core.image.hideAnimationEnabled"
|
||||
data-wp-bind--aria-hidden="!context.core.image.lightboxEnabled"
|
||||
aria-hidden="true"
|
||||
data-wp-bind--aria-modal="context.core.image.lightboxEnabled"
|
||||
aria-modal="false"
|
||||
data-wp-bind--aria-modal="selectors.core.image.ariaModal"
|
||||
data-wp-effect="effects.core.image.initLightbox"
|
||||
data-wp-on--keydown="actions.core.image.handleKeydown"
|
||||
data-wp-on--touchstart="actions.core.image.handleTouchStart"
|
||||
@ -282,7 +296,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
||||
</button>
|
||||
<div class="lightbox-image-container">$initial_image_content</div>
|
||||
<div class="lightbox-image-container">$enlarged_image_content</div>
|
||||
<div class="scrim" style="background-color: $background_color"></div>
|
||||
<div class="scrim" style="background-color: $background_color" aria-hidden="true"></div>
|
||||
</div>
|
||||
HTML;
|
||||
|
||||
@ -290,11 +304,13 @@ HTML;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that the view script has the `wp-interactivity` dependency.
|
||||
* Ensures that the view script has the `wp-interactivity` dependency.
|
||||
*
|
||||
* @since 6.4.0
|
||||
*
|
||||
* @global WP_Scripts $wp_scripts
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function block_core_image_ensure_interactivity_dependency() {
|
||||
global $wp_scripts;
|
||||
@ -310,6 +326,8 @@ add_action( 'wp_print_scripts', 'block_core_image_ensure_interactivity_dependenc
|
||||
|
||||
/**
|
||||
* Registers the `core/image` block on server.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function register_block_core_image() {
|
||||
register_block_type_from_metadata(
|
||||
|
@ -1 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => '05c1954ba30982dc9c41');
|
||||
<?php return array('dependencies' => array(), 'version' => '21b886a7aa24f5c7c9ef');
|
||||
|
@ -1 +1 @@
|
||||
<?php return array('dependencies' => array(), 'version' => 'd147cc02d5d2c29b2a8e');
|
||||
<?php return array('dependencies' => array(), 'version' => '6e38467974481d14d2da');
|
||||
|
@ -48,14 +48,6 @@ function render_block_core_latest_posts( $attributes ) {
|
||||
$block_core_latest_posts_excerpt_length = $attributes['excerptLength'];
|
||||
add_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 );
|
||||
|
||||
$filter_latest_posts_excerpt_more = static function ( $more ) use ( $attributes ) {
|
||||
$use_excerpt = 'excerpt' === $attributes['displayPostContentRadio'];
|
||||
/* translators: %1$s is a URL to a post, excerpt truncation character, default … */
|
||||
return $use_excerpt ? sprintf( __( ' … <a href="%1$s" rel="noopener noreferrer">Read more</a>' ), esc_url( get_permalink() ) ) : $more;
|
||||
};
|
||||
|
||||
add_filter( 'excerpt_more', $filter_latest_posts_excerpt_more );
|
||||
|
||||
if ( ! empty( $attributes['categories'] ) ) {
|
||||
$args['category__in'] = array_column( $attributes['categories'], 'id' );
|
||||
}
|
||||
@ -151,6 +143,24 @@ function render_block_core_latest_posts( $attributes ) {
|
||||
|
||||
$trimmed_excerpt = get_the_excerpt( $post );
|
||||
|
||||
/*
|
||||
* Adds a "Read more" link with screen reader text.
|
||||
* […] is the default excerpt ending from wp_trim_excerpt() in Core.
|
||||
*/
|
||||
if ( str_ends_with( $trimmed_excerpt, ' […]' ) ) {
|
||||
$excerpt_length = (int) apply_filters( 'excerpt_length', $block_core_latest_posts_excerpt_length );
|
||||
if ( $excerpt_length <= $block_core_latest_posts_excerpt_length ) {
|
||||
$trimmed_excerpt = substr( $trimmed_excerpt, 0, -11 );
|
||||
$trimmed_excerpt .= sprintf(
|
||||
/* translators: 1: A URL to a post, 2: The static string "Read more", 3: The post title only visible to screen readers. */
|
||||
__( '… <a href="%1$s" rel="noopener noreferrer">%2$s<span class="screen-reader-text">: %3$s</span></a>' ),
|
||||
esc_url( $post_link ),
|
||||
__( 'Read more' ),
|
||||
esc_html( $title )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ( post_password_required( $post ) ) {
|
||||
$trimmed_excerpt = __( 'This content is password protected.' );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user