当前位置:首页>网络教程>WordPress功能函数do_settings_sections()

WordPress功能函数do_settings_sections()

WordPress功能函数do_settings_sections(),打印出添加到特定设置页面的所有设置部分。

WordPress功能函数do_settings_sections(),打印出添加到特定设置页面的所有设置部分。

用法:

do_settings_sections( string $page )

描述:

设置API的一部分。在设置页面回调函数中使用这个函数,用add_settings_section()和add_settings_field()输出添加到$页面的所有区段和字段。

参数:

$page

(string) (必需) 要输出其设置部分的页面的段名称。

更多信息

这将输出用h3标记包装的节标题和用表包装的设置字段。

来源:

文件: wp-admin/includes/template.php

function do_settings_sections( $page ) {

global $wp_settings_sections, $wp_settings_fields;

if ( ! isset( $wp_settings_sections[ $page ] ) ) {

return;

}

foreach ( (array) $wp_settings_sections[ $page ] as $section ) {

if ( $section[‘title’] ) {

echo “<h2>{$section[‘title’]}</h2>\n”;

}

if ( $section[‘callback’] ) {

call_user_func( $section[‘callback’], $section );

}

if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[ $page ] ) || ! isset( $wp_settings_fields[ $page ][ $section[‘id’] ] ) ) {

continue;

}

echo ‘<table class=”form-table” role=”presentation”>’;

do_settings_fields( $page, $section[‘id’] );

echo ‘</table>’;

}

}

更新日志:

WordPress功能函数do_settings_sections()

给TA打赏
共{{data.count}}人
人已打赏
网络教程

WordPress功能函数add_rewrite_tag()

2022-7-15 17:01:16

网络教程

WordPress开发函数add_shortcode()

2022-7-15 17:01:36

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索