Skip to content

Commit 4767014

Browse files
authored
Merge branch 'trunk' into issue-734/query-loop-filters-get-removed
2 parents 5fbad5d + 7ff0254 commit 4767014

18 files changed

+637
-266
lines changed

.distignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ composer.json
3030
composer.lock
3131
package-lock.json
3232
webpack.config.js
33-
.phpcs.xml.dist
33+
phpcs.xml.dist
3434
phpunit.xml.dist
3535
tests/
3636
bin/

.github/workflows/pr-checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ jobs:
7878
- name: Run JavaScript unit tests
7979
run: npm run test:unit
8080

81+
- name: Install Subversion
82+
run: sudo apt-get update -y && sudo apt-get install -y subversion
83+
8184
- name: Run PHP tests
8285
run: |
8386
mysql -uroot -h127.0.0.1 -e 'SELECT version()' \

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ build/
3535

3636
# phpunit
3737
*.result.*
38+
39+
dev-env/

.phpcs.xml.dist

Lines changed: 0 additions & 47 deletions
This file was deleted.

.wp-env.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
{
2+
"$schema": "https://schemas.wp.org/trunk/wp-env.json",
23
"core": "WordPress/WordPress",
34
"port": 8988,
45
"testsPort": 8989,
56
"plugins": [ "." ],
67
"config": {
78
"WP_UPLOAD_MAX_FILESIZE": "128M",
8-
"WP_MEMORY_LIMIT": "256M"
9+
"WP_MEMORY_LIMIT": "256M",
10+
"WP_ENVIRONMENT_TYPE": "development",
11+
"WP_DEVELOPMENT_MODE": "all"
12+
},
13+
"env": {
14+
"development": {
15+
"phpmyadminPort": 9000
16+
},
17+
"tests": {
18+
"phpmyadminPort": 9001
19+
}
920
}
1021
}

create-block-theme.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Plugin Name: Create Block Theme
66
* Plugin URI: https://wordpress.org/plugins/create-block-theme
77
* Description: Generates a block theme
8-
* Version: 2.6.0
8+
* Version: 2.7.0
99
* Author: WordPress.org
1010
* Author URI: https://wordpress.org/
1111
* License: GNU General Public License v2 or later

includes/create-theme/theme-locale.php

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ private static function get_text_replacement_patterns_for_html( $block_name ) {
101101
return array( '/(<pre[^>]*>)(.*?)(<\/pre>)/' );
102102
case 'core/button':
103103
return array( '/(<a[^>]*>)(.*?)(<\/a>)/' );
104-
case 'core/image':
105-
case 'core/cover':
106-
case 'core/media-text':
107-
return array( '/alt="(.*?)"/' );
108104
case 'core/quote':
109105
case 'core/pullquote':
110106
return array(
@@ -117,6 +113,16 @@ private static function get_text_replacement_patterns_for_html( $block_name ) {
117113
'/(<th[^>]*>)(.*?)(<\/th>)/',
118114
'/(<figcaption[^>]*>)(.*?)(<\/figcaption>)/',
119115
);
116+
case 'core/video':
117+
return array( '/(<figcaption[^>]*>)(.*?)(<\/figcaption>)/' );
118+
case 'core/image':
119+
return array(
120+
'/(<figcaption[^>]*>)(.*?)(<\/figcaption>)/',
121+
'/(alt=")(.*?)(")/',
122+
);
123+
case 'core/cover':
124+
case 'core/media-text':
125+
return array( '/(alt=")(.*?)(")/' );
120126
default:
121127
return null;
122128
}
@@ -158,19 +164,7 @@ public static function escape_text_content_of_blocks( $blocks ) {
158164
case 'core/quote':
159165
case 'core/pullquote':
160166
case 'core/table':
161-
$replace_content_callback = function ( $content, $pattern ) {
162-
if ( empty( $content ) ) {
163-
return;
164-
}
165-
return preg_replace_callback(
166-
$pattern,
167-
function( $matches ) {
168-
return $matches[1] . self::escape_text_content( $matches[2] ) . $matches[3];
169-
},
170-
$content
171-
);
172-
};
173-
break;
167+
case 'core/video':
174168
case 'core/image':
175169
case 'core/cover':
176170
case 'core/media-text':
@@ -181,7 +175,11 @@ function( $matches ) {
181175
return preg_replace_callback(
182176
$pattern,
183177
function( $matches ) {
184-
return 'alt="' . self::escape_attribute( $matches[1] ) . '"';
178+
// If the pattern is for attribute like alt="".
179+
if ( str_ends_with( $matches[1], '="' ) ) {
180+
return $matches[1] . self::escape_attribute( $matches[2] ) . $matches[3];
181+
}
182+
return $matches[1] . self::escape_text_content( $matches[2] ) . $matches[3];
185183
},
186184
$content
187185
);

0 commit comments

Comments
 (0)