滤器\'the_title\'
在屏幕上显示您的帖子类型列表
初始挂钩的模式为:manage_edit-post_type_name_columns
.
示例代码:
// replace \'post\' with the post type name you want to catch.
add_filter( \'manage_edit-post_columns\', \'wpse_67171_title_to_url\' );
/**
* Replace the default title with its permalink.
*
* @param string $title
* @param int $id Post ID
* @return string
*/
function wpse_67171_title_to_url( $title, $id = 0 )
{
if ( \'the_title\' !== current_filter() )
{
add_filter( \'the_title\', __FUNCTION__, 10, 2 );
return $title;
}
// strip domain name
return parse_url( get_permalink( $id ), PHP_URL_PATH );
}
结果: