WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 2 weeks ago

#41687 closed defect (bug) (fixed)

wp_update_link() doesn't allow updating of link_owner

Reported by: pbiron Owned by: valentinbora
Milestone: 5.4 Priority: low
Severity: normal Version: 4.9
Component: Administration Keywords: has-patch commit
Focuses: administration Cc:

Description

The title says it all.

Example:

$link_id = wp_insert_link( array(
    'link_name' => 'foo',
    'link_url' => 'http://example.com',
    'link_owner' => 1,
) );
// $link_id has link_url == http://example.com and link_owner == 1

wp_update_link( array(
    'link_id' => $link_id,
    'link_url' => 'http://example.org',
    'link_owner' => 2,
) );
// $link_id now has link_url == 'http://example.org, but still has link_owner == 1 :-(

Attachments (1)

41687.diff (1.2 KB) - added by pbiron 3 years ago.
allow updates of link_owner

Download all attachments as: .zip

Change History (6)

@pbiron
3 years ago

allow updates of link_owner

#1 @pbiron
3 years ago

  • Keywords has-patch added

related: #2804

@nikhilgupte reported the same bug 11 years ago and his ticket was closed as invalid because "link ownership is being deprecated", which obviously never happened.

#2 @valentinbora
2 weeks ago

  • Focuses administration added
  • Keywords commit added
  • Milestone changed from Awaiting Review to 5.4
  • Owner set to valentinbora
  • Priority changed from normal to low
  • Status changed from new to accepted

Patch 41687.diff applies cleanly, thanks @pbiron. Looks like a trivial change, suggesting this for commit.

#3 @valentinbora
2 weeks ago

As we're at beta 1 for 5.4 since Feb 11th, I'd rather suggest punting this to 5.5 unless committers consider it could still make it.

#4 @pbiron
2 weeks ago

punting to 5.5 fine with me.

#5 @SergeyBiryukov
2 weeks ago

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

In 47291:

Administration: Allow wp_update_link() to update the link_owner field, for consistency with other link fields.

Props pbiron, valentinbora, nikhilgupte.
Fixes #41687.

Note: See TracTickets for help on using tickets.