[wordpress插件] ACF: TablePressACF:TablePress

wordpress 插件 文章 2020-01-27 14:20 572 0 全屏看文

AI助手支持GPT4.0

评分

100

100

描述

This is an extension for the popular Advanced Custom Fields plugin and 高级自定义字段插件和

https://wordpress.org/plugins/tablepress/">TablePress plugin.

https://wordpress.org/plugins/tablepress/">TablePress 插件。

By itself, this plugin does NOTHING.

本身,该插件没有任何作用。

This add-on for Advanced Custom Fields creates a custom field type to select a TablePress table, providing a dropdown menu that lets you select from a list of available tables.

此高级自定义字段加载项创建自定义字段类型以选择TablePress表,并提供一个下拉菜单,您可以从可用表列表中进行选择。

The field can return the table ID for the table selected, or the full HTML of the table.

该字段可以返回所选表的表ID或表的完整HTML。

This plugin requires:

此插件要求:

    • Advanced Custom Fields version 4+ or 5+
    • 高级自定义字段版本4+或5 +

    • TablePress version 1.5+
    • TablePress 1.5及更高版本

    Just to be sure there's no confusion… This plugin does nothing unless ACF

    请确保没有混乱… 该插件不会执行任何操作,除非 ACF

    (Or ACF Pro) and ACF Pro )和

    /plugins/tablepress/">TablePress are both active on your site

    / plugins / tablepress /“> TablePress 在您的网站上均处于活动状态

    Follow this plugin on GitHub

    GitHub 上关注此插件

    Using the Field

    使用字段

    This field can return the table ID for the table selected, or the full HTML of the table (the same output as the rendered shortcode).

    此字段可以返回所选表的表ID或表的完整HTML(与呈现的简码相同的输出)。

    When returning the table ID, either of the following code snippets will output your table (replacing ‘your_table_here’ with the field name you defined in your ACF Field Group settings).

    返回表ID时,以下代码片段之一将输出您的表(将“ your_table_here”替换为您在ACF“字段组”设置中定义的字段名称)。

      <?php    

    $tablepress_id = get_field( 'your_field_here' );    

    $ tablepress_id = get_field('your_field_here');    

    echo do_shortcode( '[table id="'.$tablepress_id.'"]' );

    echo do_shortcode('[table id =“'。$ tablepress_id。'”]');

    ?>

    ?>

    or, to avoid using do_shortcode(), use

    或者,为避免使用 do_shortcode(),请使用

      <?php    

    $tablepress_id = get_field( 'your_field_here' );    

    $ tablepress_id = get_field('your_field_here');    

    $args = array(      

    $ args =数组(      

    'id' => $tablepress_id,    

    'id'=> $ tablepress_id,    

    );    

    );    

    if ( function_exists( 'tablepress_print_table' ) ) {      

    如果(function_exists('tablepress_print_table')){      

    tablepress_print_table( $args );    

    tablepress_print_table($ args);    

    }

    }

    ?>

    ?>

    To simply display the chosen table on your page, choose the HTML output option in your field settings, and insert into your php with

    要简单地在页面上显示所选表格,请在字段设置中选择HTML输出选项,然后使用插入到您的php中

    the_field( 'your_field_here' );

      the_field('your_field_here');

    For a more detailed explanation, see our article, Setting

    有关详细说明,请参见我们的文章设置

    up an ACF field for TablePress.

    设置TablePress的ACF字段。

安装步骤

    1. Copy the acf-tablepress folder into your plugins folder
    2. acf-tablepress 文件夹复制到您的插件文件夹中

    3. Activate the plugin via the Plugins admin page
    4. 通过“插件管理”页面激活插件

下载地址

https://downloads.wordpress.org/plugin/acf-tablepress.1.3.2.zip

https://downloads.wordpress.org/plugin/acf-tablepress.1.3.2.zip

-EOF-

AI助手支持GPT4.0