WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#3033 closed defect (bug) (fixed)

Identical Permalinks for Different Attachments

Reported by: filosofo Owned by:
Milestone: 2.1 Priority: normal
Severity: normal Version: 2.1
Component: Administration Keywords: post_name bg|has-patch attachment permalink
Focuses: Cc:

Description

If you upload 2 different attachments in one post, give them the same title, and send them to the editor "linked to page," then both will end up with the same permalink for their "pages."

It happens because wp_insert_attachment() doesn't check to see if the post_name already exists.

My patch increments the post_name similarly to the way in which a regular post's post_name increments when it has a duplicate.

Attachments (1)

post.php.diff (893 bytes) - added by filosofo 8 years ago.

Download all attachments as: .zip

Change History (2)

filosofo8 years ago

comment:1 ryan7 years ago

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

(In [4561]) Make sure multiple attachments for the same post have unique permalinks. Props filosofo. fixes #3033

Note: See TracTickets for help on using tickets.