Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../public_h.../wp-inclu...
File: class-wp-query.php
$this->is_home = false;
[500] Fix | Delete
$this->is_privacy_policy = false;
[501] Fix | Delete
$this->is_404 = false;
[502] Fix | Delete
$this->is_paged = false;
[503] Fix | Delete
$this->is_admin = false;
[504] Fix | Delete
$this->is_attachment = false;
[505] Fix | Delete
$this->is_singular = false;
[506] Fix | Delete
$this->is_robots = false;
[507] Fix | Delete
$this->is_favicon = false;
[508] Fix | Delete
$this->is_posts_page = false;
[509] Fix | Delete
$this->is_post_type_archive = false;
[510] Fix | Delete
}
[511] Fix | Delete
[512] Fix | Delete
/**
[513] Fix | Delete
* Initiates object properties and sets default values.
[514] Fix | Delete
*
[515] Fix | Delete
* @since 1.5.0
[516] Fix | Delete
*/
[517] Fix | Delete
public function init() {
[518] Fix | Delete
unset( $this->posts );
[519] Fix | Delete
unset( $this->query );
[520] Fix | Delete
$this->query_vars = array();
[521] Fix | Delete
unset( $this->queried_object );
[522] Fix | Delete
unset( $this->queried_object_id );
[523] Fix | Delete
$this->post_count = 0;
[524] Fix | Delete
$this->current_post = -1;
[525] Fix | Delete
$this->in_the_loop = false;
[526] Fix | Delete
$this->before_loop = true;
[527] Fix | Delete
unset( $this->request );
[528] Fix | Delete
unset( $this->post );
[529] Fix | Delete
unset( $this->comments );
[530] Fix | Delete
unset( $this->comment );
[531] Fix | Delete
$this->comment_count = 0;
[532] Fix | Delete
$this->current_comment = -1;
[533] Fix | Delete
$this->found_posts = 0;
[534] Fix | Delete
$this->max_num_pages = 0;
[535] Fix | Delete
$this->max_num_comment_pages = 0;
[536] Fix | Delete
[537] Fix | Delete
$this->init_query_flags();
[538] Fix | Delete
}
[539] Fix | Delete
[540] Fix | Delete
/**
[541] Fix | Delete
* Reparses the query vars.
[542] Fix | Delete
*
[543] Fix | Delete
* @since 1.5.0
[544] Fix | Delete
*/
[545] Fix | Delete
public function parse_query_vars() {
[546] Fix | Delete
$this->parse_query();
[547] Fix | Delete
}
[548] Fix | Delete
[549] Fix | Delete
/**
[550] Fix | Delete
* Fills in the query variables, which do not exist within the parameter.
[551] Fix | Delete
*
[552] Fix | Delete
* @since 2.1.0
[553] Fix | Delete
* @since 4.5.0 Removed the `comments_popup` public query variable.
[554] Fix | Delete
*
[555] Fix | Delete
* @param array $query_vars Defined query variables.
[556] Fix | Delete
* @return array Complete query variables with undefined ones filled in empty.
[557] Fix | Delete
*/
[558] Fix | Delete
public function fill_query_vars( $query_vars ) {
[559] Fix | Delete
$keys = array(
[560] Fix | Delete
'error',
[561] Fix | Delete
'm',
[562] Fix | Delete
'p',
[563] Fix | Delete
'post_parent',
[564] Fix | Delete
'subpost',
[565] Fix | Delete
'subpost_id',
[566] Fix | Delete
'attachment',
[567] Fix | Delete
'attachment_id',
[568] Fix | Delete
'name',
[569] Fix | Delete
'pagename',
[570] Fix | Delete
'page_id',
[571] Fix | Delete
'second',
[572] Fix | Delete
'minute',
[573] Fix | Delete
'hour',
[574] Fix | Delete
'day',
[575] Fix | Delete
'monthnum',
[576] Fix | Delete
'year',
[577] Fix | Delete
'w',
[578] Fix | Delete
'category_name',
[579] Fix | Delete
'tag',
[580] Fix | Delete
'cat',
[581] Fix | Delete
'tag_id',
[582] Fix | Delete
'author',
[583] Fix | Delete
'author_name',
[584] Fix | Delete
'feed',
[585] Fix | Delete
'tb',
[586] Fix | Delete
'paged',
[587] Fix | Delete
'meta_key',
[588] Fix | Delete
'meta_value',
[589] Fix | Delete
'preview',
[590] Fix | Delete
's',
[591] Fix | Delete
'sentence',
[592] Fix | Delete
'title',
[593] Fix | Delete
'fields',
[594] Fix | Delete
'menu_order',
[595] Fix | Delete
'embed',
[596] Fix | Delete
);
[597] Fix | Delete
[598] Fix | Delete
foreach ( $keys as $key ) {
[599] Fix | Delete
if ( ! isset( $query_vars[ $key ] ) ) {
[600] Fix | Delete
$query_vars[ $key ] = '';
[601] Fix | Delete
}
[602] Fix | Delete
}
[603] Fix | Delete
[604] Fix | Delete
$array_keys = array(
[605] Fix | Delete
'category__in',
[606] Fix | Delete
'category__not_in',
[607] Fix | Delete
'category__and',
[608] Fix | Delete
'post__in',
[609] Fix | Delete
'post__not_in',
[610] Fix | Delete
'post_name__in',
[611] Fix | Delete
'tag__in',
[612] Fix | Delete
'tag__not_in',
[613] Fix | Delete
'tag__and',
[614] Fix | Delete
'tag_slug__in',
[615] Fix | Delete
'tag_slug__and',
[616] Fix | Delete
'post_parent__in',
[617] Fix | Delete
'post_parent__not_in',
[618] Fix | Delete
'author__in',
[619] Fix | Delete
'author__not_in',
[620] Fix | Delete
'search_columns',
[621] Fix | Delete
);
[622] Fix | Delete
[623] Fix | Delete
foreach ( $array_keys as $key ) {
[624] Fix | Delete
if ( ! isset( $query_vars[ $key ] ) ) {
[625] Fix | Delete
$query_vars[ $key ] = array();
[626] Fix | Delete
}
[627] Fix | Delete
}
[628] Fix | Delete
[629] Fix | Delete
return $query_vars;
[630] Fix | Delete
}
[631] Fix | Delete
[632] Fix | Delete
/**
[633] Fix | Delete
* Parses a query string and sets query type booleans.
[634] Fix | Delete
*
[635] Fix | Delete
* @since 1.5.0
[636] Fix | Delete
* @since 4.2.0 Introduced the ability to order by specific clauses of a `$meta_query`, by passing the clause's
[637] Fix | Delete
* array key to `$orderby`.
[638] Fix | Delete
* @since 4.4.0 Introduced `$post_name__in` and `$title` parameters. `$s` was updated to support excluded
[639] Fix | Delete
* search terms, by prepending a hyphen.
[640] Fix | Delete
* @since 4.5.0 Removed the `$comments_popup` parameter.
[641] Fix | Delete
* Introduced the `$comment_status` and `$ping_status` parameters.
[642] Fix | Delete
* Introduced `RAND(x)` syntax for `$orderby`, which allows an integer seed value to random sorts.
[643] Fix | Delete
* @since 4.6.0 Added 'post_name__in' support for `$orderby`. Introduced the `$lazy_load_term_meta` argument.
[644] Fix | Delete
* @since 4.9.0 Introduced the `$comment_count` parameter.
[645] Fix | Delete
* @since 5.1.0 Introduced the `$meta_compare_key` parameter.
[646] Fix | Delete
* @since 5.3.0 Introduced the `$meta_type_key` parameter.
[647] Fix | Delete
* @since 6.1.0 Introduced the `$update_menu_item_cache` parameter.
[648] Fix | Delete
* @since 6.2.0 Introduced the `$search_columns` parameter.
[649] Fix | Delete
*
[650] Fix | Delete
* @param string|array $query {
[651] Fix | Delete
* Optional. Array or string of Query parameters.
[652] Fix | Delete
*
[653] Fix | Delete
* @type int $attachment_id Attachment post ID. Used for 'attachment' post_type.
[654] Fix | Delete
* @type int|string $author Author ID, or comma-separated list of IDs.
[655] Fix | Delete
* @type string $author_name User 'user_nicename'.
[656] Fix | Delete
* @type int[] $author__in An array of author IDs to query from.
[657] Fix | Delete
* @type int[] $author__not_in An array of author IDs not to query from.
[658] Fix | Delete
* @type bool $cache_results Whether to cache post information. Default true.
[659] Fix | Delete
* @type int|string $cat Category ID or comma-separated list of IDs (this or any children).
[660] Fix | Delete
* @type int[] $category__and An array of category IDs (AND in).
[661] Fix | Delete
* @type int[] $category__in An array of category IDs (OR in, no children).
[662] Fix | Delete
* @type int[] $category__not_in An array of category IDs (NOT in).
[663] Fix | Delete
* @type string $category_name Use category slug (not name, this or any children).
[664] Fix | Delete
* @type array|int $comment_count Filter results by comment count. Provide an integer to match
[665] Fix | Delete
* comment count exactly. Provide an array with integer 'value'
[666] Fix | Delete
* and 'compare' operator ('=', '!=', '>', '>=', '<', '<=' ) to
[667] Fix | Delete
* compare against comment_count in a specific way.
[668] Fix | Delete
* @type string $comment_status Comment status.
[669] Fix | Delete
* @type int $comments_per_page The number of comments to return per page.
[670] Fix | Delete
* Default 'comments_per_page' option.
[671] Fix | Delete
* @type array $date_query An associative array of WP_Date_Query arguments.
[672] Fix | Delete
* See WP_Date_Query::__construct().
[673] Fix | Delete
* @type int $day Day of the month. Default empty. Accepts numbers 1-31.
[674] Fix | Delete
* @type bool $exact Whether to search by exact keyword. Default false.
[675] Fix | Delete
* @type string $fields Post fields to query for. Accepts:
[676] Fix | Delete
* - '' Returns an array of complete post objects (`WP_Post[]`).
[677] Fix | Delete
* - 'ids' Returns an array of post IDs (`int[]`).
[678] Fix | Delete
* - 'id=>parent' Returns an associative array of parent post IDs,
[679] Fix | Delete
* keyed by post ID (`int[]`).
[680] Fix | Delete
* Default ''.
[681] Fix | Delete
* @type int $hour Hour of the day. Default empty. Accepts numbers 0-23.
[682] Fix | Delete
* @type int|bool $ignore_sticky_posts Whether to ignore sticky posts or not. Setting this to false
[683] Fix | Delete
* excludes stickies from 'post__in'. Accepts 1|true, 0|false.
[684] Fix | Delete
* Default false.
[685] Fix | Delete
* @type int $m Combination YearMonth. Accepts any four-digit year and month
[686] Fix | Delete
* numbers 01-12. Default empty.
[687] Fix | Delete
* @type string|string[] $meta_key Meta key or keys to filter by.
[688] Fix | Delete
* @type string|string[] $meta_value Meta value or values to filter by.
[689] Fix | Delete
* @type string $meta_compare MySQL operator used for comparing the meta value.
[690] Fix | Delete
* See WP_Meta_Query::__construct() for accepted values and default value.
[691] Fix | Delete
* @type string $meta_compare_key MySQL operator used for comparing the meta key.
[692] Fix | Delete
* See WP_Meta_Query::__construct() for accepted values and default value.
[693] Fix | Delete
* @type string $meta_type MySQL data type that the meta_value column will be CAST to for comparisons.
[694] Fix | Delete
* See WP_Meta_Query::__construct() for accepted values and default value.
[695] Fix | Delete
* @type string $meta_type_key MySQL data type that the meta_key column will be CAST to for comparisons.
[696] Fix | Delete
* See WP_Meta_Query::__construct() for accepted values and default value.
[697] Fix | Delete
* @type array $meta_query An associative array of WP_Meta_Query arguments.
[698] Fix | Delete
* See WP_Meta_Query::__construct() for accepted values.
[699] Fix | Delete
* @type int $menu_order The menu order of the posts.
[700] Fix | Delete
* @type int $minute Minute of the hour. Default empty. Accepts numbers 0-59.
[701] Fix | Delete
* @type int $monthnum The two-digit month. Default empty. Accepts numbers 1-12.
[702] Fix | Delete
* @type string $name Post slug.
[703] Fix | Delete
* @type bool $nopaging Show all posts (true) or paginate (false). Default false.
[704] Fix | Delete
* @type bool $no_found_rows Whether to skip counting the total rows found. Enabling can improve
[705] Fix | Delete
* performance. Default false.
[706] Fix | Delete
* @type int $offset The number of posts to offset before retrieval.
[707] Fix | Delete
* @type string $order Designates ascending or descending order of posts. Default 'DESC'.
[708] Fix | Delete
* Accepts 'ASC', 'DESC'.
[709] Fix | Delete
* @type string|array $orderby Sort retrieved posts by parameter. One or more options may be passed.
[710] Fix | Delete
* To use 'meta_value', or 'meta_value_num', 'meta_key=keyname' must be
[711] Fix | Delete
* also be defined. To sort by a specific `$meta_query` clause, use that
[712] Fix | Delete
* clause's array key. Accepts:
[713] Fix | Delete
* - 'none'
[714] Fix | Delete
* - 'name'
[715] Fix | Delete
* - 'author'
[716] Fix | Delete
* - 'date'
[717] Fix | Delete
* - 'title'
[718] Fix | Delete
* - 'modified'
[719] Fix | Delete
* - 'menu_order'
[720] Fix | Delete
* - 'parent'
[721] Fix | Delete
* - 'ID'
[722] Fix | Delete
* - 'rand'
[723] Fix | Delete
* - 'relevance'
[724] Fix | Delete
* - 'RAND(x)' (where 'x' is an integer seed value)
[725] Fix | Delete
* - 'comment_count'
[726] Fix | Delete
* - 'meta_value'
[727] Fix | Delete
* - 'meta_value_num'
[728] Fix | Delete
* - 'post__in'
[729] Fix | Delete
* - 'post_name__in'
[730] Fix | Delete
* - 'post_parent__in'
[731] Fix | Delete
* - The array keys of `$meta_query`.
[732] Fix | Delete
* Default is 'date', except when a search is being performed, when
[733] Fix | Delete
* the default is 'relevance'.
[734] Fix | Delete
* @type int $p Post ID.
[735] Fix | Delete
* @type int $page Show the number of posts that would show up on page X of a
[736] Fix | Delete
* static front page.
[737] Fix | Delete
* @type int $paged The number of the current page.
[738] Fix | Delete
* @type int $page_id Page ID.
[739] Fix | Delete
* @type string $pagename Page slug.
[740] Fix | Delete
* @type string $perm Show posts if user has the appropriate capability.
[741] Fix | Delete
* @type string $ping_status Ping status.
[742] Fix | Delete
* @type int[] $post__in An array of post IDs to retrieve, sticky posts will be included.
[743] Fix | Delete
* @type int[] $post__not_in An array of post IDs not to retrieve. Note: a string of comma-
[744] Fix | Delete
* separated IDs will NOT work.
[745] Fix | Delete
* @type string $post_mime_type The mime type of the post. Used for 'attachment' post_type.
[746] Fix | Delete
* @type string[] $post_name__in An array of post slugs that results must match.
[747] Fix | Delete
* @type int $post_parent Page ID to retrieve child pages for. Use 0 to only retrieve
[748] Fix | Delete
* top-level pages.
[749] Fix | Delete
* @type int[] $post_parent__in An array containing parent page IDs to query child pages from.
[750] Fix | Delete
* @type int[] $post_parent__not_in An array containing parent page IDs not to query child pages from.
[751] Fix | Delete
* @type string|string[] $post_type A post type slug (string) or array of post type slugs.
[752] Fix | Delete
* Default 'any' if using 'tax_query'.
[753] Fix | Delete
* @type string|string[] $post_status A post status (string) or array of post statuses.
[754] Fix | Delete
* @type int $posts_per_page The number of posts to query for. Use -1 to request all posts.
[755] Fix | Delete
* @type int $posts_per_archive_page The number of posts to query for by archive page. Overrides
[756] Fix | Delete
* 'posts_per_page' when is_archive(), or is_search() are true.
[757] Fix | Delete
* @type string $s Search keyword(s). Prepending a term with a hyphen will
[758] Fix | Delete
* exclude posts matching that term. Eg, 'pillow -sofa' will
[759] Fix | Delete
* return posts containing 'pillow' but not 'sofa'. The
[760] Fix | Delete
* character used for exclusion can be modified using the
[761] Fix | Delete
* the 'wp_query_search_exclusion_prefix' filter.
[762] Fix | Delete
* @type string[] $search_columns Array of column names to be searched. Accepts 'post_title',
[763] Fix | Delete
* 'post_excerpt' and 'post_content'. Default empty array.
[764] Fix | Delete
* @type int $second Second of the minute. Default empty. Accepts numbers 0-59.
[765] Fix | Delete
* @type bool $sentence Whether to search by phrase. Default false.
[766] Fix | Delete
* @type bool $suppress_filters Whether to suppress filters. Default false.
[767] Fix | Delete
* @type string $tag Tag slug. Comma-separated (either), Plus-separated (all).
[768] Fix | Delete
* @type int[] $tag__and An array of tag IDs (AND in).
[769] Fix | Delete
* @type int[] $tag__in An array of tag IDs (OR in).
[770] Fix | Delete
* @type int[] $tag__not_in An array of tag IDs (NOT in).
[771] Fix | Delete
* @type int $tag_id Tag id or comma-separated list of IDs.
[772] Fix | Delete
* @type string[] $tag_slug__and An array of tag slugs (AND in).
[773] Fix | Delete
* @type string[] $tag_slug__in An array of tag slugs (OR in). unless 'ignore_sticky_posts' is
[774] Fix | Delete
* true. Note: a string of comma-separated IDs will NOT work.
[775] Fix | Delete
* @type array $tax_query An associative array of WP_Tax_Query arguments.
[776] Fix | Delete
* See WP_Tax_Query::__construct().
[777] Fix | Delete
* @type string $title Post title.
[778] Fix | Delete
* @type bool $update_post_meta_cache Whether to update the post meta cache. Default true.
[779] Fix | Delete
* @type bool $update_post_term_cache Whether to update the post term cache. Default true.
[780] Fix | Delete
* @type bool $update_menu_item_cache Whether to update the menu item cache. Default false.
[781] Fix | Delete
* @type bool $lazy_load_term_meta Whether to lazy-load term meta. Setting to false will
[782] Fix | Delete
* disable cache priming for term meta, so that each
[783] Fix | Delete
* get_term_meta() call will hit the database.
[784] Fix | Delete
* Defaults to the value of `$update_post_term_cache`.
[785] Fix | Delete
* @type int $w The week number of the year. Default empty. Accepts numbers 0-53.
[786] Fix | Delete
* @type int $year The four-digit year. Default empty. Accepts any four-digit year.
[787] Fix | Delete
* }
[788] Fix | Delete
*/
[789] Fix | Delete
public function parse_query( $query = '' ) {
[790] Fix | Delete
if ( ! empty( $query ) ) {
[791] Fix | Delete
$this->init();
[792] Fix | Delete
$this->query = wp_parse_args( $query );
[793] Fix | Delete
$this->query_vars = $this->query;
[794] Fix | Delete
} elseif ( ! isset( $this->query ) ) {
[795] Fix | Delete
$this->query = $this->query_vars;
[796] Fix | Delete
}
[797] Fix | Delete
[798] Fix | Delete
$this->query_vars = $this->fill_query_vars( $this->query_vars );
[799] Fix | Delete
$qv = &$this->query_vars;
[800] Fix | Delete
$this->query_vars_changed = true;
[801] Fix | Delete
[802] Fix | Delete
if ( ! empty( $qv['robots'] ) ) {
[803] Fix | Delete
$this->is_robots = true;
[804] Fix | Delete
} elseif ( ! empty( $qv['favicon'] ) ) {
[805] Fix | Delete
$this->is_favicon = true;
[806] Fix | Delete
}
[807] Fix | Delete
[808] Fix | Delete
if ( ! is_scalar( $qv['p'] ) || (int) $qv['p'] < 0 ) {
[809] Fix | Delete
$qv['p'] = 0;
[810] Fix | Delete
$qv['error'] = '404';
[811] Fix | Delete
} else {
[812] Fix | Delete
$qv['p'] = (int) $qv['p'];
[813] Fix | Delete
}
[814] Fix | Delete
[815] Fix | Delete
$qv['page_id'] = is_scalar( $qv['page_id'] ) ? absint( $qv['page_id'] ) : 0;
[816] Fix | Delete
$qv['year'] = is_scalar( $qv['year'] ) ? absint( $qv['year'] ) : 0;
[817] Fix | Delete
$qv['monthnum'] = is_scalar( $qv['monthnum'] ) ? absint( $qv['monthnum'] ) : 0;
[818] Fix | Delete
$qv['day'] = is_scalar( $qv['day'] ) ? absint( $qv['day'] ) : 0;
[819] Fix | Delete
$qv['w'] = is_scalar( $qv['w'] ) ? absint( $qv['w'] ) : 0;
[820] Fix | Delete
$qv['m'] = is_scalar( $qv['m'] ) ? preg_replace( '|[^0-9]|', '', $qv['m'] ) : '';
[821] Fix | Delete
$qv['paged'] = is_scalar( $qv['paged'] ) ? absint( $qv['paged'] ) : 0;
[822] Fix | Delete
$qv['cat'] = preg_replace( '|[^0-9,-]|', '', $qv['cat'] ); // Array or comma-separated list of positive or negative integers.
[823] Fix | Delete
$qv['author'] = is_scalar( $qv['author'] ) ? preg_replace( '|[^0-9,-]|', '', $qv['author'] ) : ''; // Comma-separated list of positive or negative integers.
[824] Fix | Delete
$qv['pagename'] = is_scalar( $qv['pagename'] ) ? trim( $qv['pagename'] ) : '';
[825] Fix | Delete
$qv['name'] = is_scalar( $qv['name'] ) ? trim( $qv['name'] ) : '';
[826] Fix | Delete
$qv['title'] = is_scalar( $qv['title'] ) ? trim( $qv['title'] ) : '';
[827] Fix | Delete
[828] Fix | Delete
if ( is_scalar( $qv['hour'] ) && '' !== $qv['hour'] ) {
[829] Fix | Delete
$qv['hour'] = absint( $qv['hour'] );
[830] Fix | Delete
} else {
[831] Fix | Delete
$qv['hour'] = '';
[832] Fix | Delete
}
[833] Fix | Delete
[834] Fix | Delete
if ( is_scalar( $qv['minute'] ) && '' !== $qv['minute'] ) {
[835] Fix | Delete
$qv['minute'] = absint( $qv['minute'] );
[836] Fix | Delete
} else {
[837] Fix | Delete
$qv['minute'] = '';
[838] Fix | Delete
}
[839] Fix | Delete
[840] Fix | Delete
if ( is_scalar( $qv['second'] ) && '' !== $qv['second'] ) {
[841] Fix | Delete
$qv['second'] = absint( $qv['second'] );
[842] Fix | Delete
} else {
[843] Fix | Delete
$qv['second'] = '';
[844] Fix | Delete
}
[845] Fix | Delete
[846] Fix | Delete
if ( is_scalar( $qv['menu_order'] ) && '' !== $qv['menu_order'] ) {
[847] Fix | Delete
$qv['menu_order'] = absint( $qv['menu_order'] );
[848] Fix | Delete
} else {
[849] Fix | Delete
$qv['menu_order'] = '';
[850] Fix | Delete
}
[851] Fix | Delete
[852] Fix | Delete
// Fairly large, potentially too large, upper bound for search string lengths.
[853] Fix | Delete
if ( ! is_scalar( $qv['s'] ) || ( ! empty( $qv['s'] ) && strlen( $qv['s'] ) > 1600 ) ) {
[854] Fix | Delete
$qv['s'] = '';
[855] Fix | Delete
}
[856] Fix | Delete
[857] Fix | Delete
// Compat. Map subpost to attachment.
[858] Fix | Delete
if ( is_scalar( $qv['subpost'] ) && '' != $qv['subpost'] ) {
[859] Fix | Delete
$qv['attachment'] = $qv['subpost'];
[860] Fix | Delete
}
[861] Fix | Delete
if ( is_scalar( $qv['subpost_id'] ) && '' != $qv['subpost_id'] ) {
[862] Fix | Delete
$qv['attachment_id'] = $qv['subpost_id'];
[863] Fix | Delete
}
[864] Fix | Delete
[865] Fix | Delete
$qv['attachment_id'] = is_scalar( $qv['attachment_id'] ) ? absint( $qv['attachment_id'] ) : 0;
[866] Fix | Delete
[867] Fix | Delete
if ( ( '' !== $qv['attachment'] ) || ! empty( $qv['attachment_id'] ) ) {
[868] Fix | Delete
$this->is_single = true;
[869] Fix | Delete
$this->is_attachment = true;
[870] Fix | Delete
} elseif ( '' !== $qv['name'] ) {
[871] Fix | Delete
$this->is_single = true;
[872] Fix | Delete
} elseif ( $qv['p'] ) {
[873] Fix | Delete
$this->is_single = true;
[874] Fix | Delete
} elseif ( '' !== $qv['pagename'] || ! empty( $qv['page_id'] ) ) {
[875] Fix | Delete
$this->is_page = true;
[876] Fix | Delete
$this->is_single = false;
[877] Fix | Delete
} else {
[878] Fix | Delete
// Look for archive queries. Dates, categories, authors, search, post type archives.
[879] Fix | Delete
[880] Fix | Delete
if ( isset( $this->query['s'] ) ) {
[881] Fix | Delete
$this->is_search = true;
[882] Fix | Delete
}
[883] Fix | Delete
[884] Fix | Delete
if ( '' !== $qv['second'] ) {
[885] Fix | Delete
$this->is_time = true;
[886] Fix | Delete
$this->is_date = true;
[887] Fix | Delete
}
[888] Fix | Delete
[889] Fix | Delete
if ( '' !== $qv['minute'] ) {
[890] Fix | Delete
$this->is_time = true;
[891] Fix | Delete
$this->is_date = true;
[892] Fix | Delete
}
[893] Fix | Delete
[894] Fix | Delete
if ( '' !== $qv['hour'] ) {
[895] Fix | Delete
$this->is_time = true;
[896] Fix | Delete
$this->is_date = true;
[897] Fix | Delete
}
[898] Fix | Delete
[899] Fix | Delete
if ( $qv['day'] ) {
[900] Fix | Delete
if ( ! $this->is_date ) {
[901] Fix | Delete
$date = sprintf( '%04d-%02d-%02d', $qv['year'], $qv['monthnum'], $qv['day'] );
[902] Fix | Delete
if ( $qv['monthnum'] && $qv['year'] && ! wp_checkdate( $qv['monthnum'], $qv['day'], $qv['year'], $date ) ) {
[903] Fix | Delete
$qv['error'] = '404';
[904] Fix | Delete
} else {
[905] Fix | Delete
$this->is_day = true;
[906] Fix | Delete
$this->is_date = true;
[907] Fix | Delete
}
[908] Fix | Delete
}
[909] Fix | Delete
}
[910] Fix | Delete
[911] Fix | Delete
if ( $qv['monthnum'] ) {
[912] Fix | Delete
if ( ! $this->is_date ) {
[913] Fix | Delete
if ( 12 < $qv['monthnum'] ) {
[914] Fix | Delete
$qv['error'] = '404';
[915] Fix | Delete
} else {
[916] Fix | Delete
$this->is_month = true;
[917] Fix | Delete
$this->is_date = true;
[918] Fix | Delete
}
[919] Fix | Delete
}
[920] Fix | Delete
}
[921] Fix | Delete
[922] Fix | Delete
if ( $qv['year'] ) {
[923] Fix | Delete
if ( ! $this->is_date ) {
[924] Fix | Delete
$this->is_year = true;
[925] Fix | Delete
$this->is_date = true;
[926] Fix | Delete
}
[927] Fix | Delete
}
[928] Fix | Delete
[929] Fix | Delete
if ( $qv['m'] ) {
[930] Fix | Delete
$this->is_date = true;
[931] Fix | Delete
if ( strlen( $qv['m'] ) > 9 ) {
[932] Fix | Delete
$this->is_time = true;
[933] Fix | Delete
} elseif ( strlen( $qv['m'] ) > 7 ) {
[934] Fix | Delete
$this->is_day = true;
[935] Fix | Delete
} elseif ( strlen( $qv['m'] ) > 5 ) {
[936] Fix | Delete
$this->is_month = true;
[937] Fix | Delete
} else {
[938] Fix | Delete
$this->is_year = true;
[939] Fix | Delete
}
[940] Fix | Delete
}
[941] Fix | Delete
[942] Fix | Delete
if ( $qv['w'] ) {
[943] Fix | Delete
$this->is_date = true;
[944] Fix | Delete
}
[945] Fix | Delete
[946] Fix | Delete
$this->query_vars_hash = false;
[947] Fix | Delete
$this->parse_tax_query( $qv );
[948] Fix | Delete
[949] Fix | Delete
foreach ( $this->tax_query->queries as $tax_query ) {
[950] Fix | Delete
if ( ! is_array( $tax_query ) ) {
[951] Fix | Delete
continue;
[952] Fix | Delete
}
[953] Fix | Delete
[954] Fix | Delete
if ( isset( $tax_query['operator'] ) && 'NOT IN' !== $tax_query['operator'] ) {
[955] Fix | Delete
switch ( $tax_query['taxonomy'] ) {
[956] Fix | Delete
case 'category':
[957] Fix | Delete
$this->is_category = true;
[958] Fix | Delete
break;
[959] Fix | Delete
case 'post_tag':
[960] Fix | Delete
$this->is_tag = true;
[961] Fix | Delete
break;
[962] Fix | Delete
default:
[963] Fix | Delete
$this->is_tax = true;
[964] Fix | Delete
}
[965] Fix | Delete
}
[966] Fix | Delete
}
[967] Fix | Delete
unset( $tax_query );
[968] Fix | Delete
[969] Fix | Delete
if ( empty( $qv['author'] ) || ( '0' == $qv['author'] ) ) {
[970] Fix | Delete
$this->is_author = false;
[971] Fix | Delete
} else {
[972] Fix | Delete
$this->is_author = true;
[973] Fix | Delete
}
[974] Fix | Delete
[975] Fix | Delete
if ( '' !== $qv['author_name'] ) {
[976] Fix | Delete
$this->is_author = true;
[977] Fix | Delete
}
[978] Fix | Delete
[979] Fix | Delete
if ( ! empty( $qv['post_type'] ) && ! is_array( $qv['post_type'] ) ) {
[980] Fix | Delete
$post_type_obj = get_post_type_object( $qv['post_type'] );
[981] Fix | Delete
if ( ! empty( $post_type_obj->has_archive ) ) {
[982] Fix | Delete
$this->is_post_type_archive = true;
[983] Fix | Delete
}
[984] Fix | Delete
}
[985] Fix | Delete
[986] Fix | Delete
if ( $this->is_post_type_archive || $this->is_date || $this->is_author || $this->is_category || $this->is_tag || $this->is_tax ) {
[987] Fix | Delete
$this->is_archive = true;
[988] Fix | Delete
}
[989] Fix | Delete
}
[990] Fix | Delete
[991] Fix | Delete
if ( '' != $qv['feed'] ) {
[992] Fix | Delete
$this->is_feed = true;
[993] Fix | Delete
}
[994] Fix | Delete
[995] Fix | Delete
if ( '' != $qv['embed'] ) {
[996] Fix | Delete
$this->is_embed = true;
[997] Fix | Delete
}
[998] Fix | Delete
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function