Forums

Posts 2 Posts
[resolved] Parse error: syntax error, unexpected ';' (5 posts)

  1. Li-An
    Member
    Posted 6 months ago #

    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://wordpress.org/extend/plugins/posts-to-posts/

  2. scribu
    Member
    Posted 6 months ago #

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

  3. Li-An
    Member
    Posted 6 months ago #

    <?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.

  4. scribu
    Member
    Posted 6 months ago #

    You're missing ), at the end:

    'title' => array( 'from' => 'Managed by', 'to' => 'Manages' ),
  5. Li-An
    Member
    Posted 6 months ago #

    You are right. Thank you again.

Reply

You must log in to post.

About this Plugin

About this Topic