[wordpress插件] Custom Query Fields自定义查询字段

wordpress 插件 文章 2020-04-09 11:50 594 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

THIS PLUGIN IS IN HEAVY DEVELOPMENT!

这个插件正在大力发展!

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

使用自定义字段值扩展您网站的查询和排序功能。

The following function registers queryable fields.
    

以下函数注册可查询的字段。
    

register_custom_queryable_field($fieldName, $options);

register_custom_queryable_field($ fieldName,$ options);

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”的帖子)

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”之间)

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.

          • 如果用户使用“ order_by”查询变量,则此选项确定订单。

            Available options are “ASC” and “DESC”(default)

          • 可用选项为“ ASC”和“ DESC”(默认)

        • compare

        • 比较

            • Compare method for text types.

            • 比较文本类型的方法。

              Defaults to ‘=’.

              默认为“ =”。

              Recommend ‘LIKE’

            • 推荐“赞”

          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 添加到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.

          注意:当在后端时,此插件不会更改任何查询。

安装步骤

    1. Upload custom-query-fields directory to the /wp-content/plugins/ directory
    2. custom-query-fields 目录上传到 / wp-content / plugins / 目录

    3. Activate the plugin through the ‘Plugins’ menu in WordPress
    4. 通过WordPress中的“插件”菜单激活插件

    5. See Description on how to enable the custom variables.
    6. 请参阅有关如何启用自定义变量的说明。

下载地址
https://downloads.wordpress.org/plugin/custom-query-fields.zip
-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
[wordpress插件] Custom WooCommerce Checkout Fields Editor自定义WooCommerce结帐字段编辑器
[wordpress插件] CSV Posts ImporterCSV帖子导入器
[wordpress插件] Coppermine Photo Gallery Badge Plugin for WordPress适用于WordPress的Coppermine图片库徽章插件
[wordpress插件] Bonjour Bar你好吧
[wordpress插件] BePro Listings Business DirectoryBePro商家信息目录
随便看看
微信公众号免300认证教程 4980
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 4098
小程序广告组件通过审核,但是小程序内没有显示广告? 4277
企业微信通讯录账号被管理员误/恶意删除,怎么办? 8058
问题? 7284
如何快速搭建抽奖助手小程序(无需代码知识) 5067
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 6022
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 5634
我的小程序广告收款主体是个体工商户,每个月邮寄两次发票很是麻烦,我年底的时候打包邮寄一次可以么? 5225
如何解决渲染层网络错误Failed to load media? 16576