settings = $settings; } /** * Registers the hooks. * * @since 1.0.0 * * @return void */ public function hooks(): void { add_action( 'elevenrank_deactivate', array( self::class, 'forget' ) ); // Which modules are on, and whether output continues next to another SEO plugin, decide // which rules get registered. // The first save of a group that was never stored is an "add", not an "update". foreach ( array( 'modules', 'general' ) as $group ) { add_action( 'update_option_' . $this->settings->option_name( $group ), array( self::class, 'forget' ) ); add_action( 'add_option_' . $this->settings->option_name( $group ), array( self::class, 'forget' ) ); } } /** * Makes WordPress rebuild its rewrite rules on the next request. * * @since 1.0.0 * * @return void */ public static function forget(): void { delete_option( 'rewrite_rules' ); } }