• Resolved kalipekona

    (@kalipekona)


    Hi imath,
    When displaying the list of ideas for a specific category, the footer for each idea says “This idea was posted in [name of category] on [date].

    When displaying a single idea, the footer says “This idea as posted in [name of category] on [date] by [name/email of submitter].

    I would like to include the name/email of the submitter in the footer for each idea when displaying the list of ideas for a specific category, just like the footer is for a single idea.

    Can you please tell me how I would accomplish this? Thanks so much for your help.

    https://www.ads-software.com/plugins/wp-idea-stream/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mathieu Viet

    (@imath)

    Hi @kalipekona,

    Here’s how you can do :

    create a wp-idea-stream-custom.php file and put in it :

    <?php
    
    function kalipekona_idea_category_footer( $idea_footer = '', $idea_footer_parts = array(), $idea = null ) {
    	if ( ! wp_idea_stream_is_category() || ! is_array( $idea_footer_parts ) ) {
    		return $idea_footer;
    	}
    
    	if ( ! empty( $idea_footer_parts['date'] ) ) {
    		$idea_footer_parts['date'] = substr( $idea_footer_parts['date'], 0, -1 );
    	}
    
    	// Get the author info
    	$user = wp_idea_stream_users_get_user_data( 'id', $idea->post_author );
    	$user_link = '<a class="idea-author" href="' . esc_url( wp_idea_stream_users_get_user_profile_url( $idea->post_author, $user->user_nicename ) ) . '" title="' . esc_attr( $user->display_name ) . '">';
    	$user_link .= esc_html( $user->display_name ) . '</a>';
    
    	$idea_footer_parts['author'] = sprintf( _x( 'by %s.', 'single idea author link', 'wp-idea-stream' ), $user_link );
    
    	// Move the edit part at the end of the array
    	if ( ! empty( $idea_footer_parts['edit'] ) ) {
    		$edit = $idea_footer_parts['edit'];
    		unset( $idea_footer_parts['edit'] );
    		$idea_footer_parts['edit'] = $edit;
    	}
    
    	return join( ' ', $idea_footer_parts );
    }
    add_filter( 'wp_idea_stream_ideas_get_idea_footer', 'kalipekona_idea_category_footer', 10, 3 );
    Thread Starter kalipekona

    (@kalipekona)

    Once again you have been a huge help imath, this worked perfectly! Thanks so much for your continued support with your wonderful plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Including submitter's info for each idea entry in category’ is closed to new replies.