Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#4631 closed enhancement (duplicate)

Non-valid XHTML code in widgets.php, line 431

Reported by: kommix's profile kommix Owned by: kommix's profile kommix
Milestone: Priority: normal
Severity: normal Version: 2.2
Component: Optimization Keywords: widgets, xhtml, valid, non-valid
Focuses: Cc:

Description

When we want to display our archives in a dropdown menu, XHTML would not be valid because of the code on line 431 @ wp-includes/widgets.php. Here:

<select name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo attribute_escape(('Select Month')); ?></option> <?php wp_get_archives("type=monthly&format=option&show_post_count=$c"); ?> </select>

The property "onChange" is not valid, which is because it has a capital letter. XHTML codes should not have any capital letters. The line should be like this:

<select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo attribute_escape(('Select Month')); ?></option> <?php wp_get_archives("type=monthly&format=option&show_post_count=$c"); ?> </select>

Change History (2)

#1 @kommix
17 years ago

  • Owner changed from anonymous to kommix
  • Status changed from new to assigned
  • Type changed from defect to enhancement

When we want to display our archives in a dropdown menu, XHTML would not be valid because of the code on line 431 @ wp-includes/widgets.php. Here:

<select name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo attribute_escape(('Select Month')); ?></option> <?php wp_get_archives("type=monthly&format=option&show_post_count=$c"); ?> </select>

The property "onChange" is not valid, which is because it has a capital letter. XHTML codes should not have any capital letters. The line should be like this:

<select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo attribute_escape(('Select Month')); ?></option> <?php wp_get_archives("type=monthly&format=option&show_post_count=$c"); ?> </select>

#2 @Nazgul
17 years ago

  • Milestone 2.2.2 deleted
  • Resolution set to duplicate
  • Status changed from assigned to closed

Duplicate of 4630.

Note: See TracTickets for help on using tickets.