0
votes

I have created a custom post type in wordpress called videos. When the admin adds a video he also needs to provide a youtube-id. This can be done by selecting the appropriate custom field from the drop-down list and then entering the ID.

I was wondering though, isn't there a way to always display that custom field when you are adding or editing a video? (And optionally, could you even make it a required field?)

4

4 Answers

2
votes

You could use the More Fields or Custom Post Type UI plugins to create the youtube-id field for your video posts.

1
votes

I'll just answer my own question after 8 years :)

For people who live on another planet: just use the ACF plugin

0
votes

Youtube Post Type also requires a youtube url before creating a custom post type draft.

0
votes

Create a Meta Fields for youtube video url

By using

add_meta_box( $id, $title, $callback, $post_type, $context, $priority, $callback_args );

Example