Php 将文章id与文章的链接包装在一起
我有这个功能在wordpress的管理端运行。因此,它会显示每个用户最喜欢的帖子的帖子IDPhp 将文章id与文章的链接包装在一起,php,wordpress,Php,Wordpress,我有这个功能在wordpress的管理端运行。因此,它会显示每个用户最喜欢的帖子的帖子ID function new_modify_user_table( $column ) { $column['id'] = 'ID'; $column['favorites_number'] = 'Favorites Number'; $column['favorites_posts'] = 'Favorites Posts'; return $column; } add_fi
function new_modify_user_table( $column ) {
$column['id'] = 'ID';
$column['favorites_number'] = 'Favorites Number';
$column['favorites_posts'] = 'Favorites Posts';
return $column;
}
add_filter( 'manage_users_columns', 'new_modify_user_table' );
function new_modify_user_table_row( $val, $column_name, $user_id ) {
switch ($column_name) {
case 'id' :
return get_the_author_meta( 'ID', $user_id );
case 'favorites_number' :
$faves = get_the_author_meta('simplefavorites', $user_id);
return empty( $faves[0]['posts']) ? '0' : count( $faves[0]['posts']);
case 'favorites_posts' :
$faves = get_the_author_meta('simplefavorites', $user_id);
return implode(',', $faves[0]['posts']);
default:
}
return $val;
}
add_filter( 'manage_users_custom_column', 'new_modify_user_table_row', 10, 3 );
所以在我喜欢的地方
return implode(',', $faves[0]['posts']);
我想通过permalink,以便可以单击这些ID:
get_permalink($post_id)
你知道怎么做吗?任何反馈都非常感谢:)hmmmm这已经死了:(