CPT to CPT with slug
-
I am using a CPT “ai1ec_event” created by All-in-One Event Calendar.
I need to connect an Event only to another Event that has the slug “corsi” or “seminari” or “master”. I don’t want to see in the list events with other slugs.What I’ve done so far shows me all types od Events, even if I specify the slugs in the “to_query_vars” array.
p2p_register_connection_type( array( 'name' => 'iscrizione_a_corso', 'from' => 'ai1ec_event', 'to' => 'ai1ec_event', 'to_query_vars' => array( 'events_categories' => 'corsi , seminari , master' ) , 'reciprocal' => true , 'admin_box' => array( 'show' => 'to', 'context' => 'side' ), 'title' => array( 'from' => __( 'Collega Corso', 'my-textdomain' ), ), 'to_labels' => array( 'singular_name' => __( 'Corso', 'my-textdomain' ), 'search_items' => __( 'Cerca Corso', 'my-textdomain' ), 'not_found' => __( 'Nessun Corso trovato.', 'my-textdomain' ), 'create' => __( 'Crea Collegamento', 'my-textdomain' ) ) ) );
Any suggestion?
- The topic ‘CPT to CPT with slug’ is closed to new replies.