From b30e9bf5a44a8ac18c6e7cdcb78c23a1a55654a7 Mon Sep 17 00:00:00 2001 From: Tim Carr Date: Thu, 18 Jun 2026 19:48:09 +0800 Subject: [PATCH] Settings: Broadcasts: Refresh settings on save; remove unused methods --- .../class-convertkit-settings-broadcasts.php | 48 ++++++++----------- 1 file changed, 21 insertions(+), 27 deletions(-) diff --git a/includes/class-convertkit-settings-broadcasts.php b/includes/class-convertkit-settings-broadcasts.php index 10fc8f4be..9d743a0d2 100644 --- a/includes/class-convertkit-settings-broadcasts.php +++ b/includes/class-convertkit-settings-broadcasts.php @@ -190,33 +190,6 @@ public function no_styles() { } - /** - * Returns whether imported Broadcasts should have their Restrict Content - * setting defined, if the Broadcast is marked as paid. - * - * @since 2.2.9 - * - * @return bool - */ - public function restrict_content_enabled() { - - return ! empty( $this->settings['restrict_content'] ); - - } - - /** - * Returns the Restrict Content setting to assign to imported Broadcasts - * - * @since 2.2.9 - * - * @return string - */ - public function restrict_content() { - - return $this->settings['restrict_content']; - - } - /** * The default settings, used when the ConvertKit Broadcasts Settings haven't been saved * e.g. on a new installation. @@ -267,6 +240,27 @@ public function save( $settings ) { update_option( self::SETTINGS_NAME, array_merge( $this->get(), $settings ) ); + // Reload settings in class, to reflect changes. + $this->refresh_settings(); + + } + + /** + * Reloads settings from the options table so this instance has the latest values. + * + * @since 3.3.4 + */ + private function refresh_settings() { + + $settings = get_option( self::SETTINGS_NAME ); + + if ( ! $settings ) { + $this->settings = $this->get_defaults(); + return; + } + + $this->settings = array_merge( $this->get_defaults(), $settings ); + } }