post_type, PostTypes::supported(), true ) ) { return null; } return $page; } public static function page_number(): int { return max( 1, (int) get_query_var( 'paged' ) ); } /** * Raw (unescaped) URL of the current listing page — escape on output. */ public static function url(): string { if ( self::page_number() > 1 ) { return get_pagenum_link( self::page_number(), false ); } $page = self::posts_page(); if ( null !== $page ) { $permalink = get_permalink( $page ); return is_string( $permalink ) ? $permalink : ''; } return home_url( '/' ); } }