diff --git a/includes/Admin/Settings_Screens/Advertise.php b/includes/Admin/Settings_Screens/Advertise.php index 6cb6d8cf..90b4d739 100644 --- a/includes/Admin/Settings_Screens/Advertise.php +++ b/includes/Admin/Settings_Screens/Advertise.php @@ -31,7 +31,14 @@ class Advertise extends Abstract_Settings_Screen { * @since 2.2.0 */ public function __construct() { - $this->id = self::ID; + add_action( 'init', array( $this, 'initHook' ) ); + } + + /** + * Initializes this settings page's properties. + */ + public function initHook(): void { + $this->id = self::ID; $this->label = __( 'Advertise', 'facebook-for-woocommerce' ); $this->title = __( 'Advertise', 'facebook-for-woocommerce' ); $this->documentation_url = 'https://woocommerce.com/document/facebook-for-woocommerce/#how-to-create-ads-on-facebook'; diff --git a/includes/Admin/Settings_Screens/Connection.php b/includes/Admin/Settings_Screens/Connection.php index 975b4435..14ad3ada 100644 --- a/includes/Admin/Settings_Screens/Connection.php +++ b/includes/Admin/Settings_Screens/Connection.php @@ -30,16 +30,22 @@ class Connection extends Abstract_Settings_Screen { * Connection constructor. */ public function __construct() { - - $this->id = self::ID; - $this->label = __( 'Connection', 'facebook-for-woocommerce' ); - $this->title = __( 'Connection', 'facebook-for-woocommerce' ); + add_action( 'init', array( $this, 'initHook' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) ); add_action( 'admin_notices', array( $this, 'add_notices' ) ); } + /** + * Initializes this settings page's properties. + */ + public function initHook(): void { + $this->id = self::ID; + $this->label = __( 'Connection', 'facebook-for-woocommerce' ); + $this->title = __( 'Connection', 'facebook-for-woocommerce' ); + } + /** * Adds admin notices. diff --git a/includes/Admin/Settings_Screens/Product_Sets.php b/includes/Admin/Settings_Screens/Product_Sets.php index 6a43d1b3..932c79bc 100644 --- a/includes/Admin/Settings_Screens/Product_Sets.php +++ b/includes/Admin/Settings_Screens/Product_Sets.php @@ -27,6 +27,13 @@ class Product_Sets extends Abstract_Settings_Screen { * Connection constructor. */ public function __construct() { + add_action( 'init', array( $this, 'initHook' ) ); + } + + /** + * Initializes this settings page's properties. + */ + public function initHook(): void { $this->id = self::ID; $this->label = __( 'Product sets', 'facebook-for-woocommerce' ); $this->title = __( 'Product sets', 'facebook-for-woocommerce' ); diff --git a/includes/Admin/Settings_Screens/Product_Sync.php b/includes/Admin/Settings_Screens/Product_Sync.php index 3f2182a7..8dc50e3f 100644 --- a/includes/Admin/Settings_Screens/Product_Sync.php +++ b/includes/Admin/Settings_Screens/Product_Sync.php @@ -38,15 +38,21 @@ class Product_Sync extends Abstract_Settings_Screen { * Connection constructor. */ public function __construct() { - $this->id = self::ID; - $this->label = __( 'Product sync', 'facebook-for-woocommerce' ); - $this->title = __( 'Product sync', 'facebook-for-woocommerce' ); - $this->documentation_url = 'https://woocommerce.com/document/facebook-for-woocommerce/#product-sync-settings'; + add_action( 'init', array( $this, 'initHook' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) ); add_action( 'woocommerce_admin_field_product_sync_title', array( $this, 'render_title' ) ); add_action( 'woocommerce_admin_field_product_sync_google_product_categories', array( $this, 'render_google_product_category_field' ) ); } + /** + * Initializes this settings page's properties. + */ + public function initHook(): void { + $this->id = self::ID; + $this->label = __( 'Product sync', 'facebook-for-woocommerce' ); + $this->title = __( 'Product sync', 'facebook-for-woocommerce' ); + $this->documentation_url = 'https://woocommerce.com/document/facebook-for-woocommerce/#product-sync-settings'; + } /** * Enqueues the assets.