Changeset 37305 for trunk/src/wp-includes/comment-template.php
- Timestamp:
- 04/22/2016 10:44:33 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment-template.php
r37208 r37305 294 294 function get_comment_author_url( $comment_ID = 0 ) { 295 295 $comment = get_comment( $comment_ID ); 296 $url = ('http://' == $comment->comment_author_url) ? '' : $comment->comment_author_url; 297 $url = esc_url( $url, array('http', 'https') ); 296 $url = ''; 297 $id = 0; 298 if ( ! empty( $comment ) ) { 299 $author_url = ( 'http://' == $comment->comment_author_url ) ? '' : $comment->comment_author_url; 300 $url = esc_url( $author_url, array( 'http', 'https' ) ); 301 $id = $comment->ID; 302 } 298 303 299 304 /** … … 307 312 * @param WP_Comment $comment The comment object. 308 313 */ 309 return apply_filters( 'get_comment_author_url', $url, $ comment->comment_ID, $comment );314 return apply_filters( 'get_comment_author_url', $url, $id, $comment ); 310 315 } 311 316 … … 346 351 * 347 352 * @since 1.5.0 348 * 349 * @param string $linktext Optional. The text to display instead of the comment 350 * author's email address. Default empty. 351 * @param string $before Optional. The text or HTML to display before the email link. 352 * Default empty. 353 * @param string $after Optional. The text or HTML to display after the email link. 354 * Default empty. 353 * @since 4.6.0 The `$comment` parameter was added. 354 * 355 * @param string $linktext Optional. The text to display instead of the comment 356 * author's email address. Default empty. 357 * @param string $before Optional. The text or HTML to display before the email link. 358 * Default empty. 359 * @param string $after Optional. The text or HTML to display after the email link. 360 * Default empty. 361 * @param int|WP_Comment $comment Optional. Comment ID or WP_Comment object. 362 * Default is the current comment. 355 363 * @return string The HTML link between the $before and $after parameters. 356 364 */ 357 function get_comment_author_url_link( $linktext = '', $before = '', $after = '' ) {358 $url = get_comment_author_url( );365 function get_comment_author_url_link( $linktext = '', $before = '', $after = '', $comment = 0 ) { 366 $url = get_comment_author_url( $comment ); 359 367 $display = ($linktext != '') ? $linktext : $url; 360 368 $display = str_replace( 'http://www.', '', $display ); … … 381 389 * 382 390 * @since 0.71 383 * 384 * @param string $linktext Optional. Text to display instead of the comment author's 385 * email address. Default empty. 386 * @param string $before Optional. Text or HTML to display before the email link. 387 * Default empty. 388 * @param string $after Optional. Text or HTML to display after the email link. 389 * Default empty. 390 */ 391 function comment_author_url_link( $linktext = '', $before = '', $after = '' ) { 392 echo get_comment_author_url_link( $linktext, $before, $after ); 391 * @since 4.6.0 The `$comment` parameter was added. 392 * 393 * @param string $linktext Optional. Text to display instead of the comment author's 394 * email address. Default empty. 395 * @param string $before Optional. Text or HTML to display before the email link. 396 * Default empty. 397 * @param string $after Optional. Text or HTML to display after the email link. 398 * Default empty. 399 * @param int|WP_Comment $comment Optional. Comment ID or WP_Comment object. 400 * Default is the current comment. 401 */ 402 function comment_author_url_link( $linktext = '', $before = '', $after = '', $comment = 0 ) { 403 echo get_comment_author_url_link( $linktext, $before, $after, $comment ); 393 404 } 394 405
Note: See TracChangeset
for help on using the changeset viewer.