我已经创建了一个简单的设置页面,只有一个页面、一个部分和两个字段,它们都显示得很好,但我无法从我的生活中知道为什么它无法保存。要么是错误,要么是我遗漏了一个完整的函数或类似的东西。
我的代码: test-page.php
';
}
function field_2 () {
$field2 = esc_attr(get_option('field_2'));
echo '';
}
//add template
function add_test_page() {
require_once( 'html-templates/test-page-template.php' );
}和我的模板,test-page-template.php
My Test Template提前谢谢你的帮助。
发布于 2021-04-05 03:07:45
对于可能没有阅读过上述注释并可能有类似问题的其他人,@epilektric已经回答了这个问题,该问题指出,在=和field_2函数下的value属性之后,缺少了field_1符号。
https://wordpress.stackexchange.com/questions/385975
复制相似问题