X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/bf5c68485ef07868ad0a91168ecd0092af7661ae..8f374b7233bc2815ccc387e448d208c5434eb961:/wp-includes/comment-template.php diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 25f73c3d..5bacda18 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -55,7 +55,7 @@ function comment_author( $comment_ID = 0 ) { * @uses apply_filters() Calls the 'get_comment_author_email' hook on the comment author email * @uses $comment * - * @param int $comment_ID The ID of the comment for which to get the author's email. Optional. + * @param int $comment_ID The ID of the comment for which to get the author's email. Optional. * @return string The current comment author's email */ function get_comment_author_email( $comment_ID = 0 ) { @@ -141,7 +141,7 @@ function get_comment_author_email_link($linktext='', $before='', $after='') { * @since 1.5.0 * @uses apply_filters() Calls 'get_comment_author_link' hook on the complete link HTML or author * - * @param int $comment_ID The ID of the comment for which to get the author's link. Optional. + * @param int $comment_ID The ID of the comment for which to get the author's link. Optional. * @return string Comment Author name or HTML link for author's URL */ function get_comment_author_link( $comment_ID = 0 ) { @@ -189,7 +189,7 @@ function get_comment_author_IP( $comment_ID = 0 ) { * @since 0.71 * @see get_comment_author_IP() Echoes Result * - * @param int $comment_ID The ID of the comment for which to print the author's IP address. Optional. + * @param int $comment_ID The ID of the comment for which to print the author's IP address. Optional. */ function comment_author_IP( $comment_ID = 0 ) { echo get_comment_author_IP( $comment_ID ); @@ -201,7 +201,7 @@ function comment_author_IP( $comment_ID = 0 ) { * @since 1.5.0 * @uses apply_filters() Calls 'get_comment_author_url' hook on the comment author's URL * - * @param int $comment_ID The ID of the comment for which to get the author's URL. Optional. + * @param int $comment_ID The ID of the comment for which to get the author's URL. Optional. * @return string */ function get_comment_author_url( $comment_ID = 0 ) { @@ -384,7 +384,7 @@ function get_comment_date( $d = '', $comment_ID = 0 ) { * @since 0.71 * * @param string $d The format of the date (defaults to user's config) - * @param int $comment_ID The ID of the comment for which to print the date. Optional. + * @param int $comment_ID The ID of the comment for which to print the date. Optional. */ function comment_date( $d = '', $comment_ID = 0 ) { echo get_comment_date( $d, $comment_ID ); @@ -769,7 +769,7 @@ function trackback_rdf( $deprecated = '' ) { * @param int $post_id An optional post ID to check instead of the current post. * @return bool True if the comments are open */ -function comments_open( $post_id=NULL ) { +function comments_open( $post_id = null ) { $_post = get_post($post_id); @@ -786,7 +786,7 @@ function comments_open( $post_id=NULL ) { * @param int $post_id An optional post ID to check instead of the current post. * @return bool True if pings are accepted */ -function pings_open( $post_id = NULL ) { +function pings_open( $post_id = null ) { $_post = get_post($post_id); @@ -816,8 +816,10 @@ function wp_comment_form_unfiltered_html_nonce() { if ( !empty($post) ) $post_id = $post->ID; - if ( current_user_can('unfiltered_html') ) - wp_nonce_field('unfiltered-html-comment_' . $post_id, '_wp_unfiltered_html_comment', false); + if ( current_user_can( 'unfiltered_html' ) ) { + wp_nonce_field( 'unfiltered-html-comment_' . $post_id, '_wp_unfiltered_html_comment_disabled', false ); + echo "\n"; + } } /** @@ -899,10 +901,10 @@ function comments_template( $file = '/comments.php', $separate_comments = false $comments_by_type = &$wp_query->comments_by_type; } - $overridden_cpage = FALSE; + $overridden_cpage = false; if ( '' == get_query_var('cpage') && get_option('page_comments') ) { set_query_var( 'cpage', 'newest' == get_option('default_comments_page') ? get_comment_pages_count() : 1 ); - $overridden_cpage = TRUE; + $overridden_cpage = true; } if ( !defined('COMMENTS_TEMPLATE') || !COMMENTS_TEMPLATE) @@ -912,7 +914,7 @@ function comments_template( $file = '/comments.php', $separate_comments = false if ( file_exists( $include ) ) require( $include ); elseif ( file_exists( TEMPLATEPATH . $file ) ) - require( TEMPLATEPATH . $file ); + require( TEMPLATEPATH . $file ); else // Backward compat code will be removed in a future release require( ABSPATH . WPINC . '/theme-compat/comments.php'); } @@ -1091,7 +1093,7 @@ function comment_reply_link($args = array(), $comment = null, $post = null) { * @since 2.7.0 * * @param array $args Optional. Override default options. - * @param int|object $post Optional. Post that the comment is going to be displayed on. Defaults to current post. + * @param int|object $post Optional. Post that the comment is going to be displayed on. Defaults to current post. * @return string|bool|null Link to show comment form, if successful. False, if comments are closed. */ function get_post_reply_link($args = array(), $post = null) { @@ -1191,7 +1193,7 @@ function comment_id_fields( $id = 0 ) { * @param string $replytext Optional. Text to display when replying to a comment. Accepts "%s" for the author of the comment being replied to. * @param string $linktoparent Optional. Boolean to control making the author's name a link to their comment. */ -function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = TRUE ) { +function comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = true ) { global $comment; if ( false === $noreplytext ) $noreplytext = __( 'Leave a Reply' ); @@ -1238,7 +1240,7 @@ class Walker_Comment extends Walker { * @param int $depth Depth of comment. * @param array $args Uses 'style' argument for type of HTML list. */ - function start_lvl(&$output, $depth, $args) { + function start_lvl( &$output, $depth = 0, $args = array() ) { $GLOBALS['comment_depth'] = $depth + 1; switch ( $args['style'] ) { @@ -1262,7 +1264,7 @@ class Walker_Comment extends Walker { * @param int $depth Depth of comment. * @param array $args Will only append content if style argument value is 'ol' or 'ul'. */ - function end_lvl(&$output, $depth, $args) { + function end_lvl( &$output, $depth = 0, $args = array() ) { $GLOBALS['comment_depth'] = $depth + 1; switch ( $args['style'] ) { @@ -1326,7 +1328,7 @@ class Walker_Comment extends Walker { * @param int $depth Depth of comment in reference to parents. * @param array $args */ - function start_el(&$output, $comment, $depth, $args) { + function start_el( &$output, $comment, $depth, $args, $id = 0 ) { $depth++; $GLOBALS['comment_depth'] = $depth; @@ -1386,7 +1388,7 @@ class Walker_Comment extends Walker { * @param int $depth Depth of comment. * @param array $args */ - function end_el(&$output, $comment, $depth, $args) { + function end_el(&$output, $comment, $depth = 0, $args = array() ) { if ( !empty($args['end-callback']) ) { call_user_func($args['end-callback'], $comment, $args, $depth); return; @@ -1408,7 +1410,7 @@ class Walker_Comment extends Walker { * @uses Walker_Comment * * @param string|array $args Formatting options - * @param array $comments Optional array of comment objects. Defaults to $wp_query->comments + * @param array $comments Optional array of comment objects. Defaults to $wp_query->comments */ function wp_list_comments($args = array(), $comments = null ) { global $wp_query, $comment_alt, $comment_depth, $comment_thread_alt, $overridden_cpage, $in_comment_loop; @@ -1517,7 +1519,7 @@ function comment_form( $args = array(), $post_id = null ) { $commenter = wp_get_current_commenter(); $user = wp_get_current_user(); - $user_identity = ! empty( $user->ID ) ? $user->display_name : ''; + $user_identity = $user->exists() ? $user->display_name : ''; $req = get_option( 'require_name_email' ); $aria_req = ( $req ? " aria-required='true'" : '' ); @@ -1534,7 +1536,7 @@ function comment_form( $args = array(), $post_id = null ) { $defaults = array( 'fields' => apply_filters( 'comment_form_default_fields', $fields ), 'comment_field' => '

', - 'must_log_in' => '

' . sprintf( __( 'You must be logged in to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '

', + 'must_log_in' => '

' . sprintf( __( 'You must be logged in to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '

', 'logged_in_as' => '

' . sprintf( __( 'Logged in as %2$s. Log out?' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '

', 'comment_notes_before' => '

' . __( 'Your email address will not be published.' ) . ( $req ? $required_text : '' ) . '

', 'comment_notes_after' => '

' . sprintf( __( 'You may use these HTML tags and attributes: %s' ), ' ' . allowed_tags() . '' ) . '

', @@ -1549,7 +1551,7 @@ function comment_form( $args = array(), $post_id = null ) { $args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) ); ?> - +

@@ -1588,5 +1590,3 @@ function comment_form( $args = array(), $post_id = null ) {