* after being passed through a filter. If the comment is empty, then the global
* comment variable will be used, if it is set.
*
- * If the comment is empty, then the global comment variable will be used, if it
- * is set.
- *
* @since 2.0.0
* @uses $wpdb
*
*/
var $meta_query = false;
+ /**
+ * Date query container
+ *
+ * @since 3.7.0
+ * @access public
+ * @var object WP_Date_Query
+ */
+ var $date_query = false;
+
/**
* Execute the query
*
'meta_key' => '',
'meta_value' => '',
'meta_query' => '',
+ 'date_query' => null, // See WP_Date_Query
);
$groupby = '';
$groupby = "{$wpdb->comments}.comment_ID";
}
+ if ( ! empty( $date_query ) && is_array( $date_query ) ) {
+ $date_query_object = new WP_Date_Query( $date_query, 'comment_date' );
+ $where .= $date_query_object->get_sql();
+ }
+
$pieces = array( 'fields', 'join', 'where', 'orderby', 'order', 'limits', 'groupby' );
$clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );
foreach ( $pieces as $piece )
if ( empty($comments) )
return 0;
+ if ( ! get_option( 'page_comments' ) )
+ return 1;
+
if ( !isset($per_page) )
$per_page = (int) get_query_var('comments_per_page');
if ( 0 === $per_page )
// First, get all of the original fields
$comment = get_comment($commentarr['comment_ID'], ARRAY_A);
+ if ( empty( $comment ) )
+ return 0;
// Escape data pulled from DB.
$comment = wp_slash($comment);
$excerpt = str_replace(']]>', ']]>', $excerpt);
$excerpt = wp_html_excerpt($excerpt, 252, '…');
+ /** This filter is documented in wp-includes/post-template.php */
$post_title = apply_filters('the_title', $post->post_title, $post->ID);
$post_title = strip_tags($post_title);
$pung = get_pung($post_ID);
- // Variables
- $ltrs = '\w';
- $gunk = '/#~:.?+=&%@!\-';
- $punc = '.:?\-';
- $any = $ltrs . $gunk . $punc;
-
// Step 1
// Parsing the post, external links (if any) are stored in the $post_links array
- // This regexp comes straight from phpfreaks.com
- // http://www.phpfreaks.com/quickcode/Extract_All_URLs_on_a_Page/15.php
- preg_match_all("{\b http : [$any] +? (?= [$punc] * [^$any] | $)}x", $content, $post_links_temp);
+ $post_links_temp = wp_extract_urls( $content );
// Step 2.
// Walking thru the links array
// http://dummy-weblog.org/post.php
// We don't wanna ping first and second types, even if they have a valid <link/>
- foreach ( (array) $post_links_temp[0] as $link_test ) :
+ foreach ( (array) $post_links_temp as $link_test ) :
if ( !in_array($link_test, $pung) && (url_to_postid($link_test) != $post_ID) // If we haven't pung it already and it isn't a link to itself
&& !is_local_attachment($link_test) ) : // Also, let's never ping local attachments.
if ( $test = @parse_url($link_test) ) {