wordpress - 有什么方法可以在 ACF 图像字段中添加默认图像
问题描述
当我尝试使用 ACF 创建图像字段时,我想在 WordPress 管理员中添加默认图像选项(我们可以说在图像字段中设置默认选项)非常感谢您提前
解决方案
你可以把下面的代码放在你的functions.php中
add_action('acf/render_field_settings/type=image', 'add_defult_image_field');
function add_defult_image_field($field) {
acf_render_field_setting( $field, array(
'label' => 'Defult Image',
'instructions' => 'Appears when creating a new post',
'type' => 'image',
'name' => 'defult_value',
));
}
推荐阅读
- ios - 使用 ZXing Xamarin for iOS 的条形码扫描仪应用程序在应用程序类中遇到空引用错误
- windows - DJI Windows 10 SDK FFMPEG 视频缓冲
- node.js - 无法访问 JSON API 并给我参考错误
- javascript - 反应,表格:无法读取未定义的属性“长度”
- python - PyQtGraph PlotWidget 在关闭窗口时崩溃应用程序
- excel - VBA UserForm:在 TextBox 上使用 SetFocus 后出现意外行为
- ui-testing - 测试我的网站在不同设备上的显示方式
- c++ - Cmake仅包含仅标头目标的标头目标
- ruby-on-rails - 在 Rails 中禁用连接池以使用 PgBouncer
- bash - 将截断的 JSON 对象传递给 jq 时出现无效的数字文字