Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions inc/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function setup_admin_hooks() {

add_action( 'enqueue_block_editor_assets', array( $this, 'add_fse_design_pack_notice' ) );
add_action( 'wp_ajax_raft_dismiss_design_pack_notice', array( $this, 'remove_design_pack_notice' ) );
add_filter( 'themeisle_sdk_blackfriday_data', array( $this, 'add_black_friday_data' ) );
}

/**
Expand Down Expand Up @@ -411,4 +412,31 @@ function( $data, $page_slug ) {
);
do_action( 'themeisle_internal_page', RAFT_PRODUCT_SLUG, $screen->id );
}

/**
* Add Black Friday data.
*
* @param array $configs The configuration array for the loaded products.
*
* @return array
*/
public function add_black_friday_data( $configs ) {
$config = $configs['default'];

// translators: %1$s - plugin name, %2$s - HTML tag, %3$s - discount, %4$s - HTML tag, %5$s - company name.
$message_template = __( 'Enhance %1$s with %2$s– up to %3$s OFF in our biggest sale of the year. Limited time only.', 'raft' );

$config['dismiss'] = true; // Note: Allow dismiss since it appears on `/wp-admin`.
$config['message'] = sprintf( $message_template, 'Raft', 'Otter Blocks Pro', '70%' );
$config['sale_url'] = add_query_arg(
array(
'utm_term' => 'free',
),
tsdk_translate_link( tsdk_utmify( 'https://themeisle.link/otter-bf', 'bfcm', 'raft' ) )
);

$configs[ RAFT_PRODUCT_SLUG ] = $config;

return $configs;
}
}
Loading