I’ve made a customized subject with none plugin. After I select file I need to add that file and get its url on my web page. Mainly, I need to add video and present it on frontend. That is my code proper now (its simply good for textual content, not add file):
operate cd_meta_box_cb()
{
international $put up;
$values = get_post_custom( $post->ID );
$textual content = isset( $values['my_meta_box_text'] ) ? $values['my_meta_box_text'][0] : '';
wp_nonce_field( 'my_meta_box_nonce', 'meta_box_nonce' );
?>
<p>
<label for="my_meta_box_text">Video URL</label>
<enter sort="file"
id="my_meta_box_text" title="my_meta_box_text" id="my_meta_box_text"
settle for="video/*" worth="<?php echo $textual content; ?>" />
<enter sort="hidden" class="hidden-file-field" title="hidden_file_field" />
</p>
<?php
}
add_action( 'save_post', 'cd_meta_box_save' );
operate cd_meta_box_save( $post_id )