diff --git a/CHANGELOG.md b/CHANGELOG.md index eb0ee461a5..14c265e029 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,18 @@ +##### [Version 3.1.3](https://github.com/Codeinwp/neve/compare/v3.1.2...v3.1.3) (2022-01-06) + +- [Fix] Sidebar positioning on the shop page +- [Fix] Hide the whole page cover when hiding title in page meta +- [Fix] Conflict between Neve, Relevanssi Premium, and Elementor Pro +- [Fix] Radio-image customizer control console errors +- Improve the font-weight control to display only the weights that are available for the selected font + ##### [Version 3.1.2](https://github.com/Codeinwp/neve/compare/v3.1.1...v3.1.2) (2021-12-23) - [Fix] 'neve_before_pagination' not working on the first page - [Fix] Mega menu issue on mobile - [Fix] Primary navigation menu links to in-page sections have active color - [Fix] Adds left and right border when a user is editing table contents -- [Feat[ Add documentation section in customizer +- [Feat] Add documentation section in customizer - Remove the description in the header components selector popup - Improve upsells to better inform about pro functionality - Keep upsells when the license is invalid diff --git a/assets/apps/components/package.json b/assets/apps/components/package.json index dd470b79d2..7b723916ec 100644 --- a/assets/apps/components/package.json +++ b/assets/apps/components/package.json @@ -1,6 +1,6 @@ { "name": "@neve-wp/components", - "version": "0.0.21", + "version": "0.0.22", "description": "Neve React Components", "author": "themeisle ", "license": "GPL-2.0-or-later", diff --git a/assets/apps/components/src/Controls/RadioImage.js b/assets/apps/components/src/Controls/RadioImage.js index 9370554f89..0e908d3de4 100644 --- a/assets/apps/components/src/Controls/RadioImage.js +++ b/assets/apps/components/src/Controls/RadioImage.js @@ -40,34 +40,47 @@ const RadioImage = ({ choices, onClick, value, label, documentation }) => { {Object.keys(choices).map((choice, index) => { const { name, image, url, upsellUrl } = choices[choice]; const divClass = classnames([ - { option: true, upsell: typeof upsellUrl !== 'undefined' }, + { + option: true, + upsell: typeof upsellUrl !== 'undefined', + }, ]); const buttonClass = classnames([ - { active: choice === value,}, + { active: choice === value }, ]); return ( - <> -
- {/*eslint-disable-next-line jsx-a11y/label-has-for */} - - {upsellUrl && UNLOCK } -
- +
+ {/*eslint-disable-next-line jsx-a11y/label-has-for */} + + {upsellUrl && ( + + UNLOCK + + + )} +
); })} diff --git a/assets/apps/customizer-controls/src/typeface/Typeface.js b/assets/apps/customizer-controls/src/typeface/Typeface.js index 216e221fbb..cf71310819 100644 --- a/assets/apps/customizer-controls/src/typeface/Typeface.js +++ b/assets/apps/customizer-controls/src/typeface/Typeface.js @@ -1,4 +1,5 @@ -import { useState } from '@wordpress/element'; +/* global NeveReactCustomize */ +import { useState, useEffect } from '@wordpress/element'; import { __ } from '@wordpress/i18n'; import { InlineSelect, NumberControl } from '@neve-wp/components'; import PropTypes from 'prop-types'; @@ -8,6 +9,7 @@ const Typeface = (props) => { const { label, + fontFamilyControl, withTextTransform = true, value = { fontSize: { @@ -69,6 +71,20 @@ const Typeface = (props) => { }, } = props; + const [fontFamily, setFontFamily] = useState( + wp.customize.control(fontFamilyControl) + ? wp.customize.control(fontFamilyControl).setting() + : '' + ); + + useEffect(() => { + window.wp.customize.bind('change', (setting) => { + if (setting.id === fontFamilyControl) { + setFontFamily(setting.get()); + } + }); + }, []); + const renderTextTransform = () => { if (!withTextTransform) { return; @@ -106,22 +122,39 @@ const Typeface = (props) => { fontWeight = 'none'; } + const { fontVariants, systemFontVariants } = NeveReactCustomize; + const allFontVariants = { ...fontVariants, ...systemFontVariants }; + const defaultOptions = [ + { value: 'none', label: __('None', 'neve') }, + { value: 100, label: '100' }, + { value: 200, label: '200' }, + { value: 300, label: '300' }, + { value: 400, label: '400' }, + { value: 500, label: '500' }, + { value: 600, label: '600' }, + { value: 700, label: '700' }, + { value: 800, label: '800' }, + { value: 900, label: '900' }, + ]; + + let options; + if (allFontVariants[fontFamily] !== undefined) { + options = allFontVariants[fontFamily] + .filter((fv) => !fv.includes('italic')) + .reduce( + (acc, curr) => [ + ...acc, + { value: parseInt(curr), label: curr }, + ], + [{ value: 'none', label: __('None', 'neve') }] + ); + } + return ( { onChange({ fontWeight: nextValue }); if (nextValue === 'none' && refreshAfterReset) { diff --git a/assets/apps/customizer-controls/src/typeface/TypefaceComponent.js b/assets/apps/customizer-controls/src/typeface/TypefaceComponent.js index 372c863b22..eb9f47dcf8 100644 --- a/assets/apps/customizer-controls/src/typeface/TypefaceComponent.js +++ b/assets/apps/customizer-controls/src/typeface/TypefaceComponent.js @@ -1,4 +1,4 @@ -/*eslint camelcase: ["error", {allow: ["text_transform","weight_default","refresh_on_reset","letter_spacing_default","line_height_units","disable_transform","size_default","size_units","line_height_default"]}]*/ +/*eslint camelcase: ["error", {allow: ["text_transform","weight_default","refresh_on_reset","font_family_control","letter_spacing_default","line_height_units","disable_transform","size_default","size_units","line_height_default"]}]*/ import PropTypes from 'prop-types'; import { useState } from '@wordpress/element'; @@ -146,7 +146,7 @@ const TypefaceComponent = ({ control }) => { }); }; - const { label, refresh_on_reset } = control.params; + const { label, font_family_control, refresh_on_reset } = control.params; const { disable_transform, size_default, @@ -160,6 +160,7 @@ const TypefaceComponent = ({ control }) => { array( '400', '700', '400italic', '700italic' ), + 'Arial Black, Gadget, sans-serif' => array( '900', '900italic' ), + 'Bookman Old Style, serif' => array( '400', '700', '400italic', '700italic' ), + 'Comic Sans MS, cursive' => array( '400', '700', '400italic', '700italic' ), + 'Courier, monospace' => array( '400', '700', '400italic', '700italic' ), + 'Georgia, serif' => array( '400', '700', '400italic', '700italic' ), + 'Garamond, serif' => array( '400', '700', '400italic', '700italic' ), + 'Impact, Charcoal, sans-serif' => array( '400', '700', '400italic', '700italic' ), + 'Lucida Console, Monaco, monospace' => array( '400', '700', '400italic', '700italic' ), + 'Lucida Sans Unicode, Lucida Grande, sans-serif' => array( '400', '700', '400italic', '700italic' ), + 'MS Sans Serif, Geneva, sans-serif' => array( '400', '700', '400italic', '700italic' ), + 'MS Serif, New York, sans-serif' => array( '400', '700', '400italic', '700italic' ), + 'Palatino Linotype, Book Antiqua, Palatino, serif' => array( '400', '700', '400italic', '700italic' ), + 'Tahoma, Geneva, sans-serif' => array( '400', '700', '400italic', '700italic' ), + 'Times New Roman, Times, serif' => array( '400', '700', '400italic', '700italic' ), + 'Trebuchet MS, Helvetica, sans-serif' => array( '400', '700', '400italic', '700italic' ), + 'Verdana, Geneva, sans-serif' => array( '400', '700', '400italic', '700italic' ), + 'Paratina Linotype' => array( '400', '700', '400italic', '700italic' ), + 'Trebuchet MS' => array( '400', '700', '400italic', '700italic' ), ); + + if ( $with_variants ) { + return apply_filters( 'neve_standard_fonts_with_variants_array', $fonts ); + } + + return apply_filters( 'neve_standard_fonts_array', array_keys( $fonts ) ); } /** diff --git a/header-footer-grid/Core/Components/Abstract_Component.php b/header-footer-grid/Core/Components/Abstract_Component.php index f3fa01c3a8..86c59d78f6 100644 --- a/header-footer-grid/Core/Components/Abstract_Component.php +++ b/header-footer-grid/Core/Components/Abstract_Component.php @@ -949,13 +949,14 @@ private function add_typography_controls() { 'default' => $this->typography_default, 'sanitize_callback' => 'neve_sanitize_typography_control', 'options' => [ - 'input_attrs' => array( + 'input_attrs' => array( 'size_units' => [ 'em', 'px' ], 'weight_default' => $this->typography_default['fontWeight'], 'size_default' => $this->typography_default['fontSize'], 'line_height_default' => $this->typography_default['lineHeight'], 'letter_spacing_default' => $this->typography_default['letterSpacing'], ), + 'font_family_control' => $this->get_id() . '_' . self::FONT_FAMILY_ID, ], ] ); diff --git a/inc/compatibility/elementor.php b/inc/compatibility/elementor.php index 7024ceb1cd..e49aace0cc 100644 --- a/inc/compatibility/elementor.php +++ b/inc/compatibility/elementor.php @@ -17,13 +17,6 @@ */ class Elementor extends Page_Builder_Base { - /** - * Elementor location manager - * - * @var \ElementorPro\Modules\ThemeBuilder\Classes\Locations_Manager - */ - public $elementor_location_manager; - /** * Init function. */ @@ -156,6 +149,10 @@ public function add_theme_builder_hooks() { // Elementor locations compatibility. (This action fires by Elementor Pro) add_action( 'elementor/theme/register_locations', array( $this, 'register_theme_locations' ) ); + if ( ! function_exists( 'elementor_theme_do_location' ) ) { + return; + } + // Override theme templates. add_action( 'neve_do_top_bar', array( $this, 'do_header' ), 0 ); add_action( 'neve_do_header', array( $this, 'do_header' ), 0 ); @@ -174,14 +171,13 @@ public function add_theme_builder_hooks() { */ public function register_theme_locations( $manager ) { $manager->register_all_core_location(); - $this->elementor_location_manager = \ElementorPro\Modules\ThemeBuilder\Module::instance()->get_locations_manager(); } /** * Remove actions for elementor header to act properly. */ public function do_header() { - $did_location = $this->elementor_location_manager->do_location( 'header' ); + $did_location = elementor_theme_do_location( 'header' ); if ( $did_location ) { remove_all_actions( 'neve_do_top_bar' ); remove_all_actions( 'neve_do_header' ); @@ -192,7 +188,7 @@ public function do_header() { * Remove actions for elementor footer to act properly. */ public function do_footer() { - $did_location = $this->elementor_location_manager->do_location( 'footer' ); + $did_location = elementor_theme_do_location( 'footer' ); if ( $did_location ) { remove_all_actions( 'neve_do_footer' ); } @@ -205,7 +201,7 @@ public function do_404() { if ( ! is_404() ) { return; } - $did_location = $this->elementor_location_manager->do_location( 'single' ); + $did_location = elementor_theme_do_location( 'single' ); if ( $did_location ) { remove_all_actions( 'neve_do_404' ); } @@ -215,7 +211,7 @@ public function do_404() { * Remove actions for elementor single post to act properly. */ public function do_single_post() { - $did_location = $this->elementor_location_manager->do_location( 'single' ); + $did_location = elementor_theme_do_location( 'single' ); if ( $did_location ) { remove_all_actions( 'neve_do_single_post' ); } @@ -225,7 +221,7 @@ public function do_single_post() { * Remove actions for elementor single page to act properly. */ public function do_single_page() { - $did_location = $this->elementor_location_manager->do_location( 'single' ); + $did_location = elementor_theme_do_location( 'single' ); if ( $did_location ) { remove_all_actions( 'neve_do_single_page' ); } diff --git a/inc/customizer/controls/react/typography.php b/inc/customizer/controls/react/typography.php index cd9b6627b2..4b161a7a00 100644 --- a/inc/customizer/controls/react/typography.php +++ b/inc/customizer/controls/react/typography.php @@ -31,13 +31,20 @@ class Typography extends \WP_Customize_Control { * @var bool */ public $refresh_on_reset = false; + /** + * The control that holds the font family used by this control + * + * @var string + */ + public $font_family_control = ''; /** * Send to JS. */ public function to_json() { parent::to_json(); - $this->json['input_attrs'] = is_array( $this->input_attrs ) ? wp_json_encode( $this->input_attrs ) : $this->input_attrs; - $this->json['refresh_on_reset'] = $this->refresh_on_reset; + $this->json['input_attrs'] = is_array( $this->input_attrs ) ? wp_json_encode( $this->input_attrs ) : $this->input_attrs; + $this->json['refresh_on_reset'] = $this->refresh_on_reset; + $this->json['font_family_control'] = $this->font_family_control; } } diff --git a/inc/customizer/loader.php b/inc/customizer/loader.php index cd87ffd402..ca2d349ed3 100755 --- a/inc/customizer/loader.php +++ b/inc/customizer/loader.php @@ -129,6 +129,7 @@ public function enqueue_customizer_controls() { 'Google' => neve_get_google_fonts(), ), 'fontVariants' => neve_get_google_fonts( true ), + 'systemFontVariants' => neve_get_standard_fonts( true ), 'hideConditionalHeaderSelector' => ! neve_can_use_conditional_header(), 'dashUpdatesMessage' => sprintf( 'Please %s to the latest version of Neve Pro to manage the conditional headers.', '' . __( 'update', 'neve' ) . '' ), 'bundlePath' => get_template_directory_uri() . '/assets/apps/customizer-controls/build/', diff --git a/inc/customizer/options/buttons.php b/inc/customizer/options/buttons.php index 3bd4c9c4f9..a265d4a02a 100644 --- a/inc/customizer/options/buttons.php +++ b/inc/customizer/options/buttons.php @@ -127,6 +127,7 @@ public function add_controls() { ), ), 'type' => 'neve_typeface_control', + 'font_family_control' => 'neve_body_font_family', 'live_refresh_selector' => true, 'live_refresh_css_prop' => [ 'cssVar' => [ diff --git a/inc/customizer/options/form_fields.php b/inc/customizer/options/form_fields.php index 00d60e1ac9..b69a10d4c3 100644 --- a/inc/customizer/options/form_fields.php +++ b/inc/customizer/options/form_fields.php @@ -423,6 +423,7 @@ private function add_input_text_controls() { ), ), 'type' => 'neve_typeface_control', + 'font_family_control' => 'neve_body_font_family', 'refresh_on_reset' => true, 'live_refresh_selector' => ' form input:read-write, @@ -523,6 +524,7 @@ private function add_form_labels_controls() { ], ], 'type' => 'neve_typeface_control', + 'font_family_control' => 'neve_body_font_family', 'refresh_on_reset' => true, 'live_refresh_selector' => 'form label, body .wpforms-container .wpforms-field-label, .woocommerce form .form-row label', 'live_refresh_css_prop' => [ diff --git a/inc/customizer/options/typography.php b/inc/customizer/options/typography.php index 2e43eea0bf..5c402880a0 100644 --- a/inc/customizer/options/typography.php +++ b/inc/customizer/options/typography.php @@ -135,6 +135,7 @@ private function controls_typography_general() { 'letter_spacing_default' => $defaults['letterSpacing'], ), 'type' => 'neve_typeface_control', + 'font_family_control' => 'neve_body_font_family', 'live_refresh_selector' => 'body, .site-title', ], '\Neve\Customizer\Controls\React\Typography' @@ -256,6 +257,7 @@ private function controls_typography_headings() { 'letter_spacing_default' => $default_values['letterSpacing'], ), 'type' => 'neve_typeface_control', + 'font_family_control' => 'neve_headings_font_family', 'live_refresh_selector' => $selectors[ $heading_id ], 'live_refresh_css_prop' => [ 'cssVar' => [ @@ -295,32 +297,38 @@ private function controls_typography_blog() { 'label' => __( 'Post title', 'neve' ), 'category_label' => __( 'Blog Archive', 'neve' ), 'priority' => 10, + 'font_family_control' => 'neve_headings_font_family', 'live_refresh_selector' => '.blog .blog-entry-title, .archive .blog-entry-title', ), 'neve_archive_typography_post_excerpt' => array( 'label' => __( 'Post excerpt', 'neve' ), 'priority' => 20, + 'font_family_control' => 'neve_body_font_family', 'live_refresh_selector' => '.blog .entry-summary, .archive .entry-summary, .blog .post-pages-links', ), 'neve_archive_typography_post_meta' => array( 'label' => __( 'Post meta', 'neve' ), 'priority' => 30, + 'font_family_control' => 'neve_body_font_family', 'live_refresh_selector' => '.blog .nv-meta-list li, .archive .nv-meta-list li', ), 'neve_single_post_typography_post_title' => array( 'label' => __( 'Post title', 'neve' ), 'category_label' => __( 'Single Post', 'neve' ), 'priority' => 40, + 'font_family_control' => 'neve_headings_font_family', 'live_refresh_selector' => '.single h1.entry-title', ), 'neve_single_post_typography_post_meta' => array( 'label' => __( 'Post meta', 'neve' ), 'priority' => 50, + 'font_family_control' => 'neve_body_font_family', 'live_refresh_selector' => '.single .nv-meta-list li', ), 'neve_single_post_typography_comments_title' => array( 'label' => __( 'Comments reply title', 'neve' ), 'priority' => 60, + 'font_family_control' => 'neve_headings_font_family', 'live_refresh_selector' => '.single .comment-reply-title', ), ); @@ -361,6 +369,7 @@ private function controls_typography_blog() { 'priority' => $control_settings['priority'] += 1, 'section' => 'neve_typography_blog', 'type' => 'neve_typeface_control', + 'font_family_control' => $control_settings['font_family_control'], 'live_refresh_selector' => neve_is_new_skin() ? true : $control_settings['live_refresh_selector'], 'live_refresh_css_prop' => [ 'cssVar' => [ diff --git a/inc/views/cover_header.php b/inc/views/cover_header.php index 81d7ad187e..9cbf2c9105 100644 --- a/inc/views/cover_header.php +++ b/inc/views/cover_header.php @@ -75,32 +75,32 @@ public function render_cover_header() { $cover_style = 'style="' . $cover_style . '"'; } - $hide_title = false; if ( $context === 'page' ) { $hide_title = get_theme_mod( 'neve_page_hide_title', false ); $specific_hide_title = get_post_meta( get_the_ID(), 'neve_meta_disable_title', true ); - if ( ! empty( $specific_hide_title ) ) { - $hide_title = $specific_hide_title === 'on'; + $hide_title = ! empty( $specific_hide_title ) ? $specific_hide_title === 'on' : $hide_title; + if ( $hide_title ) { + return; } } echo '
'; echo '
'; echo $container_mode === 'contained' ? '
' : ''; + echo '
'; - if ( ! $hide_title ) { - echo '
'; - if ( $meta_before === true ) { - Post_Layout::render_post_meta(); - } - do_action( 'neve_before_post_title' ); - echo '

' . wp_kses_post( get_the_title() ) . '

'; - if ( $meta_before === false ) { - Post_Layout::render_post_meta(); - } - echo '
'; + if ( $meta_before === true ) { + Post_Layout::render_post_meta(); + } + + do_action( 'neve_before_post_title' ); + + echo '

' . wp_kses_post( get_the_title() ) . '

'; + if ( $meta_before === false ) { + Post_Layout::render_post_meta(); } + echo '
'; echo $container_mode === 'contained' ? '
' : ''; echo '
'; } diff --git a/inc/views/pluggable/metabox_settings.php b/inc/views/pluggable/metabox_settings.php index 975c9d3691..5f41873c6e 100644 --- a/inc/views/pluggable/metabox_settings.php +++ b/inc/views/pluggable/metabox_settings.php @@ -159,6 +159,11 @@ private function get_post_id() { return false; } + // On shop page the returning id is the id of the first product. We need the id of the page. + if ( class_exists( 'WooCommerce' ) && is_shop() ) { + return wc_get_page_id( 'shop' ); + } + global $post; if ( empty( $post ) ) { return false; diff --git a/package.json b/package.json index 6790a9d64c..150943faca 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "neve", "nicename": "Neve", - "version": "3.1.2", + "version": "3.1.3", "description": "Neve theme by ThemeIsle", "category": "themes", "author": "ThemeIsle ", diff --git a/readme.md b/readme.md index 8d08219285..007c9c45a1 100644 --- a/readme.md +++ b/readme.md @@ -19,6 +19,17 @@ Neve is distributed under the terms of the GNU GPLv2 or later ## Changelog ## +##### [Version 3.1.3](https://github.com/Codeinwp/neve/compare/v3.1.2...v3.1.3) (2022-01-06) + +- [Fix] Sidebar positioning on the shop page +- [Fix] Hide the whole page cover when hiding title in page meta +- [Fix] Conflict between Neve, Relevanssi Premium, and Elementor Pro +- [Fix] Radio-image customizer control console errors +- Improve the font-weight control to display only the weights that are available for the selected font + + + + ##### [Version 3.1.2](https://github.com/Codeinwp/neve/compare/v3.1.1...v3.1.2) (2021-12-23) - [Fix] 'neve_before_pagination' not working on the first page diff --git a/readme.txt b/readme.txt index fb616d39b4..7fe87549ad 100644 --- a/readme.txt +++ b/readme.txt @@ -19,6 +19,17 @@ Neve is distributed under the terms of the GNU GPLv2 or later == Changelog == +##### [Version 3.1.3](https://github.com/Codeinwp/neve/compare/v3.1.2...v3.1.3) (2022-01-06) + +- [Fix] Sidebar positioning on the shop page +- [Fix] Hide the whole page cover when hiding title in page meta +- [Fix] Conflict between Neve, Relevanssi Premium, and Elementor Pro +- [Fix] Radio-image customizer control console errors +- Improve the font-weight control to display only the weights that are available for the selected font + + + + ##### [Version 3.1.2](https://github.com/Codeinwp/neve/compare/v3.1.1...v3.1.2) (2021-12-23) - [Fix] 'neve_before_pagination' not working on the first page diff --git a/style.css b/style.css index dd6ca106b5..96aee497df 100644 --- a/style.css +++ b/style.css @@ -7,7 +7,7 @@ Tested up to: 5.8 Requires PHP: 7.0 Requires at least: 5.4 Description: Neve is a super fast, easily customizable, multi-purpose theme. It’s perfect for blogs, small business, startups, agencies, firms, e-commerce shops (WooCommerce storefront) as well as personal portfolio sites and most types of projects. A fully AMP optimized and responsive theme, Neve will load in mere seconds and adapt perfectly on any viewing device. While it is lightweight and has a minimalist design, the theme is highly extendable, it has a highly SEO optimized code, resulting in top rankings in Google search results. Neve works perfectly with Gutenberg and the most popular page builders (Elementor, Brizy, Beaver Builder, Visual Composer, SiteOrigin, Divi). Neve is also WooCommerce ready, responsive, RTL & translation ready. Look no further. Neve is the perfect theme for you! -Version: 3.1.2 +Version: 3.1.3 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: neve