comment_ID ); // Create an empty array if the comment template array is not set. if ( ! isset( liquid()->comment_template ) || ! is_array( liquid()->comment_template ) ) { liquid()->comment_template = array(); } // Check if a template has been provided for the specific comment type. If not, get the template. if ( ! isset( liquid()->comment_template[ $comment_type ] ) ) { // Create an array of template files to look for. $templates = array( "templates/comment/{$comment_type}.php" ); // If the comment type is a 'pingback' or 'trackback', allow the use of 'comment-ping.php'. if ( 'pingback' == $comment_type || 'trackback' == $comment_type ) { $templates[] = 'templates/comment/ping.php'; } // Add the fallback 'comment.php' template. $templates[] = 'templates/comment/comment.php'; // Allow devs to filter the template hierarchy. $templates = apply_filters( 'liquid_comment_template_hierarchy', $templates, $comment_type ); // Locate the comment template. $template = locate_template( $templates ); // Set the template in the comment template array. liquid()->comment_template[ $comment_type ] = $template; } // If a template was found, load the template. if ( ! empty( liquid()->comment_template[ $comment_type ] ) ) { require( liquid()->comment_template[ $comment_type ] ); } } // 3. Template Tags -------------------------------------------------- // /** * [liquid_comment_reply_link description] * @method liquid_comment_reply_link * @param array $args [description] * @return [type] [description] */ function liquid_comment_reply_link( $args = array() ) { echo liquid_get_comment_reply_link( $args ); } /** * [liquid_get_comment_reply_link description] * @method liquid_get_comment_reply_link * @param array $args [description] * @return [type] [description] */ function liquid_get_comment_reply_link( $args = array() ) { if ( ! get_option( 'thread_comments' ) || in_array( get_comment_type(), array( 'pingback', 'trackback' ) ) ) { return ''; } $args = wp_parse_args( $args, array( 'depth' => intval( $GLOBALS['comment_depth'] ), 'max_depth' => get_option( 'thread_comments_depth' ), ) ); return get_comment_reply_link( $args ); }