Skip to content

Commit 2e249d6

Browse files
committed
chore: remove hfg banner upsells
1 parent 5c866bf commit 2e249d6

File tree

10 files changed

+57
-525
lines changed

10 files changed

+57
-525
lines changed

assets/apps/customizer-controls/src/builder-upsell/BannerUpsell.tsx

Lines changed: 0 additions & 102 deletions
This file was deleted.

assets/apps/customizer-controls/src/controls.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import './style.scss';
4040
import Documentation from './documentation-section/Documentation.tsx';
4141
import Instructions from './builder-instructions/Instructions.tsx';
4242
import Upsells from './builder-upsell/Upsells.tsx';
43-
import BannerUpsell from './builder-upsell/BannerUpsell.tsx';
4443
import { initLocalGoogleFonts } from './typography-extra/LocalGoogleFonts';
4544

4645
import MainSearch from './customizer-search/MainSearch.tsx';
@@ -217,34 +216,6 @@ const initUpsellSection = () => {
217216

218217
render(<Upsells control={section} />, section.container[0]);
219218
});
220-
221-
const upsellBannerSections = document.querySelectorAll(
222-
'.control-section.neve-upsell-banner'
223-
);
224-
upsellBannerSections.forEach((node) => {
225-
const slug = node.getAttribute('data-slug');
226-
const section = wp.customize.section(slug);
227-
228-
if (!section) {
229-
return;
230-
}
231-
232-
render(<BannerUpsell control={section} />, section.container[0]);
233-
});
234-
235-
const upsellBannerControls = document.querySelectorAll(
236-
'.customize-control.neve-upsell-banner'
237-
);
238-
upsellBannerControls.forEach((node) => {
239-
const slug = node.getAttribute('data-slug');
240-
const control = wp.customize.control(slug);
241-
242-
if (!control) {
243-
return;
244-
}
245-
246-
render(<BannerUpsell control={control} />, control.container[0]);
247-
});
248219
};
249220

250221
const initQuickLinksSections = () => {

assets/apps/customizer-controls/src/scss/_upsell.scss

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -34,76 +34,3 @@ $upsell_blue: #0065A6 !default;
3434
}
3535
}
3636
}
37-
38-
#acordion-section-neve_hfg_header_upsell_section,
39-
#acordion-section-neve_hfg_footer_upsell_section,
40-
ul[id^=sub-accordion-panel-hfg_] .control-subsection.neve-upsell-banner,
41-
ul[id^=sub-accordion-section-hfg_] .customize-control.neve-upsell-banner {
42-
display: block !important;
43-
&.control-section.neve-upsell-banner,
44-
&.customize-control.neve-upsell-banner {
45-
.upsell-inner {
46-
bottom: 240px;
47-
z-index: 10;
48-
}
49-
}
50-
}
51-
52-
@media (max-width: 960px){
53-
.control-section.neve-upsell-banner .upsell-inner {
54-
bottom: calc(240px + 2vh + 0.8em) !important;
55-
}
56-
}
57-
58-
.control-section.neve-upsell-banner,
59-
.customize-control.neve-upsell-banner {
60-
.upsell-inner {
61-
position: fixed;
62-
bottom: 0;
63-
right: 0;
64-
width: calc(100% - clamp(300px, 18%, 600px) - 12px);
65-
border: none;
66-
.neve-customizer-heading {
67-
border: none;
68-
background-color: $upsell_blue;
69-
color: #fff;
70-
padding: 2px 12px;
71-
display: flex;
72-
align-items: center;
73-
justify-content: start;
74-
gap: 12px;
75-
font-weight: normal;
76-
height: auto;
77-
78-
.accordion-heading {
79-
padding: 8px 2px;
80-
}
81-
82-
.logo {
83-
width: 24px;
84-
filter: grayscale(1) invert(1) brightness(10);
85-
}
86-
87-
.components-button.is-primary {
88-
margin: 6px 6px 6px 24px;
89-
background-color: #fff;
90-
color: $upsell_blue;
91-
font-weight: bold;
92-
&:hover {
93-
background-color: #4f94d4cc;
94-
color: #fff;
95-
}
96-
}
97-
98-
.nv-dismiss-upsell {
99-
color: #fff;
100-
margin-left: auto;
101-
margin-right: 12px;
102-
&:hover {
103-
color: #000;
104-
}
105-
}
106-
}
107-
}
108-
}
109-

assets/customizer/js/upsell.js

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,10 @@
1-
/* global upsellConfig */
2-
wp.customize.bind( 'ready', function () {
3-
const hasBanner = document.getElementById(
4-
'acordion-section-neve_hfg_header_upsell_section'
5-
);
6-
if (typeof upsellConfig !== 'undefined' && !hasBanner) {
7-
const markup =
8-
'<div class="nv-upsell"><div class="nv-upsell-content">' +
9-
upsellConfig.text +
10-
'</div><a rel="external noreferrer noopener" target="_blank" href="' +
11-
upsellConfig.button_url +
12-
'" class="button button-primary">' +
13-
upsellConfig.button_text +
14-
'<span class="components-visually-hidden">' +
15-
upsellConfig.screen_reader +
16-
'</span>' +
17-
'</a></div>';
18-
const elChild = document.createElement( 'li' );
19-
elChild.innerHTML = markup;
20-
const el = document.getElementById( 'sub-accordion-panel-hfg_header' );
21-
el.appendChild( elChild );
22-
}
23-
} );
24-
25-
wp.customize.sectionConstructor.nv_simple_upsell_section = wp.customize.Section.extend(
26-
{
1+
wp.customize.sectionConstructor.nv_simple_upsell_section =
2+
wp.customize.Section.extend({
273
// No events for this type of section.
284
attachEvents() {},
295

306
// Always make the section active.
317
isContextuallyActive() {
328
return true;
339
},
34-
}
35-
);
10+
});

inc/compatibility/starter-content/theme-mods.php

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,7 @@
134134
'fixed' => false,
135135
'useFeatured' => false,
136136
),
137-
'neve_blog_items_border_radius' => 8,
138137
'neve_blog_archive_layout' => 'grid',
139-
'neve_post_excerpt_length' => 35,
140138
'neve_post_meta_ordering' => '["author","comments"]',
141139
'neve_advanced_layout_options' => true,
142140
'neve_blog_archive_sidebar_layout' => 'full-width',
@@ -292,7 +290,6 @@
292290
),
293291
'flag' => false,
294292
),
295-
'neve_single_post_sidebar_layout' => 'full-width',
296293
'neve_other_pages_sidebar_layout' => 'full-width',
297294
'neve_single_post_content_width' => 70,
298295
'neve_other_pages_content_width' => 100,
@@ -839,4 +836,45 @@
839836
'custom_logo' => '{{featured-image-logo}}',
840837
'logo_color' => 'var(--nv-text-color)',
841838
'neve_blog_post_meta_fields' => '[{"slug":"author","title":"' . __( 'Author', 'neve' ) . '","visibility":"yes","hide_on_mobile":"","blocked":"yes"},{"slug":"comments","title":"' . __( 'Comments', 'neve' ) . '","visibility":"yes","hide_on_mobile":"","blocked":"yes"},{"slug":"category","title":"' . __( 'Category', 'neve' ) . '","visibility":"yes","hide_on_mobile":"","blocked":"yes"},{"slug":"date","title":"' . __( 'Date', 'neve' ) . '","visibility":"no","hide_on_mobile":"","blocked":"yes"}]',
839+
// V4 changes.
840+
'neve_blog_items_border_radius' => 8,
841+
'neve_blog_content_padding' => [
842+
'mobile' => [
843+
'top' => 25,
844+
'right' => 25,
845+
'bottom' => 25,
846+
'left' => 25,
847+
],
848+
'tablet' => [
849+
'top' => 25,
850+
'right' => 25,
851+
'bottom' => 25,
852+
'left' => 25,
853+
],
854+
'desktop' => [
855+
'top' => 25,
856+
'right' => 25,
857+
'bottom' => 25,
858+
'left' => 25,
859+
],
860+
'mobile-unit' => 'px',
861+
'tablet-unit' => 'px',
862+
'desktop-unit' => 'px',
863+
],
864+
'neve_enable_card_style' => true,
865+
'neve_blog_grid_card_bg_color' => 'var(--nv-site-bg)',
866+
'neve_blog_grid_text_color' => 'var(--nv-text-color)',
867+
'neve_blog_card_shadow' => 0.5,
868+
'neve_blog_archive_aspect_ratio' => '4-3',
869+
'neve_post_excerpt_length' => 35,
870+
'neve_layout_single_post_elements_order' => wp_json_encode(
871+
[
872+
'title-meta',
873+
'content',
874+
'tags',
875+
'comments',
876+
]
877+
),
878+
'neve_single_post_sidebar_layout' => 'full-width',
879+
'neve_archive_hide_title' => true,
842880
);

inc/core/admin.php

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,6 @@ function () {
6060
add_action( 'wp_ajax_neve_dismiss_welcome_notice', [ $this, 'remove_notice' ] );
6161
}
6262

63-
// load upsell dismiss only if neve pro is not active or license is invalid.
64-
if ( ! $this->has_valid_addons() ) {
65-
add_action(
66-
'wp_ajax_neve_dismiss_customizer_upsell_notice',
67-
[
68-
'Neve\Customizer\Options\Upsells',
69-
'remove_customizer_upsell_notice',
70-
]
71-
);
72-
}
73-
7463
add_action( 'admin_menu', [ $this, 'remove_background_submenu' ], 110 );
7564
add_action( 'after_switch_theme', [ $this, 'get_previous_theme' ] );
7665

@@ -182,11 +171,11 @@ public function register_react_components() {
182171

183172
if ( isset( $deps['chunks'] ) ) {
184173
foreach ( $deps['chunks'] as $chunk_file ) {
185-
174+
186175
$chunk_handle = 'neve-components-chunk-' . $chunk_file;
187176
wp_register_script( $chunk_handle, trailingslashit( NEVE_ASSETS_URL ) . 'apps/components/build/' . $chunk_file, [], $deps['version'], true );
188177
wp_enqueue_script( $chunk_handle );
189-
178+
190179
if ( function_exists( 'wp_set_script_translations' ) ) {
191180
wp_set_script_translations( $chunk_handle, 'neve' );
192181
}
@@ -485,7 +474,7 @@ public function welcome_notice_content() {
485474
</div>
486475
</div>
487476
';
488-
477+
489478
$ob_btn_link = admin_url( 'admin.php?page=' . $theme_page . '&onboarding=yes#starter-sites' );
490479
if ( defined( 'TIOB_PATH' ) ) {
491480
$url_path = 'admin.php?page=tiob-starter-sites';
@@ -535,12 +524,12 @@ public function welcome_notice_content() {
535524
$onboarding_starter_sites_btn,
536525
$onboarding_notice_exit_btn
537526
);
538-
527+
539528
$notice_picture = sprintf(
540529
'<img src="%1$s"/>',
541530
esc_url( $this->get_notice_picture() )
542531
);
543-
532+
544533
$style = '
545534
.nv-notice-wrapper .nv-notice-title {
546535
font-size: 23px;

0 commit comments

Comments
 (0)