Index: trunk/wp-includes/general-template.php
===================================================================
--- trunk/wp-includes/general-template.php	(révision 19734)
+++ trunk/wp-includes/general-template.php	(copie de travail)
@@ -1129,17 +1129,18 @@
 	$unixmonth = mktime(0, 0 , 0, $thismonth, 1, $thisyear);
 	$last_day = date('t', $unixmonth);
 
+	$join = apply_filters( 'getcalendar_join', '' );
+	$where = apply_filters( 'getcalendar_where', "AND post_type = 'post' AND post_status = 'publish'" );
+
 	// Get the next and previous month and year with at least one post
 	$previous = $wpdb->get_row("SELECT MONTH(post_date) AS month, YEAR(post_date) AS year
-		FROM $wpdb->posts
-		WHERE post_date < '$thisyear-$thismonth-01'
-		AND post_type = 'post' AND post_status = 'publish'
+		FROM $wpdb->posts $join
+		WHERE post_date < '$thisyear-$thismonth-01' $where
 			ORDER BY post_date DESC
 			LIMIT 1");
 	$next = $wpdb->get_row("SELECT MONTH(post_date) AS month, YEAR(post_date) AS year
-		FROM $wpdb->posts
-		WHERE post_date > '$thisyear-$thismonth-{$last_day} 23:59:59'
-		AND post_type = 'post' AND post_status = 'publish'
+		FROM $wpdb->posts $join
+		WHERE post_date > '$thisyear-$thismonth-{$last_day} 23:59:59' $where
 			ORDER BY post_date ASC
 			LIMIT 1");
 
@@ -1192,9 +1193,9 @@
 
 	// Get days with posts
 	$dayswithposts = $wpdb->get_results("SELECT DISTINCT DAYOFMONTH(post_date)
-		FROM $wpdb->posts WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00'
-		AND post_type = 'post' AND post_status = 'publish'
-		AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59'", ARRAY_N);
+		FROM $wpdb->posts $join
+		WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00'
+		AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59' $where", ARRAY_N);
 	if ( $dayswithposts ) {
 		foreach ( (array) $dayswithposts as $daywith ) {
 			$daywithpost[] = $daywith[0];
@@ -1210,10 +1211,11 @@
 
 	$ak_titles_for_day = array();
 	$ak_post_titles = $wpdb->get_results("SELECT ID, post_title, DAYOFMONTH(post_date) as dom "
-		."FROM $wpdb->posts "
+		."FROM $wpdb->posts " 
+		.$join
 		."WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00' "
 		."AND post_date <= '{$thisyear}-{$thismonth}-{$last_day} 23:59:59' "
-		."AND post_type = 'post' AND post_status = 'publish'"
+		.$where
 	);
 	if ( $ak_post_titles ) {
 		foreach ( (array) $ak_post_titles as $ak_post_title ) {
