From your comment on my first answer, I think you wish to apply filters.
function lpe_get_comments_number( $anchor='#comments' ) {
$return = '<a class="comments-number-link" href="' . get_permalink() . $anchor . '">';
$args = array(
'zero' => 'Zero comments',
'one' => 'One comment',
'more' => '% Comments'
);
$filtered_args = apply_filters( 'choose_your_hook_name', $args );
// be sure all keys in the filtered args are present and have a valid value
// this is optional but usefull
$args = wp_parse_args( $filtered_args, $args );
$return .= get_comments_number( $args['zero'], $args['one'], $args['more'] ); // '0', '1', '%'
$return .= '</a>';
return $return;
}
add_filter( 'choose_your_hook_name', 'your_filter_callback', 1, 1 );
function your_filter_callback( $args ) {
return array( 'zero' => 'Foo Comments', 'one' => 'Bar Comments' );
}
You can also pass additional argument to apply_filters()
if you want to decide things depending on the passed arguments:
$zero = 'Zero Comments';
if ( $today == 'sunday' ) {
$foo = 'Sunday, yeah!';
} else {
$foo = '';
$bar = 'No sunday';
}
$zero = apply_filters( 'choose_your_hook_name', $zero, $foo, $bar );
get_comments_number( $zero, $one, $more );
[more code]
add_filter( 'choose_your_hook_name', 'your_filter_callback', 1, 3 );
function your_filter_callback( $zero, $foo = '', $bar = '' ) {
if ( ! empty( $foo ) )
$zero = 'No comments on sunday!';
elseif( ! empty( $bar ) )
$zero = $bar . ', here are % comments';
return $zero;
}