Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#37309 closed enhancement (fixed)

Show always domain and path when deleting a site

Reported by: ocean90's profile ocean90 Owned by: ianedington's profile ian.edington
Milestone: 4.7 Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: good-first-bug has-patch
Focuses: multisite Cc:

Description

Since #22383 the domain and path UI is combined and a subdomain install can have a custom path too. But tags/4.5.3/src/wp-admin/ms-delete-site.php?marks=88#L88 is still doing this check:

is_subdomain_install() ? $blog->domain : $blog->domain . $blog->path

This should be changed to always show the full URL.

Attachments (1)

ms-delete-site.diff (1.1 KB) - added by ian.edington 9 years ago.
Patch ms-delete-site to remove conditional

Download all attachments as: .zip

Change History (6)

@ian.edington
9 years ago

Patch ms-delete-site to remove conditional

#1 @ian.edington
9 years ago

  • Keywords has-patch added; needs-patch removed

Removed conditional if and set the printf paramaters order to help with translation.

PS first patch. be kind ;)
Done as part of TO Contrib2Core meetup.

#2 @ocean90
9 years ago

  • Milestone changed from Future Release to 4.7
  • Owner set to ian.edington
  • Status changed from new to assigned

@ian.edington Thanks for the patch! The change to the string is not necessary as there is only one placeholder.

#3 follow-up: @ian.edington
9 years ago

@ocean90 Thanks for the feedback. My understanding from @pbearne is that although %s works, %1$s makes the code more clear, therefore readable. I can see both points of view and both ways are used throughout the code base. Which one is the standard/better?

php files in core that use %1 without %2 in same line: (24 files)
php files in core that use %s: (100+ files)

Would you like me to re-submit a patch without the string change?

#4 @ocean90
9 years ago

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

In 38633:

Multisite: Show always domain and path when deleting a site.

Add a missing translators comment.

Props ian.edington.
Fixes #37309.

#5 in reply to: ↑ 3 @ocean90
9 years ago

Replying to ian.edington:

@ocean90 Thanks for the feedback. My understanding from @pbearne is that although %s works, %1$s makes the code more clear, therefore readable.

Not sure if it's more readable but I prefer using %s if it's just one placeholder.

Would you like me to re-submit a patch without the string change?

No, I did it on commit. Thanks again!

Note: See TracTickets for help on using tickets.