Trying to flush and recreate rewrite rules whenever call `get_xml_url` function.
-
Hi there,
I’ve updated from 4.1.1 to 4.1.5 and realized that lots of update option queries when I visit the
/sitemap.xml
page. Then I tried to reproduce the problem fresh install with WordPress 6.0 to see any of my configurations or plugins effect the sitemap plugin or not, I saw the same queries.I do not think there is any point of doing that, I hope I’m missing something or you can fix this.
Logs from my site:
NOTICE: PHP message: rewrite_option_updated_528 NOTICE: PHP message: rewrite_option_updated_529 NOTICE: PHP message: rewrite_option_updated_530 NOTICE: PHP message: rewrite_option_updated_531 NOTICE: PHP message: rewrite_option_updated_532 NOTICE: PHP message: rewrite_option_updated_533 NOTICE: PHP message: rewrite_option_updated_534 NOTICE: PHP message: rewrite_option_updated_535
Here is my mu-plugin to see rewrite option updates:
<?php namespace NefisYemekTarifleri\Test_Sitemap; global $rewrite_update_count; $rewrite_update_count = 0; function updated_option( $option, $old_value, $value ) { global $rewrite_update_count; if ( 'rewrite_rules' !== $option ) { return; } if ( true === empty( $value ) ) { return; } $rewrite_update_count++; @error_log( sprintf( 'rewrite_option_updated_%d', $rewrite_update_count ) ); } add_action( 'updated_option', __NAMESPACE__ . '\\updated_option', 10, 3 );
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Trying to flush and recreate rewrite rules whenever call `get_xml_url` function.’ is closed to new replies.