WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#4800 closed enhancement (fixed)

Trackback function cleanup

Reported by: Otto42 Owned by: markjaquith
Milestone: 2.3 Priority: lowest
Severity: trivial Version: 2.3
Component: Optimization Keywords: has-patch commit
Focuses: Cc:

Description

The trackback_url functions are a bit haphazard. This is a patch to clean the up and bring them somewhat in line with the rest of the code.

trackback_url() accepts a $display parameter which is pointless when it's just using the get_trackback_url() function to do all the work.

get_trackback_url() set the trackback url to the default setting, then set it again to the correct URL if using permalinks. A minor optimization is to use an else{} to set it correctly in the first place and avoid the extra string work and function calls.

Minor optimizations, but still, we should try to keep things consistent and fast.

Attachments (1)

trackback-cleanup.diff (3.8 KB) - added by Otto42 7 years ago.
Cleanup of trackback_url functions

Download all attachments as: .zip

Change History (6)

comment:1 rob1n7 years ago

  • Keywords commit added; 2nd-opinion removed
  • Milestone changed from 2.4 (future) to 2.3 (trunk)

comment:2 follow-up: markjaquith7 years ago

  • Owner changed from anonymous to markjaquith
  • Status changed from new to assigned

in comment-template.php you used trackback_url() to replace trackback_url(0) -- that should be get_trackback_url()

Also, we should deprecate the echo/return switch for a version before we remove it. Turn the variable into $deprecated and retain the echo/return logic. We can mark it with // remove backwards compat in 2.4

comment:3 JeremyVisser7 years ago

Does anybody actually use trackback still, apart from spammers?

Otto427 years ago

Cleanup of trackback_url functions

comment:4 in reply to: ↑ 2 Otto427 years ago

Replying to markjaquith:

in comment-template.php you used trackback_url() to replace trackback_url(0) -- that should be get_trackback_url()

Also, we should deprecate the echo/return switch for a version before we remove it. Turn the variable into $deprecated and retain the echo/return logic. We can mark it with // remove backwards compat in 2.4

Agreed. Both changes made to the patch, new patch uploaded (replacing the old one).

comment:5 ryan7 years ago

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

(In [5982]) Trackback fxn cleanup from Otto42. fixes #4800

Note: See TracTickets for help on using tickets.