diff --git a/packages/block-library/src/query-total/edit.js b/packages/block-library/src/query-total/edit.js
index 4824021ae99b0d..d91a1990715727 100644
--- a/packages/block-library/src/query-total/edit.js
+++ b/packages/block-library/src/query-total/edit.js
@@ -48,27 +48,25 @@ export default function QueryTotalEdit( { attributes, setAttributes } ) {
// Controls for the block.
const controls = (
- <>
-
-
-
-
-
- >
+
+
+
+
+
);
// Render output based on the selected display type.
const renderDisplay = () => {
if ( displayType === 'total-results' ) {
- return
{ __( '12 results found' ) }
;
+ return <>{ __( '12 results found' ) }>;
}
if ( displayType === 'range-display' ) {
- return { __( 'Displaying 1 – 10 of 12' ) }
;
+ return <>{ __( 'Displaying 1 – 10 of 12' ) }>;
}
return null;
diff --git a/packages/block-library/src/query-total/index.php b/packages/block-library/src/query-total/index.php
index c78d0498f634f1..ff2ac486727b92 100644
--- a/packages/block-library/src/query-total/index.php
+++ b/packages/block-library/src/query-total/index.php
@@ -40,14 +40,14 @@ function render_block_core_query_total( $attributes, $content, $block ) {
switch ( $attributes['displayType'] ) {
case 'range-display':
if ( $start === $end ) {
- $range_text = sprintf(
+ $output = sprintf(
/* translators: 1: Start index of posts, 2: Total number of posts */
__( 'Displaying %1$s of %2$s' ),
$start,
$max_rows
);
} else {
- $range_text = sprintf(
+ $output = sprintf(
/* translators: 1: Start index of posts, 2: End index of posts, 3: Total number of posts */
__( 'Displaying %1$s – %2$s of %3$s' ),
$start,
@@ -56,17 +56,12 @@ function render_block_core_query_total( $attributes, $content, $block ) {
);
}
- $output = sprintf( '%s
', $range_text );
break;
case 'total-results':
default:
// translators: %d: number of results.
- $total_text = sprintf( _n( '%d result found', '%d results found', $max_rows ), $max_rows );
- $output = sprintf(
- '%s
',
- $total_text
- );
+ $output = sprintf( _n( '%d result found', '%d results found', $max_rows ), $max_rows );
break;
}