admin管理员组文章数量:1130349
I'm trying to create a utility script that to add some metadata into all posts of a certain post type. Right now I have it set up to loop through all users
$blogusers = get_users(array(
'role' => 'freelancer'
));
for( $i = $index; $i < count($blogusers); ++$i) {
$user = $blogusers[$i];
$userID = $user->ID; // set to user id
$profile_id = get_user_meta( $userID, 'user_profile_id', true);
$user_reach = get_post_meta( $profile_id, 'total_reach', true);
$user_engagement = get_post_meta( $profile_id, 'total_starpower', true);
$user_rating = get_post_meta( $profile_id, 'rating_score', true);
write_log("working on " . $user->user_login);
}
I want to copy user_reach, user_engagement, and user_rating into the meta of all of the users posts of BID post type.
I'm trying to create a utility script that to add some metadata into all posts of a certain post type. Right now I have it set up to loop through all users
$blogusers = get_users(array(
'role' => 'freelancer'
));
for( $i = $index; $i < count($blogusers); ++$i) {
$user = $blogusers[$i];
$userID = $user->ID; // set to user id
$profile_id = get_user_meta( $userID, 'user_profile_id', true);
$user_reach = get_post_meta( $profile_id, 'total_reach', true);
$user_engagement = get_post_meta( $profile_id, 'total_starpower', true);
$user_rating = get_post_meta( $profile_id, 'rating_score', true);
write_log("working on " . $user->user_login);
}
I want to copy user_reach, user_engagement, and user_rating into the meta of all of the users posts of BID post type.
本文标签: wp queryHow do I get all authors posts of a custom post type outside loop
版权声明:本文标题:wp query - How do I get all authors posts of a custom post type outside loop 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749186923a2329542.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论