THIS PLUGIN IS IN HEAVY DEVELOPMENT!
这个插件正在大力发展! p>
Extend your site’s querying and sorting functionality using custom field values.
使用自定义字段值扩展您网站的查询和排序功能。 p>
The following function registers queryable fields.
以下函数注册可查询的字段。
register_custom_queryable_field($fieldName, $options);
register_custom_queryable_field($ fieldName,$ options); p>
Simple Example:
简单示例:
register_custom_queryable_field(‘city’);
register_custom_queryable_field('city');
(The above registers the custom field ‘city’ to be searchable using query variables)
(上面注册了自定义字段“城市”,可使用查询变量进行搜索)
http://www.yoursite.com/?city=Anahiem
http://www.yoursite.com/?city=Anahiem
(displays posts which have a meta key ‘city’ and a value of ‘Anahiem’)
(显示具有元键“ city”且值为“ Anahiem”的帖子) p>
Advanced Example:
高级示例:
register_custom_queryable_field(“price”, array(“dataType”=>”numeric”));
register_custom_queryable_field(“ price”,array(“ dataType” =>“ numeric”));
(The above registers the custom field “price” to be searchable as a number using query variables)
(上面将自定义字段“ price”注册为可使用查询变量搜索为数字)
http://www.yoursite.com/?price=500
http://www.yoursite.com/?price=500
(displays posts which have a meta key ‘price’ and a exact value of ‘500’)
(显示带有元键“价格”且确切值为“ 500”的帖子)
http://www.yoursite.com/?price_min=200&price_max=800&order_by=price
http://www.yoursite.com/?price_min=200&price_max=800&order_by=price
(displays posts, sorted by ‘price’, which have a meta key ‘price’ and a value between ‘200’ and ‘800’)
(显示按“价格”排序的帖子,其中包含一个元键“价格”,其值在“ 200”和“ 800”之间) p>
Available Options:
可用选项: p>
- dataType
- 数据类型
- text (default)
- 文本(默认) li>
- numeric (receive min/max query variables, see above example)
- 数字(接收最小/最大查询变量,请参见上面的示例) li>
ul>
li>
- order
- 订单
li>
- compare
- 比较
- Compare method for text types.
- 比较文本类型的方法。
Defaults to ‘=’.
默认为“ =”。
Recommend ‘LIKE’
推荐“赞” li>
ul>
li>
ul>
There is a “order_by” query var made available.
有一个“ order_by”查询变量可用。
This is used by adding &order_by=price
to the URL.
这是通过将&order_by = price code>添加到URL来使用的。In this instance, the query would sort based on the “price” field only.
在这种情况下,查询将仅基于“价格”字段进行排序。 p>
Note: This plugin does not alter any queries when in the backend.
注意:当在后端时,此插件不会更改任何查询。 p>