WordPress.org

Make WordPress Core

Ticket #51136: patch.diff

File patch.diff, 703 bytes (added by vaurdan, 11 months ago)

Patch with a potential fix

  • wp-includes/sitemaps/class-wp-sitemaps.php

     
    6262         * @since 5.5.0
    6363         */
    6464        public function init() {
     65                if ( ! $this->sitemaps_enabled() ) {
     66                        return;
     67                }
     68
    6569                // These will all fire on the init hook.
    6670                $this->register_rewrites();
    6771
    6872                add_action( 'template_redirect', array( $this, 'render_sitemaps' ) );
    6973
    70                 if ( ! $this->sitemaps_enabled() ) {
    71                         return;
    72                 }
    73 
    7474                $this->register_sitemaps();
    7575
    7676                // Add additional action callbacks.