Plugin này chưa được cập nhật với 3 phiên bản mới nhất của WordPress. Nó có thể không được hỗ trợ và bảo trì, và có thể xung đột với các phiên bản WordPress mới nhất.

Custom Query Fields

Mô tả


Extend your site’s querying and sorting functionality using custom field values.

The following function registers queryable fields.
register_custom_queryable_field($fieldName, $options);

Simple Example:
(The above registers the custom field ‘city’ to be searchable using query variables)
(displays posts which have a meta key ‘city’ and a value of ‘Anahiem’)

Advanced Example:
register_custom_queryable_field(“price”, array(“dataType”=>”numeric”));
(The above registers the custom field “price” to be searchable as a number using query variables)
(displays posts which have a meta key ‘price’ and a exact value of ‘500’)
(displays posts, sorted by ‘price’, which have a meta key ‘price’ and a value between ‘200’ and ‘800’)

Available Options:

  • dataType
    • text (default)
    • numeric (receive min/max query variables, see above example)
  • order
    • If the user uses the “order_by” query variable then this option determines the order. Available options are “ASC” and “DESC”(default)
  • compare
    • Compare method for text types. Defaults to ‘=’. Recommend ‘LIKE’

There is a “order_by” query var made available. This is used by adding &order_by=price to the URL. In this instance, the query would sort based on the “price” field only.

Note: This plugin does not alter any queries when in the backend.

Cài đặt

  1. Upload custom-query-fields directory to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. See Description on how to enable the custom variables.

Hỏi đáp

When will you have some FAQ’s?


Đánh giá

There are no reviews for this plugin.

Người đóng góp & Lập trình viên

“Custom Query Fields” là mã nguồn mở. Những người sau đã đóng góp vào plugin này.

Những người đóng góp

Nhật ký thay đổi


  • Fixed some foreach bugs that threw warnings if no fields were registered.
  • The plugin is now only using one global variable.
  • Added backward compatibility with version 3.0.
  • Improved code efficiency.
  • Added enable and disable functions to allow you to apply custom field query to external query’s.


  • Added the ability to control whether the query altering function is run only once.
  • Added the compare option to the registered fields. This compare is ignored for numeric comparisons.


  • Initial build.