Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9ca0b27
WIP
jrfnl Nov 2, 2022
57f0dba
WIP step 2
jrfnl Nov 2, 2022
58b0ff1
WIP - step 3
jrfnl Nov 2, 2022
d3bbd20
WIP Step 3b
jrfnl Nov 2, 2022
c17341b
WIP - setp 4
jrfnl Nov 2, 2022
aa13245
WIP - simplify it a little more
jrfnl Nov 2, 2022
188ce0f
WIP - step 5
jrfnl Nov 2, 2022
194368e
WIP - side step 6
jrfnl Nov 2, 2022
8fed0c1
WIP - side step 7
jrfnl Nov 2, 2022
5fa9aae
CS & cleanup
aristath Nov 3, 2022
979bfef
replace array_key_exists with isset
aristath Nov 3, 2022
be50567
replace an array_merge with a foreach loop
aristath Nov 3, 2022
6aa5ede
Add an inline comment to avoid future refactors
aristath Nov 3, 2022
4434b1d
We can use isset() instead of array_key_exists() here (no null values)
aristath Nov 3, 2022
505a4f8
replace array_merge with a foreach loop
aristath Nov 3, 2022
0345837
replace array_merge with foreach loop in the flatten_tree method
aristath Nov 3, 2022
8df441c
replace array_key_exists() with isset()
aristath Nov 3, 2022
8c04874
Replace more array_merge with foreach loops where appropriate
aristath Nov 3, 2022
213e94b
Fix PHP 5.6 errors + added notes for the future
aristath Nov 3, 2022
8923cd8
Merge branch 'trunk' into feature/pp-ari-wp-theme-json
felixarntz Nov 10, 2022
5730ac1
Add comment references pointing to https://core.trac.wordpress.org/ti…
felixarntz Nov 10, 2022
4af0999
Merge branch 'trunk' into feature/pp-ari-wp-theme-json
felixarntz Nov 10, 2022
abf51b6
Merge branch 'trunk' into feature/pp-ari-wp-theme-json
felixarntz Nov 10, 2022
4889396
Merge branch 'trunk' into feature/pp-ari-wp-theme-json
felixarntz Nov 11, 2022
7ecd0a8
Clarify variable name.
felixarntz Nov 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP - step 3
  • Loading branch information
jrfnl authored and aristath committed Nov 8, 2022
commit 58b0ff174f1257392c6b7951f021f2aebf3a8fa5
11 changes: 10 additions & 1 deletion src/wp-includes/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -2302,7 +2302,16 @@ public function merge( $incoming ) {
$override_preset = ! static::get_metadata_boolean( $this->theme_json['settings'], $preset['prevent_override'], true );

foreach ( static::VALID_ORIGINS as $origin ) {
$base_path = array_merge( $node['path'], $preset['path'] );
// $base_path = array_merge( $node['path'], $preset['path'] );
$base_path = $node['path'];
$flipped_path = array_flip($node['path']);
foreach($preset['path'] as $leaf) {
if (isset($flipped_path[$leaf]) === false) {
$base_path[] = $leaf;
}
}


$path = array_merge( $base_path, array( $origin ) );
$content = _wp_array_get( $incoming_data, $path, null );
if ( ! isset( $content ) ) {
Expand Down