Ticket #4800 (closed enhancement: fixed)

Opened 1 year ago

Last modified 1 year ago

Trackback function cleanup

Reported by: Otto42 Assigned to: markjaquith
Priority: lowest Milestone: 2.3
Component: Optimization Version: 2.3
Severity: trivial Keywords: has-patch commit
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

trackback-cleanup.diff (3.8 kB) - added by Otto42 on 08/23/07 14:58:13.
Cleanup of trackback_url functions

Change History

08/22/07 22:13:52 changed by rob1n

  • keywords changed from has-patch 2nd-opinion to has-patch commit.
  • milestone changed from 2.4 (future) to 2.3 (trunk).

(follow-up: ↓ 4 ) 08/23/07 03:57:37 changed by markjaquith

  • 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

08/23/07 11:04:29 changed by JeremyVisser

Does anybody actually use trackback still, apart from spammers?

08/23/07 14:58:13 changed by Otto42

  • attachment trackback-cleanup.diff added.

Cleanup of trackback_url functions

(in reply to: ↑ 2 ) 08/23/07 14:59:06 changed by Otto42

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).

08/29/07 23:08:44 changed by ryan

  • status changed from assigned to closed.
  • resolution set to fixed.

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