public function pre_get_posts( WP_Query $query ) {
		global $pagenow;

		if ( $pagenow === 'edit.php' && ! is_null( papi_get_qs( 'page_type' ) ) ) {
			if ( papi_get_qs( 'page_type' ) === 'papi-standard-page' ) {
				$query->set( 'meta_query', [
					[
						'key'     => papi_get_page_type_key(),
						'compare' => 'NOT EXISTS'
					]
				] );
			} else {
				$query->set( 'meta_key', papi_get_page_type_key() );
				$query->set( 'meta_value', papi_get_qs( 'page_type' ) );
			}
		}

		// Order query result by entry type.
		if ( $query->get( 'orderby' ) === 'entry_type' ) {
			$query->set( 'meta_key', papi_get_page_type_key() );
			$query->set( 'orderby', 'meta_value' );
		}

		return $query;
	}
public function pre_get_posts( WP_Query $query ) {
		global $pagenow;

		if ( $pagenow === 'edit.php' && ! is_null( papi_get_qs( 'page_type' ) ) ) {
			if ( papi_get_qs( 'page_type' ) === 'papi-standard-page' ) {
				$query->set( 'meta_query', [
					[
						'key'     => papi_get_page_type_key(),
						'compare' => 'NOT EXISTS'
					]
				] );
			} else {
				$query->set( 'meta_key', papi_get_page_type_key() );
				$query->set( 'meta_value', papi_get_qs( 'page_type' ) );
			}
		}

		// Order query result by entry type.
		if ( $query->get( 'orderby' ) === 'entry_type' ) {
			$query->set( 'meta_key', papi_get_page_type_key() );
			$query->set( 'orderby', 'meta_value' );
		}

		return $query;
	}
public function pre_get_posts ( WP_Query $ query ) { global $ pagenow ; if ( $ pagenow === 'edit.php' && ! is_null ( papi_get_qs ( 'page_type' ) ) ) { if ( papi_get_qs ( 'page_type' ) === 'papi-standard-page' ) { $ query -> set ( 'meta_query' , [ [ 'key' => papi_get_page_type_key ( ) , 'compare' => 'NOT EXISTS' ] ] ) ; } else { $ query -> set ( 'meta_key' , papi_get_page_type_key ( ) ) ; $ query -> set ( 'meta_value' , papi_get_qs ( 'page_type' ) ) ; } } // Order query result by entry type. if ( $ query -> get ( 'orderby' ) === 'entry_type' ) { $ query -> set ( 'meta_key' , papi_get_page_type_key ( ) ) ; $ query -> set ( 'orderby' , 'meta_value' ) ; } return $ query ; }
Filter posts on load if `page_type` query string is set.

@param  WP_Query $query

@return WP_Query
Filter posts on load if page_type query string is set .