Skip to content

Commit

Permalink
release: fixes
Browse files Browse the repository at this point in the history
- Fixed duplicate ID issue with secondary navigation menu
- Fixed translations support on dashboard pages
  • Loading branch information
abaicus authored Jul 31, 2024
2 parents 857c045 + fecc5b6 commit 62fc4b0
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 51 deletions.
16 changes: 8 additions & 8 deletions composer-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5ff6006d935844c41896b3b9f0a56207",
"content-hash": "33a849a1bb965e64c9c96d8d6dd5b79b",
"packages": [
{
"name": "codeinwp/themeisle-sdk",
"version": "3.3.4",
"version": "3.3.27",
"source": {
"type": "git",
"url": "https://github.com/Codeinwp/themeisle-sdk.git",
"reference": "871adb3e4617c408bb6a48f6cb8156b99c8de98a"
"reference": "ae9f1aae6e71677db5de1f579b2275be6fc838f4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/871adb3e4617c408bb6a48f6cb8156b99c8de98a",
"reference": "871adb3e4617c408bb6a48f6cb8156b99c8de98a",
"url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/ae9f1aae6e71677db5de1f579b2275be6fc838f4",
"reference": "ae9f1aae6e71677db5de1f579b2275be6fc838f4",
"shasum": ""
},
"require-dev": {
Expand All @@ -42,9 +42,9 @@
],
"support": {
"issues": "https://github.com/Codeinwp/themeisle-sdk/issues",
"source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.3.4"
"source": "https://github.com/Codeinwp/themeisle-sdk/tree/v3.3.27"
},
"time": "2023-09-18T15:48:59+00:00"
"time": "2024-07-30T06:16:39+00:00"
},
{
"name": "wptt/webfont-loader",
Expand Down Expand Up @@ -989,5 +989,5 @@
"platform-overrides": {
"php": "7.2"
},
"plugin-api-version": "2.3.0"
"plugin-api-version": "2.6.0"
}
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.

2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function() {
'is_enabled' => ! defined( 'NEVE_PRO_VERSION' ),
'pro_name' => 'Neve Pro Addon',
'logo' => get_template_directory_uri() . '/assets/img/dashboard/logo.svg',
'cta_link' => tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/?discount=LOYALUSER582&dvalue=50', 'neve-welcome', 'notice' ),
'cta_link' => tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/?discount=LOYALUSER582&dvalue=50', 'neve-welcome', 'notice' ), 'query' ),
];
}
);
Expand Down
4 changes: 2 additions & 2 deletions header-footer-grid/Core/Builder/Footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function init() {
'footer_copyright_content' => array(
'label' => esc_html__( 'Change Copyright', 'neve' ),
'icon' => 'dashicons-nametag',
'url' => $this->has_valid_addons() ? null : tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'copyright' ),
'url' => $this->has_valid_addons() ? null : tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'copyright' ), 'query' ),
),
'hfg_footer_layout_bottom_background' => array(
'label' => esc_html__( 'Change Footer Color', 'neve' ),
Expand Down Expand Up @@ -156,7 +156,7 @@ public function add_footer_component( $builder, $row, $slot ) {
$output .= sprintf(
/* translators: %1$s is Theme Name ( Neve ), %2$s is WordPress */
esc_html__( '%1$s | Powered by %2$s', 'neve' ),
wp_kses_post( '<p><a href="https://themeisle.com/themes/neve/" rel="nofollow">Neve</a>' ),
wp_kses_post( '<p><a href="' . tsdk_translate_link( 'https://themeisle.com/themes/neve/', 'path' ) . '" rel="nofollow">Neve</a>' ),
wp_kses_post( '<a href="https://wordpress.org" rel="nofollow">WordPress</a></p>' )
);
$output .= '</div></div></div></div>';
Expand Down
2 changes: 1 addition & 1 deletion header-footer-grid/Core/Components/SecondNav.php
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public function add_settings() {
*/
public function render_component() {
do_action( 'neve_before_render_nav', $this->get_id() );
Main::get_instance()->load( 'components/component-nav-secondary' );
Main::get_instance()->load( 'components/component-nav-secondary', '', $this->args );
do_action( 'neve_after_render_nav', $this->get_id() );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@
namespace HFG;

use HFG\Core\Components\SecondNav;
use HFG\Core\Builder\Header as HeaderBuilder;

$style = component_setting( SecondNav::STYLE_ID );

$style = component_setting( SecondNav::STYLE_ID );
$device_class = isset( $args ) && ! empty( $args ) ? $args['device'] : '';
$container_classes = [ 'nav-menu-secondary' ];

if ( $style !== 'style-plain' ) {
$container_classes[] = $style;
$container_classes[] = 'm-style';
}

$menu_id = SecondNav::COMPONENT_ID . '-' . $device_class . '-' . current_row( HeaderBuilder::BUILDER_NAME );
?>
<div class="nv-top-bar">
<div role="navigation" class="menu-content <?php echo esc_attr( join( ' ', $container_classes ) ); ?>"
Expand All @@ -28,7 +30,7 @@
array(
'theme_location' => 'top-bar',
'menu_class' => 'nav-ul',
'menu_id' => 'secondary-menu',
'menu_id' => $menu_id,
'container' => 'ul',
'depth' => - 1,
'fallback_cb' => '__return_false',
Expand Down
16 changes: 8 additions & 8 deletions inc/admin/dashboard/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function () use ( $filtered_name ) {
// Add predefined product pages to the about page.
'product_pages' => [ 'otter-page' ],
// Upgrade menu item link & text
'upgrade_link' => tsdk_utmify( esc_url( 'https://themeisle.com/themes/neve/upgrade/' ), 'aboutfilter', 'nevedashboard' ),
'upgrade_link' => tsdk_translate_link( tsdk_utmify( esc_url( 'https://themeisle.com/themes/neve/upgrade/' ), 'aboutfilter', 'nevedashboard' ), 'query' ),
'upgrade_text' => __( 'Upgrade', 'neve' ) . ' ' . $filtered_name,
];
}
Expand Down Expand Up @@ -299,7 +299,7 @@ public function enqueue() {

$build_path = get_template_directory_uri() . '/assets/apps/dashboard/build/';
$dependencies = ( include get_template_directory() . '/assets/apps/dashboard/build/dashboard.asset.php' );

wp_register_style( 'neve-dash-style', $build_path . 'style-dashboard.css', [ 'wp-components', 'neve-components' ], $dependencies['version'] );
wp_style_add_data( 'neve-dash-style', 'rtl', 'replace' );
wp_enqueue_style( 'neve-dash-style' );
Expand Down Expand Up @@ -339,10 +339,10 @@ private function get_localization() {
'plugins' => $this->get_useful_plugins(),
'featureData' => $this->get_free_pro_features(),
'showFeedbackNotice' => $this->should_show_feedback_notice(),
'allfeaturesNeveProURL' => tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'seeallfeatures', 'freevspropage' ),
'startSitesgetNeveProURL' => tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'welcomestartersitescard', 'nevedashboard' ),
'customLayoutsNeveProURL' => tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'customlayoutscard', 'nevedashboard' ),
'upgradeURL' => apply_filters( 'neve_upgrade_link_from_child_theme_filter', tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'getpronow', 'freevspropage' ) ),
'allfeaturesNeveProURL' => tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'seeallfeatures', 'freevspropage' ), 'query' ),
'startSitesgetNeveProURL' => tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'welcomestartersitescard', 'nevedashboard' ), 'query' ),
'customLayoutsNeveProURL' => tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'customlayoutscard', 'nevedashboard' ), 'query' ),
'upgradeURL' => apply_filters( 'neve_upgrade_link_from_child_theme_filter', tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'getpronow', 'freevspropage' ), 'query' ) ),
'supportURL' => esc_url( 'https://wordpress.org/support/theme/neve/' ),
'docsURL' => esc_url( 'https://docs.themeisle.com/article/946-neve-doc' ),
'codexURL' => esc_url( 'https://codex.nevewp.com/' ),
Expand Down Expand Up @@ -371,7 +371,7 @@ private function get_localization() {
'licenseCardDescription' => sprintf(
// translators: store name (Themeisle)
__( 'Enter your license from %1$s purchase history in order to get plugin updates', 'neve' ),
'<a target="_blank" rel="external noreferrer noopener" href="https://store.themeisle.com/">ThemeIsle<span class="components-visually-hidden">' . esc_html__( '(opens in a new tab)', 'neve' ) . '</span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" class="components-external-link__icon" role="img" aria-hidden="true" focusable="false" style="fill: #0073AA"><path d="M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"></path></svg></a>'
'<a target="_blank" rel="external noreferrer noopener" href="' . tsdk_translate_link( 'https://store.themeisle.com/', 'query' ) . '">ThemeIsle<span class="components-visually-hidden">' . esc_html__( '(opens in a new tab)', 'neve' ) . '</span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" class="components-external-link__icon" role="img" aria-hidden="true" focusable="false" style="fill: #0073AA"><path d="M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"></path></svg></a>'
),
],
'changelog' => $this->cl_handler->get_changelog( get_template_directory() . '/CHANGELOG.md' ),
Expand Down Expand Up @@ -470,7 +470,7 @@ public function get_notifications() {
__( 'From 3.3.0 we decided to remove the copyright component from the free version. You can continue using it if you rollback to 3.2.x or you can upgrade to pro, using a one time 50%% discount: %s', 'neve' ),
wp_kses_post( '<code>NEVEBRANDING50</code>' )
),
'url' => tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'copyrightnotice', 'nevedashboard' ),
'url' => tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'copyrightnotice', 'nevedashboard' ), 'query' ),
'targetBlank' => true,
'cta' => __( 'Upgrade', 'neve' ),
];
Expand Down
2 changes: 1 addition & 1 deletion inc/admin/hooks_upsells.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function () use ( $hook_value, $hook_label, $upsell_label ) {
if ( 'woocommerce_before_shop_loop_item' === $hook_value ) {
$style = 'max-width: 200px;';
}
$upsell_url = tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'viewhooks' );
$upsell_url = tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'viewhooks' ), 'query' );
echo '<div class="nv-hook-wrapper nv-hook-upsell-wrapper">';
echo '<div class="nv-hook-placeholder">';
echo '<a href="' . esc_url( $upsell_url ) . '" title="' . esc_attr( $upsell_label ) . '" target="_blank">';
Expand Down
1 change: 1 addition & 0 deletions inc/core/core_loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ function () {
add_action( 'wp_enqueue_scripts', array( $front_end, 'enqueue_scripts' ) );
add_action( 'after_setup_theme', array( $front_end, 'setup_theme' ) );
add_action( 'widgets_init', array( $front_end, 'register_sidebars' ) );
add_filter( 'load_script_translation_file', array( $front_end, 'fix_script_translation_files' ), 10, 3 );
}

/**
Expand Down
25 changes: 25 additions & 0 deletions inc/core/front_end.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,4 +573,29 @@ public function css_global_custom_colors( $current_styles, $context ) {

return $current_styles;
}

/**
* Fix script translations language directory.
*
* @param string | false $file File path.
* @param string $handle Script handle.
* @param string $domain Script text domain.
*
* @return string | false
*/
public function fix_script_translation_files( $file, $handle, $domain ) {
if ( ! $file || $domain !== 'neve' ) {
return $file;
}

if ( is_file( $file ) ) {
return $file;
}

if ( strpos( $file, WP_LANG_DIR . '/plugins' ) !== false ) {
$file = str_replace( WP_LANG_DIR . '/plugins', WP_LANG_DIR . '/themes', $file );
}

return $file;
}
}
6 changes: 3 additions & 3 deletions inc/customizer/loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function enqueue_customizer_controls() {
'controls' => array(),
'options' => array(),
),
'upsellComponentsLink' => tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'hfgcomponents' ),
'upsellComponentsLink' => tsdk_translate_link( tsdk_utmify( 'https://themeisle.com/themes/neve/upgrade/', 'hfgcomponents' ), 'query' ),
'fonts' => array(
'System' => neve_get_standard_fonts(),
'Google' => neve_get_google_fonts(),
Expand Down Expand Up @@ -168,11 +168,11 @@ public function enqueue_customizer_controls() {

if ( isset( $dependencies['chunks'] ) ) {
foreach ( $dependencies['chunks'] as $chunk_file ) {

$chunk_handle = 'neve-customizer-chunk-' . $chunk_file;
wp_register_script( $chunk_handle, $bundle_path . $chunk_file, [], $dependencies['version'], true );
wp_enqueue_script( $chunk_handle );

if ( function_exists( 'wp_set_script_translations' ) ) {
wp_set_script_translations( $chunk_handle, 'neve' );
}
Expand Down
Loading

0 comments on commit 62fc4b0

Please sign in to comment.