WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 5 years ago

#30830 closed defect (bug) (wontfix)

Remove unnecessary space after class="postbox when postbox_classes returns an empty string in metaboxes

Reported by: ShinichiN Owned by:
Milestone: Priority: lowest
Severity: trivial Version: 3.0
Component: Administration Keywords:
Focuses: ui Cc:

Description

When the postbox_classes() function returns an empty string, we have an unnecessary space after postbox.

<div id="submitdiv" class="postbox " >
<div id="formatdiv" class="postbox " >
<div id="postimagediv" class="postbox " >

http://th-daily.shinichi.me/wp-content/uploads/2014/12/src_wordpress-develop_dev_wp-admin_post-new_php.jpg

This patch gives no unnecessary space when postbox_classes returns an empty string.

Attachments (1)

30830.diff (965 bytes) - added by ShinichiN 6 years ago.

Download all attachments as: .zip

Change History (5)

@ShinichiN
6 years ago

#1 @SergeyBiryukov
6 years ago

  • Focuses administration added
  • Priority changed from normal to lowest
  • Severity changed from normal to trivial

#2 @nacin
6 years ago

  • Version changed from trunk to 3.0

We could remove the class after " and before > pretty easily, but look at how much code is required to make it without a space :)

Could we safely return 'postbox' from postbox_classes()? Is there ever a time where that should not be the case?

This has been this way for a while, going back to at least 3.0, probably 2.7.

#3 @DrewAPicture
6 years ago

  • Component changed from General to Administration
  • Focuses ui added; administration removed

#4 @afercia
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

There are several other places where core outputs a space after a CSS class, as noted by @nacin this could be fixed with additional code but for a little benefit. Does it harms having a space? What's the real benefit in trying to remove it? Sure, as a best practice these spaces should be avoided but I'd suggest to spend energies and time elsewhere rather than refactoring existing code for such small details.
Also, no traction in 13 months :) Closing out, please do feel free to reopen if you think it's really relevant.

Note: See TracTickets for help on using tickets.