Skip to content

Commit 399035c

Browse files
feat: add Black Friday integration
1 parent 2e026ac commit 399035c

5 files changed

Lines changed: 47 additions & 8 deletions

File tree

includes/library/font-awesome/font-awesome.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public static function _icon_picker_font_media_templates( $template ) {
113113
</div>
114114
</div>
115115
<a class="check" href="#" title="%s"><div class="media-modal-icon"></div></a>',
116-
esc_attr__( 'Deselect', 'icon-picker' )
116+
esc_attr__( 'Deselect', 'menu-icons' )
117117
),
118118
);
119119

includes/library/form-fields.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ final public static function create( array $field, $args = array() ) {
149149
) {
150150
trigger_error(
151151
sprintf(
152+
// translators: %1$s - the name of the class, %2$s - the type of the field.
152153
esc_html__( '%1$s: Type %2$s is not supported, reverting to text.', 'menu-icons' ),
153154
__CLASS__,
154155
esc_html( $field['type'] )

includes/settings.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ public static function get_fields() {
473473
'id' => $menu_key,
474474
'title' => __( 'Current Menu', 'menu-icons' ),
475475
'description' => sprintf(
476+
// translators: %s - the name of the menu.
476477
__( '"%s" menu settings', 'menu-icons' ),
477478
apply_filters( 'single_term_title', $menu_term->name )
478479
),
@@ -770,6 +771,7 @@ public static function _enqueue_assets() {
770771
'all' => __( 'All', 'menu-icons' ),
771772
'preview' => __( 'Preview', 'menu-icons' ),
772773
'settingsInfo' => sprintf(
774+
// translators: %2$s - a link to the Customizer with the label `the customizer`.
773775
'<div> %1$s <p>' . esc_html__( 'Please note that the actual look of the icons on the front-end will also be affected by the style of your active theme. You can add your own CSS using %2$s.', 'menu-icons' ) . '</p></div>',
774776
$box_data,
775777
sprintf(

menu-icons.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ function() {
113113
return array( 'om-editor', 'om-image-block' );
114114
}
115115
);
116+
117+
add_filter( 'themeisle_sdk_blackfriday_data', array( __CLASS__, 'add_black_friday_data' ) );
116118
}
117119

118120

@@ -255,6 +257,33 @@ public static function _upsell_admin_notice() {
255257
</div>
256258
<?php
257259
}
260+
261+
/**
262+
* Add Black Friday data.
263+
*
264+
* @param array $configs The configuration array for the loaded products.
265+
*
266+
* @return array
267+
*/
268+
public static function add_black_friday_data( $configs ) {
269+
$config = $configs['default'];
270+
$product_slug = basename(dirname(__FILE__));
271+
272+
// translators: %1$s - plugin name, %2$s - HTML tag, %3$s - discount, %4$s - HTML tag, %5$s - company name.
273+
$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.', 'menu-icons' );
274+
275+
$config['message'] = sprintf( $message_template, 'Menu Icons', '<strong>', '70%', '</strong>', '<strong>Themeisle</strong>' );
276+
$config['sale_url'] = add_query_arg(
277+
array(
278+
'utm_term' => 'free',
279+
),
280+
tsdk_translate_link( tsdk_utmify( 'https://themeisle.link/all-bf', 'bfcm', 'menu-icons' ) )
281+
);
282+
283+
$configs[ $product_slug ] = $config;
284+
285+
return $configs;
286+
}
258287
}
259288
add_action( 'plugins_loaded', array( 'Menu_Icons', '_load' ) );
260289

phpcs.xml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
<exclude-pattern>lib/*</exclude-pattern>
1111
<exclude-pattern>tests/*</exclude-pattern>
1212

13-
<arg name="extensions" value="php"/>
14-
<arg value="sp"/>
13+
<arg name="extensions" value="php" />
14+
<arg value="sp" />
1515
<arg name="basepath" value="./" />
16-
<arg name="parallel" value="20"/>
16+
<arg name="parallel" value="20" />
1717

1818

1919
<rule ref="WordPress-Core">
2020
<exclude name="Squiz.Commenting" />
21-
<exclude name="WordPress.WhiteSpace.ControlStructureSpacing.ExtraSpaceBeforeCloseParenthesis" />
21+
<exclude
22+
name="WordPress.WhiteSpace.ControlStructureSpacing.ExtraSpaceBeforeCloseParenthesis" />
2223
<exclude name="Squiz.PHP.EmbeddedPhp" />
2324
<exclude name="Generic.Commenting" />
2425
<exclude name="PEAR.Functions.FunctionCallSignature.SpaceBeforeCloseBracket" />
@@ -43,17 +44,23 @@
4344
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
4445
<exclude name="WordPress.Arrays.ArrayDeclarationSpacing" />
4546
<exclude name="Squiz.PHP.CommentedOutCode" />
46-
<exclude name="WordPress.WP.I18n.MissingTranslatorsComment" />
4747
<exclude name="PEAR.Functions.FunctionCallSignature.MultipleArguments" />
4848
</rule>
4949
<rule ref="WordPress-Docs">
5050

5151
</rule>
52-
<config name="testVersion" value="5.6-"/>
52+
<rule ref="WordPress.WP.I18n">
53+
<properties>
54+
<property name="text_domain" type="array">
55+
<element value="menu-icons" />
56+
</property>
57+
</properties>
58+
</rule>
59+
<config name="testVersion" value="5.6-" />
5360
<rule ref="PHPCompatibilityWP">
5461
</rule>
5562
<rule ref="Squiz.Commenting.FunctionComment.ScalarTypeHintMissing">
5663
<severity>0</severity>
5764
</rule>
5865

59-
</ruleset>
66+
</ruleset>

0 commit comments

Comments
 (0)