[wp-trac] [WordPress Trac] #2571: Suggested improvement to
edit_post_link
WordPress Trac
wp-trac at lists.automattic.com
Wed Mar 15 12:26:18 GMT 2006
#2571: Suggested improvement to edit_post_link
-------------------------+--------------------------------------------------
Id: 2571 | Status: new
Component: General | Modified: Wed Mar 15 12:26:18 2006
Severity: enhancement | Milestone:
Priority: normal | Version: 2.0.2
Owner: anonymous | Reporter: longwayround
-------------------------+--------------------------------------------------
WAI guidelines expect all links to have unique titles.
In my local install, I have amended the file template-functions-links.php
to contain the following:
{{{
function edit_post_link($link = 'Edit This', $before = '', $after = '') {
global $post;
if ( ! current_user_can('edit_post', $post->ID) )
return;
if ( is_attachment() )
return;
else
$file = 'post';
$location = get_settings('siteurl') . "/wp-
admin/{$file}.php?action=edit&post=$post->ID";
/* Accessibility improvement */
/* echo $before . "<a href=\"$location\">$link</a>" . $after; */
echo "$before <a href=\"$location\" title=\"Edit Post
$post->post_title\">$link</a> $after";
/* Accessibility improvement ends */
}
}}}
Now, all comment links have useful titles.
--
Ticket URL: <http://trac.wordpress.org/ticket/2571>
WordPress Trac <http://wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list