Ticket #4153 (closed enhancement: fixed)

Opened 5 years ago

Last modified 5 years ago

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: christianskarby

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

4153.diff Download (3.0 KB) - added by rob1n 5 years ago.

Change History

  • Cc christianskarby added
  • Keywords has-patch needs-testing added
  • Milestone changed from 2.1.4 to 2.2

comment:3   ryan5 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.

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

Yeah, having get_edit_post_link() makes sense.

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

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

  • Status changed from closed to reopened
  • Resolution fixed deleted

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.

  • Priority changed from low to high

Seriously.

Where's the QA team? :)

I attached a patch. You probably understand.

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

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

  • Keywords commit removed
  • Priority changed from highest omg bbq to normal
  • Status changed from new to closed
  • Resolution set to fixed

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

  • Keywords commit added
  • Priority changed from normal to highest omg bbq
  • Status changed from closed to reopened
  • Resolution fixed deleted

Nvr mind me.

4153.diff

  1. dpryo's quote mark (keeps link from being displayed in browser).
  2. Get rid of unused variable.
  • Severity changed from normal to blocker

I'll tackle this when I get home.

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.

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

  • Priority changed from highest omg bbq to normal
  • Severity changed from blocker to normal
  • 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.

  • Milestone changed from 2.2 to 2.3

rob1n5 years ago

  • Keywords has-patch commit added

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

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

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

Note: See TracTickets for help on using tickets.