Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#52845 closed defect (bug) (fixed)

Admin template.php file javascript code enhancement

Reported by: nayanchamp7's profile nayanchamp7 Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.8 Priority: normal
Severity: normal Version: 5.7
Component: Administration Keywords: has-patch
Focuses: javascript, coding-standards Cc:

Description

Here in wp-admin/includes/template.php file has some codes which are not standards according to WordPress core javascript coding standards. In 2118 line, there is 'typeof' condition which is not given as strict equal condition.

<script type="text/javascript">if(typeof wpOnload=="function")wpOnload();</script>

These need to be updated.

Attachments (1)

template.php.patch (1.2 KB) - added by nayanchamp7 4 years ago.
Updated the codes and tested.

Download all attachments as: .zip

Change History (5)

@nayanchamp7
4 years ago

Updated the codes and tested.

#1 @nayanchamp7
4 years ago

  • Type changed from enhancement to defect (bug)

#2 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 5.8
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#3 @SergeyBiryukov
4 years ago

Hi there, welcome to WordPress Trac! Thanks for the ticket and the patch.

Since the rest of this code is minified, I think we'd want to just use strict comparison and avoid adding extra spaces.

Last edited 4 years ago by SergeyBiryukov (previous) (diff)

#4 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 50541:

Coding Standards: Use strict comparison for JS fragment in some admin files.

Follow-up to [48083].

Props nayanchamp7, rnaby.
Fixes #52845, #41988.

Note: See TracTickets for help on using tickets.