Make WordPress Core

Opened 20 years ago

Closed 20 years ago

#4153 closed enhancement (fixed)

edit_post_link return/echo

Reported by: christianskarby Owned by: rob1n
Priority: normal Milestone: 2.3
Component: General Version: 2.2
Severity: normal Keywords: has-patch commit
Cc: Focuses:

Description

I suggest the following API-change to allow for templates to decide whether the text should be displayed from within the edit_post_link function (legacy) or returned back as a string.

from: edit_post_link($link = 'Edit This', $before = '', $after = '')
to:   edit_post_link($link = 'Edit This', $before = '', $after = '', $echo=true)

Attachments (1)

4153.diff​ (3.0 KB ) - added by rob1n 20 years ago.

Download all attachments as: .zip

Change History (22)

#1 @christianskarby
20 years ago

  • Cc christianskarby added
  • Keywords has-patch needs-testing added

#2 @foolswisdom
20 years ago

  • Milestone 2.1.4 → 2.2

#3 @ryan
20 years ago

We can add get_edit_post_link() that returns the bare link. Output should be run through a 'edit_post_link' filter. edit_post_link() would then call get_edit_post_link(). Same can be done for edit_comment_link(). See all of the other get_*_link() functions.

#4 @rob1n
20 years ago

  • Keywords has-patch needs-testing removed
  • Owner changed from anonymous to rob1n

Yeah, having get_edit_post_link() makes sense.

#5 @rob1n
20 years ago

  • Resolution → fixed
  • Status new → closed

(In [5275]) Add get_edit_comment_link() and get_edit_post_link(). fixes #4153

#6 @kkwangen
20 years ago

  • Resolution fixed
  • Status closed → reopened

There was as missing " on line 296 in link-template.php causes the entire page/ post to becoming an edit this link. I've attached the fixed one I made.

#7 @dpryo
20 years ago

  • Priority low → high

Seriously.

Where's the QA team? :)

I attached a patch. You probably understand.

#8 @westi
20 years ago

  • Keywords has-patch commit added
  • Priority high → highest omg bbq
  • Severity minor → normal
  • Status reopened → new
  • Version 2.1.3 → 2.2

/me slaps rob1n - test test test commit ;-)

#9 @foolswisdom
20 years ago

  • Keywords commit removed
  • Priority highest omg bbq → normal
  • Resolution → fixed
  • Status new → closed

dpryo, no I don't understand, though attaching as a patch is appreciated.
I think this has already been corrected, [5276] (and then also [5277]).

#10 @foolswisdom
20 years ago

  • Keywords commit added
  • Priority normal → highest omg bbq
  • Resolution fixed
  • Status closed → reopened

Nvr mind me.

#11 @mdawaffe
20 years ago

4153.diff

  1. dpryo's quote mark (keeps link from being displayed in browser).
  2. Get rid of unused variable.

#12 @rob1n
20 years ago

  • Severity normal → blocker

#13 @rob1n
20 years ago

I'll tackle this when I get home.

#14 @ryan
20 years ago

get_edit_post_link() shouldn't return an anchor with href, just the link itself as do the other get functions. The link should be passed through a filter for those who want to change the link.

#15 @ryan
20 years ago

(In [5282]) Revert [5275] - [5277]. Fix it later. see #4153

#16 @foolswisdom
20 years ago

  • Priority highest omg bbq → normal
  • Severity blocker → normal

#17 @rob1n
20 years ago

  • Keywords has-patch commit removed

Okay, this time around:

  1. TEST TEST TEST (/me slaps self)
  1. get_edit_*_link() returns URL, not code
  1. Filters, filters, filters.

Working on a patch.

#18 @rob1n
20 years ago

  • Milestone 2.2 → 2.3

#19 @rob1n
20 years ago

  • Keywords has-patch commit added

#20 @ryan
20 years ago

WP coding style doesn't put braces around one line if statements. Other than that, looks good.

#21 @rob1n
20 years ago

  • Resolution → fixed
  • Status reopened → closed

(In [5302]) get_edit_*_link() functions. fixes #4153

Note: See TracTickets for help on using tickets.