Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu...
File: comment-template.php
[1500] Fix | Delete
if ( isset( $comment_args['include_unapproved'] ) ) {
[1501] Fix | Delete
$top_level_args['include_unapproved'] = $comment_args['include_unapproved'];
[1502] Fix | Delete
}
[1503] Fix | Delete
[1504] Fix | Delete
/**
[1505] Fix | Delete
* Filters the arguments used in the top level comments query.
[1506] Fix | Delete
*
[1507] Fix | Delete
* @since 5.6.0
[1508] Fix | Delete
*
[1509] Fix | Delete
* @see WP_Comment_Query::__construct()
[1510] Fix | Delete
*
[1511] Fix | Delete
* @param array $top_level_args {
[1512] Fix | Delete
* The top level query arguments for the comments template.
[1513] Fix | Delete
*
[1514] Fix | Delete
* @type bool $count Whether to return a comment count.
[1515] Fix | Delete
* @type string|array $orderby The field(s) to order by.
[1516] Fix | Delete
* @type int $post_id The post ID.
[1517] Fix | Delete
* @type string|array $status The comment status to limit results by.
[1518] Fix | Delete
* }
[1519] Fix | Delete
*/
[1520] Fix | Delete
$top_level_args = apply_filters( 'comments_template_top_level_query_args', $top_level_args );
[1521] Fix | Delete
[1522] Fix | Delete
$top_level_count = $top_level_query->query( $top_level_args );
[1523] Fix | Delete
[1524] Fix | Delete
$comment_args['offset'] = ( (int) ceil( $top_level_count / $per_page ) - 1 ) * $per_page;
[1525] Fix | Delete
}
[1526] Fix | Delete
}
[1527] Fix | Delete
[1528] Fix | Delete
/**
[1529] Fix | Delete
* Filters the arguments used to query comments in comments_template().
[1530] Fix | Delete
*
[1531] Fix | Delete
* @since 4.5.0
[1532] Fix | Delete
*
[1533] Fix | Delete
* @see WP_Comment_Query::__construct()
[1534] Fix | Delete
*
[1535] Fix | Delete
* @param array $comment_args {
[1536] Fix | Delete
* Array of WP_Comment_Query arguments.
[1537] Fix | Delete
*
[1538] Fix | Delete
* @type string|array $orderby Field(s) to order by.
[1539] Fix | Delete
* @type string $order Order of results. Accepts 'ASC' or 'DESC'.
[1540] Fix | Delete
* @type string $status Comment status.
[1541] Fix | Delete
* @type array $include_unapproved Array of IDs or email addresses whose unapproved comments
[1542] Fix | Delete
* will be included in results.
[1543] Fix | Delete
* @type int $post_id ID of the post.
[1544] Fix | Delete
* @type bool $no_found_rows Whether to refrain from querying for found rows.
[1545] Fix | Delete
* @type bool $update_comment_meta_cache Whether to prime cache for comment meta.
[1546] Fix | Delete
* @type bool|string $hierarchical Whether to query for comments hierarchically.
[1547] Fix | Delete
* @type int $offset Comment offset.
[1548] Fix | Delete
* @type int $number Number of comments to fetch.
[1549] Fix | Delete
* }
[1550] Fix | Delete
*/
[1551] Fix | Delete
$comment_args = apply_filters( 'comments_template_query_args', $comment_args );
[1552] Fix | Delete
[1553] Fix | Delete
$comment_query = new WP_Comment_Query( $comment_args );
[1554] Fix | Delete
$_comments = $comment_query->comments;
[1555] Fix | Delete
[1556] Fix | Delete
// Trees must be flattened before they're passed to the walker.
[1557] Fix | Delete
if ( $comment_args['hierarchical'] ) {
[1558] Fix | Delete
$comments_flat = array();
[1559] Fix | Delete
foreach ( $_comments as $_comment ) {
[1560] Fix | Delete
$comments_flat[] = $_comment;
[1561] Fix | Delete
$comment_children = $_comment->get_children(
[1562] Fix | Delete
array(
[1563] Fix | Delete
'format' => 'flat',
[1564] Fix | Delete
'status' => $comment_args['status'],
[1565] Fix | Delete
'orderby' => $comment_args['orderby'],
[1566] Fix | Delete
)
[1567] Fix | Delete
);
[1568] Fix | Delete
[1569] Fix | Delete
foreach ( $comment_children as $comment_child ) {
[1570] Fix | Delete
$comments_flat[] = $comment_child;
[1571] Fix | Delete
}
[1572] Fix | Delete
}
[1573] Fix | Delete
} else {
[1574] Fix | Delete
$comments_flat = $_comments;
[1575] Fix | Delete
}
[1576] Fix | Delete
[1577] Fix | Delete
/**
[1578] Fix | Delete
* Filters the comments array.
[1579] Fix | Delete
*
[1580] Fix | Delete
* @since 2.1.0
[1581] Fix | Delete
*
[1582] Fix | Delete
* @param array $comments Array of comments supplied to the comments template.
[1583] Fix | Delete
* @param int $post_id Post ID.
[1584] Fix | Delete
*/
[1585] Fix | Delete
$wp_query->comments = apply_filters( 'comments_array', $comments_flat, $post->ID );
[1586] Fix | Delete
[1587] Fix | Delete
$comments = &$wp_query->comments;
[1588] Fix | Delete
$wp_query->comment_count = count( $wp_query->comments );
[1589] Fix | Delete
$wp_query->max_num_comment_pages = $comment_query->max_num_pages;
[1590] Fix | Delete
[1591] Fix | Delete
if ( $separate_comments ) {
[1592] Fix | Delete
$wp_query->comments_by_type = separate_comments( $comments );
[1593] Fix | Delete
$comments_by_type = &$wp_query->comments_by_type;
[1594] Fix | Delete
} else {
[1595] Fix | Delete
$wp_query->comments_by_type = array();
[1596] Fix | Delete
}
[1597] Fix | Delete
[1598] Fix | Delete
$overridden_cpage = false;
[1599] Fix | Delete
[1600] Fix | Delete
if ( '' == get_query_var( 'cpage' ) && $wp_query->max_num_comment_pages > 1 ) {
[1601] Fix | Delete
set_query_var( 'cpage', 'newest' === get_option( 'default_comments_page' ) ? get_comment_pages_count() : 1 );
[1602] Fix | Delete
$overridden_cpage = true;
[1603] Fix | Delete
}
[1604] Fix | Delete
[1605] Fix | Delete
if ( ! defined( 'COMMENTS_TEMPLATE' ) ) {
[1606] Fix | Delete
define( 'COMMENTS_TEMPLATE', true );
[1607] Fix | Delete
}
[1608] Fix | Delete
[1609] Fix | Delete
$theme_template = trailingslashit( $wp_stylesheet_path ) . $file;
[1610] Fix | Delete
[1611] Fix | Delete
/**
[1612] Fix | Delete
* Filters the path to the theme template file used for the comments template.
[1613] Fix | Delete
*
[1614] Fix | Delete
* @since 1.5.1
[1615] Fix | Delete
*
[1616] Fix | Delete
* @param string $theme_template The path to the theme template file.
[1617] Fix | Delete
*/
[1618] Fix | Delete
$include = apply_filters( 'comments_template', $theme_template );
[1619] Fix | Delete
[1620] Fix | Delete
if ( file_exists( $include ) ) {
[1621] Fix | Delete
require $include;
[1622] Fix | Delete
} elseif ( file_exists( trailingslashit( $wp_template_path ) . $file ) ) {
[1623] Fix | Delete
require trailingslashit( $wp_template_path ) . $file;
[1624] Fix | Delete
} else { // Backward compat code will be removed in a future release.
[1625] Fix | Delete
require ABSPATH . WPINC . '/theme-compat/comments.php';
[1626] Fix | Delete
}
[1627] Fix | Delete
}
[1628] Fix | Delete
[1629] Fix | Delete
/**
[1630] Fix | Delete
* Displays the link to the comments for the current post ID.
[1631] Fix | Delete
*
[1632] Fix | Delete
* @since 0.71
[1633] Fix | Delete
*
[1634] Fix | Delete
* @param false|string $zero Optional. String to display when no comments. Default false.
[1635] Fix | Delete
* @param false|string $one Optional. String to display when only one comment is available. Default false.
[1636] Fix | Delete
* @param false|string $more Optional. String to display when there are more than one comment. Default false.
[1637] Fix | Delete
* @param string $css_class Optional. CSS class to use for comments. Default empty.
[1638] Fix | Delete
* @param false|string $none Optional. String to display when comments have been turned off. Default false.
[1639] Fix | Delete
*/
[1640] Fix | Delete
function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) {
[1641] Fix | Delete
$post_id = get_the_ID();
[1642] Fix | Delete
$post_title = get_the_title();
[1643] Fix | Delete
$comments_number = get_comments_number( $post_id );
[1644] Fix | Delete
[1645] Fix | Delete
if ( false === $zero ) {
[1646] Fix | Delete
/* translators: %s: Post title. */
[1647] Fix | Delete
$zero = sprintf( __( 'No Comments<span class="screen-reader-text"> on %s</span>' ), $post_title );
[1648] Fix | Delete
}
[1649] Fix | Delete
[1650] Fix | Delete
if ( false === $one ) {
[1651] Fix | Delete
/* translators: %s: Post title. */
[1652] Fix | Delete
$one = sprintf( __( '1 Comment<span class="screen-reader-text"> on %s</span>' ), $post_title );
[1653] Fix | Delete
}
[1654] Fix | Delete
[1655] Fix | Delete
if ( false === $more ) {
[1656] Fix | Delete
/* translators: 1: Number of comments, 2: Post title. */
[1657] Fix | Delete
$more = _n(
[1658] Fix | Delete
'%1$s Comment<span class="screen-reader-text"> on %2$s</span>',
[1659] Fix | Delete
'%1$s Comments<span class="screen-reader-text"> on %2$s</span>',
[1660] Fix | Delete
$comments_number
[1661] Fix | Delete
);
[1662] Fix | Delete
$more = sprintf( $more, number_format_i18n( $comments_number ), $post_title );
[1663] Fix | Delete
}
[1664] Fix | Delete
[1665] Fix | Delete
if ( false === $none ) {
[1666] Fix | Delete
/* translators: %s: Post title. */
[1667] Fix | Delete
$none = sprintf( __( 'Comments Off<span class="screen-reader-text"> on %s</span>' ), $post_title );
[1668] Fix | Delete
}
[1669] Fix | Delete
[1670] Fix | Delete
if ( 0 == $comments_number && ! comments_open() && ! pings_open() ) {
[1671] Fix | Delete
printf(
[1672] Fix | Delete
'<span%1$s>%2$s</span>',
[1673] Fix | Delete
! empty( $css_class ) ? ' class="' . esc_attr( $css_class ) . '"' : '',
[1674] Fix | Delete
$none
[1675] Fix | Delete
);
[1676] Fix | Delete
return;
[1677] Fix | Delete
}
[1678] Fix | Delete
[1679] Fix | Delete
if ( post_password_required() ) {
[1680] Fix | Delete
_e( 'Enter your password to view comments.' );
[1681] Fix | Delete
return;
[1682] Fix | Delete
}
[1683] Fix | Delete
[1684] Fix | Delete
if ( 0 == $comments_number ) {
[1685] Fix | Delete
$respond_link = get_permalink() . '#respond';
[1686] Fix | Delete
/**
[1687] Fix | Delete
* Filters the respond link when a post has no comments.
[1688] Fix | Delete
*
[1689] Fix | Delete
* @since 4.4.0
[1690] Fix | Delete
*
[1691] Fix | Delete
* @param string $respond_link The default response link.
[1692] Fix | Delete
* @param int $post_id The post ID.
[1693] Fix | Delete
*/
[1694] Fix | Delete
$comments_link = apply_filters( 'respond_link', $respond_link, $post_id );
[1695] Fix | Delete
} else {
[1696] Fix | Delete
$comments_link = get_comments_link();
[1697] Fix | Delete
}
[1698] Fix | Delete
[1699] Fix | Delete
$link_attributes = '';
[1700] Fix | Delete
[1701] Fix | Delete
/**
[1702] Fix | Delete
* Filters the comments link attributes for display.
[1703] Fix | Delete
*
[1704] Fix | Delete
* @since 2.5.0
[1705] Fix | Delete
*
[1706] Fix | Delete
* @param string $link_attributes The comments link attributes. Default empty.
[1707] Fix | Delete
*/
[1708] Fix | Delete
$link_attributes = apply_filters( 'comments_popup_link_attributes', $link_attributes );
[1709] Fix | Delete
[1710] Fix | Delete
printf(
[1711] Fix | Delete
'<a href="%1$s"%2$s%3$s>%4$s</a>',
[1712] Fix | Delete
esc_url( $comments_link ),
[1713] Fix | Delete
! empty( $css_class ) ? ' class="' . $css_class . '" ' : '',
[1714] Fix | Delete
$link_attributes,
[1715] Fix | Delete
get_comments_number_text( $zero, $one, $more )
[1716] Fix | Delete
);
[1717] Fix | Delete
}
[1718] Fix | Delete
[1719] Fix | Delete
/**
[1720] Fix | Delete
* Retrieves HTML content for reply to comment link.
[1721] Fix | Delete
*
[1722] Fix | Delete
* @since 2.7.0
[1723] Fix | Delete
* @since 4.4.0 Added the ability for `$comment` to also accept a WP_Comment object.
[1724] Fix | Delete
*
[1725] Fix | Delete
* @param array $args {
[1726] Fix | Delete
* Optional. Override default arguments.
[1727] Fix | Delete
*
[1728] Fix | Delete
* @type string $add_below The first part of the selector used to identify the comment to respond below.
[1729] Fix | Delete
* The resulting value is passed as the first parameter to addComment.moveForm(),
[1730] Fix | Delete
* concatenated as $add_below-$comment->comment_ID. Default 'comment'.
[1731] Fix | Delete
* @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
[1732] Fix | Delete
* to addComment.moveForm(), and appended to the link URL as a hash value.
[1733] Fix | Delete
* Default 'respond'.
[1734] Fix | Delete
* @type string $reply_text The text of the Reply link. Default 'Reply'.
[1735] Fix | Delete
* @type string $login_text The text of the link to reply if logged out. Default 'Log in to Reply'.
[1736] Fix | Delete
* @type int $max_depth The max depth of the comment tree. Default 0.
[1737] Fix | Delete
* @type int $depth The depth of the new comment. Must be greater than 0 and less than the value
[1738] Fix | Delete
* of the 'thread_comments_depth' option set in Settings > Discussion. Default 0.
[1739] Fix | Delete
* @type string $before The text or HTML to add before the reply link. Default empty.
[1740] Fix | Delete
* @type string $after The text or HTML to add after the reply link. Default empty.
[1741] Fix | Delete
* }
[1742] Fix | Delete
* @param int|WP_Comment $comment Optional. Comment being replied to. Default current comment.
[1743] Fix | Delete
* @param int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on.
[1744] Fix | Delete
* Default current post.
[1745] Fix | Delete
* @return string|false|null Link to show comment form, if successful. False, if comments are closed.
[1746] Fix | Delete
*/
[1747] Fix | Delete
function get_comment_reply_link( $args = array(), $comment = null, $post = null ) {
[1748] Fix | Delete
$defaults = array(
[1749] Fix | Delete
'add_below' => 'comment',
[1750] Fix | Delete
'respond_id' => 'respond',
[1751] Fix | Delete
'reply_text' => __( 'Reply' ),
[1752] Fix | Delete
/* translators: Comment reply button text. %s: Comment author name. */
[1753] Fix | Delete
'reply_to_text' => __( 'Reply to %s' ),
[1754] Fix | Delete
'login_text' => __( 'Log in to Reply' ),
[1755] Fix | Delete
'max_depth' => 0,
[1756] Fix | Delete
'depth' => 0,
[1757] Fix | Delete
'before' => '',
[1758] Fix | Delete
'after' => '',
[1759] Fix | Delete
);
[1760] Fix | Delete
[1761] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[1762] Fix | Delete
[1763] Fix | Delete
if ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] ) {
[1764] Fix | Delete
return;
[1765] Fix | Delete
}
[1766] Fix | Delete
[1767] Fix | Delete
$comment = get_comment( $comment );
[1768] Fix | Delete
[1769] Fix | Delete
if ( empty( $comment ) ) {
[1770] Fix | Delete
return;
[1771] Fix | Delete
}
[1772] Fix | Delete
[1773] Fix | Delete
if ( empty( $post ) ) {
[1774] Fix | Delete
$post = $comment->comment_post_ID;
[1775] Fix | Delete
}
[1776] Fix | Delete
[1777] Fix | Delete
$post = get_post( $post );
[1778] Fix | Delete
[1779] Fix | Delete
if ( ! comments_open( $post->ID ) ) {
[1780] Fix | Delete
return false;
[1781] Fix | Delete
}
[1782] Fix | Delete
[1783] Fix | Delete
if ( get_option( 'page_comments' ) ) {
[1784] Fix | Delete
$permalink = str_replace( '#comment-' . $comment->comment_ID, '', get_comment_link( $comment ) );
[1785] Fix | Delete
} else {
[1786] Fix | Delete
$permalink = get_permalink( $post->ID );
[1787] Fix | Delete
}
[1788] Fix | Delete
[1789] Fix | Delete
/**
[1790] Fix | Delete
* Filters the comment reply link arguments.
[1791] Fix | Delete
*
[1792] Fix | Delete
* @since 4.1.0
[1793] Fix | Delete
*
[1794] Fix | Delete
* @param array $args Comment reply link arguments. See get_comment_reply_link()
[1795] Fix | Delete
* for more information on accepted arguments.
[1796] Fix | Delete
* @param WP_Comment $comment The object of the comment being replied to.
[1797] Fix | Delete
* @param WP_Post $post The WP_Post object.
[1798] Fix | Delete
*/
[1799] Fix | Delete
$args = apply_filters( 'comment_reply_link_args', $args, $comment, $post );
[1800] Fix | Delete
[1801] Fix | Delete
if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) {
[1802] Fix | Delete
$link = sprintf(
[1803] Fix | Delete
'<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>',
[1804] Fix | Delete
esc_url( wp_login_url( get_permalink() ) ),
[1805] Fix | Delete
$args['login_text']
[1806] Fix | Delete
);
[1807] Fix | Delete
} else {
[1808] Fix | Delete
$data_attributes = array(
[1809] Fix | Delete
'commentid' => $comment->comment_ID,
[1810] Fix | Delete
'postid' => $post->ID,
[1811] Fix | Delete
'belowelement' => $args['add_below'] . '-' . $comment->comment_ID,
[1812] Fix | Delete
'respondelement' => $args['respond_id'],
[1813] Fix | Delete
'replyto' => sprintf( $args['reply_to_text'], get_comment_author( $comment ) ),
[1814] Fix | Delete
);
[1815] Fix | Delete
[1816] Fix | Delete
$data_attribute_string = '';
[1817] Fix | Delete
[1818] Fix | Delete
foreach ( $data_attributes as $name => $value ) {
[1819] Fix | Delete
$data_attribute_string .= " data-{$name}=\"" . esc_attr( $value ) . '"';
[1820] Fix | Delete
}
[1821] Fix | Delete
[1822] Fix | Delete
$data_attribute_string = trim( $data_attribute_string );
[1823] Fix | Delete
[1824] Fix | Delete
$link = sprintf(
[1825] Fix | Delete
"<a rel='nofollow' class='comment-reply-link' href='%s' %s aria-label='%s'>%s</a>",
[1826] Fix | Delete
esc_url(
[1827] Fix | Delete
add_query_arg(
[1828] Fix | Delete
array(
[1829] Fix | Delete
'replytocom' => $comment->comment_ID,
[1830] Fix | Delete
'unapproved' => false,
[1831] Fix | Delete
'moderation-hash' => false,
[1832] Fix | Delete
),
[1833] Fix | Delete
$permalink
[1834] Fix | Delete
)
[1835] Fix | Delete
) . '#' . $args['respond_id'],
[1836] Fix | Delete
$data_attribute_string,
[1837] Fix | Delete
esc_attr( sprintf( $args['reply_to_text'], get_comment_author( $comment ) ) ),
[1838] Fix | Delete
$args['reply_text']
[1839] Fix | Delete
);
[1840] Fix | Delete
}
[1841] Fix | Delete
[1842] Fix | Delete
$comment_reply_link = $args['before'] . $link . $args['after'];
[1843] Fix | Delete
[1844] Fix | Delete
/**
[1845] Fix | Delete
* Filters the comment reply link.
[1846] Fix | Delete
*
[1847] Fix | Delete
* @since 2.7.0
[1848] Fix | Delete
*
[1849] Fix | Delete
* @param string $comment_reply_link The HTML markup for the comment reply link.
[1850] Fix | Delete
* @param array $args An array of arguments overriding the defaults.
[1851] Fix | Delete
* @param WP_Comment $comment The object of the comment being replied.
[1852] Fix | Delete
* @param WP_Post $post The WP_Post object.
[1853] Fix | Delete
*/
[1854] Fix | Delete
return apply_filters( 'comment_reply_link', $comment_reply_link, $args, $comment, $post );
[1855] Fix | Delete
}
[1856] Fix | Delete
[1857] Fix | Delete
/**
[1858] Fix | Delete
* Displays the HTML content for reply to comment link.
[1859] Fix | Delete
*
[1860] Fix | Delete
* @since 2.7.0
[1861] Fix | Delete
*
[1862] Fix | Delete
* @see get_comment_reply_link()
[1863] Fix | Delete
*
[1864] Fix | Delete
* @param array $args Optional. Override default options. Default empty array.
[1865] Fix | Delete
* @param int|WP_Comment $comment Optional. Comment being replied to. Default current comment.
[1866] Fix | Delete
* @param int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on.
[1867] Fix | Delete
* Default current post.
[1868] Fix | Delete
*/
[1869] Fix | Delete
function comment_reply_link( $args = array(), $comment = null, $post = null ) {
[1870] Fix | Delete
echo get_comment_reply_link( $args, $comment, $post );
[1871] Fix | Delete
}
[1872] Fix | Delete
[1873] Fix | Delete
/**
[1874] Fix | Delete
* Retrieves HTML content for reply to post link.
[1875] Fix | Delete
*
[1876] Fix | Delete
* @since 2.7.0
[1877] Fix | Delete
*
[1878] Fix | Delete
* @param array $args {
[1879] Fix | Delete
* Optional. Override default arguments.
[1880] Fix | Delete
*
[1881] Fix | Delete
* @type string $add_below The first part of the selector used to identify the comment to respond below.
[1882] Fix | Delete
* The resulting value is passed as the first parameter to addComment.moveForm(),
[1883] Fix | Delete
* concatenated as $add_below-$comment->comment_ID. Default is 'post'.
[1884] Fix | Delete
* @type string $respond_id The selector identifying the responding comment. Passed as the third parameter
[1885] Fix | Delete
* to addComment.moveForm(), and appended to the link URL as a hash value.
[1886] Fix | Delete
* Default 'respond'.
[1887] Fix | Delete
* @type string $reply_text Text of the Reply link. Default is 'Leave a Comment'.
[1888] Fix | Delete
* @type string $login_text Text of the link to reply if logged out. Default is 'Log in to leave a Comment'.
[1889] Fix | Delete
* @type string $before Text or HTML to add before the reply link. Default empty.
[1890] Fix | Delete
* @type string $after Text or HTML to add after the reply link. Default empty.
[1891] Fix | Delete
* }
[1892] Fix | Delete
* @param int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on.
[1893] Fix | Delete
* Default current post.
[1894] Fix | Delete
* @return string|false|null Link to show comment form, if successful. False, if comments are closed.
[1895] Fix | Delete
*/
[1896] Fix | Delete
function get_post_reply_link( $args = array(), $post = null ) {
[1897] Fix | Delete
$defaults = array(
[1898] Fix | Delete
'add_below' => 'post',
[1899] Fix | Delete
'respond_id' => 'respond',
[1900] Fix | Delete
'reply_text' => __( 'Leave a Comment' ),
[1901] Fix | Delete
'login_text' => __( 'Log in to leave a Comment' ),
[1902] Fix | Delete
'before' => '',
[1903] Fix | Delete
'after' => '',
[1904] Fix | Delete
);
[1905] Fix | Delete
[1906] Fix | Delete
$args = wp_parse_args( $args, $defaults );
[1907] Fix | Delete
[1908] Fix | Delete
$post = get_post( $post );
[1909] Fix | Delete
[1910] Fix | Delete
if ( ! comments_open( $post->ID ) ) {
[1911] Fix | Delete
return false;
[1912] Fix | Delete
}
[1913] Fix | Delete
[1914] Fix | Delete
if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) {
[1915] Fix | Delete
$link = sprintf(
[1916] Fix | Delete
'<a rel="nofollow" class="comment-reply-login" href="%s">%s</a>',
[1917] Fix | Delete
wp_login_url( get_permalink() ),
[1918] Fix | Delete
$args['login_text']
[1919] Fix | Delete
);
[1920] Fix | Delete
} else {
[1921] Fix | Delete
$onclick = sprintf(
[1922] Fix | Delete
'return addComment.moveForm( "%1$s-%2$s", "0", "%3$s", "%2$s" )',
[1923] Fix | Delete
$args['add_below'],
[1924] Fix | Delete
$post->ID,
[1925] Fix | Delete
$args['respond_id']
[1926] Fix | Delete
);
[1927] Fix | Delete
[1928] Fix | Delete
$link = sprintf(
[1929] Fix | Delete
"<a rel='nofollow' class='comment-reply-link' href='%s' onclick='%s'>%s</a>",
[1930] Fix | Delete
get_permalink( $post->ID ) . '#' . $args['respond_id'],
[1931] Fix | Delete
$onclick,
[1932] Fix | Delete
$args['reply_text']
[1933] Fix | Delete
);
[1934] Fix | Delete
}
[1935] Fix | Delete
[1936] Fix | Delete
$post_reply_link = $args['before'] . $link . $args['after'];
[1937] Fix | Delete
[1938] Fix | Delete
/**
[1939] Fix | Delete
* Filters the formatted post comments link HTML.
[1940] Fix | Delete
*
[1941] Fix | Delete
* @since 2.7.0
[1942] Fix | Delete
*
[1943] Fix | Delete
* @param string $post_reply_link The HTML-formatted post comments link.
[1944] Fix | Delete
* @param int|WP_Post $post The post ID or WP_Post object.
[1945] Fix | Delete
*/
[1946] Fix | Delete
return apply_filters( 'post_comments_link', $post_reply_link, $post );
[1947] Fix | Delete
}
[1948] Fix | Delete
[1949] Fix | Delete
/**
[1950] Fix | Delete
* Displays the HTML content for reply to post link.
[1951] Fix | Delete
*
[1952] Fix | Delete
* @since 2.7.0
[1953] Fix | Delete
*
[1954] Fix | Delete
* @see get_post_reply_link()
[1955] Fix | Delete
*
[1956] Fix | Delete
* @param array $args Optional. Override default options. Default empty array.
[1957] Fix | Delete
* @param int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on.
[1958] Fix | Delete
* Default current post.
[1959] Fix | Delete
*/
[1960] Fix | Delete
function post_reply_link( $args = array(), $post = null ) {
[1961] Fix | Delete
echo get_post_reply_link( $args, $post );
[1962] Fix | Delete
}
[1963] Fix | Delete
[1964] Fix | Delete
/**
[1965] Fix | Delete
* Retrieves HTML content for cancel comment reply link.
[1966] Fix | Delete
*
[1967] Fix | Delete
* @since 2.7.0
[1968] Fix | Delete
* @since 6.2.0 Added the `$post` parameter.
[1969] Fix | Delete
*
[1970] Fix | Delete
* @param string $link_text Optional. Text to display for cancel reply link. If empty,
[1971] Fix | Delete
* defaults to 'Click here to cancel reply'. Default empty.
[1972] Fix | Delete
* @param int|WP_Post|null $post Optional. The post the comment thread is being
[1973] Fix | Delete
* displayed for. Defaults to the current global post.
[1974] Fix | Delete
* @return string
[1975] Fix | Delete
*/
[1976] Fix | Delete
function get_cancel_comment_reply_link( $link_text = '', $post = null ) {
[1977] Fix | Delete
if ( empty( $link_text ) ) {
[1978] Fix | Delete
$link_text = __( 'Click here to cancel reply.' );
[1979] Fix | Delete
}
[1980] Fix | Delete
[1981] Fix | Delete
$post = get_post( $post );
[1982] Fix | Delete
$reply_to_id = $post ? _get_comment_reply_id( $post->ID ) : 0;
[1983] Fix | Delete
$link_style = 0 !== $reply_to_id ? '' : ' style="display:none;"';
[1984] Fix | Delete
$link_url = esc_url( remove_query_arg( array( 'replytocom', 'unapproved', 'moderation-hash' ) ) ) . '#respond';
[1985] Fix | Delete
[1986] Fix | Delete
$cancel_comment_reply_link = sprintf(
[1987] Fix | Delete
'<a rel="nofollow" id="cancel-comment-reply-link" href="%1$s"%2$s>%3$s</a>',
[1988] Fix | Delete
$link_url,
[1989] Fix | Delete
$link_style,
[1990] Fix | Delete
$link_text
[1991] Fix | Delete
);
[1992] Fix | Delete
[1993] Fix | Delete
/**
[1994] Fix | Delete
* Filters the cancel comment reply link HTML.
[1995] Fix | Delete
*
[1996] Fix | Delete
* @since 2.7.0
[1997] Fix | Delete
*
[1998] Fix | Delete
* @param string $cancel_comment_reply_link The HTML-formatted cancel comment reply link.
[1999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function