This page redirects to an external site: https://developer.wordpress.org/reference/classes/wp_query/
Languages: English • Italiano • 한국어 • 日本語 中文(简体) • (Add your language)
WP_Query는 wp-includes/query.php
안에 정의된 클래스입니다. WP_Query 클래스는 포스트 또는 페이지가 워드프레스 블로그에 요청하는 복잡한 사항들을 처리합니다. The wp-blog-header.php
(or the WP class in Version 2.0) gives the $wp_query object information defining the current request, and then $wp_query determines what type of query it's dealing with (possibly a category archive, dated archive, feed, or search), and fetches the requested posts. It retains a lot of information on the request, which can be pulled at a later date.
대부분의 경우에 클래스 내부와 전역 변수를 다루지 않고 당신이 원하는 정보를 찾을 수 있습니다. 어디서든지 당신이 원하는 정보를 얻게 해주는 함수들의 전체 묶음이 있습니다.
당신이 WP_Query를 사용하기를 원하는 경우가 대표적으로 두 가지 경우가 있습니다. 첫번째 경우에는 워드프레스가 현재 처리하고 있는 요청의 타입을 확인하는 것입니다. $is_* 속성은 이 정보를 담도록 디자인 되었습니다. 조건 태그를 사용하여 상호작용 할 수 있습니다.
The second is during The Loop. WP_Query provides numerous functions for common tasks within The Loop. To begin with, have_posts(), which calls $wp_query->have_posts(), is called to see if there are any posts to show. If there are, a while loop is begun, using have_posts() as the condition. This will iterate around as long as there are posts to show. In each iteration, the_post(), which calls $wp_query->the_post() is called, setting up internal variables within $wp_query and the global $post variable (which the Template Tags rely on), as above. These are the functions you should use when writing a theme file that needs a loop. See also The Loop and The Loop in Action for more information.
Note: If you use the_post() with your query, you need to run wp_reset_postdata() afterwards to have Template Tags use the main query's current post again.
<?php // The Query $the_query = new WP_Query( $args ); // The Loop if ( $the_query->have_posts() ) { echo '<ul>'; while ( $the_query->have_posts() ) { $the_query->the_post(); echo '<li>' . get_the_title() . '</li>'; } echo '</ul>'; } else { // no posts found } /* Restore original Post Data */ wp_reset_postdata();
<?php // the query $the_query = new WP_Query( $args ); ?> <?php if ( $the_query->have_posts() ) : ?> <!-- pagination here --> <!-- the loop --> <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <h2><?php the_title(); ?></h2> <?php endwhile; ?> <!-- end of the loop --> <!-- pagination here --> <?php wp_reset_postdata(); ?> <?php else : ?> <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p> <?php endif; ?>
여러 쿼리가 있으면 다음과 같이 다중 루프문을 수행할 필요가 있을 것입니다.
<?php // The Query $query1 = new WP_Query( $args ); // The Loop while ( $query1->have_posts() ) { $query1->the_post(); echo '<li>' . get_the_title() . '</li>'; } /* Restore original Post Data * NB: Because we are using new WP_Query we aren't stomping on the * original $wp_query and it does not need to be reset with * wp_reset_query(). We just need to set the post data back up with * wp_reset_postdata(). */ wp_reset_postdata(); /* The 2nd Query (without global var) */ $query2 = new WP_Query( $args2 ); // The 2nd Loop while ( $query2->have_posts() ) { $query2->next_post(); echo '<li>' . get_the_title( $query2->post->ID ) . '</li>'; } // Restore original Post Data wp_reset_postdata(); ?>
This is the formal documentation of WP_Query. You shouldn't alter the properties directly, but instead use the methods to interact with them. Also see Interacting with WP_Query for some useful functions that avoid the need to mess around with class internals and global variables.
(An ampersand (&) before a method name indicates it returns by reference.)
특정 저자(글쓴이)와 관련된 포스트를 보여줍니다.
특정 저자가 작성한 포스트 보여주기
저자 ID 를 사용하여 특정 저자가 작성한 포스트를 표시합니다 :
$query = new WP_Query( 'author=123' );
'user_nicename'을 사용하여 특정 저자가 작성한 포스트를 표시합니다 :
$query = new WP_Query( 'author_name=rami' );
다수의 저자가 작성한 포스트 보여주기
몇몇 특정 저자들이 작성한 포스트를 표시합니다 :
$query = new WP_Query( 'author=2,6,17,38' );
특정 저자가 쓴 포스트를 제외시켜서 표시하기
Display all posts except those from an author(singular) by prefixing its id with a '-' (minus) sign:
$query = new WP_Query( 'author=-12' );
다수의 저자 다루기
다수의 저자 ID를 배열로 넘겨, 그 저자들이 작성한 포스트를 표시합니다 :
$query = new WP_Query( array( 'author__in' => array( 2, 6 ) ) );
또한 다음과 같이 다수의 저자를 제외시킬 수도 있습니다 :
$query = new WP_Query( array( 'author__not_in' => array( 2, 6 ) ) );
특정 카테고리와 관련된 포스트들을 보여줍니다.
특정 카테고리의 글 표시하기
해당 카테고리가 가지고 있는 포스트를 표시합니다 (해당 카테고리의 자손 카테고리에 포함된 글도 포함). 카테고리 ID를 사용 :
$query = new WP_Query( 'cat=4' );
해당 카테고리가 가지고 있는 포스트를 표시합니다 (해당 카테고리의 자손 카테고리에 포함된 글도 포함). 카테고리 슬러그(Slug)를 사용 :
$query = new WP_Query( 'category_name=staff' );
해당 카테고리가 가지고 있는 포스트를 표시합니다 (해당 카테고리의 자손 카테고리에 포함된 글은 제외). 카테고리 ID를 사용 :
$query = new WP_Query( 'category__in=4' );
몇개의 카테고리에 속한 포스트 표시하기
여러 개의 카테고리를 지정하여 해당 카테고리에 속한 포스트를 모두 표시합니다. 카테고리 ID 사용 :
$query = new WP_Query( 'cat=2,6,17,38' );
여러 개의 카테고리를 지정하여 해당 카테고리에 속한 포스트를 모두 표시합니다. 카테고리 슬러그(Slug) 사용 :
$query = new WP_Query( 'category_name=staff,news' );
Display posts that have "all" of these categories:
$query = new WP_Query( 'category_name=staff+news' );
Exclude Posts Belonging to Category
Display all posts except those from a category by prefixing its id with a '-' (minus) sign.
$query = new WP_Query( 'cat=-12,-34,-56' );
Multiple Category Handling
Display posts that are in multiple categories. This shows posts that are in both categories 2 and 6:
$query = new WP_Query( array( 'category__and' => array( 2, 6 ) ) );
To display posts from either category 2 OR 6, you could use cat as mentioned above, or by using category__in (note this does not show posts from any children of these categories):
$query = new WP_Query( array( 'category__in' => array( 2, 6 ) ) );
You can also exclude multiple categories this way:
$query = new WP_Query( array( 'category__not_in' => array( 2, 6 ) ) );
특정 태그와 관련된 포스트를 보여줍니다.
Show Posts for One Tag
Display posts that have this tag, using tag slug:
$query = new WP_Query( 'tag=cooking' );
Display posts that have this tag, using tag id:
$query = new WP_Query( 'tag_id=13' );
Show Posts From Several Tags
Display posts that have "either" of these tags:
$query = new WP_Query( 'tag=bread,baking' );
Display posts that have "all" of these tags:
$query = new WP_Query( 'tag=bread+baking+recipe' );
Multiple Tag Handling
Display posts that are tagged with both tag id 37 and tag id 47:
$query = new WP_Query( array( 'tag__and' => array( 37, 47 ) ) );
To display posts from either tag id 37 or 47, you could use tag as mentioned above, or explicitly specify by using tag__in:
$query = new WP_Query( array( 'tag__in' => array( 37, 47 ) ) );
Display posts that do not have any of the two tag ids 37 and 47:
$query = new WP_Query( array( 'tag__not_in' => array( 37, 47 ) ) );
The tag_slug__in and tag_slug__and behave much the same, except match against the tag's slug.
특정 택소노미(Taxonomy)와 관련된 포스트를 보여줍니다.
Important Note: tax_query takes an array of tax query arguments arrays (it takes an array of arrays) - you can see this in the second example below. This construct allows you to query multiple taxonomies by using the relation parameter in the first (outer) array to describe the boolean relationship between the taxonomy arrays. See the second and third multiple taxonomy handling examples below.
As of 3.5, a bug was fixed where tax_query would inadvertently return all posts when a result was empty.
Simple Taxonomy Query:
Display posts tagged with bob, under people custom taxonomy:
$args = array( 'post_type' => 'post', 'people' => 'bob', ); $query = new WP_Query( $args );
Display posts tagged with bob, under people custom taxonomy, using tax_query:
$args = array( 'post_type' => 'post', 'tax_query' => array( array( 'taxonomy' => 'people', 'field' => 'slug', 'terms' => 'bob', ), ), ); $query = new WP_Query( $args );
Multiple Taxonomy Handling:
Display posts from several custom taxonomies:
$args = array( 'post_type' => 'post', 'people' => 'bob', 'language' => 'english', ); $query = new WP_Query( $args );
Display posts from several custom taxonomies, using tax_query:
$args = array( 'post_type' => 'post', 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'movie_genre', 'field' => 'slug', 'terms' => array( 'action', 'comedy' ), ), array( 'taxonomy' => 'actor', 'field' => 'id', 'terms' => array( 103, 115, 206 ), 'operator' => 'NOT IN', ), ), ); $query = new WP_Query( $args );
Display posts that are in the quotes category OR have the quote format:
$args = array( 'post_type' => 'post', 'tax_query' => array( 'relation' => 'OR', array( 'taxonomy' => 'category', 'field' => 'slug', 'terms' => array( 'quotes' ), ), array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array( 'post-format-quote' ), ), ), ); $query = new WP_Query( $args );
Show posts based on a keyword search.
Show Posts based on a keyword search
Display posts that match the search term "keyword":
$query = new WP_Query( 's=keyword' );
Display content based on post and page parameters. Remember that default post_type is only set to display posts but not pages.
Show Post/Page by ID
Display post by ID:
$query = new WP_Query( 'p=7' );
Display page by ID:
$query = new WP_Query( 'page_id=7' );
Show Post/Page by Slug
Display post by slug:
$query = new WP_Query( 'name=about-my-life' );
Display page by slug:
$query = new WP_Query( 'pagename=contact' );
Show Child Posts/Pages
Display child page using the slug of the parent and the child page, separated by a slash (e.g. 'parent_slug/child_slug'):
$query = new WP_Query( 'pagename=contact_us/canada' );
Display child pages using parent page ID:
$query = new WP_Query( 'post_parent=93' );
Display only top-level pages, exclude all child pages:
$query = new WP_Query( 'post_parent=0' );
Display posts whose parent is in an array:
$query = new WP_Query( array( 'post_parent__in' => array( 2, 5, 12, 14, 20 ) ) );
Multiple Posts/Pages Handling
Display only the specific posts:
$query = new WP_Query( array( 'post_type' => 'page', 'post__in' => array( 2, 5, 12, 14, 20 ) ) );
Display all posts but NOT the specified ones:
$query = new WP_Query( array( 'post_type' => 'post', 'post__not_in' => array( 2, 5, 12, 14, 20 ) ) );
Note: you cannot combine post__in and post__not_in in the same query.
Also note that using a string containing a comma separated list will not work here. If you're passing a variable, make sure it's a proper array of integer values:
// This will NOT work $exclude_ids = '1,2,3'; $query = new WP_Query( array( 'post__not_in' => array( $exclude_ids ) ) ); // This WILL work $exclude_ids = array( 1, 2, 3 ); $query = new WP_Query( array( 'post__not_in' => $exclude_ids ) );
Show content based on post and page parameters. Remember that default post_type is only set to display posts but not pages.
Show Posts with/without passwords
Display only password protected posts:
$query = new WP_Query( array( 'has_password' => true ) );
Display only posts without passwords:
$query = new WP_Query( array( 'has_password' => false ) );
Display only posts with and without passwords:
$query = new WP_Query( array( 'has_password' => null ) );
Show Posts with particular password
Display posts with 'zxcvbn' password:
$query = new WP_Query( array( 'post_password' => 'zxcvbn' ) );
Show posts associated with certain type.
Show Post by Type
Display only pages:
$query = new WP_Query( 'post_type=page' );
Display 'any' post type (retrieves any type except revisions and types with 'exclude_from_search' set to TRUE):
$query = new WP_Query( 'post_type=any' );
Display multiple post types, including custom post types:
$query = new WP_Query( array( 'post_type' => array( 'post', 'page', 'movie', 'book' ) ) );
Show posts associated with certain status.
Show Post by Status
Display only drafts:
$query = new WP_Query( 'post_status=draft' );
Display multiple post status:
$query = new WP_Query( array( 'post_status' => array( 'pending', 'draft', 'future' ) ) );
Display all attachments:
$query = new WP_Query( array( 'post_status' => 'any', 'post_type' => 'attachment' ) );
Show x Posts per page
Display 3 posts per page:
$query = new WP_Query( 'posts_per_page=3' );
Show All Post
Display all posts in one page:
$query = new WP_Query( 'posts_per_page=-1' );
Display all posts by disabling pagination:
$query = new WP_Query( 'nopaging=true' );
Pass over Posts
Display posts from the 4th one:
$query = new WP_Query( 'offset=3' ) );
Display 5 posts per page which follow the 3 most recent posts:
$query = new WP_Query( array( 'posts_per_page' => 5, 'offset' => 3 ) );
Show Posts from page x
Display posts from page number 6:
$query = new WP_Query( 'paged=6' );
Show Posts from Current Page
Display posts from current page:
$query = new WP_Query( array( 'paged' => get_query_var( 'paged' ) ) );
Display posts from the current page and set the 'paged' parameter to 1 when the query variable is not set (first page).
$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1; $query = new WP_Query( array( 'paged' => $paged ) );
Pagination Note: Use get_query_var('page'); if you want your query to work in a Page template that you've set as your static front page. The query variable 'page' also holds the pagenumber for a single paginated Post or Page that includes the <!--nextpage-->
Quicktag in the post content.
Display posts from current page on a static front page:
$paged = ( get_query_var('page') ) ? get_query_var('page') : 1; $query = new WP_Query( array( 'paged' => $paged ) );
Show Sticky Posts
Display just the first sticky post:
$sticky = get_option( 'sticky_posts' ); $query = new WP_Query( 'p=' . $sticky[0] );
Display just the first sticky post, if none return the last post published:
$args = array( 'posts_per_page' => 1, 'post__in' => get_option( 'sticky_posts' ), 'ignore_sticky_posts' => 1, ); $query = new WP_Query( $args );
Display just the first sticky post, if none return nothing:
$sticky = get_option( 'sticky_posts' ); $args = array( 'posts_per_page' => 1, 'post__in' => $sticky, 'ignore_sticky_posts' => 1, ); $query = new WP_Query( $args ); if ( $sticky[0] ) { // insert here your stuff... }
Don't Show Sticky Posts
Exclude all sticky posts from the query:
$query = new WP_Query( array( 'post__not_in' => get_option( 'sticky_posts' ) ) );
Exclude sticky posts from a category. Return ALL posts within the category, but don't show sticky posts at the top. The 'sticky posts' will still show in their natural position (e.g. by date):
$query = new WP_Query( array( 'ignore_sticky_posts' => 1, 'posts_per_page' => 3, 'cat' => 6 );
Exclude sticky posts from a category. Return posts within the category, but exclude sticky posts completely, and adhere to paging rules:
$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1; $sticky = get_option( 'sticky_posts' ); $args = array( 'cat' => 3, 'ignore_sticky_posts' => 1, 'post__not_in' => $sticky, 'paged' => $paged, ); $query = new WP_Query( $args );
Sort retrieved posts.
Show Posts sorted by Title, Descending order
Display posts sorted by post title in a descending order:
$query = new WP_Query( array ( 'orderby' => 'title', 'order' => 'DESC' ) );
Display posts sorted by menu_order with a fallback to post title, in a descending order:
$query = new WP_Query( array ( 'orderby' => 'menu_order title', 'order' => 'DESC' ) );
Show Random Post
Display one random post:
$query = new WP_Query( array ( 'orderby' => 'rand', 'posts_per_page' => '1' ) );
Show Popular Posts
Display posts ordered by comment count:
$query = new WP_Query( array( 'orderby' => 'comment_count' ) );
Show Products sorted by Price
Display posts with 'Product' type ordered by 'Price' custom field:
$query = new WP_Query( array ( 'post_type' => 'product', 'orderby' => 'meta_value_num', 'meta_key' => 'price' ) );
Multiple 'orderby' values
Display pages ordered by 'title' and 'menu_order'. (title is dominant):
$query = new WP_Query( array( 'post_type' => 'page', 'orderby' => 'title menu_order', 'order' => 'ASC' ) );
Multiple 'orderby' values using an array
Display pages ordered by 'title' and 'menu_order' with different sort orders (ASC/DESC):
$query = new WP_Query( array( 'orderby' => array( 'title' => 'DESC', 'menu_order' => 'ASC' ) ) );
Mulitiple orderby/order pairs
'orderby' => array( 'meta_value_num' => 'DESC', 'title' => 'ASC' ), 'meta_key' => 'age'
'orderby' with 'meta_value' and custom post type
Display posts of type 'my_custom_post_type', ordered by 'age', and filtered to show only ages 3 and 4 (using meta_query).
$args = array( 'post_type' => 'my_custom_post_type', 'meta_key' => 'age', 'orderby' => 'meta_value_num', 'order' => 'ASC', 'meta_query' => array( array( 'key' => 'age', 'value' => array( 3, 4 ), 'compare' => 'IN', ), ), ); $query = new WP_Query( $args );
Show posts associated with a certain time and date period.
Returns posts dated December 12, 2012:
$query = new WP_Query( 'year=2012&monthnum=12&day=12' );
or:
$args = array( 'date_query' => array( array( 'year' => 2012, 'month' => 12, 'day' => 12, ), ), ); $query = new WP_Query( $args );
Returns posts for today:
$today = getdate(); $query = new WP_Query( 'year=' . $today['year'] . '&monthnum=' . $today['mon'] . '&day=' . $today['mday'] );
or:
$today = getdate(); $args = array( 'date_query' => array( array( 'year' => $today['year'], 'month' => $today['mon'], 'day' => $today['mday'], ), ), ); $query = new WP_Query( $args );
Returns posts for this week:
$week = date( 'W' ); $year = date( 'Y' ); $query = new WP_Query( 'year=' . $year . '&w=' . $week );
or:
$args = array( 'date_query' => array( array( 'year' => date( 'Y' ), 'week' => date( 'W' ), ), ), ); $query = new WP_Query( $args );
Return posts between 9AM to 5PM on weekdays
$args = array( 'date_query' => array( array( 'hour' => 9, 'compare' => '>=', ), array( 'hour' => 17, 'compare' => '<=', ), array( 'dayofweek' => array( 2, 6 ), 'compare' => 'BETWEEN', ), ), 'posts_per_page' => -1, ); $query = new WP_Query( $args );
Return posts from January 1st to February 28th
$args = array( 'date_query' => array( array( 'after' => 'January 1st, 2013', 'before' => array( 'year' => 2013, 'month' => 2, 'day' => 28, ), 'inclusive' => true, ), ), 'posts_per_page' => -1, ); $query = new WP_Query( $args );
Note that if a strtotime()-compatible string with just a date was passed in the before parameter, this will be converted to 00:00:00 on that date. In this case, even if inclusive was set to true, the date would not be included in the query. If you want a before date to be inclusive, include the time as well, such as 'before' => '2013-02-28 23:59:59', or use the array format, which is adjusted automatically if inclusive is set.
Return posts made over a year ago but modified in the past month
$args = array( 'date_query' => array( array( 'column' => 'post_date_gmt', 'before' => '1 year ago', ), array( 'column' => 'post_modified_gmt', 'after' => '1 month ago', ), ), 'posts_per_page' => -1, ); $query = new WP_Query( $args );
Show posts associated with a certain custom field.
This part of the query is parsed by WP_Meta_Query, so check the docs for it as well in case this list of arguments isn't up to date.
meta_query also contains one or more arrays with the following keys:
The 'type' DATE works with the 'compare' value BETWEEN only if the date is stored at the format YYYYMMDD and tested with this format.
Important Note: meta_query takes an array of meta query arguments arrays (it takes an array of arrays) - you can see this in the examples below. This construct allows you to query multiple metadatas by using the relation parameter in the first (outer) array to describe the boolean relationship between the meta queries. Accepted arguments are 'AND', 'OR'. The default is 'AND'.
Simple Custom Field Query:
Display posts where the custom field key is 'color', regardless of the custom field value:
$query = new WP_Query( 'meta_key=color' );
Display posts where the custom field value is 'blue', regardless of the custom field key:
$query = new WP_Query( 'meta_value=blue' );
Display Page where the custom field value is 'blue', regardless of the custom field key:
$query = new WP_Query( 'meta_value=blue&post_type=page' );
Display posts where the custom field key is 'color' and the custom field value is 'blue':
$query = new WP_Query( array( 'meta_key' => 'color', 'meta_value' => 'blue' ) );
Display posts where the custom field key is 'color' and the custom field value IS NOT 'blue':
$query = new WP_Query( array( 'meta_key' => 'color', 'meta_value' => 'blue', 'meta_compare' => '!=' ) );
Display 'product'(s) where the custom field key is 'price' and the custom field value that is LESS THAN OR EQUAL TO 22.
By using the 'meta_value' parameter the value 99 will be considered greater than 100 as the data are stored as 'strings', not 'numbers'. For number comparison use 'meta_value_num'.
$query = new WP_Query( array( 'meta_key' => 'price', 'meta_value' => '22', 'meta_compare' => '<=', 'post_type' => 'product' ) );
Display posts with a custom field value of zero (0), regardless of the custom field key:
$query = new WP_Query( array( 'meta_value' => '_wp_zero_value' ) );
Single Custom Field Handling:
Display posts from a single custom field:
$args = array( 'post_type' => 'product', 'meta_query' => array( array( 'key' => 'color', 'value' => 'blue', 'compare' => 'NOT LIKE', ), ), ); $query = new WP_Query( $args );
(Note that meta_query expects nested arrays, even if you only have one query.)
Multiple Custom Field Handling:
Display posts from several custom field:
$args = array( 'post_type' => 'product', 'meta_query' => array( array( 'key' => 'color', 'value' => 'blue', 'compare' => 'NOT LIKE', ), array( 'key' => 'price', 'value' => array( 20, 100 ), 'type' => 'numeric', 'compare' => 'BETWEEN', ), ), ); $query = new WP_Query( $args );
Display posts that have meta key 'color' NOT LIKE value 'blue' OR meta key 'price' with values BETWEEN 20 and 100:
$args = array( 'post_type' => 'product', 'meta_query' => array( 'relation' => 'OR', array( 'key' => 'color', 'value' => 'blue', 'compare' => 'NOT LIKE', ), array( 'key' => 'price', 'value' => array( 20, 100 ), 'type' => 'numeric', 'compare' => 'BETWEEN', ), ), ); $query = new WP_Query( $args );
Show posts if user has the appropriate capability:
Display published and private posts, if the user has the appropriate capability:
$query = new WP_Query( array( 'post_status' => array( 'publish', 'private' ), 'perm' => 'readable' ) );
Stop the data retrieved from being added to the cache.
Show Posts without adding post information to the cache
Display 50 posts, but don't add post information to the cache:
$query = new WP_Query( array( 'posts_per_page' => 50, 'cache_results' => false ) );
Show Posts without adding post meta information to the cache
Display 50 posts, but don't add post meta information to the cache:
$query = new WP_Query( array( 'posts_per_page' => 50, 'update_post_meta_cache' => false ) );
Show Posts without adding post term information to the cache
Display 50 posts, but don't add post term information to the cache:
$query = new WP_Query( array( 'posts_per_page' => 50, 'update_post_term_cache' => false ) );
In general usage you should not need to use these, adding to the cache is the right thing to do, however they may be useful in specific circumstances. An example of such circumstances might be when using a WP_Query to retrieve a list of post titles and URLs to be displayed, but in which no other information about the post will be used and the taxonomy and meta data won't be needed. By not loading this information, you can save time from the extra unnecessary SQL queries.
Note: If a persistent object cache backend (such as memcached) is used, these flags are set to false by default since there is no need to update the cache every page load when a persistent cache exists.
Set return values.
Note, that there are more filters than the mentioned. As it is hard to keep the codex up to date, please inspect the get_posts();
function inside the WP_Query class yourself (/wp-includes/query.php).
WP_Query() is located in wp-includes/query.php
.