How do populate a column when listing custom posts?

Make sure your hook knows to accept two arguments as shown in the codex example.1

add_action( 'manage_stb_custom_column', 'stb_output_cols', 10, 2);

See the $accepted_args2 parameter in the function reference of WP codex. Note that the “10” preceding this parameter is the default priority, but you have to include that so the action knows that “2” is the number of accepted args.

$accepted_args (int) (optional) The number of arguments the hooked
function accepts. In WordPress 1.5.1+, hooked functions can take extra
arguments that are set when the matching do_action() or
apply_filters() call is run. For example, the action
comment_id_not_found will pass any functions that hook onto it the ID
of the requested comment. Default: 1

I believe your stb_replace_title needs to merge the new array data with $columns before returning so that these values can be passed to your stb_output_cols function later. Otherwise, it will completely replace the original $columns array, savvy?3

function stb_replace_title($columns)
{
    unset($columns['title']) ;
    $columns['testimonials']  = _('testimonials');
    // Merge, don't replace, the $columns array.
    return array_merge($columns,
      array('cb' => '<input type="checkbox" />',
      'testimonials'  => __('Testimonial'),
      'dates' => __('Date')
      )
    );
}

To post your content to the page, get the terms, meta data or whatever you want with the appropriate WordPress function and echo the data within the callback function you hooked with manage_{$post_type}_posts_columns. In your case, the callback function is stb_output_cols.

This (modified) example4 from codex will get the taxonomy term ‘book_author’ as well as the post meta ‘publisher’ and echo their respective values for the given $post_id. The $post_id should already be passed to your function thanks to the above steps.

switch ( $column ) {
// Gets and echoes the value for term 'book_author' to the $columns['book_author']
case 'book_author' :
    $terms = get_the_term_list( $post_id , 'book_author' , '' , ',' , '' );
        if ( is_string( $terms ) )
        echo $terms;
    else
        _e( 'Unable to get author(s)', 'your_text_domain' );
    break;

// Gets and echoes the the value for post meta key 'publisher' to $columns['publisher'].
case 'publisher' :
    echo get_post_meta( $post_id , 'publisher' , true ); 
    break;
}

Of course, this assumes you have added the data to the database already. For example, the publisher for a given post ID could be defined as “HarperCollins” with the function update_post_meta(42, 'publisher', 'HarperCollins');.

Now, when the case ‘publisher’ is true for post ID 42, the publisher column should display “HarperCollins”.

There are many possibilities here. Familiarize yourself with the Function Reference5 and the index of template tags6 for retrieving the specific data you require.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)