Title: WP Ajax Query
Author: aizatto
Published: <strong>2010 年 5 月 27 日</strong>
Last modified: 2010 年 5 月 27 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/wp-ajax-query.svg)

# WP Ajax Query

 作者：[aizatto](https://profiles.wordpress.org/aizatto/)

[下载](https://downloads.wordpress.org/plugin/wp-ajax-query.0.1.zip)

 * [详情](https://cn.wordpress.org/plugins/wp-ajax-query/#description)
 * [评价](https://cn.wordpress.org/plugins/wp-ajax-query/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/wp-ajax-query/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/wp-ajax-query/#developers)

 [支持](https://wordpress.org/support/plugin/wp-ajax-query/)

## 描述

WP Ajax Query allows you to query your WordPress database using the same query paramaters
you would use for WP_Query, and return a JSON respresentation of the query results.
This allows developers to easily interface with WordPress without having to relearn
a new API.

### How It Works

The Ajax Query interface would be available at http://example.com/wp-admin/admin-
ajax.php?action=query

A sample jQuery request would be like:
 $.get(ajaxurl, { action: ‘query’ }, function(){},‘
json’);

Querying for a post:
 $.get(ajaxurl, { action: ‘query’, p: 1 }, function () { },‘
json’);

JSON results:
 { “id”: 1, “type”: ‘post’, “title”: “Hello World”, “permalink”: “
http:\/\/example.com\/?p=1” }

Query a category:
 $.get(ajaxurl, { action: ‘query’, cat: 1 }, function () { }, ‘
json’);

JSON results:
 { “id”: 1 “type”: “category”, “permalink”: “http:\/\/example.com\/?
cat=1”, “terms”: [], “posts”: [] }

    ```
    terms and `posts` represents an array of either terms that are sub categories of the category, or posts belonging to the category.<h3>Why I Created It</h3>
    ```

Needed a common way to query the database for posts and taxonomies across multiple
plugins, and didn’t find a suitable replacement.

## 安装

 1. Upload the `wp-ajax-query` folder into your plugin directory.
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## 评价

此插件暂无评价。

## 贡献者及开发者

「WP Ajax Query」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ aizatto ](https://profiles.wordpress.org/aizatto/)

[帮助将「WP Ajax Query」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/wp-ajax-query)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/wp-ajax-query/)，查看
[SVN仓库](https://plugins.svn.wordpress.org/wp-ajax-query/)，或通过[RSS](https://plugins.trac.wordpress.org/log/wp-ajax-query/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/wp-ajax-query/)。

## 额外信息

 *  版本 **0.1**
 *  最后更新：**16 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 3 或更高版本 **
 *  已测试的最高版本为 **3**
 *  语言
 * [English (US)](https://wordpress.org/plugins/wp-ajax-query/)
 * 标签
 * [ajax](https://cn.wordpress.org/plugins/tags/ajax/)[JSON](https://cn.wordpress.org/plugins/tags/json/)
   [query](https://cn.wordpress.org/plugins/tags/query/)[wp_query](https://cn.wordpress.org/plugins/tags/wp_query/)
 *  [高级视图](https://cn.wordpress.org/plugins/wp-ajax-query/advanced/)

## 评级

尚未提交反馈。

[Your review](https://wordpress.org/support/plugin/wp-ajax-query/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/wp-ajax-query/reviews/)

## 贡献者

 *   [ aizatto ](https://profiles.wordpress.org/aizatto/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/wp-ajax-query/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=aizat%2efaiz%40gmail%2ecom&lc=MY&item_name=Ezwan%20Aizat%20Bin%20Abdullah%20Faiz&item_number=WP%20Ajax%20Query&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)