Changeset 13297
- Timestamp:
- 03/07/2024 04:39:31 AM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/wporg-robots.php
r13069 r13297 65 65 "Sitemap: https://wordpress.org/showcase/sitemap.xml\n" . 66 66 "Sitemap: https://wordpress.org/documentation/sitemap.xml\n" . 67 "Sitemap: https://wordpress.org/patterns/sitemap.xml\n" . 68 "Sitemap: https://wordpress.org/photos/sitemap.xml\n" . 67 69 $robots; 68 70 } … … 80 82 } 81 83 82 /* 83 * Add the Developer Blog sitemap. 84 */ 85 if ( 'developer.wordpress.org' === $blog_details->domain ) { 86 $robots = "Sitemap: https://developer.wordpress.org/news/sitemap.xml\n" . 87 "Sitemap: https://developer.wordpress.org/news/news-sitemap.xml\n" . 88 $robots; 84 // Should all sub-sites sitemaps be included? 85 if ( 86 'developer.wordpress.org' === $blog_details->domain || 87 'make.wordpress.org' === $blog_details->domain 88 ) { 89 $should_include_subsite_sitemaps = true; 90 } 91 92 if ( $should_include_subsite_sitemaps && '/' === $blog_details->path ) { 93 // Check all subsites. 94 $sites = get_sites( [ 95 'network_id' => $blog_details->site_id, 96 'domain' => $blog_details->domain, 97 'public' => 1, 98 'archived' => 0, 99 ] ); 100 foreach ( $sites as $site ) { 101 if ( '/' === $site->path ) { 102 continue; 103 } 104 105 switch_to_blog( $site->blog_id ); 106 107 // Are Jetpack Sitemaps enabled on a public site? 108 if ( Jetpack::is_module_active( 'sitemaps' ) && get_option( 'blog_public' ) ) { 109 // Load the modules, as the sitemaps may not be loaded. 110 Jetpack::load_modules(); 111 112 if ( 113 class_exists( 'Jetpack_Sitemap_Manager' ) && 114 is_callable( 'Jetpack_Sitemap_Manager', 'callback_action_do_robotstxt' ) 115 ) { 116 $sitemaps = new Jetpack_Sitemap_Manager(); 117 ob_start(); 118 $sitemaps->callback_action_do_robotstxt(); 119 $robots = ob_get_clean() . $robots; 120 } 121 } 122 123 restore_current_blog(); 124 } 125 89 126 } 90 127
Note: See TracChangeset
for help on using the changeset viewer.