Skip to content

Commit c0d2e31

Browse files
authored
Merge pull request #22 from oceanwp/rc-2.2.0
Rc 2.2.0
2 parents 0cc5f0e + ecbc298 commit c0d2e31

9 files changed

+229
-170
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
**Contributors:** The OceanWP Team, [Amit Singh](https://profiles.wordpress.org/apprimit/), [Marko](https://profiles.wordpress.org/wpfleek/)
44
**Requires at least:** WordPress 5.6
5-
**Tested up to:** WordPress 6.6.2
6-
**Stable tag:** 2.1.0
5+
**Tested up to:** WordPress 6.6
6+
**Stable tag:** 2.2.0
77
**License:** GPLv2 or later
88
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html
99

assets/js/customizer.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
55
*/
66

7-
( function( $ ) {
8-
wp.customize( 'ops_product_sharing_borders_color', function( value ) {
9-
value.bind( function( to ) {
10-
$( '.oew-product-share,.oew-product-share ul li' ).css( 'border-color', to );
11-
} );
12-
} );
13-
wp.customize( 'ops_product_sharing_icons_bg', function( value ) {
14-
value.bind( function( to ) {
15-
$( '.oew-product-share ul li a .ops-icon-wrap' ).css( 'background-color', to );
16-
} );
17-
} );
18-
wp.customize( 'ops_product_sharing_icons_color', function( value ) {
19-
value.bind( function( to ) {
20-
$( '.oew-product-share ul li a .ops-icon-wrap .ops-icon' ).css( 'fill', to );
21-
} );
22-
} );
23-
} )( jQuery );
7+
// ( function( $ ) {
8+
// wp.customize( 'ops_product_sharing_borders_color', function( value ) {
9+
// value.bind( function( to ) {
10+
// $( '.oew-product-share,.oew-product-share ul li' ).css( 'border-color', to );
11+
// } );
12+
// } );
13+
// wp.customize( 'ops_product_sharing_icons_bg', function( value ) {
14+
// value.bind( function( to ) {
15+
// $( '.oew-product-share ul li a .ops-icon-wrap' ).css( 'background-color', to );
16+
// } );
17+
// } );
18+
// wp.customize( 'ops_product_sharing_icons_color', function( value ) {
19+
// value.bind( function( to ) {
20+
// $( '.oew-product-share ul li a .ops-icon-wrap .ops-icon' ).css( 'fill', to );
21+
// } );
22+
// } );
23+
// } )( jQuery );

assets/js/customizer.min.js

-1
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
!function(c){wp.customize("ops_product_sharing_borders_color",function(o){o.bind(function(o){c(".oew-product-share,.oew-product-share ul li").css("border-color",o)})}),wp.customize("ops_product_sharing_icons_bg",function(o){o.bind(function(o){c(".oew-product-share ul li a .ops-icon-wrap").css("background-color",o)})}),wp.customize("ops_product_sharing_icons_color",function(o){o.bind(function(o){c(".oew-product-share ul li a .ops-icon-wrap .ops-icon").css("fill",o)})})}(jQuery);

changelog.txt

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
== Changelog ==
22

3+
= 2.2.0 - OCT 16 2024 =
4+
- NEW: Customizer: Library upgraded to default WordPress ReactJS.
5+
- NEW: Customizer: Customizer Controls.
6+
- NEW: Customizer: User Interface.
7+
- NEW: Customizer: Reorganized settings for improved user experience.
8+
- Removed: Customizer: Legacy PHP Controls.
9+
310
= 2.1.0 - OCT 11 2024 =
411
- Added: Conditional checks for future updates.
512
- Updated: Compatibility: WordPress version number.

includes/helpers.php

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ function ops_social_share_sites() {
1818
// Get socials from Customizer
1919
$socials = get_theme_mod( 'ops_product_sharing_sites', $socials );
2020

21+
if (is_string($socials)) {
22+
$socials = json_decode($socials, true);
23+
}
24+
2125
// Turn into array if string
2226
if ( $socials && ! is_array( $socials ) ) {
2327
$socials = explode( ',', $socials );

includes/options.php

+145
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
<?php
2+
/**
3+
* OceanWP Customizer Class: Product Sharing
4+
*
5+
* @package OceanWP WordPress theme
6+
*/
7+
8+
if ( ! defined( 'ABSPATH' ) ) {
9+
exit;
10+
}
11+
12+
/**
13+
* Customizer Options
14+
*/
15+
function ops_customizer_options() {
16+
17+
$options = [
18+
'title' => __( 'Product Sharing', 'ocean-product-sharing' ),
19+
'priority' => 16,
20+
'options' => [
21+
'ops_spacer_before_sharing_options' => [
22+
'type' => 'ocean-spacer',
23+
'section' => 'ocean_product_sharing_settings',
24+
'transport' => 'postMessage',
25+
'priority' => 10,
26+
],
27+
28+
'ops_product_sharing_sites' => [
29+
'label' => esc_html__( 'Sharing Buttons', 'ocean-product-sharing' ),
30+
'type' => 'ocean-sortable',
31+
'section' => 'ocean_product_sharing_settings',
32+
'transport' => 'refresh',
33+
'priority' => 10,
34+
'default' => ['twitter', 'facebook', 'pinterest', 'email'],
35+
'hideLabel' => false,
36+
'sanitize_callback' => 'ocean_sanitize_sortable_control',
37+
'choices' => [
38+
'twitter' => 'X (ex Twitter)',
39+
'facebook' => 'Facebook',
40+
'pinterest' => 'Pinterest',
41+
'email' => 'Mail',
42+
]
43+
],
44+
45+
'ops_divider_after_product_share_sites' => [
46+
'type' => 'ocean-divider',
47+
'section' => 'ocean_product_sharing_settings',
48+
'transport' => 'postMessage',
49+
'priority' => 10,
50+
'top' => 20,
51+
'bottom' => 25,
52+
],
53+
54+
'ops_product_sharing_borders_color' => [
55+
'type' => 'ocean-color',
56+
'label' => esc_html__( 'PS Borders', 'ocean-product-sharing' ),
57+
'section' => 'ocean_product_sharing_settings',
58+
'transport' => 'postMessage',
59+
'priority' => 10,
60+
'hideLabel' => false,
61+
'showAlpha' => true,
62+
'showPalette' => true,
63+
'sanitize_callback' => 'wp_kses_post',
64+
'setting_args' => [
65+
'normal' => [
66+
'id' => 'ops_product_sharing_borders_color',
67+
'key' => 'normal',
68+
'label' => esc_html__( 'Select Color', 'ocean-product-sharing' ),
69+
'selector' => [
70+
'.oew-product-share,.oew-product-share ul li' => 'border-color',
71+
],
72+
'attr' => [
73+
'transport' => 'postMessage',
74+
'default' => '#e9e9e9',
75+
],
76+
]
77+
]
78+
],
79+
80+
'ops_product_sharing_icons_bg' => [
81+
'type' => 'ocean-color',
82+
'label' => esc_html__( 'PS Background', 'ocean-product-sharing' ),
83+
'section' => 'ocean_product_sharing_settings',
84+
'transport' => 'postMessage',
85+
'priority' => 10,
86+
'hideLabel' => false,
87+
'showAlpha' => true,
88+
'showPalette' => true,
89+
'sanitize_callback' => 'wp_kses_post',
90+
'setting_args' => [
91+
'normal' => [
92+
'id' => 'ops_product_sharing_icons_bg',
93+
'key' => 'normal',
94+
'label' => esc_html__( 'Select Color', 'ocean-product-sharing' ),
95+
'selector' => [
96+
'.oew-product-share ul li a .ops-icon-wrap' => 'background-color',
97+
],
98+
'attr' => [
99+
'transport' => 'postMessage',
100+
'default' => '#333333',
101+
],
102+
]
103+
]
104+
],
105+
106+
'ops_product_sharing_icons_color' => [
107+
'type' => 'ocean-color',
108+
'label' => esc_html__( 'PS Icons', 'ocean-product-sharing' ),
109+
'section' => 'ocean_product_sharing_settings',
110+
'transport' => 'postMessage',
111+
'priority' => 10,
112+
'hideLabel' => false,
113+
'showAlpha' => true,
114+
'showPalette' => true,
115+
'sanitize_callback' => 'wp_kses_post',
116+
'setting_args' => [
117+
'normal' => [
118+
'id' => 'ops_product_sharing_icons_color',
119+
'key' => 'normal',
120+
'label' => esc_html__( 'Select Color', 'ocean-product-sharing' ),
121+
'selector' => [
122+
'.oew-product-share ul li a .ops-icon-wrap .ops-icon' => 'fill',
123+
],
124+
'attr' => [
125+
'transport' => 'postMessage',
126+
'default' => '#ffffff',
127+
],
128+
]
129+
]
130+
],
131+
132+
'ops_need_help_link' => [
133+
'type' => 'ocean-content',
134+
'isContent' => sprintf( esc_html__( '%1$s Need Help? %2$s','ocean-product-sharing' ), '<a href="https://docs.oceanwp.org/article/912-customizer-product-sharing/" target="_blank">', '</a>' ),
135+
'class' => 'need-help',
136+
'section' => 'ocean_product_sharing_settings',
137+
'transport' => 'postMessage',
138+
'priority' => 10,
139+
]
140+
]
141+
];
142+
143+
return apply_filters( 'ops_customizer_options', $options );
144+
145+
}

languages/ocean-product-sharing.pot

+33-23
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# This file is distributed under the same license as the Ocean Product Sharing plugin.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: Ocean Product Sharing 2.1.0\n"
5+
"Project-Id-Version: Ocean Product Sharing 2.2.0\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ocean-product-sharing\n"
77
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
88
"Language-Team: LANGUAGE <[email protected]>\n"
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2024-10-11T11:33:48+00:00\n"
12+
"POT-Creation-Date: 2024-10-16T09:43:05+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.11.0\n"
1515
"X-Domain: ocean-product-sharing\n"
@@ -40,6 +40,37 @@ msgstr ""
4040
msgid "https://oceanwp.org/"
4141
msgstr ""
4242

43+
#: includes/options.php:18
44+
#: ocean-product-sharing.php:384
45+
msgid "Product Sharing"
46+
msgstr ""
47+
48+
#: includes/options.php:29
49+
msgid "Sharing Buttons"
50+
msgstr ""
51+
52+
#: includes/options.php:56
53+
msgid "PS Borders"
54+
msgstr ""
55+
56+
#: includes/options.php:68
57+
#: includes/options.php:94
58+
#: includes/options.php:120
59+
msgid "Select Color"
60+
msgstr ""
61+
62+
#: includes/options.php:82
63+
msgid "PS Background"
64+
msgstr ""
65+
66+
#: includes/options.php:108
67+
msgid "PS Icons"
68+
msgstr ""
69+
70+
#: includes/options.php:134
71+
msgid "%1$s Need Help? %2$s"
72+
msgstr ""
73+
4374
#: includes/update-message.php:40
4475
msgid "Backup recommended before plugin update."
4576
msgstr ""
@@ -78,27 +109,6 @@ msgstr ""
78109
msgid "2.4.0"
79110
msgstr ""
80111

81-
#: ocean-product-sharing.php:290
82-
#: ocean-product-sharing.php:497
83-
msgid "Product Sharing"
84-
msgstr ""
85-
86-
#: ocean-product-sharing.php:311
87-
msgid "Sharing Buttons"
88-
msgstr ""
89-
90-
#: ocean-product-sharing.php:342
91-
msgid "Borders Color"
92-
msgstr ""
93-
94-
#: ocean-product-sharing.php:367
95-
msgid "Icons Background Color"
96-
msgstr ""
97-
98-
#: ocean-product-sharing.php:392
99-
msgid "Icons Color"
100-
msgstr ""
101-
102112
#: template/product-share.php:28
103113
msgid "Share this product on social media"
104114
msgstr ""

0 commit comments

Comments
 (0)