{$action}
云策文档标注
概述
本文档针对 WordPress 开发者,说明当启用 'postcustom' 元框时,需要执行额外的初始化操作。文档还包含一个代码示例,展示了根据帖子状态设置消息的 switch 语句。
关键要点
- 启用 'postcustom' 元框时,需进行额外初始化
- 文档提供了一个 switch 语句示例,用于根据帖子状态(如 'pending' 或 'future')设置消息值
代码示例
switch ( $status ) {
case 'pending':
$message = 8;
break;
case 'future':
$message = 9;
break;
}
原文内容
If the ‘postcustom’ meta box is enabled, then we need to perform some extra initialization on it.
Source
switch ( $status ) {
case 'pending':
$message = 8;
break;
case 'future':
$message = 9;
break;