在我的小WP项目中,我有一个表单(wp作业管理器)中的标题字段,我需要被禁用但我也想自动插入一个数字,所以当表单被POST时,数字将是保存为标题名称。 我想用占位符做某种方式,但我找不到方法。
'job_title' => array(
'label' => __( 'Job Title', 'wp-job-manager' ),
'type' => 'text',
'required' => false,
'placeholder' => '',
'priority' => 1
),
非常感谢,如果有人可以提供帮助的话。我工作了几个小时,找不到工作的解决方案,因为我是一个php初学者。
答案 0 :(得分:0)
使用表单的In file included from /Volumes/second/nvi/github/blockchain_db/src/Impl/mongo/src/mongo_db_api.cpp:3:
/Volumes/second/nvi/github/blockchain_db/src/Impl/mongo/src/mongo_db_api_utils.hpp:47:46: error: no viable conversion from 'typename std::enable_if<!util::is_functor<const finalize_type &, void (single_context)>::value, key_context<closed_context> >::type' (aka 'bsoncxx::v_noabi::builder::stream::key_context<bsoncxx::v_noabi::builder::stream::closed_context>') to 'bsoncxx::document::view_or_value' (aka 'view_or_value<document::view, document::value>')
auto cursor = db["ctlblocks"].find_one(document{} << filter << finalize);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/bsoncxx/v_noabi/bsoncxx/view_or_value.hpp:60:20: note: candidate constructor not viable: no known conversion from 'typename std::enable_if<!util::is_functor<const finalize_type &, void (single_context)>::value, key_context<closed_context> >::type' (aka 'bsoncxx::v_noabi::builder::stream::key_context<bsoncxx::v_noabi::builder::stream::closed_context>') to 'bsoncxx::v_noabi::document::view' for 1st argument
BSONCXX_INLINE view_or_value(View view) : _view{view} {
^
/usr/local/include/bsoncxx/v_noabi/bsoncxx/view_or_value.hpp:69:20: note: candidate constructor not viable: no known conversion from 'typename std::enable_if<!util::is_functor<const finalize_type &, void (single_context)>::value, key_context<closed_context> >::type' (aka 'bsoncxx::v_noabi::builder::stream::key_context<bsoncxx::v_noabi::builder::stream::closed_context>') to 'bsoncxx::v_noabi::document::value &&' for 1st argument
BSONCXX_INLINE view_or_value(Value&& value) : _value(std::move(value)), _view(*_value) {
^
/usr/local/include/bsoncxx/v_noabi/bsoncxx/view_or_value.hpp:75:20: note: candidate constructor not viable: no known conversion from 'typename std::enable_if<!util::is_functor<const finalize_type &, void (single_context)>::value, key_context<closed_context> >::type' (aka 'bsoncxx::v_noabi::builder::stream::key_context<bsoncxx::v_noabi::builder::stream::closed_context>') to 'const bsoncxx::v_noabi::view_or_value<bsoncxx::v_noabi::document::view, bsoncxx::v_noabi::document::value> &' for 1st argument
BSONCXX_INLINE view_or_value(const view_or_value& other)
^
/usr/local/include/bsoncxx/v_noabi/bsoncxx/view_or_value.hpp:93:20: note: candidate constructor not viable: no known conversion from 'typename std::enable_if<!util::is_functor<const finalize_type &, void (single_context)>::value, key_context<closed_context> >::type' (aka 'bsoncxx::v_noabi::builder::stream::key_context<bsoncxx::v_noabi::builder::stream::closed_context>') to 'bsoncxx::v_noabi::view_or_value<bsoncxx::v_noabi::document::view, bsoncxx::v_noabi::document::value> &&' for 1st argument
BSONCXX_INLINE view_or_value(view_or_value&& other) noexcept
属性分配号码。您可以在onsubmit属性中添加javascript函数/代码。
或
在页面加载时将值分配给字段。