• Resolved palmtrae

    (@palmtrae)


    Hi, i’ve been adding these four lines in fields.php:139

    if ( isset( $this->data['type'] ) ) {
      $args['type'] = $this->data['type'];
      $args['value'] = $this->data['values'];
    }

    The reason for this is that i needed to add a checkbox type of field, and when I looked at your code i saw that there was support for other input types than text and select. This might be something you want to include in future releases.

    Also, the resulting code might not be perfect, but it wont break backwards compatibility with your recently added select field feature.

    Usage:

    p2p_register_connection_type( array(
    	'id' => 'posts_to_pages',
    	'from' => 'post',
    	'to' => 'page',
    
    	'fields' => array(
    		'types' => array(
    			'title' => 'Type',
    			'type' => 'radio',
    			'values' => array( 'strong', 'weak' )
    		),
    
    		'display' => array(
    			'title' => 'Display strength',
    			'type' => 'checkbox',
    			'values' => 1
    		),
    	)
    ) );

    Cheers

    http://ww.wp.xz.cn/extend/plugins/posts-to-posts/

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

The topic ‘[Plugin: Posts 2 Posts] Enable other input types in meta values’ is closed to new replies.