From: Anthony Talarico Date: Wed, 9 Nov 2016 19:32:59 +0000 (-0500) Subject: putting partner custom post type fields in one meta box X-Git-Tag: v1.0.0^2~86 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=5e2332179a426ee4488373f9474bc40b75bcb2d6;p=WP-Themes%2Funiversitycenter.git putting partner custom post type fields in one meta box --- diff --git a/lib/partners-post-type.php b/lib/partners-post-type.php index 3403497..d6c0db6 100644 --- a/lib/partners-post-type.php +++ b/lib/partners-post-type.php @@ -33,7 +33,7 @@ function custom_post_type() { $args = array( 'label' => __( 'Partner', 'text_domain' ), 'labels' => $labels, - 'supports' => array('title', 'thumbnail'), + 'supports' => array('title', 'thumbnail', 'page-attributes'), // 'taxonomies' => array( 'category', 'post_tag' ), 'hierarchical' => false, 'public' => true, @@ -55,16 +55,17 @@ function custom_post_type() { add_action( 'init', 'custom_post_type', 0 ); /** - * Partner Name + * Partner Title * * Adds the field for camper types * * @access public * @return void */ -function partner_name() { +function partner_title() { global $post; - $nonce = wp_create_nonce( 'partners-meta-noncename' ); + $nonce = wp_create_nonce( 'title-meta-noncename' ); + echo ''; // Get the features for the post. $name = get_post_meta( $post->ID, 'partner_name', true ); @@ -73,23 +74,9 @@ function partner_name() { $value = "value=".'"'.$name .'"'; } ?> - /> + /> '; - // Get the features for the post. $title = get_post_meta( $post->ID, 'partner_title', true ); // Output field. @@ -97,79 +84,41 @@ function partner_title() { $value = "value=".'"'.$title .'"'; } ?> - /> + /> ID, 'partner_email', true ); + $email= get_post_meta( $post->ID, 'partner_email', true ); // Output field. if ( !empty( $email) ) { $value = "value=".'"'.$email .'"'; } ?> - /> + /> ID, 'partner_phone', true ); + $phone = get_post_meta( $post->ID, 'partner_phone', true ); // Output field. if ( !empty( $phone) ) { $value = "value=".'"'.$phone .'"'; } ?> - /> + /> ID, 'partner_url', true ); + $url = get_post_meta( $post->ID, 'partner_url', true ); // Output field. if ( !empty( $url) ) { $value = "value=".'"'.$url .'"'; } ?> - /> + />