﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	focuses
49296	Split up WP_Query into more manageable classes	madpeter		"as it stands the WP_query class file is over 4000 lines
and with a single function that get_posts that on its own is over 1200 lines.


Suggestion
-------------------------------------------------------------------------
Split the class into its own folder with 
""vars"",""get"",""set"",""deprecated"",""process"",""comments"",""posts"",""get_posts""
as abstract classes 

example
{{{#!php
<?php 
abstract class wp_query_vars { ..... } 
abstract class wp_query_get extends wp_query_vars { ..... } 
?>
}}}


and then adjust the class-wp-query.php to load the split class

{{{#!php
<?php
/**
 * Query API: WP_Query class
 *
 * @package WordPress
 * @subpackage Query
 * @since 4.7.0
 */
 $loader = array(""vars"",""get"",""set"",""deprecated"",""process"",""comments"",""posts"",""get_posts"");
 foreach($loader as $loadclass)
 {
	 require_once(""wp-query/wp_query_"".$loadclass."".php"");
 }

class WP_Query extends wp_query_get_posts
{
	/**
	 * Constructor.
	 *
	 * Sets up the WordPress query, if parameter is not empty.
	 *
	 * @since 1.5.0
	 *
	 * @param string|array $query URL query string or array of vars.
	 */
	public function __construct( $query = '' ) {
		if ( ! empty( $query ) ) {
			$this->query( $query );
		}
	}
}
}}


after this is done other improvements should be made to the get_posts function."	enhancement	new	normal	Awaiting Review	Query	5.3.2	normal				
