Skip to content

Commit

Permalink
v 3.10.0
Browse files Browse the repository at this point in the history
- Multilingual social links.
- Remove jQuery Version replace.
- Update Clipboard.min.js.
  • Loading branch information
Darklg committed Nov 21, 2023
1 parent 547911f commit 79e1da8
Show file tree
Hide file tree
Showing 8 changed files with 1,897 additions and 443 deletions.
2,287 changes: 1,876 additions & 411 deletions css/main.css

Large diffs are not rendered by default.

30 changes: 7 additions & 23 deletions inc/assets/scripts.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
<?php
include dirname(__FILE__) . '/../../z-protect.php';

/* ----------------------------------------------------------
Replace jQuery Version
---------------------------------------------------------- */

add_action('wp_enqueue_scripts', 'wputh_disable_jqmigrate');
function wputh_disable_jqmigrate() {
if (is_admin()) {
return;
}
if (!is_object($GLOBALS['wp_scripts']) || !isset($GLOBALS['wp_scripts']->registered['jquery']->ver)) {
return;
}
if ($GLOBALS['wp_scripts']->registered['jquery']->ver == '3.5.1') {
wp_deregister_script('jquery');
wp_register_script('jquery', get_theme_file_uri('/js/libs/jquery-3.5.1.min.js'), array(), '3.5.1');
}
}

/* ----------------------------------------------------------
Common libraries
---------------------------------------------------------- */
Expand All @@ -36,13 +18,15 @@ function wputh_common_libraries() {
wp_enqueue_style('wputh-simplebar-css', get_theme_file_uri('/js/libs/simplebar/simplebar.css'), array(), '5.3.6');
}
if (apply_filters('wputh_common_libraries__juxtapose', false)) {
wp_enqueue_script('wputh-juxtapose-js', get_theme_file_uri('/js/libs/juxtapose/js/juxtapose.min.js'), array(), '1.2.1', true);
wp_enqueue_script('wputh-juxtapose-init-js', get_theme_file_uri('/js/libs/juxtapose-init.js'), array('jquery', 'wputh-juxtapose-js'), '1.2.1', true);
wp_enqueue_style('wputh-juxtapose-css', get_theme_file_uri('/js/libs/juxtapose/css/juxtapose.css'), array(), '1.2.1');
$juxtapose_version = '1.2.1';
wp_enqueue_script('wputh-juxtapose-js', get_theme_file_uri('/js/libs/juxtapose/js/juxtapose.min.js'), array(), $juxtapose_version, true);
wp_enqueue_script('wputh-juxtapose-init-js', get_theme_file_uri('/js/libs/juxtapose-init.js'), array('jquery', 'wputh-juxtapose-js'), $juxtapose_version, true);
wp_enqueue_style('wputh-juxtapose-css', get_theme_file_uri('/js/libs/juxtapose/css/juxtapose.css'), array(), $juxtapose_version);
}
if (apply_filters('wputh_common_libraries__clipboard', false)) {
wp_enqueue_script('wputh-clipboard-js', get_theme_file_uri('/js/libs/clipboard/clipboard.min.js'), array(), '2.0.8', true);
wp_enqueue_script('wputh-clipboard-init-js', get_theme_file_uri('/js/libs/clipboard-init.js'), array('jquery', 'wputh-clipboard-js'), '2.0.8', true);
$clipboard_version = '2.0.11';
wp_enqueue_script('wputh-clipboard-js', get_theme_file_uri('/js/libs/clipboard/clipboard.min.js'), array(), $clipboard_version, true);
wp_enqueue_script('wputh-clipboard-init-js', get_theme_file_uri('/js/libs/clipboard-init.js'), array('jquery', 'wputh-clipboard-js'), $clipboard_version, true);
wp_localize_script('wputh-clipboard-init-js', 'wputh_clipboard_init_js', array(
'txt_copied' => __('Copied !', 'wputh')
));
Expand Down
9 changes: 6 additions & 3 deletions inc/plugins/wpu-options.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,19 @@ function set_wputh_options_fields_default($options) {
$options['social_' . $id . '_url'] = array(
'label' => $name . ' URL',
'type' => 'url',
'box' => 'social_networks'
'box' => 'social_networks',
'lang' => 1
);
if ($id == 'twitter') {
$options['social_' . $id . '_username'] = array(
'label' => $name . ' username',
'box' => 'social_networks'
'box' => 'social_networks',
'lang' => 1
);
$options['social_' . $id . '_share_text'] = array(
'label' => $name . ' text',
'box' => 'social_networks'
'box' => 'social_networks',
'lang' => 1
);
}
}
Expand Down
4 changes: 3 additions & 1 deletion inc/theme/utilities/social.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ function wputh_get_social_links($wpu_social_links_ids = array()) {
}
$links = array();
foreach ($wpu_social_links_ids as $id => $name) {
$social_link = trim(get_option('social_' . $id . '_url'));
$opt_id = 'social_' . $id . '_url';
$opt = function_exists('wputh_l18n_get_option') ? wputh_l18n_get_option($opt_id) : get_option($opt_id);
$social_link = trim($opt);
if (!empty($social_link)) {
$links[$id] = array(
'name' => $name,
Expand Down
4 changes: 2 additions & 2 deletions js/libs/clipboard/clipboard.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wputheme",
"version": "3.9.3",
"version": "3.10.0",
"description": "WPUTheme",
"dependencies": {},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion scss/csscommon
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Theme Name: WP Utilities Base Theme
Theme URI: https://github.com/WordPressUtilities/WPUTheme
Update URI: https://github.com/WordPressUtilities/WPUTheme
Description: A Framework WordPress Theme
Version: 3.9.3
Version: 3.10.0
Author: Darklg
Author URI: https://darklg.me/
License: GPLv2 or later
Expand Down

0 comments on commit 79e1da8

Please sign in to comment.