Advertisement
Guest User

Paste

a guest
Dec 24th, 2013
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.00 KB | None | 0 0
  1. //In Functions.php I added the artist from the example
  2.  
  3. /**
  4.  * Add a field to the add post area
  5.  *
  6.  * @uses `wpuf_add_post_form_description` action hook
  7.  *
  8.  * @param string $post_type the post type of the post add screen
  9.  * @param object|null $post the post object
  10.  */
  11. function wpufe_artist( $post_type, $post = null) {
  12.      
  13.     $artist = ( $post != null ) ? get_post_meta( $post->ID, 'artists', true ) : '';
  14.     ?>
  15.     <li>
  16.         <label for="song_artist">
  17.             Artist <span class="required">*</span>
  18.         </label>
  19.         <input class="requiredField" value="<?php echo esc_attr( $artist ); ?>" type="text" name="song_artist" id="song_artist" minlength="2" />
  20.         <div class="clear"></div>
  21.     </li>
  22.  
  23.     <?php
  24. }
  25.  
  26. add_action( 'wpuf_add_post_form_description', 'wpufe_artist', 10, 2 );
  27.  
  28.  
  29. // In Add post, I changed to output the errors
  30.         //if not any errors, proceed
  31.         if ( $errors ) {
  32.             echo wpuf_error_msg( $errors );
  33.             return;
  34.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement