Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




comments_number [ WordPress Function ]

comments_number ( $zero = false, $one = false, $more = false, $deprecated = '' )
Parameters:
  • (string) $zero Text for no comments
  • (string) $one Text for one comment
  • (string) $more Text for more than one comment
  • (string) $deprecated Not used.
Uses:
Defined at:



Display the language string for the number of comments the current post has.

Source


<?php
function comments_number$zero false$one false$more false$deprecated '' ) {
    if ( !empty( 
$deprecated ) )
        
_deprecated_argument__FUNCTION__'1.3' );

    
$number get_comments_number();

    if ( 
$number )
        
$output str_replace('%'number_format_i18n($number), ( false === $more ) ? __('% Comments') : $more);
    elseif ( 
$number == )
        
$output = ( false === $zero ) ? __('No Comments') : $zero;
    else 
// must be one
        
$output = ( false === $one ) ? __('1 Comment') : $one;

    echo 
apply_filters('comments_number'$output$number);
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics