|
| 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 | +} |
0 commit comments