Ticket #4153 (closed enhancement: fixed)
edit_post_link return/echo
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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
Change History
comment:1
christianskarby — 5 years ago
- Cc christianskarby added
- Keywords has-patch needs-testing added
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
- 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 ;-)
comment:9
foolswisdom — 5 years ago
- Keywords commit removed
- Priority changed from highest omg bbq to normal
- Status changed from new to closed
- Resolution set to fixed
comment:10
foolswisdom — 5 years ago
- Keywords commit added
- Priority changed from normal to highest omg bbq
- Status changed from closed to reopened
- Resolution fixed deleted
Nvr mind me.
comment:11
mdawaffe — 5 years ago
4153.diff
- dpryo's quote mark (keeps link from being displayed in browser).
- Get rid of unused variable.
comment:13
rob1n — 5 years ago
I'll tackle this when I get home.
comment:14
ryan — 5 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.
comment:16
foolswisdom — 5 years ago
- Priority changed from highest omg bbq to normal
- Severity changed from blocker to normal
comment:17
rob1n — 5 years ago
- Keywords has-patch commit removed
Okay, this time around:
- TEST TEST TEST (/me slaps self)
- get_edit_*_link() returns URL, not code
- Filters, filters, filters.
Working on a patch.
comment:20
ryan — 5 years ago
WP coding style doesn't put braces around one line if statements. Other than that, looks good.
comment:21
rob1n — 5 years ago
- Status changed from reopened to closed
- Resolution set to fixed

