| @@ -801,14 +801,11 @@ | ||
| 801 | 801 | * Ask the common page/CDN cache layers to drop their copy of /llms.txt. |
| 802 | 802 | * |
| 803 | 803 | * A cached response outlives a republish, so without this a mode switch or |
| 804 | 804 | * a content change keeps serving the old document (and, on the static path, |
| 805 | - * the old headers). | |
| 805 | + * the old headers). Every call is guarded — a site running none of these | |
| 806 | + * simply gets the action hook, which integrations can use. | |
| 806 | 807 | * |
| 807 | - * The layer-by-layer work moved to Cache_Purger in 2.10.1, once alt-text | |
| 808 | - * writes needed the same thing (#763). The llms.txt-specific hook stays | |
| 809 | - * here because it names this document, which a generic URL purge cannot. | |
| 810 | - * | |
| 811 | 808 | * @since 2.1.0 |
| 812 | 809 | * |
| 813 | 810 | * @return void |
| 814 | 811 | */ |
| @@ -824,9 +821,22 @@ | ||
| 824 | 821 | * @param string $url Public URL of the llms.txt document. |
| 825 | 822 | */ |
| 826 | 823 | do_action('thinkrank_llms_txt_updated', $url); |
| 827 | 824 | |
| 828 | - Cache_Purger::purge_urls([$url]); | |
| 825 | + // LiteSpeed Cache and Nginx Helper both listen on their own actions. | |
| 826 | + // These are third-party hook names we fire, not ours to prefix. | |
| 827 | + do_action('litespeed_purge_url', $url); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound | |
| 828 | + do_action('rt_nginx_helper_purge_all'); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound | |
| 829 | + | |
| 830 | + if (function_exists('rocket_clean_files')) { | |
| 831 | + rocket_clean_files([$url]); | |
| 832 | + } | |
| 833 | + if (function_exists('w3tc_flush_url')) { | |
| 834 | + w3tc_flush_url($url); | |
| 835 | + } | |
| 836 | + if (function_exists('wpsc_delete_url_cache')) { | |
| 837 | + wpsc_delete_url_cache($url); | |
| 838 | + } | |
| 829 | 839 | } |
| 830 | 840 | |
| 831 | 841 | /** |
| 832 | 842 | * Unpublish llms.txt: drop the stored document and any physical file. |