andrew/attached-post-field-cmb2

Post to post relation field for CMB2

dev-master 2016-04-03 03:49 UTC

This package is auto-updated.

Last update: 2024-10-29 04:20:04 UTC


README

Custom field for CMB2.

Create a dropdown feild listing a post type for creating a post-to-post style relationship. Saves the post ID into a custom meta field.

Example:

			'ticket_id' => [
				'id' 			=> 'ticket_id',
				'label'			=> 'Ticket Type',
				'description'	=> '',
				'class'			=> [''],
				'input_class'	=> ['attendee-ticket_id'],
				'placeholder'	=> 'Select your ticket',
				'type'			=> 'post_type',
				'options'		=> [
					'post_type'	=> 'product',
					'query'		=> [
						''
					],
				],
				'required'		=> true,		
			],