File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,6 +144,28 @@ public function test_wp_robots_non_search_page() {
144144 $ this ->assertStringNotContainsString ( 'noindex ' , $ output );
145145 }
146146
147+ /**
148+ * @ticket 63467
149+ */
150+ public function test_do_robots_uses_filtered_admin_url_paths () {
151+ $ filter = static function ( $ url , $ path , $ blog_id , $ scheme ) {
152+ if ( 'admin-ajax.php ' === $ path ) {
153+ return home_url ( '/control/admin-ajax.php ' , $ scheme );
154+ }
155+
156+ return home_url ( '/control/ ' , $ scheme );
157+ };
158+
159+ add_filter ( 'admin_url ' , $ filter , 10 , 4 );
160+
161+ $ output = get_echo ( 'do_robots ' );
162+
163+ remove_filter ( 'admin_url ' , $ filter , 10 );
164+
165+ $ this ->assertStringContainsString ( "Disallow: /control/ \n" , $ output );
166+ $ this ->assertStringContainsString ( "Allow: /control/admin-ajax.php \n" , $ output );
167+ }
168+
147169 public function add_noindex_directive ( array $ robots ) {
148170 $ robots ['noindex ' ] = true ;
149171 return $ robots ;
You can’t perform that action at this time.
0 commit comments