JSON API-按自定义分类进行搜索

时间:2015-05-29 作者:Alex Aung

我正在尝试根据一些参数获取帖子。我的JSON API查询如下。http://www.example.com/api/get_posts/?post_type=job_listing&page=10&count=5/

这是我自定义帖子的JSON结果。所以我想通过“taxonomy\\u job\\u loc”来发布这篇文章。

“taxonomy\\u job\\u loc”是自定义分类法。请问如何按自定义分类法进行搜索。

"posts": [
{
  "id": 16107,
  "type": "job_listing",
  "slug": "chief-auditor-8",
  "url": "http:\\/\\/www.example.com\\/jobs\\/chief-auditor-8\\/",
  "status": "publish",
  "title": "Chief Auditor",
  "title_plain": "Chief Auditor",
  "content": "<p><strong>Job Description<\\/strong><\\/p>\\n<ul>\\n<li>Set the strategic direction of the Internal Audit Department<br \\/>\\n\\u2022 Establish policies and procedures to guide the Internal Audit Department<br \\/>\\n\\u2022 Report periodically to Senior Management and the Audit Committee regarding Internal Audit\\u2019s\\u00a0\\u00a0\\u00a0\\u00a0 purpose, authority, responsibility, and performance relative to its Annual Audit Plan in accordance with the Internal Audit Charter<br \\/>\\n\\u2022 Develop and maintain a system to monitor the disposition of results communicated to management.<br \\/>\\n\\u2022 Ensure adequate department resources to execute the Internal Audit activities .<br \\/>\\n\\u2022 Overall resourcing and communication\\/coordination within company flows from CAE through manager to team.<\\/li>\\n<\\/ul>\\n<p><strong>Requirement<\\/strong><\\/p>\\n<ul>\\n<li>\\nMust be thoroughly familiar with internal auditing and accounting principles, risk and control principles<br \\/>\\n\\u2022 Must be familiar with Institute of Internal Auditors standards and necessary processes to ensure compliance<br \\/>\\n\\u2022 Must have CPA and CIA (strongly preferred graduate education is preferred MBA)<br \\/>\\n\\u2022 Must be able to create, lead courageously and inspire high performance teams<br \\/>\\n\\u2022 Must be a strategic, innovative thinker with strong leadership capabilities and a progressive track record in audit, risk and compliance.<\\/li>\\n<\\/ul>\\n",
  "excerpt": "<p>Job Description Set the strategic direction of the Internal Audit Department \\u2022 Establish policies and procedures to guide the Internal Audit Department \\u2022 Report periodically to Senior Management and the Audit Committee regarding Internal Audit\\u2019s\\u00a0\\u00a0\\u00a0\\u00a0 purpose, authority, responsibility, and performance relative to its Annual Audit Plan in accordance with the Internal Audit Charter \\u2022 Develop [&hellip;]<\\/p>\\n",
  "date": "2015-05-27 16:12:56",
  "modified": "2015-05-27 16:12:56",
  "categories": [

  ],
  "tags": [

  ],
  "author": {
    "id": 730,
    "slug": "supreme",
    "name": "Supreme",
    "first_name": "Supreme",
    "last_name": "HR",
    "nickname": "Supreme",
    "url": "",
    "description": ""
  },
  "comments": [

  ],
  "attachments": [

  ],
  "comment_count": 0,
  "comment_status": "open",
  "custom_fields": {
    "geo_address": [
      "Yangon"
    ],
    "geo_country": [
      "Republic of the Union of Myanmar"
    ],
    "geo_short_address": [
      "Yangon"
    ],
    "geo_short_address_country": [
      "Yangon Region, Republic of the Union of Myanmar"
    ],
    "jr_daily_count": [
      "2"
    ],
    "jr_total_count": [
      "28"
    ]
  },
  "taxonomy_job_loc": [
    {
      "id": 1287,
      "slug": "yangon",
      "title": "Yangon",
      "description": "",
      "parent": 0,
      "post_count": 290
    }
  ],
  "taxonomy_job_type": [
    {
      "id": 3,
      "slug": "full-time",
      "title": "Full-Time",
      "description": "",
      "parent": 0,
      "post_count": 315
    }
  ],
  "taxonomy_job_tag": [

  ],
  "taxonomy_job_salary": [

  ]
},

1 个回复
最合适的回答,由SO网友:TheDeadMedic 整理而成

我猜你在用this plugin? From the docs 似乎可以使用标准查询参数,因此请尝试:

/api/get_posts/?job_loc=yangon&page=10&count=5

结束

相关推荐