From f2e4ae3f706bcb27ca2c4e0043043e8bedabfb58 Mon Sep 17 00:00:00 2001 From: Sean McCafferty Date: Wed, 7 Feb 2018 18:45:39 -0500 Subject: [PATCH] =?UTF-8?q?Using=20`update=5Foption=5F{option}`=20action?= =?UTF-8?q?=20instead=20of=20`delete=5Foption=5F=E2=80=A6`=20as=20the=20de?= =?UTF-8?q?lete=5Foption=20is=20not=20fired=20when=20flushing=20the=20rewr?= =?UTF-8?q?ite=20rules.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rewrites.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rewrites.php b/src/rewrites.php index 1622ab5..13dd474 100644 --- a/src/rewrites.php +++ b/src/rewrites.php @@ -16,12 +16,12 @@ public function __construct( $connection_factory ) { */ public function init() { add_filter( 'query_vars', array( $this, 'filter_query_vars' ) ); - add_action( 'delete_option_rewrite_rules', array( $this, 'add_rewrite_rules' ), 11 ); + add_action( 'update_option_rewrite_rules', array( $this, 'add_rewrite_rules' ), 11 ); } public function deinit() { remove_filter( 'query_vars', array( $this, 'filter_query_vars' ) ); - remove_action( 'delete_option_rewrite_rules', array( $this, 'add_rewrite_rules' ), 11 ); + remove_action( 'update_option_rewrite_rules', array( $this, 'add_rewrite_rules' ), 11 ); } /**