Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#43465 closed defect (bug) (fixed)

Remove an extra space in the admin body class.

Reported by: birgire Owned by: ocean90
Priority: lowest Milestone: 5.1
Component: Administration Version:
Severity: normal Keywords: good-first-bug has-patch
Cc: Focuses:

Description

I just noticed that there's an extra space in the admin body class.

Here's an example on wp-admin/index.php:

<body class="wp-admin wp-core-ui no-js  index-php ...">

This is generated in wp-admin/admin-header.php with:

<body class="wp-admin wp-core-ui no-js <?php echo $admin_body_classes . ' ' . $admin_body_class ?>">

There's no harm in extra spaces between classes, but it could be fix it with a ltrim() or trim() to cover both ends.

Example:

<body class="wp-admin wp-core-ui no-js <?php echo trim( $admin_body_classes . ' ' . $admin_body_class ); ?>">

Maybe there are other ways or we could just leave it as is?

Attachments (4)

43465.diff​ (2.0 KB ) - added by jainnidhi 9 years ago.
43465.2.diff​ (2.1 KB ) - added by rhetorical 9 years ago.
43465.3.diff​ (756 bytes ) - added by lbenicio 9 years ago.
43465.4.diff​ (2.0 KB ) - added by jainnidhi 9 years ago.
I've already added the patch 43465.diff for this fix but I've used the coding standards in this patch.

Download all attachments as: .zip

Change History (13)

#1 @jainnidhi
9 years ago

  • Keywords has-patch added

#2 @omerblink
9 years ago

If I want to contribute in this ticket what should I do?

Sorry about the silly question... I'm new in contribution

#3 @birgire
9 years ago

Thanks for the patch @jainnidhi

@omerblink welcome to WordPress Trac.

If you're looking for general info, then a good starting point is the Core Contributor Handbook:

​https://make.wordpress.org/core/handbook/

There's also the New Contributors Chat in Slack #core

See also:

​https://make.wordpress.org/meetings/

​https://make.wordpress.org/core/tag/new-contributors/

... or to dive right in then I would suggest adjusting 43465.diff​ to the ​Coding standards, i.e. like adding extra space for the function input (see ​here).

Note that it's still an open question if this ticket should be fixed or not.

Hope it helps.

#4 @nielslange
9 years ago

  • Keywords needs-testing added

#5 @rhetorical
9 years ago

43465.2.diff updates the original patch to add extra space to the function for the coding standards that @birgire had mentioned

#6 @mathieuhays
9 years ago

I've tested the patch 43465.3.diff. It introduces a syntax error and doesn't comply to the WordPress Coding Standards.

I've tested 43465.2.diff locally, it solves the issue and does comply to the WordPress Coding Standards.

@jainnidhi
9 years ago

I've already added the patch 43465.diff for this fix but I've used the coding standards in this patch.

#7 @ocean90
9 years ago

  • Keywords needs-testing removed
  • Milestone Awaiting Review → 5.0

#8 @ocean90
9 years ago

  • Owner set to ocean90
  • Resolution → fixed
  • Status new → closed

In 42974:

Administration: Avoid an extra space in the admin body class.

Props jainnidhi, rhetorical, birgire, mathieuhays.
Fixes #43465.

#9 @pento
8 years ago

  • Milestone 5.0 → 5.1
Note: See TracTickets for help on using tickets.