Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //In Functions.php I added the artist from the example
- /**
- * Add a field to the add post area
- *
- * @uses `wpuf_add_post_form_description` action hook
- *
- * @param string $post_type the post type of the post add screen
- * @param object|null $post the post object
- */
- function wpufe_artist( $post_type, $post = null) {
- $artist = ( $post != null ) ? get_post_meta( $post->ID, 'artists', true ) : '';
- ?>
- <li>
- <label for="song_artist">
- Artist <span class="required">*</span>
- </label>
- <input class="requiredField" value="<?php echo esc_attr( $artist ); ?>" type="text" name="song_artist" id="song_artist" minlength="2" />
- <div class="clear"></div>
- </li>
- <?php
- }
- add_action( 'wpuf_add_post_form_description', 'wpufe_artist', 10, 2 );
- // In Add post, I changed to output the errors
- //if not any errors, proceed
- if ( $errors ) {
- echo wpuf_error_msg( $errors );
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement