/var/www/wordpress/wp-admin/includes/admin.php
/var/www/wordpress/wp-admin/includes/bookmark.php
/var/www/wordpress/wp-admin/includes/class-ftp-pure.php
/var/www/wordpress/wp-admin/includes/class-ftp-sockets.php
/var/www/wordpress/wp-admin/includes/class-ftp.php
/var/www/wordpress/wp-admin/includes/class-pclzip.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-base.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-direct.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ftpsockets.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ssh2.php
/var/www/wordpress/wp-admin/includes/class-wp-importer.php
/var/www/wordpress/wp-admin/includes/class-wp-upgrader.php
/var/www/wordpress/wp-admin/includes/comment.php
/var/www/wordpress/wp-admin/includes/continents-cities.php
/var/www/wordpress/wp-admin/includes/dashboard.php
/var/www/wordpress/wp-admin/includes/deprecated.php
/var/www/wordpress/wp-admin/includes/export.php
/var/www/wordpress/wp-admin/includes/file.php
/var/www/wordpress/wp-admin/includes/image-edit.php
/var/www/wordpress/wp-admin/includes/image.php
/var/www/wordpress/wp-admin/includes/import.php
/var/www/wordpress/wp-admin/includes/manifest.php
/var/www/wordpress/wp-admin/includes/media.php
/var/www/wordpress/wp-admin/includes/meta-boxes.php
/var/www/wordpress/wp-admin/includes/misc.php
/var/www/wordpress/wp-admin/includes/ms-deprecated.php
/var/www/wordpress/wp-admin/includes/ms.php
/var/www/wordpress/wp-admin/includes/nav-menu.php
/var/www/wordpress/wp-admin/includes/plugin-install.php
/var/www/wordpress/wp-admin/includes/plugin.php
/var/www/wordpress/wp-admin/includes/post.php
/var/www/wordpress/wp-admin/includes/schema.php
/var/www/wordpress/wp-admin/includes/taxonomy.php
/var/www/wordpress/wp-admin/includes/template.php
/var/www/wordpress/wp-admin/includes/theme-install.php
/var/www/wordpress/wp-admin/includes/theme.php
/var/www/wordpress/wp-admin/includes/update-core.php
/var/www/wordpress/wp-admin/includes/update.php
/var/www/wordpress/wp-admin/includes/upgrade.php
/var/www/wordpress/wp-admin/includes/user.php
/var/www/wordpress/wp-admin/includes/widgets.php
/var/www/wordpress/wp-admin/js/revisions-js.php
/var/www/wordpress/wp-admin/maint/repair.php
/var/www/wordpress/wp-admin/admin-ajax.php
/var/www/wordpress/wp-admin/admin-footer.php
/var/www/wordpress/wp-admin/admin-functions.php
/var/www/wordpress/wp-admin/admin-header.php
/var/www/wordpress/wp-admin/admin-post.php
/var/www/wordpress/wp-admin/admin.php
/var/www/wordpress/wp-admin/async-upload.php
/var/www/wordpress/wp-admin/comment.php
/var/www/wordpress/wp-admin/custom-background.php
/var/www/wordpress/wp-admin/custom-header.php
/var/www/wordpress/wp-admin/edit-attachment-rows.php
/var/www/wordpress/wp-admin/edit-comments.php
/var/www/wordpress/wp-admin/edit-form-advanced.php
/var/www/wordpress/wp-admin/edit-form-comment.php
/var/www/wordpress/wp-admin/edit-link-categories.php
/var/www/wordpress/wp-admin/edit-link-category-form.php
/var/www/wordpress/wp-admin/edit-link-form.php
/var/www/wordpress/wp-admin/edit-post-rows.php
/var/www/wordpress/wp-admin/edit-tag-form.php
/var/www/wordpress/wp-admin/edit-tags.php
/var/www/wordpress/wp-admin/edit.php
/var/www/wordpress/wp-admin/export.php
/var/www/wordpress/wp-admin/gears-manifest.php
/var/www/wordpress/wp-admin/import.php
/var/www/wordpress/wp-admin/index-extra.php
/var/www/wordpress/wp-admin/index.php
/var/www/wordpress/wp-admin/install-helper.php
/var/www/wordpress/wp-admin/install.php
/var/www/wordpress/wp-admin/link-add.php
/var/www/wordpress/wp-admin/link-category.php
/var/www/wordpress/wp-admin/link-manager.php
/var/www/wordpress/wp-admin/link-parse-opml.php
/var/www/wordpress/wp-admin/link.php
/var/www/wordpress/wp-admin/load-scripts.php
/var/www/wordpress/wp-admin/load-styles.php
/var/www/wordpress/wp-admin/media-new.php
/var/www/wordpress/wp-admin/media-upload.php
/var/www/wordpress/wp-admin/media.php
/var/www/wordpress/wp-admin/menu-header.php
/var/www/wordpress/wp-admin/menu.php
/var/www/wordpress/wp-admin/moderation.php
/var/www/wordpress/wp-admin/ms-admin.php
/var/www/wordpress/wp-admin/ms-delete-site.php
/var/www/wordpress/wp-admin/ms-edit.php
/var/www/wordpress/wp-admin/ms-options.php
/var/www/wordpress/wp-admin/ms-sites.php
/var/www/wordpress/wp-admin/ms-themes.php
/var/www/wordpress/wp-admin/ms-upgrade-network.php
/var/www/wordpress/wp-admin/ms-users.php
/var/www/wordpress/wp-admin/my-sites.php
/var/www/wordpress/wp-admin/nav-menus.php
/var/www/wordpress/wp-admin/network.php
/var/www/wordpress/wp-admin/options-discussion.php
/var/www/wordpress/wp-admin/options-general.php
/var/www/wordpress/wp-admin/options-head.php
/var/www/wordpress/wp-admin/options-media.php
/var/www/wordpress/wp-admin/options-permalink.php
/var/www/wordpress/wp-admin/options-privacy.php
/var/www/wordpress/wp-admin/options-reading.php
/var/www/wordpress/wp-admin/options-writing.php
/var/www/wordpress/wp-admin/options.php
/var/www/wordpress/wp-admin/plugin-editor.php
/var/www/wordpress/wp-admin/plugin-install.php
/var/www/wordpress/wp-admin/plugins.php
/var/www/wordpress/wp-admin/post-new.php
/var/www/wordpress/wp-admin/post.php
/var/www/wordpress/wp-admin/press-this.php
/var/www/wordpress/wp-admin/profile.php
/var/www/wordpress/wp-admin/revision.php
/var/www/wordpress/wp-admin/setup-config.php
/var/www/wordpress/wp-admin/sidebar.php
/var/www/wordpress/wp-admin/theme-editor.php
/var/www/wordpress/wp-admin/theme-install.php
/var/www/wordpress/wp-admin/themes.php
/var/www/wordpress/wp-admin/tools.php
/var/www/wordpress/wp-admin/update-core.php
/var/www/wordpress/wp-admin/update.php
/var/www/wordpress/wp-admin/upgrade-functions.php
/var/www/wordpress/wp-admin/upgrade.php
/var/www/wordpress/wp-admin/upload.php
/var/www/wordpress/wp-admin/user-edit.php
/var/www/wordpress/wp-admin/user-new.php
/var/www/wordpress/wp-admin/users.php
/var/www/wordpress/wp-admin/widgets.php
/var/www/wordpress/wp-content/languages/ru_RU.php
/var/www/wordpress/wp-content/plugins/akismet/akismet.php
/var/www/wordpress/wp-content/plugins/rh/rh.php
/var/www/wordpress/wp-content/plugins/hello.php
/var/www/wordpress/wp-content/plugins/index.php
/var/www/wordpress/wp-content/themes/twentyten/404.php
/var/www/wordpress/wp-content/themes/twentyten/archive.php
/var/www/wordpress/wp-content/themes/twentyten/attachment.php
/var/www/wordpress/wp-content/themes/twentyten/author.php
/var/www/wordpress/wp-content/themes/twentyten/category.php
/var/www/wordpress/wp-content/themes/twentyten/comments.php
/var/www/wordpress/wp-content/themes/twentyten/footer.php
/var/www/wordpress/wp-content/themes/twentyten/functions.php
/var/www/wordpress/wp-content/themes/twentyten/header.php
/var/www/wordpress/wp-content/themes/twentyten/index.php
/var/www/wordpress/wp-content/themes/twentyten/loop.php
/var/www/wordpress/wp-content/themes/twentyten/onecolumn-page.php
/var/www/wordpress/wp-content/themes/twentyten/page.php
/var/www/wordpress/wp-content/themes/twentyten/search.php
/var/www/wordpress/wp-content/themes/twentyten/sidebar-footer.php
/var/www/wordpress/wp-content/themes/twentyten/sidebar.php
/var/www/wordpress/wp-content/themes/twentyten/single.php
/var/www/wordpress/wp-content/themes/twentyten/tag.php
/var/www/wordpress/wp-content/themes/index.php
/var/www/wordpress/wp-content/index.php
/var/www/wordpress/wp-includes/js/tinymce/langs/wp-langs.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/JSON.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/Logger.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/EnchantSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/GoogleSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpellShell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/SpellChecker.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/includes/general.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/config.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/rpc.php
/var/www/wordpress/wp-includes/js/tinymce/wp-mce-help.php
/var/www/wordpress/wp-includes/js/tinymce/wp-tinymce.php
/var/www/wordpress/wp-includes/pomo/entry.php
/var/www/wordpress/wp-includes/pomo/mo.php
/var/www/wordpress/wp-includes/pomo/po.php
/var/www/wordpress/wp-includes/pomo/streams.php
/var/www/wordpress/wp-includes/pomo/translations.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/native.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/shell.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/string.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/xdiff.php
/var/www/wordpress/wp-includes/Text/Diff/Renderer/inline.php
/var/www/wordpress/wp-includes/Text/Diff/Renderer.php
/var/www/wordpress/wp-includes/Text/Diff.php
/var/www/wordpress/wp-includes/theme-compat/comments-popup.php
/var/www/wordpress/wp-includes/theme-compat/comments.php
/var/www/wordpress/wp-includes/theme-compat/footer.php
/var/www/wordpress/wp-includes/theme-compat/header.php
/var/www/wordpress/wp-includes/theme-compat/sidebar.php
/var/www/wordpress/wp-includes/atomlib.php
/var/www/wordpress/wp-includes/author-template.php
/var/www/wordpress/wp-includes/bookmark-template.php
/var/www/wordpress/wp-includes/bookmark.php
/var/www/wordpress/wp-includes/cache.php
/var/www/wordpress/wp-includes/canonical.php
/var/www/wordpress/wp-includes/capabilities.php
/var/www/wordpress/wp-includes/category-template.php
/var/www/wordpress/wp-includes/category.php
/var/www/wordpress/wp-includes/class-feed.php
/var/www/wordpress/wp-includes/class-http.php
/var/www/wordpress/wp-includes/class-IXR.php
/var/www/wordpress/wp-includes/class-json.php
/var/www/wordpress/wp-includes/class-oembed.php
/var/www/wordpress/wp-includes/class-phpass.php
/var/www/wordpress/wp-includes/class-phpmailer.php
/var/www/wordpress/wp-includes/class-pop3.php
/var/www/wordpress/wp-includes/class-simplepie.php
/var/www/wordpress/wp-includes/class-smtp.php
/var/www/wordpress/wp-includes/class-snoopy.php
/var/www/wordpress/wp-includes/class.wp-dependencies.php
/var/www/wordpress/wp-includes/class.wp-scripts.php
/var/www/wordpress/wp-includes/class.wp-styles.php
/var/www/wordpress/wp-includes/classes.php
/var/www/wordpress/wp-includes/comment-template.php
/var/www/wordpress/wp-includes/comment.php
/var/www/wordpress/wp-includes/compat.php
/var/www/wordpress/wp-includes/cron.php
/var/www/wordpress/wp-includes/default-constants.php
/var/www/wordpress/wp-includes/default-embeds.php
/var/www/wordpress/wp-includes/default-filters.php
/var/www/wordpress/wp-includes/default-widgets.php
/var/www/wordpress/wp-includes/deprecated.php
/var/www/wordpress/wp-includes/feed-atom-comments.php
/var/www/wordpress/wp-includes/feed-atom.php
/var/www/wordpress/wp-includes/feed-rdf.php
/var/www/wordpress/wp-includes/feed-rss.php
/var/www/wordpress/wp-includes/feed-rss2-comments.php
/var/www/wordpress/wp-includes/feed-rss2.php
/var/www/wordpress/wp-includes/feed.php
/var/www/wordpress/wp-includes/formatting.php
/var/www/wordpress/wp-includes/functions.php
/var/www/wordpress/wp-includes/functions.wp-scripts.php
/var/www/wordpress/wp-includes/functions.wp-styles.php
/var/www/wordpress/wp-includes/general-template.php
/var/www/wordpress/wp-includes/http.php
/var/www/wordpress/wp-includes/kses.php
/var/www/wordpress/wp-includes/l10n.php
/var/www/wordpress/wp-includes/link-template.php
/var/www/wordpress/wp-includes/load.php
/var/www/wordpress/wp-includes/locale.php
/var/www/wordpress/wp-includes/media.php
/var/www/wordpress/wp-includes/meta.php
/var/www/wordpress/wp-includes/ms-blogs.php
/var/www/wordpress/wp-includes/ms-default-constants.php
/var/www/wordpress/wp-includes/ms-default-filters.php
/var/www/wordpress/wp-includes/ms-deprecated.php
/var/www/wordpress/wp-includes/ms-files.php
/var/www/wordpress/wp-includes/ms-functions.php
/var/www/wordpress/wp-includes/ms-load.php
/var/www/wordpress/wp-includes/ms-settings.php
/var/www/wordpress/wp-includes/nav-menu-template.php
/var/www/wordpress/wp-includes/nav-menu.php
/var/www/wordpress/wp-includes/pluggable-deprecated.php
/var/www/wordpress/wp-includes/pluggable.php
/var/www/wordpress/wp-includes/plugin.php
/var/www/wordpress/wp-includes/post-template.php
/var/www/wordpress/wp-includes/post-thumbnail-template.php
/var/www/wordpress/wp-includes/post.php
/var/www/wordpress/wp-includes/query.php
#CodeDescriptions
1<?php
2/**
3 * WordPress Query API
4 *
5 * The query API attempts to get which part of WordPress to the user is on. It
6 * also provides functionality to getting URL query information.
7 *
8 * @link http://codex.wordpress.org/The_Loop More information on The Loop.
9 *
10 * @package WordPress
11 * @subpackage Query
12 */
13
14/**
15 * Retrieve variable in the WP_Query class.
16 *
17 * @see WP_Query::get()
18 * @since 1.5.0
19 * @uses $wp_query
20 *
21 * @param string $var The variable key to retrieve.
22 * @return mixed
23 */
24function get_query_var($var) {
25 global $wp_query;
26
27 return $wp_query->get($var);
28}
29
30/**
31 * Set query variable.
32 *
33 * @see WP_Query::set()
34 * @since 2.2.0
35 * @uses $wp_query
36 *
37 * @param string $var Query variable key.
38 * @param mixed $value
39 * @return null
40 */
41function set_query_var($var, $value) {
42 global $wp_query;
43
44 return $wp_query->set($var, $value);
45}
46
47/**
48 * Set up The Loop with query parameters.
49 *
50 * This will override the current WordPress Loop and shouldn't be used more than
51 * once. This must not be used within the WordPress Loop.
52 *
53 * @since 1.5.0
54 * @uses $wp_query
55 *
56 * @param string $query
57 * @return array List of posts
58 */
59function &query_posts($query) {
60 unset($GLOBALS['wp_query']);
61 $GLOBALS['wp_query'] =& new WP_Query();
62 return $GLOBALS['wp_query']->query($query);
63}
64
65/**
66 * Destroy the previous query and set up a new query.
67 *
68 * This should be used after {@link query_posts()} and before another {@link
69 * query_posts()}. This will remove obscure bugs that occur when the previous
70 * wp_query object is not destroyed properly before another is set up.
71 *
72 * @since 2.3.0
73 * @uses $wp_query
74 */
75function wp_reset_query() {
76 unset($GLOBALS['wp_query']);
77 $GLOBALS['wp_query'] =& $GLOBALS['wp_the_query'];
78 wp_reset_postdata();
79}
80
81/**
82 * After looping through a separate query, this function restores
83 * the $post global to the current post in the main query
84 *
85 * @since 3.0.0
86 * @uses $wp_query
87 */
88function wp_reset_postdata() {
89 global $wp_query;
90 if ( !empty($wp_query->post) ) {
91 $GLOBALS['post'] = $wp_query->post;
92 setup_postdata($wp_query->post);
93 }
94}
95
96/*
97 * Query type checks.
98 */
99
100/**
101 * Is query requesting an archive page.
102 *
103 * @since 1.5.0
104 * @uses $wp_query
105 *
106 * @return bool True if page is archive.
107 */
108function is_archive() {
109 global $wp_query;
110
111 return $wp_query->is_archive;
112}
113
114/**
115 * Is query requesting an attachment page.
116 *
117 * @since 2.0.0
118 * @uses $wp_query
119 *
120 * @return bool True if page is attachment.
121 */
122function is_attachment() {
123 global $wp_query;
124
125 return $wp_query->is_attachment;
126}
127
128/**
129 * Is query requesting an author page.
130 *
131 * If the $author parameter is specified then the check will be expanded to
132 * include whether the queried author matches the one given in the parameter.
133 * You can match against integers and against strings.
134 *
135 * If matching against an integer, the ID should be used of the author for the
136 * test. If the $author is an ID and matches the author page user ID, then
137 * 'true' will be returned.
138 *
139 * If matching against strings, then the test will be matched against both the
140 * nickname and user nicename and will return true on success.
141 *
142 * @since 1.5.0
143 * @uses $wp_query
144 *
145 * @param string|int $author Optional. Is current page this author.
146 * @return bool True if page is author or $author (if set).
147 */
148function is_author($author = '') {
149 global $wp_query;
150
151 if ( !$wp_query->is_author )
152 return false;
153
154 if ( empty($author) )
155 return true;
156
157 $author_obj = $wp_query->get_queried_object();
158
159 $author = (array) $author;
160
161 if ( in_array( $author_obj->ID, $author ) )
162 return true;
163 elseif ( in_array( $author_obj->nickname, $author ) )
164 return true;
165 elseif ( in_array( $author_obj->user_nicename, $author ) )
166 return true;
167
168 return false;
169}
170
171/**
172 * Whether current page query contains a category name or given category name.
173 *
174 * The category list can contain category IDs, names, or category slugs. If any
175 * of them are part of the query, then it will return true.
176 *
177 * @since 1.5.0
178 * @uses $wp_query
179 *
180 * @param string|array $category Optional.
181 * @return bool
182 */
183function is_category($category = '') {
184 global $wp_query;
185
186 if ( !$wp_query->is_category )
187 return false;
188
189 if ( empty($category) )
190 return true;
191
192 $cat_obj = $wp_query->get_queried_object();
193
194 $category = (array) $category;
195
196 if ( in_array( $cat_obj->term_id, $category ) )
197 return true;
198 elseif ( in_array( $cat_obj->name, $category ) )
199 return true;
200 elseif ( in_array( $cat_obj->slug, $category ) )
201 return true;
202
203 return false;
204}
205
206/**
207 * Whether the current page query has the given tag slug or contains tag.
208 *
209 * @since 2.3.0
210 * @uses $wp_query
211 *
212 * @param string|array $slug Optional. Single tag or list of tags to check for.
213 * @return bool
214 */
215function is_tag( $slug = '' ) {
216 global $wp_query;
217
218 if ( !$wp_query->is_tag )
219 return false;
220
221 if ( empty( $slug ) )
222 return true;
223
224 $tag_obj = $wp_query->get_queried_object();
225
226 $slug = (array) $slug;
227
228 if ( in_array( $tag_obj->slug, $slug ) )
229 return true;
230
231 return false;
232}
233
234/**
235 * Whether the current query is for the given taxonomy and/or term.
236 *
237 * If no taxonomy argument is set, returns true if any taxonomy is queried.
238 * If the taxonomy argument is passed but no term argument, returns true
239 * if the taxonomy or taxonomies in the argument are being queried.
240 * If both taxonomy and term arguments are passed, returns true
241 * if the current query is for a term contained in the terms argument
242 * which has a taxonomy contained in the taxonomy argument.
243 *
244 * @since 2.5.0
245 * @uses $wp_query
246 *
247 * @param string|array $taxonomy Optional. Taxonomy slug or slugs to check in current query.
248 * @param int|array|string $term. Optional. A single or array of, The term's ID, Name or Slug
249 * @return bool
250 */
251function is_tax( $taxonomy = '', $term = '' ) {
252 global $wp_query, $wp_taxonomies;
253
254 $queried_object = $wp_query->get_queried_object();
255 $tax_array = array_intersect(array_keys($wp_taxonomies), (array) $taxonomy);
256 $term_array = (array) $term;
257
258 if ( !$wp_query->is_tax )
259 return false;
260
261 if ( empty( $taxonomy ) )
262 return true;
263
264 if ( empty( $term ) ) // Only a Taxonomy provided
265 return isset($queried_object->taxonomy) && count( $tax_array ) && in_array($queried_object->taxonomy, $tax_array);
266
267 return isset($queried_object->term_id) &&
268 count(array_intersect(
269 array($queried_object->term_id, $queried_object->name, $queried_object->slug),
270 $term_array
271 ));
272}
273
274/**
275 * Whether the current URL is within the comments popup window.
276 *
277 * @since 1.5.0
278 * @uses $wp_query
279 *
280 * @return bool
281 */
282function is_comments_popup() {
283 global $wp_query;
284
285 return $wp_query->is_comments_popup;
286}
287
288/**
289 * Whether current URL is based on a date.
290 *
291 * @since 1.5.0
292 * @uses $wp_query
293 *
294 * @return bool
295 */
296function is_date() {
297 global $wp_query;
298
299 return $wp_query->is_date;
300}
301
302/**
303 * Whether current blog URL contains a day.
304 *
305 * @since 1.5.0
306 * @uses $wp_query
307 *
308 * @return bool
309 */
310function is_day() {
311 global $wp_query;
312
313 return $wp_query->is_day;
314}
315
316/**
317 * Whether current page query is feed URL.
318 *
319 * @since 1.5.0
320 * @uses $wp_query
321 *
322 * @return bool
323 */
324function is_feed() {
325 global $wp_query;
326
327 return $wp_query->is_feed;
328}
329
330/**
331 * Whether current page query is comment feed URL.
332 *
333 * @since 3.0.0
334 * @uses $wp_query
335 *
336 * @return bool
337 */
338function is_comment_feed() {
339 global $wp_query;
340
341 return $wp_query->is_comment_feed;
342}
343
344/**
345 * Whether current page query is the front of the site.
346 *
347 * @since 2.5.0
348 * @uses is_home()
349 * @uses get_option()
350 *
351 * @return bool True, if front of site.
352 */
353function is_front_page() {
354 // most likely case
355 if ( 'posts' == get_option('show_on_front') && is_home() )
356 return true;
357 elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') && is_page(get_option('page_on_front')) )
358 return true;
359 else
360 return false;
361}
362
363/**
364 * Whether current page view is the blog homepage.
365 *
366 * This is the page which is showing the time based blog content of your site
367 * so if you set a static page for the front page of your site then this will
368 * only be true on the page which you set as the "Posts page" in Reading Settings.
369 *
370 * @since 1.5.0
371 * @uses $wp_query
372 *
373 * @return bool True if blog view homepage.
374 */
375function is_home() {
376 global $wp_query;
377
378 return $wp_query->is_home;
379}
380
381/**
382 * Whether current page query contains a month.
383 *
384 * @since 1.5.0
385 * @uses $wp_query
386 *
387 * @return bool
388 */
389function is_month() {
390 global $wp_query;
391
392 return $wp_query->is_month;
393}
394
395/**
396 * Whether query is page or contains given page(s).
397 *
398 * Calls the function without any parameters will only test whether the current
399 * query is of the page type. Either a list or a single item can be tested
400 * against for whether the query is a page and also is the value or one of the
401 * values in the page parameter.
402 *
403 * The parameter can contain the page ID, page title, or page name. The
404 * parameter can also be an array of those three values.
405 *
406 * @since 1.5.0
407 * @uses $wp_query
408 *
409 * @param mixed $page Either page or list of pages to test against.
410 * @return bool
411 */
412function is_page($page = '') {
413 global $wp_query;
414
415 if ( !$wp_query->is_page )
416 return false;
417
418 if ( empty($page) )
419 return true;
420
421 $page_obj = $wp_query->get_queried_object();
422
423 $page = (array) $page;
424
425 if ( in_array( $page_obj->ID, $page ) )
426 return true;
427 elseif ( in_array( $page_obj->post_title, $page ) )
428 return true;
429 else if ( in_array( $page_obj->post_name, $page ) )
430 return true;
431
432 return false;
433}
434
435/**
436 * Whether query contains multiple pages for the results.
437 *
438 * @since 1.5.0
439 * @uses $wp_query
440 *
441 * @return bool
442 */
443function is_paged() {
444 global $wp_query;
445
446 return $wp_query->is_paged;
447}
448
449/**
450 * Whether the current page was created by a plugin.
451 *
452 * The plugin can set this by using the global $plugin_page and setting it to
453 * true.
454 *
455 * @since 1.5.0
456 * @global bool $plugin_page Used by plugins to tell the query that current is a plugin page.
457 *
458 * @return bool
459 */
460function is_plugin_page() {
461 global $plugin_page;
462
463 if ( isset($plugin_page) )
464 return true;
465
466 return false;
467}
468
469/**
470 * Whether the current query is preview of post or page.
471 *
472 * @since 2.0.0
473 * @uses $wp_query
474 *
475 * @return bool
476 */
477function is_preview() {
478 global $wp_query;
479
480 return $wp_query->is_preview;
481}
482
483/**
484 * Whether the current query post is robots.
485 *
486 * @since 2.1.0
487 * @uses $wp_query
488 *
489 * @return bool
490 */
491function is_robots() {
492 global $wp_query;
493
494 return $wp_query->is_robots;
495}
496
497/**
498 * Whether current query is the result of a user search.
499 *
500 * @since 1.5.0
501 * @uses $wp_query
502 *
503 * @return bool
504 */
505function is_search() {
506 global $wp_query;
507
508 return $wp_query->is_search;
509}
510
511/**
512 * Whether the current page query is single page.
513 *
514 * The parameter can contain the post ID, post title, or post name. The
515 * parameter can also be an array of those three values.
516 *
517 * This applies to other post types, attachments, pages, posts. Just means that
518 * the current query has only a single object.
519 *
520 * @since 1.5.0
521 * @uses $wp_query
522 *
523 * @param mixed $post Either post or list of posts to test against.
524 * @return bool
525 */
526function is_single($post = '') {
527 global $wp_query;
528
529 if ( !$wp_query->is_single )
530 return false;
531
532 if ( empty($post) )
533 return true;
534
535 $post_obj = $wp_query->get_queried_object();
536
537 $post = (array) $post;
538
539 if ( in_array( $post_obj->ID, $post ) )
540 return true;
541 elseif ( in_array( $post_obj->post_title, $post ) )
542 return true;
543 elseif ( in_array( $post_obj->post_name, $post ) )
544 return true;
545
546 return false;
547}
548
549/**
550 * Whether is single post, is a page, or is an attachment.
551 *
552 * @since 1.5.0
553 * @uses $wp_query
554 *
555 * @param string|array $post_types Optional. Post type or types to check in current query.
556 * @return bool
557 */
558function is_singular($post_types = '') {
559 global $wp_query;
560
561 if ( empty($post_types) || !$wp_query->is_singular )
562 return $wp_query->is_singular;
563
564 $post_obj = $wp_query->get_queried_object();
565
566 return in_array($post_obj->post_type, (array) $post_types);
567}
568
569/**
570 * Whether the query contains a time.
571 *
572 * @since 1.5.0
573 * @uses $wp_query
574 *
575 * @return bool
576 */
577function is_time() {
578 global $wp_query;
579
580 return $wp_query->is_time;
581}
582
583/**
584 * Whether the query is a trackback.
585 *
586 * @since 1.5.0
587 * @uses $wp_query
588 *
589 * @return bool
590 */
591function is_trackback() {
592 global $wp_query;
593
594 return $wp_query->is_trackback;
595}
596
597/**
598 * Whether the query contains a year.
599 *
600 * @since 1.5.0
601 * @uses $wp_query
602 *
603 * @return bool
604 */
605function is_year() {
606 global $wp_query;
607
608 return $wp_query->is_year;
609}
610
611/**
612 * Whether current page query is a 404 and no results for WordPress query.
613 *
614 * @since 1.5.0
615 * @uses $wp_query
616 *
617 * @return bool True, if nothing is found matching WordPress Query.
618 */
619function is_404() {
620 global $wp_query;
621
622 return $wp_query->is_404;
623}
624
625/*
626 * The Loop. Post loop control.
627 */
628
629/**
630 * Whether current WordPress query has results to loop over.
631 *
632 * @see WP_Query::have_posts()
633 * @since 1.5.0
634 * @uses $wp_query
635 *
636 * @return bool
637 */
638function have_posts() {
639 global $wp_query;
640
641 return $wp_query->have_posts();
642}
643
644/**
645 * Whether the caller is in the Loop.
646 *
647 * @since 2.0.0
648 * @uses $wp_query
649 *
650 * @return bool True if caller is within loop, false if loop hasn't started or ended.
651 */
652function in_the_loop() {
653 global $wp_query;
654
655 return $wp_query->in_the_loop;
656}
657
658/**
659 * Rewind the loop posts.
660 *
661 * @see WP_Query::rewind_posts()
662 * @since 1.5.0
663 * @uses $wp_query
664 *
665 * @return null
666 */
667function rewind_posts() {
668 global $wp_query;
669
670 return $wp_query->rewind_posts();
671}
672
673/**
674 * Iterate the post index in the loop.
675 *
676 * @see WP_Query::the_post()
677 * @since 1.5.0
678 * @uses $wp_query
679 */
680function the_post() {
681 global $wp_query;
682
683 $wp_query->the_post();
684}
685
686/*
687 * Comments loop.
688 */
689
690/**
691 * Whether there are comments to loop over.
692 *
693 * @see WP_Query::have_comments()
694 * @since 2.2.0
695 * @uses $wp_query
696 *
697 * @return bool
698 */
699function have_comments() {
700 global $wp_query;
701 return $wp_query->have_comments();
702}
703
704/**
705 * Iterate comment index in the comment loop.
706 *
707 * @see WP_Query::the_comment()
708 * @since 2.2.0
709 * @uses $wp_query
710 *
711 * @return object
712 */
713function the_comment() {
714 global $wp_query;
715 return $wp_query->the_comment();
716}
717
718/*
719 * WP_Query
720 */
721
722/**
723 * The WordPress Query class.
724 *
725 * @link http://codex.wordpress.org/Function_Reference/WP_Query Codex page.
726 *
727 * @since 1.5.0
728 */
729class WP_Query {
730
731 /**
732 * Query string
733 *
734 * @since 1.5.0
735 * @access public
736 * @var string
737 */
738 var $query;
739
740 /**
741 * Query search variables set by the user.
742 *
743 * @since 1.5.0
744 * @access public
745 * @var array
746 */
747 var $query_vars = array();
748
749 /**
750 * Holds the data for a single object that is queried.
751 *
752 * Holds the contents of a post, page, category, attachment.
753 *
754 * @since 1.5.0
755 * @access public
756 * @var object|array
757 */
758 var $queried_object;
759
760 /**
761 * The ID of the queried object.
762 *
763 * @since 1.5.0
764 * @access public
765 * @var int
766 */
767 var $queried_object_id;
768
769 /**
770 * Get post database query.
771 *
772 * @since 2.0.1
773 * @access public
774 * @var string
775 */
776 var $request;
777
778 /**
779 * List of posts.
780 *
781 * @since 1.5.0
782 * @access public
783 * @var array
784 */
785 var $posts;
786
787 /**
788 * The amount of posts for the current query.
789 *
790 * @since 1.5.0
791 * @access public
792 * @var int
793 */
794 var $post_count = 0;
795
796 /**
797 * Index of the current item in the loop.
798 *
799 * @since 1.5.0
800 * @access public
801 * @var int
802 */
803 var $current_post = -1;
804
805 /**
806 * Whether the loop has started and the caller is in the loop.
807 *
808 * @since 2.0.0
809 * @access public
810 * @var bool
811 */
812 var $in_the_loop = false;
813
814 /**
815 * The current post ID.
816 *
817 * @since 1.5.0
818 * @access public
819 * @var int
820 */
821 var $post;
822
823 /**
824 * The list of comments for current post.
825 *
826 * @since 2.2.0
827 * @access public
828 * @var array
829 */
830 var $comments;
831
832 /**
833 * The amount of comments for the posts.
834 *
835 * @since 2.2.0
836 * @access public
837 * @var int
838 */
839 var $comment_count = 0;
840
841 /**
842 * The index of the comment in the comment loop.
843 *
844 * @since 2.2.0
845 * @access public
846 * @var int
847 */
848 var $current_comment = -1;
849
850 /**
851 * Current comment ID.
852 *
853 * @since 2.2.0
854 * @access public
855 * @var int
856 */
857 var $comment;
858
859 /**
860 * Amount of posts if limit clause was not used.
861 *
862 * @since 2.1.0
863 * @access public
864 * @var int
865 */
866 var $found_posts = 0;
867
868 /**
869 * The amount of pages.
870 *
871 * @since 2.1.0
872 * @access public
873 * @var int
874 */
875 var $max_num_pages = 0;
876
877 /**
878 * The amount of comment pages.
879 *
880 * @since 2.7.0
881 * @access public
882 * @var int
883 */
884 var $max_num_comment_pages = 0;
885
886 /**
887 * Set if query is single post.
888 *
889 * @since 1.5.0
890 * @access public
891 * @var bool
892 */
893 var $is_single = false;
894
895 /**
896 * Set if query is preview of blog.
897 *
898 * @since 2.0.0
899 * @access public
900 * @var bool
901 */
902 var $is_preview = false;
903
904 /**
905 * Set if query returns a page.
906 *
907 * @since 1.5.0
908 * @access public
909 * @var bool
910 */
911 var $is_page = false;
912
913 /**
914 * Set if query is an archive list.
915 *
916 * @since 1.5.0
917 * @access public
918 * @var bool
919 */
920 var $is_archive = false;
921
922 /**
923 * Set if query is part of a date.
924 *
925 * @since 1.5.0
926 * @access public
927 * @var bool
928 */
929 var $is_date = false;
930
931 /**
932 * Set if query contains a year.
933 *
934 * @since 1.5.0
935 * @access public
936 * @var bool
937 */
938 var $is_year = false;
939
940 /**
941 * Set if query contains a month.
942 *
943 * @since 1.5.0
944 * @access public
945 * @var bool
946 */
947 var $is_month = false;
948
949 /**
950 * Set if query contains a day.
951 *
952 * @since 1.5.0
953 * @access public
954 * @var bool
955 */
956 var $is_day = false;
957
958 /**
959 * Set if query contains time.
960 *
961 * @since 1.5.0
962 * @access public
963 * @var bool
964 */
965 var $is_time = false;
966
967 /**
968 * Set if query contains an author.
969 *
970 * @since 1.5.0
971 * @access public
972 * @var bool
973 */
974 var $is_author = false;
975
976 /**
977 * Set if query contains category.
978 *
979 * @since 1.5.0
980 * @access public
981 * @var bool
982 */
983 var $is_category = false;
984
985 /**
986 * Set if query contains tag.
987 *
988 * @since 2.3.0
989 * @access public
990 * @var bool
991 */
992 var $is_tag = false;
993
994 /**
995 * Set if query contains taxonomy.
996 *
997 * @since 2.5.0
998 * @access public
999 * @var bool
1000 */
/var/www/wordpress/wp-includes/registration-functions.php
/var/www/wordpress/wp-includes/registration.php
/var/www/wordpress/wp-includes/rewrite.php
/var/www/wordpress/wp-includes/rss-functions.php
/var/www/wordpress/wp-includes/rss.php
/var/www/wordpress/wp-includes/script-loader.php
/var/www/wordpress/wp-includes/shortcodes.php
/var/www/wordpress/wp-includes/taxonomy.php
/var/www/wordpress/wp-includes/template-loader.php
/var/www/wordpress/wp-includes/theme.php
/var/www/wordpress/wp-includes/update.php
/var/www/wordpress/wp-includes/user.php
/var/www/wordpress/wp-includes/vars.php
/var/www/wordpress/wp-includes/version.php
/var/www/wordpress/wp-includes/widgets.php
/var/www/wordpress/wp-includes/wp-db.php
/var/www/wordpress/wp-includes/wp-diff.php
/var/www/wordpress/index.php
/var/www/wordpress/wp-activate.php
/var/www/wordpress/wp-app.php
/var/www/wordpress/wp-atom.php
/var/www/wordpress/wp-blog-header.php
/var/www/wordpress/wp-comments-post.php
/var/www/wordpress/wp-commentsrss2.php
/var/www/wordpress/wp-config-sample.php
/var/www/wordpress/wp-cron.php
/var/www/wordpress/wp-feed.php
/var/www/wordpress/wp-links-opml.php
/var/www/wordpress/wp-load.php
/var/www/wordpress/wp-login.php
/var/www/wordpress/wp-mail.php
/var/www/wordpress/wp-pass.php
/var/www/wordpress/wp-rdf.php
/var/www/wordpress/wp-register.php
/var/www/wordpress/wp-rss.php
/var/www/wordpress/wp-rss2.php
/var/www/wordpress/wp-settings.php
/var/www/wordpress/wp-signup.php
/var/www/wordpress/wp-trackback.php
/var/www/wordpress/xmlrpc.php