【发布时间】:2013-12-31 17:03:51
【问题描述】:
所以我有一个 PHP 文件,其中包含一个表单,以便用户可以在我的网站上发布工作。我想将此表单的某些字段设置为只读给用户。怎么样?
public static function init_fields() {
if ( self::$fields )
return;
self::$fields = apply_filters( 'submit_job_form_fields', array(
'job' => array(
'job_category' => array(
'label' => __( 'Job category', 'job_manager' ),
'type' => 'select',
'required' => true,
'options' => self::job_categories(),
'placeholder' => '',
'priority' => 3
),
'job_description' => array(
'label' => __( 'Description', 'job_manager' ),
'type' => 'text',
'required' => true,
'placeholder' => '',
'priority' => 4
),
我知道这可能很容易做到,但由于某种原因我找不到如何做到这一点。
【问题讨论】:
-
我倾向于认为这里没有足够的信息可以关闭。例如,没有 php 函数
apply_filters()。这是 WordPress 还是其他框架?顺便说一句,我认为您正在寻找生成的<html><input>s 以具有disabled属性 -
这是来自框架吗?