/* e2d-sitemap-refresh: rebuild Rank Math sitemaps right after a post is published */ add_action( 'transition_post_status', function ( $new_status, $old_status, $post ) { if ( 'publish' !== $new_status || 'publish' === $old_status ) { return; } if ( ! $post || ! in_array( $post->post_type, array( 'post', 'page' ), true ) ) { return; } if ( class_exists( '\RankMath\Sitemap\Cache' ) && method_exists( '\RankMath\Sitemap\Cache', 'invalidate_storage' ) ) { \RankMath\Sitemap\Cache::invalidate_storage(); } do_action( 'rank_math/sitemap/invalidate' ); if ( function_exists( 'rank_math' ) ) { delete_option( 'rank_math_sitemap_cache' ); } }, 20, 3 ); /* end e2d-sitemap-refresh */ iScore - بوابة مصر اليوم

iScore

زر الذهاب إلى الأعلى