How to change the form enctype for custom post type in WordPress?

I am creating a custom post type music.

function layzend_admin_music_init() {
  add_meta_box("layzend_music_information-meta", "Information", "layzend_music_information", "music", "normal", "low");
}

function layzend_music_information() {
    ?>
    <p>
        <label for="layzend_music_url">URL</label>
        <input type="file" id="layzend_music_url" name="layzend_music_url" />
    </p>
    <?php
}

This file field needs the form enctype to be multipart/form data how can I change the default form enctype for a custom post type?

Related posts

Leave a Reply

1 comment