• Resolved Li-An

    (@li-an)


    Hello,
    I’ve a strange error when inserting
    'title' => array( 'from' => 'Managed by', 'to' => 'Manages'
    as explained in the Wiki. I’ve got this error:
    Parse error: syntax error, unexpected ';' in (changed)\wp-content\themes\dotb-lian - Copie\functions.php on line 162
    For the moment, I’ve got this error only with title array…

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author scribu

    (@scribu)

    I’m pretty sure it’s your code. Pasting the entire call to p2p_register_connection_type() would help.

    Thread Starter Li-An

    (@li-an)

    <?php
    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(
    		'id' => 'page_un',
    		'from' => 'webcomic',
    		'to' => 'webcomic',
    		'sortable' => 'any'
    		)
    		);
    }
    add_action( 'init', 'my_connection_types', 100 );
    ?>

    I’ve put this. If I try

    <?php
    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(
    		'id' => 'page_un',
    		'from' => 'webcomic',
    		'to' => 'webcomic',
    		'sortable' => 'any',
    		'title' => array( 'from' => 'Managed by', 'to' => 'Manages'
    		)
    		);
    }
    add_action( 'init', 'my_connection_types', 100 );
    ?>

    I’ve got the error.

    Plugin Author scribu

    (@scribu)

    You’re missing ), at the end:

    'title' => array( 'from' => 'Managed by', 'to' => 'Manages' ),
    Thread Starter Li-An

    (@li-an)

    You are right. Thank you again.

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

The topic ‘[Plugin: Posts 2 Posts] Parse error: syntax error, unexpected ';'’ is closed to new replies.