WordPress.org

Make WordPress Core

Ticket #9548: comments-translated-args-by-default.diff

File comments-translated-args-by-default.diff, 3.3 KB (added by nbachiyski, 5 years ago)
  • wp-includes/comment-template.php

     
    640640 * @param string $trackbacktxt The string to display for trackback type 
    641641 * @param string $pingbacktxt The string to display for pingback type 
    642642 */ 
    643 function comment_type($commenttxt = 'Comment', $trackbacktxt = 'Trackback', $pingbacktxt = 'Pingback') { 
     643function comment_type($commenttxt = false, $trackbacktxt = false, $pingbacktxt = false) { 
     644    if ( false === $commenttxt ) $commenttxt = _x( 'Comment', 'noun' ); 
     645    if ( false === $trackbacktxt ) $trackbacktxt = __( 'Trackback' ); 
     646    if ( false === $pingbacktxt ) $pingbacktxt = __( 'Pingback' ); 
    644647        $type = get_comment_type(); 
    645648        switch( $type ) { 
    646649                case 'trackback' : 
     
    841844                $overridden_cpage = TRUE; 
    842845        } 
    843846 
    844         define('COMMENTS_TEMPLATE', true); 
     847        if ( !defined('COMMENTS_TEMPLATE') || !COMMENTS_TEMPLATE) 
     848                define('COMMENTS_TEMPLATE', true); 
    845849 
    846850        $include = apply_filters('comments_template', STYLESHEETPATH . $file ); 
    847851        if ( file_exists( $include ) ) 
     
    902906 * @param string $none The string to display when comments have been turned off 
    903907 * @return null Returns null on single posts and pages. 
    904908 */ 
    905 function comments_popup_link( $zero = 'No Comments', $one = '1 Comment', $more = '% Comments', $css_class = '', $none = 'Comments Off' ) { 
     909function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) { 
    906910        global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post; 
    907  
     911         
     912    if ( false === $zero ) $zero = __( 'No Comments' ); 
     913    if ( false === $one ) $one = __( '1 Comment' ); 
     914    if ( false === $more ) $more = __( '% Comments' ); 
     915    if ( false === $none ) $none = __( 'Comments Off' ); 
     916         
    908917        $number = get_comments_number( $id ); 
    909918 
    910919        if ( 0 == $number && 'closed' == $post->comment_status && 'closed' == $post->ping_status ) { 
     
    11041113 * @param string $replytext Optional. Text to display when replying to a comment. Accepts "%s" for the author of the comment being replied to. 
    11051114 * @param string $linktoparent Optional. Boolean to control making the author's name a link to their comment. 
    11061115 */ 
    1107 function comment_form_title( $noreplytext = 'Leave a Reply', $replytext = 'Leave a Reply to %s', $linktoparent = TRUE ) { 
     1116function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = TRUE ) { 
    11081117        global $comment; 
     1118         
     1119        if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' ); 
     1120        if ( false === $replytext ) $replytext = __( 'Leave a Reply to %s' ); 
    11091121 
    11101122        $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0; 
    11111123 
  • wp-includes/query.php

     
    22962296 
    22972297                // Put sticky posts at the top of the posts array 
    22982298                $sticky_posts = get_option('sticky_posts'); 
    2299                 if ( $this->is_home && $page <= 1 && !empty($sticky_posts) && !$q['caller_get_posts'] ) { 
     2299                if ( $this->is_home && $page <= 1 && is_array($sticky_posts) && !empty($sticky_posts) && !$q['caller_get_posts'] ) { 
    23002300                        $num_posts = count($this->posts); 
    23012301                        $sticky_offset = 0; 
    23022302                        // Loop over posts and relocate stickies to the front.