📜  刷新重写规则(); - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:26.848000             🧑  作者: Mango

代码示例1
add_action('admin_init', 'wpse_123401_plugin_settings_flush_rewrite');
function wpse_123401_plugin_settings_flush_rewrite() {
    if ( get_option('plugin_settings_have_changed') == true ) {
        flush_rewrite_rules();
        update_option('plugin_settings_have_changed', false);
    }
}