get_submit_button()
get_submit_button( string $text = ”, string $type = ‘primary large’, string $name = ‘submit’, bool $wrap = true, array|string $other_attributes = ” )
返回一个submit按钮,带有提供的文本和适当的类
Returns a submit button, with provided text and appropriate class
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$text | (string) | 可选 | 按钮的文本。默认“保存更改”。 |
$type | (string) | 可选 | 按钮的类型和CSS类。核心价值观包括“初级”、“小型”和“大型”。 |
$name | (string) | 可选 | 提交按钮的HTML名称。默认为“提交”。如果下面的$other_属性中没有id属性,$name将用作按钮的id。 |
$wrap | (bool) | 可选 | 如果输出按钮应包装在段落标记中,则为True;否则为false。 |
$other_attributes | (array | string) | 可选 | 应与按钮一起输出的其他属性,将属性映射到其值,例如array(’tabindex’=>’1’)。这些属性将作为attribute=“value”输出,如tabindex=“1”。其他属性也可以作为字符串提供,例如tabindex=“1”,尽管数组格式通常比较干净。 |
返回(Return)
(string)提交按钮HTML。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
3.1.0 | wp-admin/includes/template.php:2365 | 4 | 2 |
笔记(Notes)
文档中应该有一个注释,说明这个函数并不是设计为在wp admin之外运行的。
get_submit_button() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_submit_button/