Skip to content

Commit 040790b

Browse files
feat: add support for Black Friday
1 parent b580f0c commit 040790b

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

includes/Admin.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public function init() {
7575
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) );
7676
add_filter( 'ti_tpc_editor_data', array( $this, 'add_tpc_editor_data' ), 20 );
7777
add_action( 'admin_init', array( $this, 'activation_redirect' ) );
78+
add_filter( 'themeisle_sdk_blackfriday_data', array( $this, 'add_black_friday_data' ), 20 );
7879

7980
$this->setup_white_label();
8081

@@ -719,6 +720,8 @@ public function enqueue() {
719720
);
720721
}
721722
}
723+
724+
do_action( 'themeisle_internal_page', TIOB_BASENAME, 'onboarding' );
722725
}
723726

724727
$is_tiob_page = strpos( $screen->id, '_page_tiob-plugin' ) !== false;
@@ -746,6 +749,8 @@ public function enqueue() {
746749
wp_enqueue_script( 'tiob' );
747750

748751
wp_set_script_translations( 'tiob', 'templates-patterns-collection' );
752+
753+
do_action( 'themeisle_internal_page', TIOB_BASENAME, 'onboarding' );
749754
}
750755

751756
/**
@@ -1390,4 +1395,30 @@ private function get_prefix_for_menu_item() {
13901395

13911396
return $prefix;
13921397
}
1398+
1399+
/**
1400+
* Add Black Friday data.
1401+
*
1402+
* @param array $configs The configuration array for the loaded products.
1403+
*
1404+
* @return array
1405+
*/
1406+
public function add_black_friday_data( $configs ) {
1407+
$config = $configs['default'];
1408+
1409+
// translators: %1$s - plugin name, %2$s - HTML tag, %3$s - discount, %4$s - HTML tag, %5$s - company name.
1410+
$message_template = __( 'Brought to you by the team behind %1$s— our biggest sale of the year is here: %2$sup to %3$s OFF%4$s on premium products from %5$s! Limited-time only.', 'templates-patterns-collection' );
1411+
1412+
$config['message'] = sprintf( $message_template, 'Starter Sites & Templates by Neve', '<strong>', '70%', '</strong>', '<strong>Themeisle</strong>' );
1413+
$config['sale_url'] = add_query_arg(
1414+
array(
1415+
'utm_term' => 'free',
1416+
),
1417+
tsdk_translate_link( tsdk_utmify( 'https://themeisle.link/all-bf', 'bfcm', 'templates-patterns-collection' ) )
1418+
);
1419+
1420+
$configs[ TIOB_BASENAME ] = $config;
1421+
1422+
return $configs;
1423+
}
13931424
}

0 commit comments

Comments
 (0)