Changeset 8766
- Timestamp:
- 08/28/2008 10:30:27 PM (16 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r8732 r8766 454 454 'exclude' => '', 'meta_key' => '', 455 455 'meta_value' =>'', 'post_type' => 'post', 456 'post_parent' => 0 456 'post_parent' => 0, 'suppress_filters' => true 457 457 ); 458 458 -
trunk/wp-includes/query.php
r8754 r8766 838 838 $q['caller_get_posts'] = false; 839 839 840 if ( !isset($q['suppress_filters']) ) 841 $q['suppress_filters'] = false; 842 840 843 if ( !isset($q['post_type']) ) { 841 844 if ( $this->is_search ) … … 1373 1376 // Apply filters on where and join prior to paging so that any 1374 1377 // manipulations to them are reflected in the paging by day queries. 1375 $where = apply_filters('posts_where', $where); 1376 $join = apply_filters('posts_join', $join); 1378 if ( !$q['suppress_filters'] ) { 1379 $where = apply_filters('posts_where', $where); 1380 $join = apply_filters('posts_join', $join); 1381 } 1377 1382 1378 1383 // Paging … … 1406 1411 } 1407 1412 1408 $cjoin = apply_filters('comment_feed_join', $cjoin); 1409 $cwhere = apply_filters('comment_feed_where', $cwhere); 1410 $cgroupby = apply_filters('comment_feed_groupby', $cgroupby); 1413 if ( !$q['suppress_filters'] ) { 1414 $cjoin = apply_filters('comment_feed_join', $cjoin); 1415 $cwhere = apply_filters('comment_feed_where', $cwhere); 1416 $cgroupby = apply_filters('comment_feed_groupby', $cgroupby); 1417 } 1411 1418 1412 1419 $this->comments = (array) $wpdb->get_results("SELECT $distinct $wpdb->comments.* FROM $wpdb->comments $cjoin $cwhere $cgroupby ORDER BY comment_date_gmt DESC LIMIT " . get_option('posts_per_rss')); … … 1428 1435 // Apply post-paging filters on where and join. Only plugins that 1429 1436 // manipulate paging queries should use these hooks. 1430 1431 $where = apply_filters('posts_where_paged', $where); 1432 $groupby = apply_filters('posts_groupby', $groupby); 1433 $join = apply_filters('posts_join_paged', $join); 1434 $orderby = apply_filters('posts_orderby', $q['orderby']); 1435 $distinct = apply_filters('posts_distinct', $distinct); 1436 $fields = apply_filters('posts_fields', "$wpdb->posts.*"); 1437 $limits = apply_filters( 'post_limits', $limits ); 1437 if ( !$q['suppress_filters'] ) { 1438 $where = apply_filters('posts_where_paged', $where); 1439 $groupby = apply_filters('posts_groupby', $groupby); 1440 $join = apply_filters('posts_join_paged', $join); 1441 $orderby = apply_filters('posts_orderby', $q['orderby']); 1442 $distinct = apply_filters('posts_distinct', $distinct); 1443 $fields = apply_filters('posts_fields', "$wpdb->posts.*"); 1444 $limits = apply_filters( 'post_limits', $limits ); 1445 } 1438 1446 1439 1447 // Announce current selection parameters. For use by caching plugins. … … 1441 1449 1442 1450 // Filter again for the benefit of caching plugins. Regular plugins should use the hooks above. 1443 $where = apply_filters('posts_where_request', $where); 1444 $groupby = apply_filters('posts_groupby_request', $groupby); 1445 $join = apply_filters('posts_join_request', $join); 1446 $orderby = apply_filters('posts_orderby_request', $orderby); 1447 $distinct = apply_filters('posts_distinct_request', $distinct); 1448 $fields = apply_filters('posts_fields_request', $fields); 1449 $limits = apply_filters( 'post_limits_request', $limits ); 1451 if ( !$q['suppress_filters'] ) { 1452 $where = apply_filters('posts_where_request', $where); 1453 $groupby = apply_filters('posts_groupby_request', $groupby); 1454 $join = apply_filters('posts_join_request', $join); 1455 $orderby = apply_filters('posts_orderby_request', $orderby); 1456 $distinct = apply_filters('posts_distinct_request', $distinct); 1457 $fields = apply_filters('posts_fields_request', $fields); 1458 $limits = apply_filters( 'post_limits_request', $limits ); 1459 } 1450 1460 1451 1461 if ( ! empty($groupby) ) … … 1458 1468 1459 1469 $request = " SELECT $found_rows $distinct $fields FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits"; 1460 $this->request = apply_filters('posts_request', $request); 1470 if ( !$q['suppress_filters'] ) 1471 $this->request = apply_filters('posts_request', $request); 1461 1472 1462 1473 $this->posts = $wpdb->get_results($this->request); 1463 1474 // Raw results filter. Prior to status checks. 1464 $this->posts = apply_filters('posts_results', $this->posts); 1475 if ( !$q['suppress_filters'] ) 1476 $this->posts = apply_filters('posts_results', $this->posts); 1465 1477 1466 1478 if ( !empty($this->posts) && $this->is_comment_feed && $this->is_singular ) { … … 1544 1556 } 1545 1557 1546 $this->posts = apply_filters('the_posts', $this->posts); 1558 if ( !$q['suppress_filters'] ) 1559 $this->posts = apply_filters('the_posts', $this->posts); 1547 1560 1548 1561 update_post_caches($this->posts);
Note: See TracChangeset
for help on using the changeset viewer.