Title: [Plugin: Posts 2 Posts] Custom Post Type Issue
Last modified: August 20, 2016

---

# [Plugin: Posts 2 Posts] Custom Post Type Issue

 *  Resolved [robheath](https://wordpress.org/support/users/robheath/)
 * (@robheath)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-custom-post-type-issue/)
 * *ahem*
 * I used the following
 *     ```
       function my_connection_types() {
       	// Make sure the Posts 2 Posts plugin is active.
       	if ( !function_exists( 'p2p_register_connection_type' ) )
       		return;
   
       	p2p_register_connection_type( array(
       		'name' => 'Movie Trailer_to_Movie Hub',
       		'from' => 'Movie Trailer',
       		'to' => 'Movie Hub'
       	) );
       }
       add_action( 'wp_loaded', 'my_connection_types' );
       But it stills show up as the following:
       ```
   
 * “Posts ↔ Posts (Connected Posts)”
 * The box doesn’t appear in my custom post type editor pages. But still shows up
   in the default post type editor. What am I doing wrong?
 * My post types exist, I registered them in the functions file.
 * Thanks for your help.
 * [http://wordpress.org/extend/plugins/posts-to-posts/](http://wordpress.org/extend/plugins/posts-to-posts/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Marlon Amâncio](https://wordpress.org/support/users/marlonlamancio/)
 * (@marlonlamancio)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-custom-post-type-issue/#post-2901369)
 * Are ‘Movie Trailer’ and ‘Movie Hub’ the names of custom post types?
 * Because cpt can not contain capital letters or spaces and name parameter of connection
   type either.
 * Cpts name should be some like ‘movie_trailer’ and ‘movie_hub’. Connection name
   some like ‘movie_trailer_to_movie_hub’.
 *  Thread Starter [robheath](https://wordpress.org/support/users/robheath/)
 * (@robheath)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-custom-post-type-issue/#post-2901422)
 * I tried ‘movie_trailer_to_movie_hub’ too.
 * Here is my functions code for post type (just for movie trailers)
 *     ```
       // registration code for movietrailers post type
       	  function register_movietrailers_posttype() {
       		  $labels = array(
       			  'name' 				=> _x( 'Movie Trailers', 'post type general name' ),
       			  'singular_name'		=> _x( 'Movie Trailer', 'post type singular name' ),
       			  'add_new' 			=> _x( 'Add New', 'Movie Trailer'),
       			  'add_new_item' 		=> __( 'Add New Movie Trailer '),
       			  'edit_item' 		=> __( 'Edit Movie Trailer '),
       			  'new_item' 			=> __( 'New Movie Trailer '),
       			  'view_item' 		=> __( 'View Movie Trailer '),
       			  'search_items' 		=> __( 'Search Movie Trailers '),
       			  'not_found' 		=>  __( 'No Movie Trailer found' ),
       			  'not_found_in_trash'=> __( 'No Movie Trailers found in Trash' ),
       			  'parent_item_colon' => ''
       		  );
   
       		  $taxonomies = array();
   
       		  $supports = array('title','editor','author','thumbnail','excerpt','custom-fields','comments','revisions');
   
       		  $post_type_args = array(
       			  'labels' 			=> $labels,
       			  'singular_label' 	=> __('Movie Trailer'),
       			  'public' 			=> true,
       			  'show_ui' 			=> true,
       			  'publicly_queryable'=> true,
       			  'query_var'			=> true,
       			  'capability_type' 	=> 'post',
       			  'has_archive' 		=> true,
       			  'hierarchical' 		=> false,
       			  'rewrite' 			=> array('slug' => 'movie_trailer', 'with_front' => false ),
       			  'supports' 			=> $supports,
       			  'menu_position' 	=> 5,
       			  'menu_icon' 		=> 'http://trailernerd.com/gurus/wp-content/uploads/2012/07/movies1.jpg',
       			  'taxonomies'		=> $taxonomies
       		   );
       		   register_post_type('movietrailers',$post_type_args);
       	  }
       ```
   
 *  Plugin Author [scribu](https://wordpress.org/support/users/scribu/)
 * (@scribu)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-custom-post-type-issue/#post-2901441)
 * Your CPT name is ‘movietrailers’. That’s what you should pass to p2p_register_connection_type().
 *  Thread Starter [robheath](https://wordpress.org/support/users/robheath/)
 * (@robheath)
 * [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-custom-post-type-issue/#post-2901459)
 * Ok, I changed it to the following:
 *     ```
       function my_connection_types() {
       	// Make sure the Posts 2 Posts plugin is active.
       	if ( !function_exists( 'p2p_register_connection_type' ) )
       		return;
   
       	p2p_register_connection_type( array(
       		'name' => 'movietrailers_to_moviehubs',
       		'from' => 'movietrailers',
       		'to' => 'moviehubs'
       	) );
       }
       add_action( 'wp_loaded', 'my_connection_types' );
       ?>
       ```
   
 * But it still comes up as
 * “Movie Trailer_to_Movie Hub Posts ↔ Posts (Connected Posts)”
 * Hmmmm

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: Posts 2 Posts] Custom Post Type Issue’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/posts-to-posts_7a8e9d.svg)
 * [Posts 2 Posts](https://wordpress.org/plugins/posts-to-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/posts-to-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/posts-to-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-to-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-to-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-to-posts/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [robheath](https://wordpress.org/support/users/robheath/)
 * Last activity: [13 years, 10 months ago](https://wordpress.org/support/topic/plugin-posts-2-posts-custom-post-type-issue/#post-2901459)
 * Status: resolved