Viewing 3 replies - 1 through 3 (of 3 total)
  • inactive

    (@nurdanucergmailcom)

    I have a similar problem. I would like to display post author and post date in addition to the title when I am creating/searching for connections. (I need to know the date/author before I relate one item to the other)

    I had solved this problem in an earlier version of P2P by storing my additional information in the post excerpt field, and selecting to display excerpt instead of the title while searching for connections, but I have learned my lesson with messing with a plugin code. ??

    Any ideas?

    inactive

    (@nurdanucergmailcom)

    I believe “p2p_candidate_title” is what I need:

    function append_date_to_candidate_title( $title, $ctype, $post ) {
    	if ( 'tweets_to_posts' == $ctype->name && 'post' == $post->post_type ) {
    		$title .= " (" . $post->_wp_page_template . ")";
    		$title .= " (" . $post->post_author . ")";
    		$title .= " (" . $post->post_date . ")";
    	}
    
    	return $title;
    }
    
    add_filter( 'p2p_candidate_title', 'append_date_to_candidate_title', 10, 3 );

    But this adds nothing to the candidate title in admin.

    Any ideas on what I’m doing wrong?

    Thanks.

    inactive

    (@nurdanucergmailcom)

    It turns out this filter is not yet available in the latest stable release.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show Custom fields if creating a New Post’ is closed to new replies.