最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How get list of job types of simple job board plugin from code?

programmeradmin1浏览0评论

My code to get a list of jobpost is this, but in this list don't show job types

 $active_jobs = get_posts( array(
                        'post_type'           => 'jobpost',
                        'post_status'         => array( 'publish', 'pending' ),
                        'ignore_sticky_posts' => 1,
                        'posts_per_page'      => 3,
                        'author'              => get_current_user_id()
                ) );

My code to get a list of jobpost is this, but in this list don't show job types

 $active_jobs = get_posts( array(
                        'post_type'           => 'jobpost',
                        'post_status'         => array( 'publish', 'pending' ),
                        'ignore_sticky_posts' => 1,
                        'posts_per_page'      => 3,
                        'author'              => get_current_user_id()
                ) );
Share Improve this question edited Jun 18, 2020 at 16:30 fuxia 107k38 gold badges255 silver badges459 bronze badges asked Jun 18, 2020 at 14:58 AstercrakerAstercraker 12 bronze badges 2
  • Is jobpost the correct slug for the post type? – jdm2112 Commented Jun 18, 2020 at 16:22
  • yes, for the plugin simple-job-board – Astercraker Commented Jun 18, 2020 at 16:23
Add a comment  | 

1 Answer 1

Reset to default 0

This is my solution

 $types = wp_get_post_terms($post->ID, 'jobpost_job_type');
 var_dump($types);
发布评论

评论列表(0)

  1. 暂无评论