OK
you will function like this
function aa_get_last_post( $user_id ){
$args=array(
'author' => $user_id ,
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 1,
'caller_get_posts'=> 1
);
$my_query = $out = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post();
$out .= ' <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>';
endwhile;
}
wp_reset_query(); // Restore global post data stomped by the_post().
return $out;
}
the problem is getting into the
so you will need to add a placeholder in your current code
function change_aa_user_name_template () {
return '<span class="name custom_class">%s</span>{{replace_me}}';
}
add_filter('aa_user_name_template', 'change_aa_user_name_template');
then we need to use the “aa_user_final_content” filter to replace placeholder
function change_aa_user_final_content ( $html, $user ) {
return str_replace( '{{replace_me}}', aa_get_last_post($user->ID), $html );
}
add_filter('aa_user_final_content', 'change_aa_user_final_content');
this code hasn’t been tested
I hope it points you in the right direction
Please post your working when you fix it
Paul