[ Index ]

WordPress Cross Reference

title

Body

[close]

/wp-includes/ -> comment-template.php (summary)

Comment template functions These functions are meant to live inside of the WordPress loop.

File Size: 2152 lines (75 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 1 file
 wp-includes/theme-compat/comments.php

Defines 1 class

Walker_Comment:: (10 methods):
  start_lvl()
  end_lvl()
  display_element()
  start_el()
  end_el()
  ping()
  comment()
  html5_comment()
  wp_list_comments()
  comment_form()

Defines 10 functions

  get_comment_author()
  comment_author()
  get_comment_author_email()
  comment_author_email()
  comment_author_email_link()
  get_comment_author_email_link()
  get_comment_author_link()
  comment_author_link()
  get_comment_author_IP()
  comment_author_IP()
  get_comment_author_url()
  comment_author_url()
  get_comment_author_url_link()
  comment_author_url_link()
  comment_class()
  get_comment_class()
  get_comment_date()
  comment_date()
  get_comment_excerpt()
  comment_excerpt()
  get_comment_ID()
  comment_ID()
  get_comment_link()
  get_comments_link()
  comments_link()
  get_comments_number()
  comments_number()
  get_comment_text()
  comment_text()
  get_comment_time()
  comment_time()
  get_comment_type()
  comment_type()
  get_trackback_url()
  trackback_url()
  trackback_rdf()
  comments_open()
  pings_open()
  wp_comment_form_unfiltered_html_nonce()
  comments_template()
  comments_popup_script()
  comments_popup_link()
  get_comment_reply_link()
  comment_reply_link()
  get_post_reply_link()
  post_reply_link()
  get_cancel_comment_reply_link()
  cancel_comment_reply_link()
  get_comment_id_fields()
  comment_id_fields()
  comment_form_title()

Class: Walker_Comment  - X-Ref

HTML comment list class.

start_lvl( &$output, $depth = 0, $args = array()   X-Ref
Start the list before the elements are added.

param: string $output Passed by reference. Used to append additional content.
param: int $depth Depth of comment.
param: array $args Uses 'style' argument for type of HTML list.

end_lvl( &$output, $depth = 0, $args = array()   X-Ref
End the list of items after the elements are added.

param: string $output Passed by reference. Used to append additional content.
param: int    $depth  Depth of comment.
param: array  $args   Will only append content if style argument value is 'ol' or 'ul'.

display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output )   X-Ref
Traverse elements to create list from elements.

This function is designed to enhance Walker::display_element() to
display children of higher nesting levels than selected inline on
the highest depth level displayed. This prevents them being orphaned
at the end of the comment list.

Example: max_depth = 2, with 5 levels of nested content.
1
1.1
1.1.1
1.1.1.1
1.1.1.1.1
1.1.2
1.1.2.1
2
2.2

param: object $element           Data object.
param: array  $children_elements List of elements to continue traversing.
param: int    $max_depth         Max depth to traverse.
param: int    $depth             Depth of current element.
param: array  $args              An array of arguments. @see wp_list_comments()
param: string $output            Passed by reference. Used to append additional content.
return: null Null on failure with no changes to parameters.

start_el( &$output, $comment, $depth = 0, $args = array()   X-Ref
Start the element output.

param: string $output  Passed by reference. Used to append additional content.
param: object $comment Comment data object.
param: int    $depth   Depth of comment in reference to parents.
param: array  $args    An array of arguments. @see wp_list_comments()

end_el( &$output, $comment, $depth = 0, $args = array()   X-Ref
Ends the element output, if needed.

param: string $output  Passed by reference. Used to append additional content.
param: object $comment The comment object. Default current comment.
param: int    $depth   Depth of comment.
param: array  $args    An array of arguments. @see wp_list_comments()

ping( $comment, $depth, $args )   X-Ref
Output a pingback comment.

param: object $comment The comment object.
param: int    $depth   Depth of comment.
param: array  $args    An array of arguments. @see wp_list_comments()

comment( $comment, $depth, $args )   X-Ref
Output a single comment.

param: object $comment Comment to display.
param: int    $depth   Depth of comment.
param: array  $args    An array of arguments. @see wp_list_comments()

html5_comment( $comment, $depth, $args )   X-Ref
Output a comment in the HTML5 format.

param: object $comment Comment to display.
param: int    $depth   Depth of comment.
param: array  $args    An array of arguments. @see wp_list_comments()

wp_list_comments( $args = array()   X-Ref
List comments.

Used in the comments.php template to list comments for a particular post.

param: string|array $args {
param: array $comments Optional. Array of comment objects. @see WP_Query->comments

comment_form( $args = array()   X-Ref
Output a complete commenting form for use within a template.

Most strings and form fields may be controlled through the $args array passed
into the function, while you may also choose to use the comment_form_default_fields
filter to modify the array of default fields if you'd just like to add a new
one or remove a single field. All fields are also individually passed through
a filter of the form comment_form_field_$name where $name is the key used
in the array of fields.

param: array       $args {
param: int|WP_Post $post_id Optional. Post ID or WP_Post object to generate the form for. Default current post.

Functions
Functions that are not part of a class:

get_comment_author( $comment_ID = 0 )   X-Ref
Retrieve the author of the current comment.

If the comment has an empty comment_author field, then 'Anonymous' person is
assumed.

param: int $comment_ID Optional. The ID of the comment for which to retrieve the author. Default current comment.
return: string The comment author

comment_author( $comment_ID = 0 )   X-Ref
Displays the author of the current comment.

param: int $comment_ID Optional. The ID of the comment for which to print the author. Default current comment.

get_comment_author_email( $comment_ID = 0 )   X-Ref
Retrieve the email of the author of the current comment.

param: int $comment_ID Optional. The ID of the comment for which to get the author's email. Default current comment.
return: string The current comment author's email

comment_author_email( $comment_ID = 0 )   X-Ref
Display the email of the author of the current global $comment.

Care should be taken to protect the email address and assure that email
harvesters do not capture your commentors' email address. Most assume that
their email address will not appear in raw form on the blog. Doing so will
enable anyone, including those that people don't want to get the email
address and use it for their own means good and bad.

param: int $comment_ID Optional. The ID of the comment for which to print the author's email. Default current comment.

comment_author_email_link( $linktext = '', $before = '', $after = '' )   X-Ref
Display the html email link to the author of the current comment.

Care should be taken to protect the email address and assure that email
harvesters do not capture your commentors' email address. Most assume that
their email address will not appear in raw form on the blog. Doing so will
enable anyone, including those that people don't want to get the email
address and use it for their own means good and bad.

param: string $linktext Optional. The text to display instead of the comment author's email address. Default empty.
param: string $before   Optional. The text or HTML to display before the email link.Default empty.
param: string $after    Optional. The text or HTML to display after the email link. Default empty.

get_comment_author_email_link( $linktext = '', $before = '', $after = '' )   X-Ref
Return the html email link to the author of the current comment.

Care should be taken to protect the email address and assure that email
harvesters do not capture your commentors' email address. Most assume that
their email address will not appear in raw form on the blog. Doing so will
enable anyone, including those that people don't want to get the email
address and use it for their own means good and bad.

param: string $linktext Optional. The text to display instead of the comment author's email address. Default empty.
param: string $before   Optional. The text or HTML to display before the email link. Default empty.
param: string $after    Optional. The text or HTML to display after the email link. Default empty.

get_comment_author_link( $comment_ID = 0 )   X-Ref
Retrieve the HTML link to the URL of the author of the current comment.

Both get_comment_author_url() and get_comment_author() rely on get_comment(),
which falls back to the global comment variable if the $comment_ID argument is empty.

param: int $comment_ID Optional. The ID of the comment for which to get the author's link. Default current comment.
return: string The comment author name or HTML link for author's URL.

comment_author_link( $comment_ID = 0 )   X-Ref
Display the html link to the url of the author of the current comment.

param: int $comment_ID Optional. The ID of the comment for which to print the author's link. Default current comment.

get_comment_author_IP( $comment_ID = 0 )   X-Ref
Retrieve the IP address of the author of the current comment.

param: int $comment_ID Optional. The ID of the comment for which to get the author's IP address. Default current comment.
return: string The comment author's IP address.

comment_author_IP( $comment_ID = 0 )   X-Ref
Display the IP address of the author of the current comment.

param: int $comment_ID Optional. The ID of the comment for which to print the author's IP address. Default current comment.

get_comment_author_url( $comment_ID = 0 )   X-Ref
Retrieve the url of the author of the current comment.

param: int $comment_ID Optional. The ID of the comment for which to get the author's URL. Default current comment.
return: string

comment_author_url( $comment_ID = 0 )   X-Ref
Display the url of the author of the current comment.

param: int $comment_ID Optional. The ID of the comment for which to print the author's URL. Default current comment.

get_comment_author_url_link( $linktext = '', $before = '', $after = '' )   X-Ref
Retrieves the HTML link of the url of the author of the current comment.

$linktext parameter is only used if the URL does not exist for the comment
author. If the URL does exist then the URL will be used and the $linktext
will be ignored.

Encapsulate the HTML link between the $before and $after. So it will appear
in the order of $before, link, and finally $after.

param: string $linktext Optional. The text to display instead of the comment author's email address. Default empty.
param: string $before   Optional. The text or HTML to display before the email link. Default empty.
param: string $after    Optional. The text or HTML to display after the email link. Default empty.
return: string The HTML link between the $before and $after parameters.

comment_author_url_link( $linktext = '', $before = '', $after = '' )   X-Ref
Displays the HTML link of the url of the author of the current comment.

param: string $linktext Optional. The text to display instead of the comment author's email address. Default empty.
param: string $before   Optional. The text or HTML to display before the email link. Default empty.
param: string $after    Optional. The text or HTML to display after the email link. Default empty.

comment_class( $class = '', $comment_id = null, $post_id = null, $echo = true )   X-Ref
Generates semantic classes for each comment element

param: string|array $class      Optional. One or more classes to add to the class list. Default empty.
param: int          $comment_id Optional. Comment ID. Default current comment.
param: int|WP_Post  $post_id    Optional. Post ID or WP_Post object. Default current post.
param: bool         $echo       Optional. Whether comment_class should echo or return. Default true.

get_comment_class( $class = '', $comment_id = null, $post_id = null )   X-Ref
Returns the classes for the comment div as an array

param: string|array $class      Optional. One or more classes to add to the class list. Default empty.
param: int          $comment_id Optional. Comment ID. Default current comment.
param: int|WP_Post  $post_id    Optional. Post ID or WP_Post object. Default current post.
return: array An array of classes.

get_comment_date( $d = '', $comment_ID = 0 )   X-Ref
Retrieve the comment date of the current comment.

param: string $d          Optional. The format of the date. Default user's setting.
param: int    $comment_ID Optional. The ID of the comment for which to get the date. Default current comment.
return: string The comment's date.

comment_date( $d = '', $comment_ID = 0 )   X-Ref
Display the comment date of the current comment.

param: string $d          Optional. The format of the date. Default user's settings.
param: int    $comment_ID Optional. The ID of the comment for which to print the date. Default current comment.

get_comment_excerpt( $comment_ID = 0 )   X-Ref
Retrieve the excerpt of the current comment.

Will cut each word and only output the first 20 words with '…' at the end.
If the word count is less than 20, then no truncating is done and no '…'
will appear.

param: int $comment_ID Optional. The ID of the comment for which to get the excerpt. Default current comment.
return: string The maybe truncated comment with 20 words or less.

comment_excerpt( $comment_ID = 0 )   X-Ref
Display the excerpt of the current comment.

param: int $comment_ID Optional. The ID of the comment for which to print the excerpt. Default current comment.

get_comment_ID()   X-Ref
Retrieve the comment id of the current comment.

return: int The comment ID.

comment_ID()   X-Ref
Display the comment id of the current comment.


get_comment_link( $comment = null, $args = array()   X-Ref
Retrieve the link to a given comment.

param: mixed $comment Optional. Comment to retrieve. Default current comment.
param: array $args    Optional. An array of arguments to override the defaults. @see get_page_of_comment()
return: string The permalink to the given comment.

get_comments_link( $post_id = 0 )   X-Ref
Retrieve the link to the current post comments.

param: int|WP_Post $post_id Optional. Post ID or WP_Post object. Default current post.
return: string The link to the comments.

comments_link( $deprecated = '', $deprecated_2 = '' )   X-Ref
Display the link to the current post comments.

param: string $deprecated   Not Used.
param: bool   $deprecated_2 Not Used.

get_comments_number( $post_id = 0 )   X-Ref
Retrieve the amount of comments a post has.

param: int|WP_Post $post_id Optional. Post ID or WP_Post object. Default current post.
return: int The number of comments a post has.

comments_number( $zero = false, $one = false, $more = false, $deprecated = '' )   X-Ref
Display the language string for the number of comments the current post has.

param: string $zero       Optional. Text for no comments. Default false.
param: string $one        Optional. Text for one comment. Default false.
param: string $more       Optional. Text for more than one comment. Default false.
param: string $deprecated Not used.

get_comment_text( $comment_ID = 0, $args = array()   X-Ref
Retrieve the text of the current comment.

param: int   $comment_ID Optional. The ID of the comment for which to get the text. Default current comment.
param: array $args       Optional. An array of arguments. @see Walker_Comment::comment()
return: string The comment content.

comment_text( $comment_ID = 0, $args = array()   X-Ref
Display the text of the current comment.

param: int   $comment_ID Optional. The ID of the comment for which to print the text.
param: array $args       Optional. An array of arguments. @see Walker_Comment::comment()

get_comment_time( $d = '', $gmt = false, $translate = true )   X-Ref
Retrieve the comment time of the current comment.

param: string $d         Optional. The format of the time. Default user's settings.
param: bool   $gmt       Optional. Whether to use the GMT date. Default false.
param: bool   $translate Optional. Whether to translate the time (for use in feeds). Default true.
return: string The formatted time

comment_time( $d = '' )   X-Ref
Display the comment time of the current comment.

param: string $d Optional. The format of the time. Default user's settings.

get_comment_type( $comment_ID = 0 )   X-Ref
Retrieve the comment type of the current comment.

param: int $comment_ID Optional. The ID of the comment for which to get the type. Default current comment.
return: string The comment type

comment_type( $commenttxt = false, $trackbacktxt = false, $pingbacktxt = false )   X-Ref
Display the comment type of the current comment.

param: string $commenttxt   Optional. The string to display for comment type. Default false.
param: string $trackbacktxt Optional. The string to display for trackback type. Default false.
param: string $pingbacktxt  Optional. The string to display for pingback type. Default false.

get_trackback_url()   X-Ref
Retrieve The current post's trackback URL.

There is a check to see if permalink's have been enabled and if so, will
retrieve the pretty path. If permalinks weren't enabled, the ID of the
current post is used and appended to the correct page to go to.

return: string The trackback URL after being filtered.

trackback_url( $deprecated_echo = true )   X-Ref
Display the current post's trackback URL.

param: bool $deprecated_echo Not used.
return: void|string Should only be used to echo the trackback URL, use get_trackback_url() for the result instead.

trackback_rdf( $deprecated = '' )   X-Ref
Generate and display the RDF for the trackback information of current post.

Deprecated in 3.0.0, and restored in 3.0.1.

param: int $deprecated Not used (Was $timezone = 0).

comments_open( $post_id = null )   X-Ref
Whether the current post is open for comments.

param: int|WP_Post $post_id Optional. Post ID or WP_Post object. Default current post.
return: bool True if the comments are open.

pings_open( $post_id = null )   X-Ref
Whether the current post is open for pings.

param: int|WP_Post $post_id Optional. Post ID or WP_Post object. Default current post.
return: bool True if pings are accepted

wp_comment_form_unfiltered_html_nonce()   X-Ref
Display form token for unfiltered comments.

Will only display nonce token if the current user has permissions for
unfiltered html. Won't display the token for other users.

The function was backported to 2.0.10 and was added to versions 2.1.3 and
above. Does not exist in versions prior to 2.0.10 in the 2.0 branch and in
the 2.1 branch, prior to 2.1.3. Technically added in 2.2.0.

Backported to 2.0.10.


comments_template( $file = '/comments.php', $separate_comments = false )   X-Ref
Load the comment template specified in $file.

Will not display the comments template if not on single post or page, or if
the post does not have comments.

Uses the WordPress database object to query for the comments. The comments
are passed through the 'comments_array' filter hook with the list of comments
and the post ID respectively.

The $file path is passed through a filter hook called, 'comments_template'
which includes the TEMPLATEPATH and $file combined. Tries the $filtered path
first and if it fails it will require the default comment template from the
default theme. If either does not exist, then the WordPress process will be
halted. It is advised for that reason, that the default theme is not deleted.

param: string $file              Optional. The file to load. Default '/comments.php'.
param: bool   $separate_comments Optional. Whether to separate the comments by comment type. Default false.
return: null Returns null if no comments appear.

comments_popup_script( $width = 400, $height = 400, $file = '' )   X-Ref
Display the JS popup script to show a comment.

If the $file parameter is empty, then the home page is assumed. The defaults
for the window are 400px by 400px.

For the comment link popup to work, this function has to be called or the
normal comment link will be assumed.

param: int $width  Optional. The width of the popup window. Default 400.
param: int $height Optional. The height of the popup window. Default 400.
param: string $file Optional. Sets the location of the popup window.

comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false )   X-Ref
Displays the link to the comments popup window for the current post ID.

Is not meant to be displayed on single posts and pages. Should be used on the
lists of posts

param: string $zero      Optional. The string to display when no comments. Default false.
param: string $one       Optional. The string to display when only one comment is available. Default false.
param: string $more      Optional. The string to display when there are more than one comment. Default false.
param: string $css_class Optional. The CSS class to use for comments. Default empty.
param: string $none      Optional. The string to display when comments have been turned off. Default false.
return: null Returns null on single posts and pages.

get_comment_reply_link($args = array()   X-Ref
Retrieve HTML content for reply to comment link.

param: array $args {
param: int         $comment Optional. Comment being replied to. Default current comment.
param: int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on. Default current post.
return: mixed Link to show comment form, if successful. False, if comments are closed.

comment_reply_link($args = array()   X-Ref
Displays the HTML content for reply to comment link.

param: array       $args    Optional. Override default options, @see get_comment_reply_link()
param: int         $comment Optional. Comment being replied to. Default current comment.
param: int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on. Default current post.
return: mixed Link to show comment form, if successful. False, if comments are closed.

get_post_reply_link($args = array()   X-Ref
Retrieve HTML content for reply to post link.

param: array $args {
param: int|WP_Post $post    Optional. Post ID or WP_Post object the comment is going to be displayed on. Default current post.
return: string|bool|null Link to show comment form, if successful. False, if comments are closed.

post_reply_link($args = array()   X-Ref
Displays the HTML content for reply to post link.

param: array       $args Optional. Override default options, @see get_post_reply_link()
param: int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on. Default current post.
return: string|bool|null Link to show comment form, if successful. False, if comments are closed.

get_cancel_comment_reply_link( $text = '' )   X-Ref
Retrieve HTML content for cancel comment reply link.

param: string $text Optional. Text to display for cancel reply link. Default empty.

cancel_comment_reply_link( $text = '' )   X-Ref
Display HTML content for cancel comment reply link.

param: string $text Optional. Text to display for cancel reply link. Default empty.

get_comment_id_fields( $id = 0 )   X-Ref
Retrieve hidden input HTML for replying to comments.

param: int $id Optional. Post ID. Default current post ID.
return: string Hidden input HTML for replying to comments

comment_id_fields( $id = 0 )   X-Ref
Output hidden input HTML for replying to comments.

param: int $id Optional. Post ID. Default current post ID.

comment_form_title( $noreplytext = false, $replytext = false, $linktoparent = true )   X-Ref
Display text based on comment reply status.

Only affects users with Javascript disabled.

param: string $noreplytext  Optional. Text to display when not replying to a comment. Default false.
param: string $replytext    Optional. Text to display when replying to a comment.
param: string $linktoparent Optional. Boolean to control making the author's name a link to their comment. Default true.



Generated: Tue Mar 25 01:41:18 2014 WordPress honlapkészítés: online1.hu