Skip to content

Commit 822e877

Browse files
refactor: use configs array
1 parent 4722e54 commit 822e877

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

includes/admin/feedzy-rss-feeds-admin.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function( $data, $page_slug ) {
7777
);
7878
}
7979

80-
add_filter( 'themeisle_sdk_blackfriday_data', array( $this, 'set_black_friday_data' ) );
80+
add_filter( 'themeisle_sdk_blackfriday_data', array( $this, 'add_black_friday_data' ) );
8181

8282
/**
8383
* Load SDK dependencies.
@@ -91,8 +91,6 @@ function( $data, $page_slug ) {
9191
$this->add_banner_anchor();
9292
}
9393

94-
add_filter( 'themeisle_sdk_blackfriday_data', array( $this, 'set_black_friday_data' ), 99 );
95-
9694
if (
9795
in_array( $page_slug, array( 'imports', 'new-category', 'settings' ), true )
9896
&& 'yes' === get_option( 'feedzy_rss_feeds_logger_flag', false )
@@ -2370,10 +2368,12 @@ private function enable_telemetry() {
23702368
/**
23712369
* Set the black friday data.
23722370
*
2373-
* @param array $config The configuration array.
2371+
* @param array $configs The configuration array for the loaded products.
23742372
* @return array
23752373
*/
2376-
public function set_black_friday_data( $config ) {
2374+
public function add_black_friday_data( $configs ) {
2375+
$config = $configs['default'];
2376+
23772377
$product_label = __( 'Feedzy', 'feedzy-rss-feeds' );
23782378
$discount = '70%';
23792379

@@ -2408,6 +2408,8 @@ public function set_black_friday_data( $config ) {
24082408
tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/plugins/feedzy-rss-feeds/blackfriday', 'bfcm', 'feedzy' ) )
24092409
);
24102410

2411-
return $config;
2411+
$configs[ $this->plugin_name ] = $config;
2412+
2413+
return $configs;
24122414
}
24132415
}

0 commit comments

Comments
 (0)