WordPress.org

Make WordPress Core

Opened 6 months ago

Closed 5 months ago

#38152 closed defect (bug) (fixed)

Clarify in the DocBlock that get_site_by_path() does not return exact matches

Reported by: ocean90 Owned by: jeremyfelt
Milestone: 4.7 Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: good-first-bug has-patch
Focuses: docs, multisite Cc:

Description

Related Slack discussion: https://wordpress.slack.com/archives/core-multisite/p1474390310000390

get_site_by_path() does not return exact matches because it also searches sites with path = '/'. The same applies to WP_Network::get_by_path() but its DocBlock is much better. We should add a similar comment to get_site_by_path().

Attachments (2)

38152.patch (728 bytes) - added by stevenlinx 6 months ago.
38152.2.patch (786 bytes) - added by stevenlinx 6 months ago.

Download all attachments as: .zip

Change History (10)

@stevenlinx
6 months ago

#1 @stevenlinx
6 months ago

  • Keywords has-patch added; needs-patch removed

#2 @DrewAPicture
6 months ago

  • Milestone changed from Future Release to 4.7
  • Owner set to DrewAPicture
  • Status changed from new to reviewing

This ticket was mentioned in Slack in #docs by morganestes. View the logs.


6 months ago

#4 @morganestes
6 months ago

The patch doesn't seem to match the description. Don't we want the description to be more descriptive, rather than shorter here?

@stevenlinx
6 months ago

#5 @stevenlinx
6 months ago

sry., there was a diff option issue. In the previous patch, the red block should be the green block and vice versa.

I've uploaded a revised version.

This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.


6 months ago

#7 @jeremyfelt
6 months ago

  • Owner changed from DrewAPicture to jeremyfelt

#8 @jeremyfelt
5 months ago

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

In 38781:

Multisite: Clarify that get_site_by_path() does not return exact matches.

Props stevenlinx.
Fixes #38152.

Note: See TracTickets for help on using tickets.