[wordpress插件] ACF Dynamic ChoicesACF动态选择

wordpress 插件 文章 2020-01-26 11:00 513 0 全屏看文

AI助手支持GPT4.0

评分

100

100

描述

If you’ve ever needed your ACF choices to be dynamically generated by a SQL query, this plugin will help you get the job done.

如果您曾经需要通过SQL查询动态生成ACF选项,则此插件将帮助您完成工作。

You can mix and match static choices with dynamic, SQL-based choices by placing as many regular choices in the list as you'd like, followed by the special %%QUERY%% choice that

您可以通过在列表中放置任意数量的常规选项,然后再添加特殊的 %% QUERY %% 选项,将静态选项与基于SQL的动态选项混合和匹配。

will tell this plugin to load choices dynamically from the database.

会告诉该插件从数据库动态加载选择。

An example on how to list users, setting the id as the value, would look like this:

关于如何列出用户的示例,将 id 设置为值,将看起来像这样:

%%QUERY%% : SELECT user_nicename AS text, id AS value FROM wp_users

  %% QUERY %%:选择user_nicename AS文本,id AS值来自wp_users

Arbitrary section

任意部分

安装步骤

    1. Upload acf-dynamic-choices folder to the /wp-content/plugins/ directory.

    2. acf-dynamic-choices 文件夹上载到 / wp-content / plugins / 目录。

      Alternatively, install the zip through the WordPress Plugins installer.

    3. 或者,通过WordPress插件安装程序安装 zip

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

    6. Place a query in your ACF choices box in this form: %%QUERY%% : SELECT field1 AS text, field2 AS value FROM ....
    7. 以以下形式在ACF选择框中放置一个查询: %% QUERY %%:选择field1 AS文本,field2 AS值FROM...。

    8. Browse to a Post or the Options Page where you just added the dynamic query and ensure that the choices are properly being populated.
    9. 浏览至帖子或“选项”页面,您刚刚在其中添加了动态查询,并确保正确填充了选择。

下载地址

https://downloads.wordpress.org/plugin/acf-dynamic-choices.0.5.zip

https://downloads.wordpress.org/plugin/acf-dynamic-choices.0.5.zip

-EOF-

AI助手支持GPT4.0