Skip to content

Commit b083a29

Browse files
committed
Avoid using pretty permalink for author URL due to GHA testing problem
1 parent 1fc20af commit b083a29

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

plugins/optimization-detective/tests/storage/test-data.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,16 @@ static function ( $data ) {
396396
$user_id = self::factory()->user->create();
397397
$this->assertIsInt( $user_id );
398398
$post_ids = self::factory()->post->create_many( 3, array( 'post_author' => $user_id ) );
399+
400+
// This is a workaround because the author URL pretty permalink is failing for some reason only on GHA.
401+
add_filter(
402+
'author_link',
403+
static function ( $link, $author_id ) {
404+
return add_query_arg( 'author', $author_id, home_url( '/' ) );
405+
},
406+
10,
407+
2
408+
);
399409
$this->go_to( get_author_posts_url( $user_id ) );
400410
$GLOBALS['template'] = trailingslashit( get_template_directory() ) . 'author.php';
401411

0 commit comments

Comments
 (0)