Make WordPress Core

Opened 22 hours ago

Last modified 12 hours ago

#65497 new enhancement

Replace unnecessary PHP comment with HTML comment in wp-admin/customize.php — at Version 2

Reported by: harishtewari's profile harishtewari Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.9
Component: Customize Keywords: has-patch
Focuses: Cc:

Description (last modified by sabernhardt)

In src/wp-admin/customize.php (around line 227 and 266), there is a PHP opening tag used solely for an inline comment:

<ul class="customize-pane-parent"><?php // Panels and sections are managed here via JavaScript ?></ul>

Since no PHP code is being executed, the PHP tag is unnecessary. This can be replaced with an HTML comment to improve code readability and maintainability.
WordPress coding standards generally prefer avoiding unnecessary PHP tags when no PHP code is being executed

Change History (2)

This ticket was mentioned in PR #12241 on WordPress/wordpress-develop by @harishtewari.


22 hours ago
#1

https://core.trac.wordpress.org/ticket/65497

In src/wp-admin/customize.php (around line 227 and 266), there is a PHP opening tag used solely for an inline comment:

<ul class="customize-pane-parent"><?php Panels and sections are managed here via JavaScript ?></ul>

Since no PHP code is being executed, the PHP tag is unnecessary. This can be replaced with an HTML comment to improve code readability and maintainability.

WordPress coding standards generally prefer avoiding unnecessary PHP tags when no PHP code is being executed

Trac ticket:

## Use of AI Tools

#2 @sabernhardt
15 hours ago

  • Component changed from General to Customize
  • Description modified (diff)
  • Summary changed from Unnecessary PHP comment with HTML comment in wp-admin/customize.php to Replace unnecessary PHP comment with HTML comment in wp-admin/customize.php
  • Type changed from defect (bug) to enhancement
  • Version changed from 7.0 to 4.9

These comments were committed in r30102 and r41626.

Note: See TracTickets for help on using tickets.