WordPress.org

Make WordPress Core

Opened 2 months ago

Closed 5 weeks ago

#40516 closed defect (bug) (fixed)

Twenty Seventeen: Remove uneccessary return statement in twentyseventeen_edit_link()

Reported by: truongwp Owned by: obenland
Milestone: 4.8 Priority: normal
Severity: normal Version: 4.7
Component: Bundled Theme Keywords: has-patch
Focuses: template Cc:

Description

I think that the return statement in twentyseventeen_edit_link() function is not neccessary because the edit_post_link() function always returns null.

Attachments (1)

40516.diff (648 bytes) - added by truongwp 2 months ago.

Download all attachments as: .zip

Change History (11)

@truongwp
2 months ago

#1 @truongwp
2 months ago

  • Component changed from Themes to Bundled Theme
  • Summary changed from Remove uneccessary return statement in twentyseventeen_edit_link() to Twenty Seventeen: Remove uneccessary return statement in twentyseventeen_edit_link()

#2 @afercia
2 months ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 4.7.5
  • Type changed from enhancement to defect (bug)
  • Version changed from trunk to 4.7

Yep, actually edit_post_link() echoes the link and doesn't return anything so the implementation here doesn't look correct to me. Thanks @truongwp !

#3 follow-up: @Presskopp
2 months ago

what about the line

twentyseventeen_edit_link( get_the_ID() );

in:

content-front-page-panels.php
content-front-page.php
content-page.php

?

#4 in reply to: ↑ 3 @truongwp
2 months ago

@Presskopp: It shows the Edit page link.
@afercia: Thank you!

Last edited 2 months ago by truongwp (previous) (diff)

#5 @lukecavanagh
2 months ago

40516.diff Applies cleanly.

This ticket was mentioned in Slack in #core by desrosj. View the logs.


6 weeks ago

#7 @desrosj
6 weeks ago

  • Milestone changed from 4.7.5 to 4.8

Looks like this just needs an owner. Putting it in 4.8.

This ticket was mentioned in Slack in #core by obenland. View the logs.


5 weeks ago

#9 @obenland
5 weeks ago

  • Owner set to obenland
  • Status changed from new to accepted

#10 @obenland
5 weeks ago

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

In 40795:

Twenty Seventeen: Remove uneccessary return statement

Props truongwp.
Fixes #40516.

Note: See TracTickets for help on using tickets.