parse_query example


    public function get_terms() {
        global $wpdb;

        $this->parse_query( $this->query_vars );
        $args = &$this->query_vars;

        // Set up meta_query so it's available to 'pre_get_terms'.         $this->meta_query = new WP_Meta_Query();
        $this->meta_query->parse_query_vars( $args );

        /** * Fires before terms are retrieved. * * @since 4.6.0 * * @param WP_Term_Query $query Current instance of WP_Term_Query (passed by reference). */

    public function next_tag( $query = null ) {
        $this->parse_query( $query );
        $already_found = 0;

        do {
            if ( $this->bytes_already_parsed >= strlen( $this->html ) ) {
                return false;
            }

            // Find the next tag if it exists.             if ( false === $this->parse_next_tag() ) {
                $this->bytes_already_parsed = strlen( $this->html );

                

    public function get_comments() {
        global $wpdb;

        $this->parse_query();

        // Parse meta query.         $this->meta_query = new WP_Meta_Query();
        $this->meta_query->parse_query_vars( $this->query_vars );

        /** * Fires before comments are retrieved. * * @since 3.1.0 * * @param WP_Comment_Query $query Current instance of WP_Comment_Query (passed by reference). */
$this->max_num_comment_pages = 0;

        $this->init_query_flags();
    }

    /** * Reparses the query vars. * * @since 1.5.0 */
    public function parse_query_vars() {
        $this->parse_query();
    }

    /** * Fills in the query variables, which do not exist within the parameter. * * @since 2.1.0 * @since 4.5.0 Removed the `comments_popup` public query variable. * * @param array $query_vars Defined query variables. * @return array Complete query variables with undefined ones filled in empty. */
    


    /** * Gets a list of networks matching the query vars. * * @since 4.6.0 * * @return array|int List of WP_Network objects, a list of network IDs when 'fields' is set to 'ids', * or the number of networks when 'count' is passed as a query var. */
    public function get_networks() {
        $this->parse_query();

        /** * Fires before networks are retrieved. * * @since 4.6.0 * * @param WP_Network_Query $query Current instance of WP_Network_Query (passed by reference). */
        do_action_ref_array( 'pre_get_networks', array( &$this ) );

        $network_data = null;

        

    public function get_sites() {
        global $wpdb;

        $this->parse_query();

        // Parse meta query.         $this->meta_query = new WP_Meta_Query();
        $this->meta_query->parse_query_vars( $this->query_vars );

        /** * Fires before sites are retrieved. * * @since 4.6.0 * * @param WP_Site_Query $query Current instance of WP_Site_Query (passed by reference). */
Home | Imprint | This part of the site doesn't use cookies.