最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

plugin development - Metabox types list

programmeradmin2浏览0评论

For example, in below code snippet, there are some types for custom metabox input fields such as text and textarea.So, I want to learn other types.I searched it on google also w.se but I couldnt.For example, I want to learn e-mail type.

array(
    'name' => 'Instagram',
    'desc' => 'You should write Instagram link here',
    'id' => $prefix . 'text-instagram',
    'type' => 'text',
    'std' => '/?hl=tr'
),
array(
    'name' => 'Additional Post Description while hover thumbnail',
    'desc' => 'The text will shown on post thumbnail via our elementor post widget',
    'id' => $prefix . 'textarea',
    'type' => 'textarea',
    'std' => 'Its amazing story so I dont know where must I start to tell...'
)

For example, in below code snippet, there are some types for custom metabox input fields such as text and textarea.So, I want to learn other types.I searched it on google also w.se but I couldnt.For example, I want to learn e-mail type.

array(
    'name' => 'Instagram',
    'desc' => 'You should write Instagram link here',
    'id' => $prefix . 'text-instagram',
    'type' => 'text',
    'std' => 'https://www.instagram/britneyspears/?hl=tr'
),
array(
    'name' => 'Additional Post Description while hover thumbnail',
    'desc' => 'The text will shown on post thumbnail via our elementor post widget',
    'id' => $prefix . 'textarea',
    'type' => 'textarea',
    'std' => 'Its amazing story so I dont know where must I start to tell...'
)
Share Improve this question asked Apr 22, 2020 at 18:52 I dont believe youI dont believe you 112 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

It would be useful if you specify if you are using a plugin to develop these metaboxes, to narrow down the answer.

If you're working with CMB2, you're looking for text_url field ty (see the full list in CMB2 GitHub page.).

If you're working with MetaBox, then text would be the one as url fields are implicit within it. See the full list of field types here.

Same goes for ACF (text field) or page_link. Check the full list of available field types in their official docs.

But then there's the option to create your own field types.

Hope this helps.

发布评论

评论列表(0)

  1. 暂无评论