Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#4800 closed enhancement (fixed)

Trackback function cleanup

Reported by: otto42's profile Otto42 Owned by: markjaquith's profile 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 17 years ago.
Cleanup of trackback_url functions

Download all attachments as: .zip

Change History (6)

#1 @rob1n
17 years ago

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

#2 follow-up: @markjaquith
17 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

#3 @JeremyVisser
17 years ago

Does anybody actually use trackback still, apart from spammers?

@Otto42
17 years ago

Cleanup of trackback_url functions

#4 in reply to: ↑ 2 @Otto42
17 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).

#5 @ryan
17 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.