wp

The timeline below displays how wordpress function wp has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Sets up the WordPress query.
 *
 * @since 2.0.0
 *
 * @global WP       $wp           Current WordPress environment instance.
 * @global WP_Query $wp_query     WordPress Query object.
 * @global WP_Query $wp_the_query Copy of the WordPress Query object.
 *
 * @param string|array $query_vars Default WP_Query arguments.
 */
function wp($query_vars = '')
{
    global $wp, $wp_query, $wp_the_query;
    $wp->main($query_vars);
    if (!isset($wp_the_query)) {
        $wp_the_query = $wp_query;
    }
}

WordPress Version: 5.3

/**
 * Set up the WordPress query.
 *
 * @since 2.0.0
 *
 * @global WP       $wp           Current WordPress environment instance.
 * @global WP_Query $wp_query     WordPress Query object.
 * @global WP_Query $wp_the_query Copy of the WordPress Query object.
 *
 * @param string|array $query_vars Default WP_Query arguments.
 */
function wp($query_vars = '')
{
    global $wp, $wp_query, $wp_the_query;
    $wp->main($query_vars);
    if (!isset($wp_the_query)) {
        $wp_the_query = $wp_query;
    }
}

WordPress Version: 4.3

/**
 * Set up the WordPress query.
 *
 * @since 2.0.0
 *
 * @global WP       $wp_locale
 * @global WP_Query $wp_query
 * @global WP_Query $wp_the_query
 *
 * @param string|array $query_vars Default WP_Query arguments.
 */
function wp($query_vars = '')
{
    global $wp, $wp_query, $wp_the_query;
    $wp->main($query_vars);
    if (!isset($wp_the_query)) {
        $wp_the_query = $wp_query;
    }
}

WordPress Version: 4.2

/**
 * Set up the WordPress query.
 *
 * @since 2.0.0
 *
 * @param string|array $query_vars Default WP_Query arguments.
 */
function wp($query_vars = '')
{
    global $wp, $wp_query, $wp_the_query;
    $wp->main($query_vars);
    if (!isset($wp_the_query)) {
        $wp_the_query = $wp_query;
    }
}

WordPress Version: 3.7

/**
 * Set up the WordPress query.
 *
 * @since 2.0.0
 *
 * @param string $query_vars Default WP_Query arguments.
 */
function wp($query_vars = '')
{
    global $wp, $wp_query, $wp_the_query;
    $wp->main($query_vars);
    if (!isset($wp_the_query)) {
        $wp_the_query = $wp_query;
    }
}