Codeinwp / neve-fse

The theme you already love, built for Full-Site Editing
15 stars 6 forks source link

Debugging error in FSE themes #140

Closed HardeepAsrani closed 2 months ago

HardeepAsrani commented 3 months ago

Description

Source: https://github.com/Codeinwp/neve-fse/blob/main/inc/Admin.php#L99

This line seems to cause a debugging error in all of our FSE themes:

[14-Aug-2024 19:26:31 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-content/themes/neve-fse/inc/Admin.php:99) in /var/www/html/wp-admin/admin-header.php on line 9

We shouldn't print content in an enqueue method as it sends it out in the header. We can use other options, such as adding it to the footer of the page or adding it via JS, but not echo in the header.

Step-by-step reproduction instructions

  1. Install Neve FSE
  2. Make sure debug logging is enabled.
  3. Open the editor and you should see the error.

Screenshots, screen recording, code snippet or Help Scout ticket

No response

Environment info

No response

Is the issue you are reporting a regression

No