WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#33272 closed defect (bug) (invalid)

strange behavior with pages when added more than one with same title.

Reported by: satalways Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2.4
Component: Posts, Post Types Keywords: reporter-feedback
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Hi,

When I add few pages with same title like I am adding (My Page, My Page, My Page, My Page) 4 times. Pretty permalink is enabled and their IDs are (1, 3, 5, 7). Their slugs are (my-page, my-page2, my-page3, my-page4). All pages are published.

I am using WordPress function get_page_link(5). It always returned link of first page with ID 1. Why is this happening.. One more thing I opened page 5 in browser like http://localhost/my-page3/ When I click on Edit Page at top in Admin bar it always goes to edit 1 not 5.

I am testing all this with latest version of WordPress 4.2.4.

Change History (3)

#1 @SergeyBiryukov
5 years ago

  • Component changed from General to Posts, Post Types
  • Description modified (diff)

#2 @jeremyfelt
5 years ago

  • Keywords reporter-feedback added

Hi @satalways, thanks for the report.

I'm not able to duplicate the issue. I also created 5 pages with the same title "My Page" and my get_page_link( 1723 ); for the 5th ID returns http://foo.bar/my-page-5/ as expected.

Can you duplicate the issue with all plugins disabled and one of the default themes?

#3 @wonderboymusic
5 years ago

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

No response from @satalways, but thanks for the ticket. As @jeremyfelt noted, this appears to be working as expected.

Note: See TracTickets for help on using tickets.