- Navigate to the WordPress plugin directory of your development installation.
- Create a new directory called ch5-custom-file-uploader.
- Navigate to this directory and create a new text file called ch5-custom-file-uploader.php.
- Open the new file in a code editor and add an appropriate header at the top of the plugin file, naming the plugin Chapter 5 - Custom File Uploader.
- Add the following line of code to register a function that will be executed when WordPress is rendering the HTML code at the beginning of the post editor form:
add_action( 'post_edit_form_tag', 'ch5_cfu_form_add_enctype' );
- Add the following code section to provide an implementation for the ch5_cfu_form_add_enctype function:
function ch5_cfu_form_add_enctype() ...