src/class-extended-cpt.php
public function override_private_query_vars( WP $wp ) : WP {

		# If it's not our post type, bail out:
		if ( ! isset( $wp->query_vars['post_type'] ) || ( $this->post_type !== $wp->query_vars['post_type'] ) ) {
			return $wp;
		}

		# If it's a single post, bail out:
		if ( isset( $wp->query_vars['name'] ) ) {
			return $wp;
		}

		# Set the vars:
		foreach ( $this->args['archive'] as $var => $value ) {
			$wp->query_vars[ $var ] = $value;
		}

		return $wp;

	}
public function override_private_query_vars( WP $wp ) : WP {

		# If it's not our post type, bail out:
		if ( ! isset( $wp->query_vars['post_type'] ) || ( $this->post_type !== $wp->query_vars['post_type'] ) ) {
			return $wp;
		}

		# If it's a single post, bail out:
		if ( isset( $wp->query_vars['name'] ) ) {
			return $wp;
		}

		# Set the vars:
		foreach ( $this->args['archive'] as $var => $value ) {
			$wp->query_vars[ $var ] = $value;
		}

		return $wp;

	}
public function override_private_query_vars ( WP $ wp ) : WP { # If it's not our post type, bail out: if ( ! isset ( $ wp -> query_vars [ 'post_type' ] ) || ( $ this -> post_type !== $ wp -> query_vars [ 'post_type' ] ) ) { return $ wp ; } # If it's a single post, bail out: if ( isset ( $ wp -> query_vars [ 'name' ] ) ) { return $ wp ; } # Set the vars: foreach ( $ this -> args [ 'archive' ] as $ var => $ value ) { $ wp -> query_vars [ $ var ] = $ value ; } return $ wp ; }
Add to or override our post type archive's private query vars.

@param  WP $wp The WP request object.
@return WP     Updated WP request object.
Add to or override our post type archive s private query vars .