Skip to content

Fix undefined array key warnings for style.color.gradient#11

Merged
roborourke merged 1 commit into
mainfrom
fix/undefined-array-key-style
Apr 16, 2026
Merged

Fix undefined array key warnings for style.color.gradient#11
roborourke merged 1 commit into
mainfrom
fix/undefined-array-key-style

Conversation

@roborourke
Copy link
Copy Markdown
Collaborator

@roborourke roborourke commented Apr 16, 2026

Summary

  • Fixes PHP 8.x warnings: Undefined array key "style" and Trying to access array offset on null that occur in filter_render_block() when $block['attrs']['style'] is not set
  • Uses the null coalescing operator (??) to safely extract the nested style.color.gradient value before the empty() check

Test plan

  • Render a popup block without a gradient set — no PHP warnings should appear
  • Render a popup block with a gradient set — gradient styles should still apply correctly

🤖 Generated with Claude Code

Open WordPress Playground Preview

Use null coalescing operator to safely access the nested 'style' key
in block attributes, avoiding PHP 8.x warnings for undefined array
key 'style' and trying to access array offset on null.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
github-actions Bot added a commit that referenced this pull request Apr 16, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 16, 2026

Playwright E2E Test Results (PHP 8.4, WP latest)

passed  20 passed

Details

stats  20 tests across 3 suites
duration  2 minutes, 16 seconds
commit  a3dd3b0

@roborourke roborourke merged commit b5493a3 into main Apr 16, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant