Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#22351 closed defect (bug) (fixed)

Action "permalink_structure_changed" passes new permalink_structure for old and new permalink_structure value

Reported by: doublesharp's profile doublesharp Owned by: duck_'s profile duck_
Milestone: 3.5 Priority: normal
Severity: normal Version: 2.8
Component: Permalinks Keywords: has-patch needs-testing dev-feedback
Focuses: Cc:

Description

Per the function PHPDoc, the set_permalink_structure() method in /wp-includes/rewrite.php should fire the 'permalink_structure_changed' with the old and new permalink structure after the new structure is saved:

* Fires the 'permalink_structure_changed' action once the init call has

  • processed passing the old and new values

It is currently passing $this->permalink_structure as the "old" structure value, however as this value is updated by the call to $this->init() the result is that the new structure is passed instead of the old structure.

Suggested patch would copy $this->permalink_structure before the call to $this->init() and pass the copy as the old permalink structure.

Attachments (1)

rewrite.php.patch (549 bytes) - added by doublesharp 12 years ago.
fixes "permalink_structure_changed" action

Download all attachments as: .zip

Change History (8)

@doublesharp
12 years ago

fixes "permalink_structure_changed" action

#1 @doublesharp
12 years ago

functionality was originally added in changeset:11325 with bug.

#2 @doublesharp
12 years ago

  • Version changed from trunk to 2.8

#3 @doublesharp
12 years ago

  • Keywords dev-feedback added

#4 @SergeyBiryukov
12 years ago

  • Milestone changed from Awaiting Review to 3.5

#5 @duck_
12 years ago

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

In 22398:

Actually pass old permalink structure with permalink_structure_changed action

Props doublesharp. Fixes #22351.

#6 @duck_
12 years ago

Thanks for the patch! For future reference, it is preferred that patches are made from the root of the WordPress checkout, so referencing wp-includes/rewrite.php instead of just rewrite.php.

#7 @doublesharp
12 years ago

Sorry about that, still getting used to my new SVN client. I will make sure they are from the root in the future, thanks!

Note: See TracTickets for help on using tickets.