更新当我删除GitHub上的回购协议时,这里有一个新的答案。
add_filter( \'previous_post_link\', \'wpse13044_adjacent_post_link_tooltip\', 10, 2 );
add_filter( \'next_post_link\', \'wpse13044_adjacent_post_link_tooltip\', 10, 2 );
function wpse13044_adjacent_post_link_tooltip( $format, $link )
{
$previous = \'previous_post_link\' === current_filter();
// Get the next/previous post object
$post = get_adjacent_post(
false
,\'\'
,$previous
);
// Copypasta from cores `get_adjacent_post_link()` fn
\'\' === $title = get_the_title( $post->ID );
AND $title = $previous
? sprint( __( \'Previous Post: %s\', \'your_textdomain\' ), $title )
: sprint( __( \'Next Post: %s\', \'your_textdomain\' ), $title );
$format = str_replace(
\'rel="\'
,sprintf(
\'title="%s" rel="\'
,$title
)
,$format
);
return "<span class=\'some classes\'>{$format}</span>";
}