@@ -10,27 +10,27 @@ |
||
| 10 | 10 | defined( 'ABSPATH' ) || exit; |
| 11 | 11 | |
| 12 | 12 | Redux::set_section( |
| 13 | - $opt_name, |
|
| 14 | - array( |
|
| 15 | - 'title' => esc_html__( 'Spinner', 'your-textdomain-here' ), |
|
| 16 | - 'id' => 'slider_spinner-spinner', |
|
| 17 | - 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-fields/spinner.html" target="_blank">https://devs.redux.io/core-fields/spinner.html</a>', |
|
| 18 | - 'subsection' => true, |
|
| 19 | - 'fields' => array( |
|
| 20 | - array( |
|
| 21 | - 'id' => 'opt-spinner', |
|
| 22 | - 'type' => 'spinner', |
|
| 23 | - 'title' => esc_html__( 'JQuery UI Spinner Example 1', 'your-textdomain-here' ), |
|
| 24 | - 'desc' => esc_html__( 'JQuery UI spinner description. Min:20, max: 100, step:20, default value: 100', 'your-textdomain-here' ), |
|
| 25 | - 'default' => '100', |
|
| 26 | - 'min' => '20', |
|
| 27 | - 'step' => '20', |
|
| 28 | - 'max' => '100', |
|
| 29 | - 'suffix' => '', |
|
| 30 | - 'output_unit' => 'px', |
|
| 31 | - 'output' => array( '.content-area' => 'max-width' ), |
|
| 32 | - ), |
|
| 33 | - ), |
|
| 34 | - ) |
|
| 13 | + $opt_name, |
|
| 14 | + array( |
|
| 15 | + 'title' => esc_html__( 'Spinner', 'your-textdomain-here' ), |
|
| 16 | + 'id' => 'slider_spinner-spinner', |
|
| 17 | + 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-fields/spinner.html" target="_blank">https://devs.redux.io/core-fields/spinner.html</a>', |
|
| 18 | + 'subsection' => true, |
|
| 19 | + 'fields' => array( |
|
| 20 | + array( |
|
| 21 | + 'id' => 'opt-spinner', |
|
| 22 | + 'type' => 'spinner', |
|
| 23 | + 'title' => esc_html__( 'JQuery UI Spinner Example 1', 'your-textdomain-here' ), |
|
| 24 | + 'desc' => esc_html__( 'JQuery UI spinner description. Min:20, max: 100, step:20, default value: 100', 'your-textdomain-here' ), |
|
| 25 | + 'default' => '100', |
|
| 26 | + 'min' => '20', |
|
| 27 | + 'step' => '20', |
|
| 28 | + 'max' => '100', |
|
| 29 | + 'suffix' => '', |
|
| 30 | + 'output_unit' => 'px', |
|
| 31 | + 'output' => array( '.content-area' => 'max-width' ), |
|
| 32 | + ), |
|
| 33 | + ), |
|
| 34 | + ) |
|
| 35 | 35 | ); |
| 36 | 36 | // phpcs:enable |
@@ -10,72 +10,72 @@ |
||
| 10 | 10 | defined( 'ABSPATH' ) || exit; |
| 11 | 11 | |
| 12 | 12 | Redux::set_section( |
| 13 | - $opt_name, |
|
| 14 | - array( |
|
| 15 | - 'title' => esc_html__( 'Slider', 'your-textdomain-here' ), |
|
| 16 | - 'id' => 'slider_spinner-slider', |
|
| 17 | - 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-fields/slider.html" target="_blank">https://devs.redux.io/core-fields/slider.html</a>', |
|
| 18 | - 'fields' => array( |
|
| 19 | - array( |
|
| 20 | - 'id' => 'opt-slider-label', |
|
| 21 | - 'type' => 'slider', |
|
| 22 | - 'title' => esc_html__( 'Slider Example 1', 'your-textdomain-here' ), |
|
| 23 | - 'subtitle' => esc_html__( 'This slider displays the value as a label.', 'your-textdomain-here' ), |
|
| 24 | - 'desc' => esc_html__( 'Slider description. Min: 1, max: 500, step: 1, default value: 250', 'your-textdomain-here' ), |
|
| 25 | - 'default' => 250, |
|
| 26 | - 'min' => 1, |
|
| 27 | - 'step' => 1, |
|
| 28 | - 'max' => 500, |
|
| 29 | - 'display_value' => 'label', |
|
| 30 | - ), |
|
| 31 | - array( |
|
| 32 | - 'id' => 'opt-slider-text', |
|
| 33 | - 'type' => 'slider', |
|
| 34 | - 'title' => esc_html__( 'Slider Example 2 with Steps (5)', 'your-textdomain-here' ), |
|
| 35 | - 'subtitle' => esc_html__( 'This example displays the value in a text box', 'your-textdomain-here' ), |
|
| 36 | - 'desc' => esc_html__( 'Slider description. Min: 0, max: 800, step: 5, default value: 75', 'your-textdomain-here' ), |
|
| 37 | - 'default' => 750, |
|
| 38 | - 'min' => 0, |
|
| 39 | - 'step' => 5, |
|
| 40 | - 'max' => 800, |
|
| 41 | - 'display_value' => 'text', |
|
| 42 | - 'output' => array( '.site-content' => 'max-width' ), |
|
| 43 | - ), |
|
| 44 | - array( |
|
| 45 | - 'id' => 'opt-slider-select', |
|
| 46 | - 'type' => 'slider', |
|
| 47 | - 'title' => esc_html__( 'Slider Example 3 with two sliders', 'your-textdomain-here' ), |
|
| 48 | - 'subtitle' => esc_html__( 'This example displays the values in select boxes', 'your-textdomain-here' ), |
|
| 49 | - 'desc' => esc_html__( 'Slider description. Min: 0, max: 500, step: 5, slider 1 default value: 100, slider 2 default value: 300', 'your-textdomain-here' ), |
|
| 50 | - 'default' => array( |
|
| 51 | - 1 => 100, |
|
| 52 | - 2 => 300, |
|
| 53 | - ), |
|
| 54 | - 'min' => 0, |
|
| 55 | - 'step' => 5, |
|
| 56 | - 'max' => '500', |
|
| 57 | - 'display_value' => 'select', |
|
| 58 | - 'handles' => 2, |
|
| 59 | - 'output' => array( |
|
| 60 | - 1 => array( '.site-footer' => 'max-width' ), |
|
| 61 | - 2 => array( '.site-footer' => 'min-width' ), |
|
| 62 | - ), |
|
| 63 | - ), |
|
| 64 | - array( |
|
| 65 | - 'id' => 'opt-slider-float', |
|
| 66 | - 'type' => 'slider', |
|
| 67 | - 'title' => esc_html__( 'Slider Example 4 with float values', 'your-textdomain-here' ), |
|
| 68 | - 'subtitle' => esc_html__( 'This example displays float values', 'your-textdomain-here' ), |
|
| 69 | - 'desc' => esc_html__( 'Slider description. Min: 0, max: 1, step: .1, default value: .5', 'your-textdomain-here' ), |
|
| 70 | - 'default' => .5, |
|
| 71 | - 'min' => 0, |
|
| 72 | - 'step' => .1, |
|
| 73 | - 'max' => 1, |
|
| 74 | - 'resolution' => 0.1, |
|
| 75 | - 'display_value' => 'text', |
|
| 76 | - ), |
|
| 77 | - ), |
|
| 78 | - 'subsection' => true, |
|
| 79 | - ) |
|
| 13 | + $opt_name, |
|
| 14 | + array( |
|
| 15 | + 'title' => esc_html__( 'Slider', 'your-textdomain-here' ), |
|
| 16 | + 'id' => 'slider_spinner-slider', |
|
| 17 | + 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-fields/slider.html" target="_blank">https://devs.redux.io/core-fields/slider.html</a>', |
|
| 18 | + 'fields' => array( |
|
| 19 | + array( |
|
| 20 | + 'id' => 'opt-slider-label', |
|
| 21 | + 'type' => 'slider', |
|
| 22 | + 'title' => esc_html__( 'Slider Example 1', 'your-textdomain-here' ), |
|
| 23 | + 'subtitle' => esc_html__( 'This slider displays the value as a label.', 'your-textdomain-here' ), |
|
| 24 | + 'desc' => esc_html__( 'Slider description. Min: 1, max: 500, step: 1, default value: 250', 'your-textdomain-here' ), |
|
| 25 | + 'default' => 250, |
|
| 26 | + 'min' => 1, |
|
| 27 | + 'step' => 1, |
|
| 28 | + 'max' => 500, |
|
| 29 | + 'display_value' => 'label', |
|
| 30 | + ), |
|
| 31 | + array( |
|
| 32 | + 'id' => 'opt-slider-text', |
|
| 33 | + 'type' => 'slider', |
|
| 34 | + 'title' => esc_html__( 'Slider Example 2 with Steps (5)', 'your-textdomain-here' ), |
|
| 35 | + 'subtitle' => esc_html__( 'This example displays the value in a text box', 'your-textdomain-here' ), |
|
| 36 | + 'desc' => esc_html__( 'Slider description. Min: 0, max: 800, step: 5, default value: 75', 'your-textdomain-here' ), |
|
| 37 | + 'default' => 750, |
|
| 38 | + 'min' => 0, |
|
| 39 | + 'step' => 5, |
|
| 40 | + 'max' => 800, |
|
| 41 | + 'display_value' => 'text', |
|
| 42 | + 'output' => array( '.site-content' => 'max-width' ), |
|
| 43 | + ), |
|
| 44 | + array( |
|
| 45 | + 'id' => 'opt-slider-select', |
|
| 46 | + 'type' => 'slider', |
|
| 47 | + 'title' => esc_html__( 'Slider Example 3 with two sliders', 'your-textdomain-here' ), |
|
| 48 | + 'subtitle' => esc_html__( 'This example displays the values in select boxes', 'your-textdomain-here' ), |
|
| 49 | + 'desc' => esc_html__( 'Slider description. Min: 0, max: 500, step: 5, slider 1 default value: 100, slider 2 default value: 300', 'your-textdomain-here' ), |
|
| 50 | + 'default' => array( |
|
| 51 | + 1 => 100, |
|
| 52 | + 2 => 300, |
|
| 53 | + ), |
|
| 54 | + 'min' => 0, |
|
| 55 | + 'step' => 5, |
|
| 56 | + 'max' => '500', |
|
| 57 | + 'display_value' => 'select', |
|
| 58 | + 'handles' => 2, |
|
| 59 | + 'output' => array( |
|
| 60 | + 1 => array( '.site-footer' => 'max-width' ), |
|
| 61 | + 2 => array( '.site-footer' => 'min-width' ), |
|
| 62 | + ), |
|
| 63 | + ), |
|
| 64 | + array( |
|
| 65 | + 'id' => 'opt-slider-float', |
|
| 66 | + 'type' => 'slider', |
|
| 67 | + 'title' => esc_html__( 'Slider Example 4 with float values', 'your-textdomain-here' ), |
|
| 68 | + 'subtitle' => esc_html__( 'This example displays float values', 'your-textdomain-here' ), |
|
| 69 | + 'desc' => esc_html__( 'Slider description. Min: 0, max: 1, step: .1, default value: .5', 'your-textdomain-here' ), |
|
| 70 | + 'default' => .5, |
|
| 71 | + 'min' => 0, |
|
| 72 | + 'step' => .1, |
|
| 73 | + 'max' => 1, |
|
| 74 | + 'resolution' => 0.1, |
|
| 75 | + 'display_value' => 'text', |
|
| 76 | + ), |
|
| 77 | + ), |
|
| 78 | + 'subsection' => true, |
|
| 79 | + ) |
|
| 80 | 80 | ); |
| 81 | 81 | // phpcs:enable |
@@ -11,438 +11,438 @@ |
||
| 11 | 11 | |
| 12 | 12 | if ( ! class_exists( 'Redux_Framework_Plugin', false ) ) { |
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Main Redux_Framework_Plugin class |
|
| 16 | - * |
|
| 17 | - * @since 3.0.0 |
|
| 18 | - */ |
|
| 19 | - class Redux_Framework_Plugin { |
|
| 20 | - |
|
| 21 | - /** |
|
| 22 | - * Option array for demo mode. |
|
| 23 | - * |
|
| 24 | - * @access protected |
|
| 25 | - * @var array $options Array of config options, used to check for demo mode |
|
| 26 | - * @since 3.0.0 |
|
| 27 | - */ |
|
| 28 | - protected array $options = array(); |
|
| 29 | - |
|
| 30 | - /** |
|
| 31 | - * Use this value as the text domain when translating strings from this plugin. It should match |
|
| 32 | - * the Text Domain field set in the plugin header, as well as the directory name of the plugin. |
|
| 33 | - * Additionally, text domains should only contain letters, number and hyphens, not underscores |
|
| 34 | - * or spaces. |
|
| 35 | - * |
|
| 36 | - * @access protected |
|
| 37 | - * @var string $plugin_slug The unique ID (slug) of this plugin |
|
| 38 | - * @since 3.0.0 |
|
| 39 | - */ |
|
| 40 | - protected string $plugin_slug = 'redux-framework'; |
|
| 41 | - |
|
| 42 | - /** |
|
| 43 | - * Set on network activate. |
|
| 44 | - * |
|
| 45 | - * @access protected |
|
| 46 | - * @var null|string $plugin_network_activated Check for plugin network activation |
|
| 47 | - * @since 3.0.0 |
|
| 48 | - */ |
|
| 49 | - protected ?string $plugin_network_activated = null; |
|
| 50 | - |
|
| 51 | - /** |
|
| 52 | - * Class instance. |
|
| 53 | - * |
|
| 54 | - * @access private |
|
| 55 | - * @var ?Redux_Framework_Plugin $instance The one true Redux_Framework_Plugin |
|
| 56 | - * @since 3.0.0 |
|
| 57 | - */ |
|
| 58 | - private static ?Redux_Framework_Plugin $instance = null; |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * Crash flag. |
|
| 62 | - * |
|
| 63 | - * @access private |
|
| 64 | - * @var Redux_Framework_Plugin $crash Crash flag if inside a crash. |
|
| 65 | - * @since 4.1.15 |
|
| 66 | - */ |
|
| 67 | - public static $crash = false; |
|
| 68 | - |
|
| 69 | - /** |
|
| 70 | - * Get active instance |
|
| 71 | - * |
|
| 72 | - * @access public |
|
| 73 | - * @since 3.1.3 |
|
| 74 | - * @return self::$instance The one true Redux_Framework_Plugin |
|
| 75 | - */ |
|
| 76 | - public static function instance(): ?Redux_Framework_Plugin { |
|
| 77 | - $path = REDUX_PLUGIN_FILE; |
|
| 78 | - $res = false; |
|
| 79 | - |
|
| 80 | - if ( function_exists( 'get_plugin_data' ) && file_exists( $path ) ) { |
|
| 81 | - $data = get_plugin_data( $path, true, false ); |
|
| 82 | - |
|
| 83 | - if ( isset( $data['Version'] ) && '' !== $data['Version'] ) { |
|
| 84 | - $res = version_compare( $data['Version'], '4', '<' ); |
|
| 85 | - } |
|
| 86 | - |
|
| 87 | - if ( true === $res && ! in_array( 'redux-framework/redux-framework.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ) ) { |
|
| 88 | - echo '<div class="error"><p>' . esc_html__( 'Redux Framework version 4 is activated but not loaded. Redux Framework version 3 is still installed and activated. Please deactivate Redux Framework version 3.', 'redux-framework' ) . '</p></div>'; // phpcs:ignore WordPress.Security.EscapeOutput |
|
| 89 | - return null; |
|
| 90 | - } |
|
| 91 | - } |
|
| 92 | - |
|
| 93 | - if ( ! self::$instance ) { |
|
| 94 | - self::$instance = new self(); |
|
| 95 | - if ( class_exists( 'ReduxFramework' ) ) { |
|
| 96 | - self::$instance->load_first(); |
|
| 97 | - } else { |
|
| 98 | - self::$instance->get_redux_options(); |
|
| 99 | - self::$instance->includes(); |
|
| 100 | - self::$instance->hooks(); |
|
| 101 | - } |
|
| 102 | - } |
|
| 103 | - |
|
| 104 | - return self::$instance; |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - /** |
|
| 108 | - * Shim for getting instance |
|
| 109 | - * |
|
| 110 | - * @access public |
|
| 111 | - * @since 4.0.1 |
|
| 112 | - * @return self::$instance The one true Redux_Framework_Plugin |
|
| 113 | - */ |
|
| 114 | - public static function get_instance(): ?Redux_Framework_Plugin { |
|
| 115 | - return self::instance(); |
|
| 116 | - } |
|
| 117 | - |
|
| 118 | - /** |
|
| 119 | - * Get Redux options |
|
| 120 | - * |
|
| 121 | - * @access public |
|
| 122 | - * @since 3.1.3 |
|
| 123 | - * @return void |
|
| 124 | - */ |
|
| 125 | - public function get_redux_options() { |
|
| 126 | - |
|
| 127 | - // Setup defaults. |
|
| 128 | - $defaults = array( |
|
| 129 | - 'demo' => false, |
|
| 130 | - ); |
|
| 131 | - |
|
| 132 | - // If multisite is enabled. |
|
| 133 | - if ( is_multisite() ) { |
|
| 134 | - |
|
| 135 | - // Get network activated plugins. |
|
| 136 | - $plugins = get_site_option( 'active_sitewide_plugins' ); |
|
| 137 | - |
|
| 138 | - foreach ( $plugins as $file => $plugin ) { |
|
| 139 | - if ( strpos( $file, 'redux-framework.php' ) !== false ) { |
|
| 140 | - $this->plugin_network_activated = true; |
|
| 141 | - $this->options = get_site_option( 'ReduxFrameworkPlugin', $defaults ); |
|
| 142 | - } |
|
| 143 | - } |
|
| 144 | - } |
|
| 145 | - |
|
| 146 | - // If options aren't set, grab them now! |
|
| 147 | - if ( empty( $this->options ) ) { |
|
| 148 | - $this->options = get_option( 'ReduxFrameworkPlugin', $defaults ); |
|
| 149 | - } |
|
| 150 | - } |
|
| 151 | - |
|
| 152 | - /** |
|
| 153 | - * Include the necessary files |
|
| 154 | - * |
|
| 155 | - * @access public |
|
| 156 | - * @since 3.1.3 |
|
| 157 | - * @return void |
|
| 158 | - */ |
|
| 159 | - public function includes() { |
|
| 160 | - |
|
| 161 | - // Include Redux_Core. |
|
| 162 | - if ( file_exists( __DIR__ . '/redux-core/framework.php' ) ) { |
|
| 163 | - require_once __DIR__ . '/redux-core/framework.php'; |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - if ( file_exists( __DIR__ . '/redux-templates/redux-templates.php' ) ) { |
|
| 167 | - require_once __DIR__ . '/redux-templates/redux-templates.php'; |
|
| 168 | - } |
|
| 169 | - |
|
| 170 | - if ( isset( Redux_Core::$as_plugin ) ) { |
|
| 171 | - Redux_Core::$as_plugin = true; |
|
| 172 | - } |
|
| 173 | - |
|
| 174 | - add_action( 'setup_theme', array( $this, 'load_sample_config' ) ); |
|
| 175 | - } |
|
| 176 | - |
|
| 177 | - /** |
|
| 178 | - * Loads the sample config after everything is loaded. |
|
| 179 | - * |
|
| 180 | - * @access public |
|
| 181 | - * @since 4.0.2 |
|
| 182 | - * @return void |
|
| 183 | - */ |
|
| 184 | - public function load_sample_config() { |
|
| 185 | - // Include demo config, if demo mode is active. |
|
| 186 | - if ( $this->options['demo'] && file_exists( __DIR__ . '/sample/sample-config.php' ) ) { |
|
| 187 | - require_once __DIR__ . '/sample/sample-config.php'; |
|
| 188 | - } |
|
| 189 | - } |
|
| 190 | - |
|
| 191 | - /** |
|
| 192 | - * Run action and filter hooks |
|
| 193 | - * |
|
| 194 | - * @access private |
|
| 195 | - * @since 3.1.3 |
|
| 196 | - * @return void |
|
| 197 | - */ |
|
| 198 | - private function hooks() { |
|
| 199 | - add_action( 'activated_plugin', array( $this, 'load_first' ) ); |
|
| 200 | - add_action( 'wp_loaded', array( $this, 'options_toggle_check' ) ); |
|
| 201 | - |
|
| 202 | - // Activate plugin when a new blog is added. |
|
| 203 | - add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) ); |
|
| 204 | - |
|
| 205 | - // Display admin notices. |
|
| 206 | - add_action( 'admin_notices', array( $this, 'admin_notices' ) ); |
|
| 207 | - |
|
| 208 | - // Edit plugin metalinks. |
|
| 209 | - add_filter( 'plugin_row_meta', array( $this, 'plugin_metalinks' ), null, 2 ); |
|
| 210 | - add_filter( 'network_admin_plugin_action_links', array( $this, 'add_settings_link' ), 1, 2 ); |
|
| 211 | - add_filter( 'plugin_action_links', array( $this, 'add_settings_link' ), 1, 2 ); |
|
| 212 | - |
|
| 213 | - // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 214 | - do_action( 'redux/plugin/hooks', $this ); |
|
| 215 | - } |
|
| 216 | - |
|
| 217 | - /** |
|
| 218 | - * Pushes Redux to the top of plugin load list, so it initializes before any plugin that may use it. |
|
| 219 | - */ |
|
| 220 | - public function load_first() { |
|
| 221 | - if ( ! class_exists( 'Redux_Functions_Ex' ) ) { |
|
| 222 | - require_once __DIR__ . '/redux-core/inc/classes/class-redux-functions-ex.php'; |
|
| 223 | - } |
|
| 224 | - |
|
| 225 | - $plugin_dir = Redux_Functions_Ex::wp_normalize_path( WP_PLUGIN_DIR ) . '/'; |
|
| 226 | - $self_file = Redux_Functions_Ex::wp_normalize_path( __FILE__ ); |
|
| 227 | - |
|
| 228 | - $path = str_replace( $plugin_dir, '', $self_file ); |
|
| 229 | - $path = str_replace( 'class-redux-framework-plugin.php', 'redux-framework.php', $path ); |
|
| 230 | - |
|
| 231 | - $plugins = get_option( 'active_plugins' ); |
|
| 232 | - |
|
| 233 | - if ( $plugins ) { |
|
| 234 | - $key = array_search( $path, $plugins, true ); |
|
| 235 | - |
|
| 236 | - if ( false !== $key ) { |
|
| 237 | - array_splice( $plugins, $key, 1 ); |
|
| 238 | - array_unshift( $plugins, $path ); |
|
| 239 | - update_option( 'active_plugins', $plugins ); |
|
| 240 | - } |
|
| 241 | - } |
|
| 242 | - } |
|
| 243 | - |
|
| 244 | - /** |
|
| 245 | - * Fired on plugin activation |
|
| 246 | - * |
|
| 247 | - * @access public |
|
| 248 | - * @return void |
|
| 249 | - * @since 3.0.0 |
|
| 250 | - */ |
|
| 251 | - public static function activate() { |
|
| 252 | - delete_site_transient( 'update_plugins' ); |
|
| 253 | - } |
|
| 254 | - |
|
| 255 | - /** |
|
| 256 | - * Fired when plugin is deactivated |
|
| 257 | - * |
|
| 258 | - * @access public |
|
| 259 | - * @since 3.0.0 |
|
| 260 | - * |
|
| 261 | - * @param boolean $network_wide True if plugin is network activated, false otherwise. |
|
| 262 | - * |
|
| 263 | - * @return void |
|
| 264 | - */ |
|
| 265 | - public static function deactivate( ?bool $network_wide ) { |
|
| 266 | - if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
| 267 | - if ( $network_wide ) { |
|
| 268 | - // Get all blog IDs. |
|
| 269 | - $blog_ids = self::get_blog_ids(); |
|
| 270 | - |
|
| 271 | - foreach ( $blog_ids as $blog_id ) { |
|
| 272 | - switch_to_blog( $blog_id ); |
|
| 273 | - self::single_deactivate(); |
|
| 274 | - } |
|
| 275 | - restore_current_blog(); |
|
| 276 | - } else { |
|
| 277 | - self::single_deactivate(); |
|
| 278 | - } |
|
| 279 | - } else { |
|
| 280 | - self::single_deactivate(); |
|
| 281 | - } |
|
| 282 | - |
|
| 283 | - delete_option( 'ReduxFrameworkPlugin' ); |
|
| 284 | - } |
|
| 285 | - |
|
| 286 | - /** |
|
| 287 | - * Fired when a new WPMU site is activated |
|
| 288 | - * |
|
| 289 | - * @access public |
|
| 290 | - * |
|
| 291 | - * @param int $blog_id The ID of the new blog. |
|
| 292 | - * |
|
| 293 | - * @return void |
|
| 294 | - * @since 3.0.0 |
|
| 295 | - */ |
|
| 296 | - public function activate_new_site( int $blog_id ) { |
|
| 297 | - if ( 1 !== did_action( 'wpmu_new_blog' ) ) { |
|
| 298 | - return; |
|
| 299 | - } |
|
| 300 | - |
|
| 301 | - switch_to_blog( $blog_id ); |
|
| 302 | - self::single_activate(); |
|
| 303 | - restore_current_blog(); |
|
| 304 | - } |
|
| 305 | - |
|
| 306 | - /** |
|
| 307 | - * Get all IDs of blogs that are not activated, not spam, and not deleted |
|
| 308 | - * |
|
| 309 | - * @access private |
|
| 310 | - * @since 3.0.0 |
|
| 311 | - * @global object $wpdb |
|
| 312 | - * @return array|false Array of IDs or false if none are found |
|
| 313 | - */ |
|
| 314 | - private static function get_blog_ids() { |
|
| 315 | - global $wpdb; |
|
| 316 | - |
|
| 317 | - $var = '0'; |
|
| 318 | - |
|
| 319 | - // Get an array of IDs (We have to do it this way because WordPress says so, however redundant). |
|
| 320 | - $result = wp_cache_get( 'redux-blog-ids' ); |
|
| 321 | - if ( false === $result ) { |
|
| 322 | - |
|
| 323 | - // WordPress says get_col is discouraged? I found no alternative. So...ignore! - kp. |
|
| 324 | - // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery |
|
| 325 | - $result = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM $wpdb->blogs WHERE archived = %s AND spam = %s AND deleted = %s", $var, $var, $var ) ); |
|
| 326 | - |
|
| 327 | - wp_cache_set( 'redux-blog-ids', $result ); |
|
| 328 | - } |
|
| 329 | - |
|
| 330 | - return $result; |
|
| 331 | - } |
|
| 332 | - |
|
| 333 | - /** |
|
| 334 | - * Fired for each WPMS blog on plugin activation |
|
| 335 | - * |
|
| 336 | - * @access private |
|
| 337 | - * @since 3.0.0 |
|
| 338 | - * @return void |
|
| 339 | - */ |
|
| 340 | - private static function single_activate() { |
|
| 341 | - $nonce = wp_create_nonce( 'redux_framework_demo' ); |
|
| 342 | - |
|
| 343 | - $notices = get_option( 'ReduxFrameworkPlugin_ACTIVATED_NOTICES', array() ); |
|
| 344 | - $notices[] = esc_html__( 'Redux Framework has an embedded demo.', 'redux-framework' ) . ' <a href="./plugins.php?redux-framework-plugin=demo&nonce=' . $nonce . '">' . esc_html__( 'Click here to activate the sample config file.', 'redux-framework' ) . '</a>'; |
|
| 345 | - |
|
| 346 | - update_option( 'ReduxFrameworkPlugin_ACTIVATED_NOTICES', $notices ); |
|
| 347 | - } |
|
| 348 | - |
|
| 349 | - /** |
|
| 350 | - * Display admin notices |
|
| 351 | - * |
|
| 352 | - * @access public |
|
| 353 | - * @since 3.0.0 |
|
| 354 | - * @return void |
|
| 355 | - */ |
|
| 356 | - public function admin_notices() { |
|
| 357 | - do_action( 'redux_framework_plugin_admin_notice' ); |
|
| 358 | - $notices = get_option( 'ReduxFrameworkPlugin_ACTIVATED_NOTICES', '' ); |
|
| 359 | - if ( ! empty( $notices ) ) { |
|
| 360 | - foreach ( $notices as $notice ) { |
|
| 361 | - echo '<div class="updated notice is-dismissible"><p>' . $notice . '</p></div>'; // phpcs:ignore WordPress.Security.EscapeOutput |
|
| 362 | - } |
|
| 363 | - |
|
| 364 | - delete_option( 'ReduxFrameworkPlugin_ACTIVATED_NOTICES' ); |
|
| 365 | - } |
|
| 366 | - } |
|
| 367 | - |
|
| 368 | - /** |
|
| 369 | - * Fired for each blog when the plugin is deactivated |
|
| 370 | - * |
|
| 371 | - * @access private |
|
| 372 | - * @since 3.0.0 |
|
| 373 | - * @return void |
|
| 374 | - */ |
|
| 375 | - private static function single_deactivate() { |
|
| 376 | - delete_option( 'ReduxFrameworkPlugin_ACTIVATED_NOTICES' ); |
|
| 377 | - } |
|
| 378 | - |
|
| 379 | - /** |
|
| 380 | - * Turn on or off |
|
| 381 | - * |
|
| 382 | - * @access public |
|
| 383 | - * @since 3.0.0 |
|
| 384 | - * @return void |
|
| 385 | - */ |
|
| 386 | - public function options_toggle_check() { |
|
| 387 | - if ( isset( $_GET['nonce'] ) && wp_verify_nonce( sanitize_key( $_GET['nonce'] ), 'redux_framework_demo' ) ) { |
|
| 388 | - if ( isset( $_GET['redux-framework-plugin'] ) && 'demo' === $_GET['redux-framework-plugin'] ) { |
|
| 389 | - $url = admin_url( add_query_arg( array( 'page' => 'redux-framework' ), 'options-general.php' ) ); |
|
| 390 | - |
|
| 391 | - if ( false === $this->options['demo'] ) { |
|
| 392 | - $this->options['demo'] = true; |
|
| 393 | - $url = admin_url( add_query_arg( array( 'page' => 'redux_demo' ), 'admin.php' ) ); |
|
| 394 | - } else { |
|
| 395 | - $this->options['demo'] = false; |
|
| 396 | - } |
|
| 397 | - |
|
| 398 | - if ( is_multisite() && $this->plugin_network_activated ) { |
|
| 399 | - update_site_option( 'ReduxFrameworkPlugin', $this->options ); |
|
| 400 | - } else { |
|
| 401 | - update_option( 'ReduxFrameworkPlugin', $this->options ); |
|
| 402 | - } |
|
| 403 | - |
|
| 404 | - wp_safe_redirect( esc_url( $url ) ); |
|
| 405 | - |
|
| 406 | - exit(); |
|
| 407 | - } |
|
| 408 | - } |
|
| 409 | - } |
|
| 410 | - |
|
| 411 | - |
|
| 412 | - /** |
|
| 413 | - * Add a settings link to the Redux entry in the plugin overview screen |
|
| 414 | - * |
|
| 415 | - * @param array $links Links array. |
|
| 416 | - * |
|
| 417 | - * @return array |
|
| 418 | - * @see filter:plugin_action_links |
|
| 419 | - * @since 1.0 |
|
| 420 | - */ |
|
| 421 | - public function add_settings_link( array $links ): array { |
|
| 422 | - return $links; |
|
| 423 | - } |
|
| 424 | - |
|
| 425 | - /** |
|
| 426 | - * Edit plugin metalinks |
|
| 427 | - * |
|
| 428 | - * @access public |
|
| 429 | - * |
|
| 430 | - * @param array $links The current array of links. |
|
| 431 | - * @param string $file A specific plugin row. |
|
| 432 | - * |
|
| 433 | - * @return array The modified array of links |
|
| 434 | - * @since 3.0.0 |
|
| 435 | - */ |
|
| 436 | - public function plugin_metalinks( array $links, string $file ): array { |
|
| 437 | - if ( strpos( $file, 'redux-framework.php' ) !== false && is_plugin_active( $file ) ) { |
|
| 438 | - $links[] = '<a href="' . esc_url( admin_url( add_query_arg( array( 'page' => 'redux-framework' ), 'options-general.php' ) ) ) . '">' . esc_html__( 'What is this?', 'redux-framework' ) . '</a>'; |
|
| 439 | - } |
|
| 440 | - |
|
| 441 | - return $links; |
|
| 442 | - } |
|
| 443 | - } |
|
| 444 | - |
|
| 445 | - if ( ! class_exists( 'ReduxFrameworkPlugin' ) ) { |
|
| 446 | - class_alias( 'Redux_Framework_Plugin', 'ReduxFrameworkPlugin' ); |
|
| 447 | - } |
|
| 14 | + /** |
|
| 15 | + * Main Redux_Framework_Plugin class |
|
| 16 | + * |
|
| 17 | + * @since 3.0.0 |
|
| 18 | + */ |
|
| 19 | + class Redux_Framework_Plugin { |
|
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * Option array for demo mode. |
|
| 23 | + * |
|
| 24 | + * @access protected |
|
| 25 | + * @var array $options Array of config options, used to check for demo mode |
|
| 26 | + * @since 3.0.0 |
|
| 27 | + */ |
|
| 28 | + protected array $options = array(); |
|
| 29 | + |
|
| 30 | + /** |
|
| 31 | + * Use this value as the text domain when translating strings from this plugin. It should match |
|
| 32 | + * the Text Domain field set in the plugin header, as well as the directory name of the plugin. |
|
| 33 | + * Additionally, text domains should only contain letters, number and hyphens, not underscores |
|
| 34 | + * or spaces. |
|
| 35 | + * |
|
| 36 | + * @access protected |
|
| 37 | + * @var string $plugin_slug The unique ID (slug) of this plugin |
|
| 38 | + * @since 3.0.0 |
|
| 39 | + */ |
|
| 40 | + protected string $plugin_slug = 'redux-framework'; |
|
| 41 | + |
|
| 42 | + /** |
|
| 43 | + * Set on network activate. |
|
| 44 | + * |
|
| 45 | + * @access protected |
|
| 46 | + * @var null|string $plugin_network_activated Check for plugin network activation |
|
| 47 | + * @since 3.0.0 |
|
| 48 | + */ |
|
| 49 | + protected ?string $plugin_network_activated = null; |
|
| 50 | + |
|
| 51 | + /** |
|
| 52 | + * Class instance. |
|
| 53 | + * |
|
| 54 | + * @access private |
|
| 55 | + * @var ?Redux_Framework_Plugin $instance The one true Redux_Framework_Plugin |
|
| 56 | + * @since 3.0.0 |
|
| 57 | + */ |
|
| 58 | + private static ?Redux_Framework_Plugin $instance = null; |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * Crash flag. |
|
| 62 | + * |
|
| 63 | + * @access private |
|
| 64 | + * @var Redux_Framework_Plugin $crash Crash flag if inside a crash. |
|
| 65 | + * @since 4.1.15 |
|
| 66 | + */ |
|
| 67 | + public static $crash = false; |
|
| 68 | + |
|
| 69 | + /** |
|
| 70 | + * Get active instance |
|
| 71 | + * |
|
| 72 | + * @access public |
|
| 73 | + * @since 3.1.3 |
|
| 74 | + * @return self::$instance The one true Redux_Framework_Plugin |
|
| 75 | + */ |
|
| 76 | + public static function instance(): ?Redux_Framework_Plugin { |
|
| 77 | + $path = REDUX_PLUGIN_FILE; |
|
| 78 | + $res = false; |
|
| 79 | + |
|
| 80 | + if ( function_exists( 'get_plugin_data' ) && file_exists( $path ) ) { |
|
| 81 | + $data = get_plugin_data( $path, true, false ); |
|
| 82 | + |
|
| 83 | + if ( isset( $data['Version'] ) && '' !== $data['Version'] ) { |
|
| 84 | + $res = version_compare( $data['Version'], '4', '<' ); |
|
| 85 | + } |
|
| 86 | + |
|
| 87 | + if ( true === $res && ! in_array( 'redux-framework/redux-framework.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ) ) { |
|
| 88 | + echo '<div class="error"><p>' . esc_html__( 'Redux Framework version 4 is activated but not loaded. Redux Framework version 3 is still installed and activated. Please deactivate Redux Framework version 3.', 'redux-framework' ) . '</p></div>'; // phpcs:ignore WordPress.Security.EscapeOutput |
|
| 89 | + return null; |
|
| 90 | + } |
|
| 91 | + } |
|
| 92 | + |
|
| 93 | + if ( ! self::$instance ) { |
|
| 94 | + self::$instance = new self(); |
|
| 95 | + if ( class_exists( 'ReduxFramework' ) ) { |
|
| 96 | + self::$instance->load_first(); |
|
| 97 | + } else { |
|
| 98 | + self::$instance->get_redux_options(); |
|
| 99 | + self::$instance->includes(); |
|
| 100 | + self::$instance->hooks(); |
|
| 101 | + } |
|
| 102 | + } |
|
| 103 | + |
|
| 104 | + return self::$instance; |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + /** |
|
| 108 | + * Shim for getting instance |
|
| 109 | + * |
|
| 110 | + * @access public |
|
| 111 | + * @since 4.0.1 |
|
| 112 | + * @return self::$instance The one true Redux_Framework_Plugin |
|
| 113 | + */ |
|
| 114 | + public static function get_instance(): ?Redux_Framework_Plugin { |
|
| 115 | + return self::instance(); |
|
| 116 | + } |
|
| 117 | + |
|
| 118 | + /** |
|
| 119 | + * Get Redux options |
|
| 120 | + * |
|
| 121 | + * @access public |
|
| 122 | + * @since 3.1.3 |
|
| 123 | + * @return void |
|
| 124 | + */ |
|
| 125 | + public function get_redux_options() { |
|
| 126 | + |
|
| 127 | + // Setup defaults. |
|
| 128 | + $defaults = array( |
|
| 129 | + 'demo' => false, |
|
| 130 | + ); |
|
| 131 | + |
|
| 132 | + // If multisite is enabled. |
|
| 133 | + if ( is_multisite() ) { |
|
| 134 | + |
|
| 135 | + // Get network activated plugins. |
|
| 136 | + $plugins = get_site_option( 'active_sitewide_plugins' ); |
|
| 137 | + |
|
| 138 | + foreach ( $plugins as $file => $plugin ) { |
|
| 139 | + if ( strpos( $file, 'redux-framework.php' ) !== false ) { |
|
| 140 | + $this->plugin_network_activated = true; |
|
| 141 | + $this->options = get_site_option( 'ReduxFrameworkPlugin', $defaults ); |
|
| 142 | + } |
|
| 143 | + } |
|
| 144 | + } |
|
| 145 | + |
|
| 146 | + // If options aren't set, grab them now! |
|
| 147 | + if ( empty( $this->options ) ) { |
|
| 148 | + $this->options = get_option( 'ReduxFrameworkPlugin', $defaults ); |
|
| 149 | + } |
|
| 150 | + } |
|
| 151 | + |
|
| 152 | + /** |
|
| 153 | + * Include the necessary files |
|
| 154 | + * |
|
| 155 | + * @access public |
|
| 156 | + * @since 3.1.3 |
|
| 157 | + * @return void |
|
| 158 | + */ |
|
| 159 | + public function includes() { |
|
| 160 | + |
|
| 161 | + // Include Redux_Core. |
|
| 162 | + if ( file_exists( __DIR__ . '/redux-core/framework.php' ) ) { |
|
| 163 | + require_once __DIR__ . '/redux-core/framework.php'; |
|
| 164 | + } |
|
| 165 | + |
|
| 166 | + if ( file_exists( __DIR__ . '/redux-templates/redux-templates.php' ) ) { |
|
| 167 | + require_once __DIR__ . '/redux-templates/redux-templates.php'; |
|
| 168 | + } |
|
| 169 | + |
|
| 170 | + if ( isset( Redux_Core::$as_plugin ) ) { |
|
| 171 | + Redux_Core::$as_plugin = true; |
|
| 172 | + } |
|
| 173 | + |
|
| 174 | + add_action( 'setup_theme', array( $this, 'load_sample_config' ) ); |
|
| 175 | + } |
|
| 176 | + |
|
| 177 | + /** |
|
| 178 | + * Loads the sample config after everything is loaded. |
|
| 179 | + * |
|
| 180 | + * @access public |
|
| 181 | + * @since 4.0.2 |
|
| 182 | + * @return void |
|
| 183 | + */ |
|
| 184 | + public function load_sample_config() { |
|
| 185 | + // Include demo config, if demo mode is active. |
|
| 186 | + if ( $this->options['demo'] && file_exists( __DIR__ . '/sample/sample-config.php' ) ) { |
|
| 187 | + require_once __DIR__ . '/sample/sample-config.php'; |
|
| 188 | + } |
|
| 189 | + } |
|
| 190 | + |
|
| 191 | + /** |
|
| 192 | + * Run action and filter hooks |
|
| 193 | + * |
|
| 194 | + * @access private |
|
| 195 | + * @since 3.1.3 |
|
| 196 | + * @return void |
|
| 197 | + */ |
|
| 198 | + private function hooks() { |
|
| 199 | + add_action( 'activated_plugin', array( $this, 'load_first' ) ); |
|
| 200 | + add_action( 'wp_loaded', array( $this, 'options_toggle_check' ) ); |
|
| 201 | + |
|
| 202 | + // Activate plugin when a new blog is added. |
|
| 203 | + add_action( 'wpmu_new_blog', array( $this, 'activate_new_site' ) ); |
|
| 204 | + |
|
| 205 | + // Display admin notices. |
|
| 206 | + add_action( 'admin_notices', array( $this, 'admin_notices' ) ); |
|
| 207 | + |
|
| 208 | + // Edit plugin metalinks. |
|
| 209 | + add_filter( 'plugin_row_meta', array( $this, 'plugin_metalinks' ), null, 2 ); |
|
| 210 | + add_filter( 'network_admin_plugin_action_links', array( $this, 'add_settings_link' ), 1, 2 ); |
|
| 211 | + add_filter( 'plugin_action_links', array( $this, 'add_settings_link' ), 1, 2 ); |
|
| 212 | + |
|
| 213 | + // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 214 | + do_action( 'redux/plugin/hooks', $this ); |
|
| 215 | + } |
|
| 216 | + |
|
| 217 | + /** |
|
| 218 | + * Pushes Redux to the top of plugin load list, so it initializes before any plugin that may use it. |
|
| 219 | + */ |
|
| 220 | + public function load_first() { |
|
| 221 | + if ( ! class_exists( 'Redux_Functions_Ex' ) ) { |
|
| 222 | + require_once __DIR__ . '/redux-core/inc/classes/class-redux-functions-ex.php'; |
|
| 223 | + } |
|
| 224 | + |
|
| 225 | + $plugin_dir = Redux_Functions_Ex::wp_normalize_path( WP_PLUGIN_DIR ) . '/'; |
|
| 226 | + $self_file = Redux_Functions_Ex::wp_normalize_path( __FILE__ ); |
|
| 227 | + |
|
| 228 | + $path = str_replace( $plugin_dir, '', $self_file ); |
|
| 229 | + $path = str_replace( 'class-redux-framework-plugin.php', 'redux-framework.php', $path ); |
|
| 230 | + |
|
| 231 | + $plugins = get_option( 'active_plugins' ); |
|
| 232 | + |
|
| 233 | + if ( $plugins ) { |
|
| 234 | + $key = array_search( $path, $plugins, true ); |
|
| 235 | + |
|
| 236 | + if ( false !== $key ) { |
|
| 237 | + array_splice( $plugins, $key, 1 ); |
|
| 238 | + array_unshift( $plugins, $path ); |
|
| 239 | + update_option( 'active_plugins', $plugins ); |
|
| 240 | + } |
|
| 241 | + } |
|
| 242 | + } |
|
| 243 | + |
|
| 244 | + /** |
|
| 245 | + * Fired on plugin activation |
|
| 246 | + * |
|
| 247 | + * @access public |
|
| 248 | + * @return void |
|
| 249 | + * @since 3.0.0 |
|
| 250 | + */ |
|
| 251 | + public static function activate() { |
|
| 252 | + delete_site_transient( 'update_plugins' ); |
|
| 253 | + } |
|
| 254 | + |
|
| 255 | + /** |
|
| 256 | + * Fired when plugin is deactivated |
|
| 257 | + * |
|
| 258 | + * @access public |
|
| 259 | + * @since 3.0.0 |
|
| 260 | + * |
|
| 261 | + * @param boolean $network_wide True if plugin is network activated, false otherwise. |
|
| 262 | + * |
|
| 263 | + * @return void |
|
| 264 | + */ |
|
| 265 | + public static function deactivate( ?bool $network_wide ) { |
|
| 266 | + if ( function_exists( 'is_multisite' ) && is_multisite() ) { |
|
| 267 | + if ( $network_wide ) { |
|
| 268 | + // Get all blog IDs. |
|
| 269 | + $blog_ids = self::get_blog_ids(); |
|
| 270 | + |
|
| 271 | + foreach ( $blog_ids as $blog_id ) { |
|
| 272 | + switch_to_blog( $blog_id ); |
|
| 273 | + self::single_deactivate(); |
|
| 274 | + } |
|
| 275 | + restore_current_blog(); |
|
| 276 | + } else { |
|
| 277 | + self::single_deactivate(); |
|
| 278 | + } |
|
| 279 | + } else { |
|
| 280 | + self::single_deactivate(); |
|
| 281 | + } |
|
| 282 | + |
|
| 283 | + delete_option( 'ReduxFrameworkPlugin' ); |
|
| 284 | + } |
|
| 285 | + |
|
| 286 | + /** |
|
| 287 | + * Fired when a new WPMU site is activated |
|
| 288 | + * |
|
| 289 | + * @access public |
|
| 290 | + * |
|
| 291 | + * @param int $blog_id The ID of the new blog. |
|
| 292 | + * |
|
| 293 | + * @return void |
|
| 294 | + * @since 3.0.0 |
|
| 295 | + */ |
|
| 296 | + public function activate_new_site( int $blog_id ) { |
|
| 297 | + if ( 1 !== did_action( 'wpmu_new_blog' ) ) { |
|
| 298 | + return; |
|
| 299 | + } |
|
| 300 | + |
|
| 301 | + switch_to_blog( $blog_id ); |
|
| 302 | + self::single_activate(); |
|
| 303 | + restore_current_blog(); |
|
| 304 | + } |
|
| 305 | + |
|
| 306 | + /** |
|
| 307 | + * Get all IDs of blogs that are not activated, not spam, and not deleted |
|
| 308 | + * |
|
| 309 | + * @access private |
|
| 310 | + * @since 3.0.0 |
|
| 311 | + * @global object $wpdb |
|
| 312 | + * @return array|false Array of IDs or false if none are found |
|
| 313 | + */ |
|
| 314 | + private static function get_blog_ids() { |
|
| 315 | + global $wpdb; |
|
| 316 | + |
|
| 317 | + $var = '0'; |
|
| 318 | + |
|
| 319 | + // Get an array of IDs (We have to do it this way because WordPress says so, however redundant). |
|
| 320 | + $result = wp_cache_get( 'redux-blog-ids' ); |
|
| 321 | + if ( false === $result ) { |
|
| 322 | + |
|
| 323 | + // WordPress says get_col is discouraged? I found no alternative. So...ignore! - kp. |
|
| 324 | + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery |
|
| 325 | + $result = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM $wpdb->blogs WHERE archived = %s AND spam = %s AND deleted = %s", $var, $var, $var ) ); |
|
| 326 | + |
|
| 327 | + wp_cache_set( 'redux-blog-ids', $result ); |
|
| 328 | + } |
|
| 329 | + |
|
| 330 | + return $result; |
|
| 331 | + } |
|
| 332 | + |
|
| 333 | + /** |
|
| 334 | + * Fired for each WPMS blog on plugin activation |
|
| 335 | + * |
|
| 336 | + * @access private |
|
| 337 | + * @since 3.0.0 |
|
| 338 | + * @return void |
|
| 339 | + */ |
|
| 340 | + private static function single_activate() { |
|
| 341 | + $nonce = wp_create_nonce( 'redux_framework_demo' ); |
|
| 342 | + |
|
| 343 | + $notices = get_option( 'ReduxFrameworkPlugin_ACTIVATED_NOTICES', array() ); |
|
| 344 | + $notices[] = esc_html__( 'Redux Framework has an embedded demo.', 'redux-framework' ) . ' <a href="./plugins.php?redux-framework-plugin=demo&nonce=' . $nonce . '">' . esc_html__( 'Click here to activate the sample config file.', 'redux-framework' ) . '</a>'; |
|
| 345 | + |
|
| 346 | + update_option( 'ReduxFrameworkPlugin_ACTIVATED_NOTICES', $notices ); |
|
| 347 | + } |
|
| 348 | + |
|
| 349 | + /** |
|
| 350 | + * Display admin notices |
|
| 351 | + * |
|
| 352 | + * @access public |
|
| 353 | + * @since 3.0.0 |
|
| 354 | + * @return void |
|
| 355 | + */ |
|
| 356 | + public function admin_notices() { |
|
| 357 | + do_action( 'redux_framework_plugin_admin_notice' ); |
|
| 358 | + $notices = get_option( 'ReduxFrameworkPlugin_ACTIVATED_NOTICES', '' ); |
|
| 359 | + if ( ! empty( $notices ) ) { |
|
| 360 | + foreach ( $notices as $notice ) { |
|
| 361 | + echo '<div class="updated notice is-dismissible"><p>' . $notice . '</p></div>'; // phpcs:ignore WordPress.Security.EscapeOutput |
|
| 362 | + } |
|
| 363 | + |
|
| 364 | + delete_option( 'ReduxFrameworkPlugin_ACTIVATED_NOTICES' ); |
|
| 365 | + } |
|
| 366 | + } |
|
| 367 | + |
|
| 368 | + /** |
|
| 369 | + * Fired for each blog when the plugin is deactivated |
|
| 370 | + * |
|
| 371 | + * @access private |
|
| 372 | + * @since 3.0.0 |
|
| 373 | + * @return void |
|
| 374 | + */ |
|
| 375 | + private static function single_deactivate() { |
|
| 376 | + delete_option( 'ReduxFrameworkPlugin_ACTIVATED_NOTICES' ); |
|
| 377 | + } |
|
| 378 | + |
|
| 379 | + /** |
|
| 380 | + * Turn on or off |
|
| 381 | + * |
|
| 382 | + * @access public |
|
| 383 | + * @since 3.0.0 |
|
| 384 | + * @return void |
|
| 385 | + */ |
|
| 386 | + public function options_toggle_check() { |
|
| 387 | + if ( isset( $_GET['nonce'] ) && wp_verify_nonce( sanitize_key( $_GET['nonce'] ), 'redux_framework_demo' ) ) { |
|
| 388 | + if ( isset( $_GET['redux-framework-plugin'] ) && 'demo' === $_GET['redux-framework-plugin'] ) { |
|
| 389 | + $url = admin_url( add_query_arg( array( 'page' => 'redux-framework' ), 'options-general.php' ) ); |
|
| 390 | + |
|
| 391 | + if ( false === $this->options['demo'] ) { |
|
| 392 | + $this->options['demo'] = true; |
|
| 393 | + $url = admin_url( add_query_arg( array( 'page' => 'redux_demo' ), 'admin.php' ) ); |
|
| 394 | + } else { |
|
| 395 | + $this->options['demo'] = false; |
|
| 396 | + } |
|
| 397 | + |
|
| 398 | + if ( is_multisite() && $this->plugin_network_activated ) { |
|
| 399 | + update_site_option( 'ReduxFrameworkPlugin', $this->options ); |
|
| 400 | + } else { |
|
| 401 | + update_option( 'ReduxFrameworkPlugin', $this->options ); |
|
| 402 | + } |
|
| 403 | + |
|
| 404 | + wp_safe_redirect( esc_url( $url ) ); |
|
| 405 | + |
|
| 406 | + exit(); |
|
| 407 | + } |
|
| 408 | + } |
|
| 409 | + } |
|
| 410 | + |
|
| 411 | + |
|
| 412 | + /** |
|
| 413 | + * Add a settings link to the Redux entry in the plugin overview screen |
|
| 414 | + * |
|
| 415 | + * @param array $links Links array. |
|
| 416 | + * |
|
| 417 | + * @return array |
|
| 418 | + * @see filter:plugin_action_links |
|
| 419 | + * @since 1.0 |
|
| 420 | + */ |
|
| 421 | + public function add_settings_link( array $links ): array { |
|
| 422 | + return $links; |
|
| 423 | + } |
|
| 424 | + |
|
| 425 | + /** |
|
| 426 | + * Edit plugin metalinks |
|
| 427 | + * |
|
| 428 | + * @access public |
|
| 429 | + * |
|
| 430 | + * @param array $links The current array of links. |
|
| 431 | + * @param string $file A specific plugin row. |
|
| 432 | + * |
|
| 433 | + * @return array The modified array of links |
|
| 434 | + * @since 3.0.0 |
|
| 435 | + */ |
|
| 436 | + public function plugin_metalinks( array $links, string $file ): array { |
|
| 437 | + if ( strpos( $file, 'redux-framework.php' ) !== false && is_plugin_active( $file ) ) { |
|
| 438 | + $links[] = '<a href="' . esc_url( admin_url( add_query_arg( array( 'page' => 'redux-framework' ), 'options-general.php' ) ) ) . '">' . esc_html__( 'What is this?', 'redux-framework' ) . '</a>'; |
|
| 439 | + } |
|
| 440 | + |
|
| 441 | + return $links; |
|
| 442 | + } |
|
| 443 | + } |
|
| 444 | + |
|
| 445 | + if ( ! class_exists( 'ReduxFrameworkPlugin' ) ) { |
|
| 446 | + class_alias( 'Redux_Framework_Plugin', 'ReduxFrameworkPlugin' ); |
|
| 447 | + } |
|
| 448 | 448 | } |
@@ -11,56 +11,56 @@ |
||
| 11 | 11 | |
| 12 | 12 | if ( ! class_exists( 'Redux_Class', false ) ) { |
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Class Redux_Class |
|
| 16 | - */ |
|
| 17 | - class Redux_Class { |
|
| 14 | + /** |
|
| 15 | + * Class Redux_Class |
|
| 16 | + */ |
|
| 17 | + class Redux_Class { |
|
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * Pointer to ReduxFramework object. |
|
| 21 | - * |
|
| 22 | - * @var null|ReduxFramework |
|
| 23 | - */ |
|
| 24 | - public ?ReduxFramework $parent = null; |
|
| 19 | + /** |
|
| 20 | + * Pointer to ReduxFramework object. |
|
| 21 | + * |
|
| 22 | + * @var null|ReduxFramework |
|
| 23 | + */ |
|
| 24 | + public ?ReduxFramework $parent = null; |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * Global arguments array. |
|
| 28 | - * |
|
| 29 | - * @var array|mixed|void |
|
| 30 | - */ |
|
| 31 | - public $args = array(); |
|
| 26 | + /** |
|
| 27 | + * Global arguments array. |
|
| 28 | + * |
|
| 29 | + * @var array|mixed|void |
|
| 30 | + */ |
|
| 31 | + public $args = array(); |
|
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * Project opt_name |
|
| 35 | - * |
|
| 36 | - * @var mixed|string |
|
| 37 | - */ |
|
| 38 | - public $opt_name = ''; |
|
| 33 | + /** |
|
| 34 | + * Project opt_name |
|
| 35 | + * |
|
| 36 | + * @var mixed|string |
|
| 37 | + */ |
|
| 38 | + public $opt_name = ''; |
|
| 39 | 39 | |
| 40 | - /** |
|
| 41 | - * Redux_Class constructor. |
|
| 42 | - * |
|
| 43 | - * @param ReduxFramework|null $redux Pointer to ReduxFramework object. |
|
| 44 | - */ |
|
| 45 | - public function __construct( ?ReduxFramework $redux = null ) { |
|
| 46 | - if ( is_object( $redux ) ) { |
|
| 47 | - $this->parent = $redux; |
|
| 48 | - $this->args = $redux->args; |
|
| 49 | - $this->opt_name = $this->args['opt_name']; |
|
| 50 | - } |
|
| 51 | - } |
|
| 40 | + /** |
|
| 41 | + * Redux_Class constructor. |
|
| 42 | + * |
|
| 43 | + * @param ReduxFramework|null $redux Pointer to ReduxFramework object. |
|
| 44 | + */ |
|
| 45 | + public function __construct( ?ReduxFramework $redux = null ) { |
|
| 46 | + if ( is_object( $redux ) ) { |
|
| 47 | + $this->parent = $redux; |
|
| 48 | + $this->args = $redux->args; |
|
| 49 | + $this->opt_name = $this->args['opt_name']; |
|
| 50 | + } |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * Pointer to a project-specific ReduxFramework object. |
|
| 55 | - * |
|
| 56 | - * @return null|object|ReduxFramework |
|
| 57 | - */ |
|
| 58 | - public function core() { |
|
| 59 | - if ( isset( $this->opt_name ) && '' !== $this->opt_name ) { |
|
| 60 | - return Redux::instance( $this->opt_name ); |
|
| 61 | - } |
|
| 53 | + /** |
|
| 54 | + * Pointer to a project-specific ReduxFramework object. |
|
| 55 | + * |
|
| 56 | + * @return null|object|ReduxFramework |
|
| 57 | + */ |
|
| 58 | + public function core() { |
|
| 59 | + if ( isset( $this->opt_name ) && '' !== $this->opt_name ) { |
|
| 60 | + return Redux::instance( $this->opt_name ); |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - return null; |
|
| 64 | - } |
|
| 65 | - } |
|
| 63 | + return null; |
|
| 64 | + } |
|
| 65 | + } |
|
| 66 | 66 | } |
@@ -11,330 +11,330 @@ |
||
| 11 | 11 | |
| 12 | 12 | if ( ! class_exists( 'Redux_Social_Profiles_Functions' ) ) { |
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Class Redux_Social_Profiles_Functions |
|
| 16 | - */ |
|
| 17 | - class Redux_Social_Profiles_Functions { |
|
| 18 | - /** |
|
| 19 | - * ReduxFramework object pointer. |
|
| 20 | - * |
|
| 21 | - * @var ReduxFramework |
|
| 22 | - */ |
|
| 23 | - public static ReduxFramework $parent; |
|
| 24 | - |
|
| 25 | - /** |
|
| 26 | - * Field ID. |
|
| 27 | - * |
|
| 28 | - * @var null|string |
|
| 29 | - */ |
|
| 30 | - public static ?string $field_id; |
|
| 31 | - |
|
| 32 | - /** |
|
| 33 | - * Field array. |
|
| 34 | - * |
|
| 35 | - * @var array|null |
|
| 36 | - */ |
|
| 37 | - public static ?array $field; |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * WordPress upload directory. |
|
| 41 | - * |
|
| 42 | - * @var string |
|
| 43 | - */ |
|
| 44 | - public static string $upload_dir; |
|
| 45 | - |
|
| 46 | - /** |
|
| 47 | - * WordPress upload URI. |
|
| 48 | - * |
|
| 49 | - * @var string |
|
| 50 | - */ |
|
| 51 | - public static string $upload_url; |
|
| 52 | - |
|
| 53 | - /** |
|
| 54 | - * Init helper library. |
|
| 55 | - * |
|
| 56 | - * @param ReduxFramework $redux ReduxFramework object. |
|
| 57 | - */ |
|
| 58 | - public static function init( ReduxFramework $redux ) { |
|
| 59 | - self::$parent = $redux; |
|
| 60 | - |
|
| 61 | - if ( empty( self::$field_id ) ) { |
|
| 62 | - self::$field = self::get_field( $redux ); |
|
| 63 | - |
|
| 64 | - if ( ! is_array( self::$field ) ) { |
|
| 65 | - return; |
|
| 66 | - } |
|
| 67 | - |
|
| 68 | - self::$field_id = self::$field['id']; |
|
| 69 | - } |
|
| 70 | - |
|
| 71 | - // Make sanitized upload dir DIR. |
|
| 72 | - self::$upload_dir = Redux_Functions_Ex::wp_normalize_path( Redux_Core::$upload_dir . 'social-profiles/' ); |
|
| 73 | - |
|
| 74 | - // Make sanitized upload dir URL. |
|
| 75 | - self::$upload_url = Redux_Functions_Ex::wp_normalize_path( Redux_Core::$upload_url . 'social-profiles/' ); |
|
| 76 | - |
|
| 77 | - Redux_Functions::init_wp_filesystem(); |
|
| 78 | - } |
|
| 79 | - |
|
| 80 | - /** |
|
| 81 | - * Read data file. |
|
| 82 | - * |
|
| 83 | - * @return array|bool|mixed|object |
|
| 84 | - */ |
|
| 85 | - public static function read_data_file() { |
|
| 86 | - $file = self::get_data_path(); |
|
| 87 | - |
|
| 88 | - if ( file_exists( $file ) ) { |
|
| 89 | - |
|
| 90 | - // Get the contents of the file and stuff it in a variable. |
|
| 91 | - $data = Redux_Core::$filesystem->execute( 'get_contents', $file ); |
|
| 92 | - |
|
| 93 | - // Error or null, set the result to false. |
|
| 94 | - if ( false === $data || null === $data ) { |
|
| 95 | - $arr_data = false; |
|
| 96 | - |
|
| 97 | - // Otherwise, decode the json object and return it. |
|
| 98 | - } else { |
|
| 99 | - $arr = json_decode( $data, true ); |
|
| 100 | - $arr_data = $arr; |
|
| 101 | - } |
|
| 102 | - } else { |
|
| 103 | - $arr_data = false; |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - return $arr_data; |
|
| 107 | - } |
|
| 108 | - |
|
| 109 | - /** |
|
| 110 | - * Write data file. |
|
| 111 | - * |
|
| 112 | - * @param array $arr_data Data. |
|
| 113 | - * @param string $file Filename. |
|
| 114 | - * |
|
| 115 | - * @return bool |
|
| 116 | - */ |
|
| 117 | - public static function write_data_file( array $arr_data, string $file = '' ): bool { |
|
| 118 | - if ( ! is_dir( self::$upload_dir ) ) { |
|
| 119 | - return false; |
|
| 120 | - } |
|
| 121 | - |
|
| 122 | - $file = ( '' === $file ) ? self::get_data_path() : self::$upload_dir . $file; |
|
| 123 | - |
|
| 124 | - // Encode the array data. |
|
| 125 | - $data = wp_json_encode( $arr_data ); |
|
| 126 | - |
|
| 127 | - // Write to its file on the server, return the return value |
|
| 128 | - // True on success, false on error. |
|
| 129 | - return Redux_Core::$filesystem->execute( 'put_contents', $file, array( 'content' => $data ) ); |
|
| 130 | - } |
|
| 131 | - |
|
| 132 | - /** |
|
| 133 | - * Get the data path. |
|
| 134 | - * |
|
| 135 | - * @return mixed|Redux_Functions_Ex|string |
|
| 136 | - */ |
|
| 137 | - public static function get_data_path() { |
|
| 138 | - return Redux_Functions_Ex::wp_normalize_path( self::$upload_dir . '/' . self::$parent->args['opt_name'] . '-' . self::$field_id . '.json' ); |
|
| 139 | - } |
|
| 140 | - |
|
| 141 | - /** |
|
| 142 | - * Get field. |
|
| 143 | - * |
|
| 144 | - * @param array|ReduxFramework $redux ReduxFramework object. |
|
| 145 | - * |
|
| 146 | - * @return mixed |
|
| 147 | - */ |
|
| 148 | - public static function get_field( $redux = array() ) { |
|
| 149 | - global $pagenow; |
|
| 150 | - |
|
| 151 | - if ( is_admin() && ( 'post-new.php' === $pagenow || 'post.php' === $pagenow ) ) { |
|
| 152 | - $inst = Redux_Instances::get_instance( self::$parent->args['opt_name'] ); |
|
| 153 | - |
|
| 154 | - $ext = $inst->extensions; |
|
| 155 | - |
|
| 156 | - if ( isset( $ext['metaboxes'] ) ) { |
|
| 157 | - $obj = $ext['metaboxes']; |
|
| 158 | - $boxes = ( $obj->boxes ); |
|
| 159 | - |
|
| 160 | - foreach ( $boxes as $sections ) { |
|
| 161 | - foreach ( $sections['sections'] as $fields ) { |
|
| 162 | - if ( isset( $fields['fields'] ) ) { |
|
| 163 | - foreach ( $fields['fields'] as $f ) { |
|
| 164 | - if ( 'social_profiles' === $f['type'] ) { |
|
| 165 | - return $f; |
|
| 166 | - } |
|
| 167 | - |
|
| 168 | - if ( 'repeater' === $f['type'] ) { |
|
| 169 | - foreach ( $f['fields'] as $r ) { |
|
| 170 | - if ( 'social_profiles' === $r['type'] ) { |
|
| 171 | - return $r; |
|
| 172 | - } |
|
| 173 | - } |
|
| 174 | - } |
|
| 175 | - } |
|
| 176 | - } |
|
| 177 | - } |
|
| 178 | - } |
|
| 179 | - } |
|
| 180 | - } else { |
|
| 181 | - if ( ! empty( $redux ) ) { |
|
| 182 | - self::$parent = $redux; |
|
| 183 | - } |
|
| 184 | - |
|
| 185 | - if ( isset( self::$parent->field_sections['social_profiles'] ) ) { |
|
| 186 | - return reset( self::$parent->field_sections['social_profiles'] ); |
|
| 187 | - } |
|
| 188 | - |
|
| 189 | - $arr = self::$parent; |
|
| 190 | - |
|
| 191 | - foreach ( $arr as $part => $bla ) { |
|
| 192 | - if ( 'sections' === $part ) { |
|
| 193 | - foreach ( $bla as $field ) { |
|
| 194 | - |
|
| 195 | - foreach ( $field as $arg => $val ) { |
|
| 196 | - if ( 'fields' === $arg ) { |
|
| 197 | - foreach ( $val as $v ) { |
|
| 198 | - if ( ! empty( $v ) ) { |
|
| 199 | - foreach ( $v as $id => $x ) { |
|
| 200 | - if ( 'type' === $id ) { |
|
| 201 | - if ( 'social_profiles' === $x ) { |
|
| 202 | - return $v; |
|
| 203 | - } |
|
| 204 | - } |
|
| 205 | - } |
|
| 206 | - } |
|
| 207 | - } |
|
| 208 | - } |
|
| 209 | - } |
|
| 210 | - } |
|
| 211 | - } |
|
| 212 | - } |
|
| 213 | - } |
|
| 214 | - |
|
| 215 | - return null; |
|
| 216 | - } |
|
| 217 | - |
|
| 218 | - /** |
|
| 219 | - * Add extra icons. |
|
| 220 | - * |
|
| 221 | - * @param array $defaults Default values. |
|
| 222 | - * |
|
| 223 | - * @return array |
|
| 224 | - */ |
|
| 225 | - public static function add_extra_icons( array $defaults ): array { |
|
| 226 | - if ( empty( self::$field ) ) { |
|
| 227 | - self::$field = self::get_field(); |
|
| 228 | - } |
|
| 229 | - |
|
| 230 | - if ( isset( self::$field['icons'] ) && ! empty( self::$field['icons'] ) ) { |
|
| 231 | - $cur_count = count( $defaults ); |
|
| 232 | - |
|
| 233 | - foreach ( self::$field['icons'] as $arr ) { |
|
| 234 | - |
|
| 235 | - $skip_add = false; |
|
| 236 | - foreach ( $defaults as $i => $v ) { |
|
| 237 | - if ( $arr['id'] === $v['id'] ) { |
|
| 238 | - |
|
| 239 | - $defaults[ $i ] = array_replace( $v, $arr ); |
|
| 240 | - $skip_add = true; |
|
| 241 | - break; |
|
| 242 | - } |
|
| 243 | - } |
|
| 244 | - |
|
| 245 | - if ( ! $skip_add ) { |
|
| 246 | - $arr['order'] = $cur_count; |
|
| 247 | - $arr['class'] = $arr['class'] ?? 'fa'; |
|
| 248 | - $defaults[ $cur_count ] = $arr; |
|
| 249 | - ++$cur_count; |
|
| 250 | - } |
|
| 251 | - } |
|
| 252 | - } |
|
| 253 | - |
|
| 254 | - return $defaults; |
|
| 255 | - } |
|
| 256 | - |
|
| 257 | - /** |
|
| 258 | - * Get Included files. |
|
| 259 | - * |
|
| 260 | - * @param array $val Value. |
|
| 261 | - * |
|
| 262 | - * @return array |
|
| 263 | - */ |
|
| 264 | - private static function get_includes( array $val ): array { |
|
| 265 | - if ( empty( self::$field ) ) { |
|
| 266 | - self::$field = self::get_field(); |
|
| 267 | - } |
|
| 268 | - |
|
| 269 | - if ( isset( self::$field['include'] ) && is_array( self::$field['include'] ) && ! empty( self::$field['include'] ) ) { |
|
| 270 | - $icons = self::$field['include']; |
|
| 271 | - |
|
| 272 | - $new_arr = array(); |
|
| 273 | - |
|
| 274 | - $idx = 0; |
|
| 275 | - foreach ( $val as $arr ) { |
|
| 276 | - foreach ( $icons as $icon ) { |
|
| 277 | - if ( $icon === $arr['id'] ) { |
|
| 278 | - $arr['order'] = $idx; |
|
| 279 | - $new_arr[ $idx ] = $arr; |
|
| 280 | - ++$idx; |
|
| 281 | - break; |
|
| 282 | - } |
|
| 283 | - } |
|
| 284 | - } |
|
| 285 | - } else { |
|
| 286 | - $new_arr = $val; |
|
| 287 | - } |
|
| 288 | - |
|
| 289 | - return $new_arr; |
|
| 290 | - } |
|
| 291 | - |
|
| 292 | - /** |
|
| 293 | - * Returns default data from config. |
|
| 294 | - * |
|
| 295 | - * @return array |
|
| 296 | - */ |
|
| 297 | - public static function get_default_data(): array { |
|
| 298 | - $data = Redux_Social_Profiles_Defaults::get_social_media_defaults(); |
|
| 299 | - $data = self::get_includes( $data ); |
|
| 300 | - |
|
| 301 | - return self::add_extra_icons( $data ); |
|
| 302 | - } |
|
| 303 | - |
|
| 304 | - /** |
|
| 305 | - * Static function to render the social icon. |
|
| 306 | - * |
|
| 307 | - * @param string $icon_class Icon class. |
|
| 308 | - * @param string $icon Icon css. |
|
| 309 | - * @param string $color Hex color. |
|
| 310 | - * @param string $background Background color. |
|
| 311 | - * @param string $title Icon title. |
|
| 312 | - * @param bool $output Print or echo. |
|
| 313 | - * |
|
| 314 | - * @return string|void |
|
| 315 | - */ |
|
| 316 | - public static function render_icon( string $icon_class, string $icon, string $color, string $background, string $title, bool $output = true ) { |
|
| 317 | - if ( $color || $background ) { |
|
| 318 | - if ( '' === $color ) { |
|
| 319 | - $color = 'transparent'; |
|
| 320 | - } |
|
| 321 | - |
|
| 322 | - if ( '' === $background ) { |
|
| 323 | - $background = 'transparent'; |
|
| 324 | - } |
|
| 325 | - |
|
| 326 | - $inline = 'style="color:' . esc_attr( $color ) . ';background-color:' . esc_attr( $background ) . ';"'; |
|
| 327 | - } else { |
|
| 328 | - $inline = ''; |
|
| 329 | - } |
|
| 330 | - |
|
| 331 | - $str = '<i class="' . $icon_class . ' ' . $icon . '" ' . $inline . ' title="' . $title . '"></i>'; |
|
| 332 | - |
|
| 333 | - if ( $output ) { |
|
| 334 | - echo $str; // phpcs:ignore WordPress.Security.EscapeOutput |
|
| 335 | - } else { |
|
| 336 | - return $str; |
|
| 337 | - } |
|
| 338 | - } |
|
| 339 | - } |
|
| 14 | + /** |
|
| 15 | + * Class Redux_Social_Profiles_Functions |
|
| 16 | + */ |
|
| 17 | + class Redux_Social_Profiles_Functions { |
|
| 18 | + /** |
|
| 19 | + * ReduxFramework object pointer. |
|
| 20 | + * |
|
| 21 | + * @var ReduxFramework |
|
| 22 | + */ |
|
| 23 | + public static ReduxFramework $parent; |
|
| 24 | + |
|
| 25 | + /** |
|
| 26 | + * Field ID. |
|
| 27 | + * |
|
| 28 | + * @var null|string |
|
| 29 | + */ |
|
| 30 | + public static ?string $field_id; |
|
| 31 | + |
|
| 32 | + /** |
|
| 33 | + * Field array. |
|
| 34 | + * |
|
| 35 | + * @var array|null |
|
| 36 | + */ |
|
| 37 | + public static ?array $field; |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * WordPress upload directory. |
|
| 41 | + * |
|
| 42 | + * @var string |
|
| 43 | + */ |
|
| 44 | + public static string $upload_dir; |
|
| 45 | + |
|
| 46 | + /** |
|
| 47 | + * WordPress upload URI. |
|
| 48 | + * |
|
| 49 | + * @var string |
|
| 50 | + */ |
|
| 51 | + public static string $upload_url; |
|
| 52 | + |
|
| 53 | + /** |
|
| 54 | + * Init helper library. |
|
| 55 | + * |
|
| 56 | + * @param ReduxFramework $redux ReduxFramework object. |
|
| 57 | + */ |
|
| 58 | + public static function init( ReduxFramework $redux ) { |
|
| 59 | + self::$parent = $redux; |
|
| 60 | + |
|
| 61 | + if ( empty( self::$field_id ) ) { |
|
| 62 | + self::$field = self::get_field( $redux ); |
|
| 63 | + |
|
| 64 | + if ( ! is_array( self::$field ) ) { |
|
| 65 | + return; |
|
| 66 | + } |
|
| 67 | + |
|
| 68 | + self::$field_id = self::$field['id']; |
|
| 69 | + } |
|
| 70 | + |
|
| 71 | + // Make sanitized upload dir DIR. |
|
| 72 | + self::$upload_dir = Redux_Functions_Ex::wp_normalize_path( Redux_Core::$upload_dir . 'social-profiles/' ); |
|
| 73 | + |
|
| 74 | + // Make sanitized upload dir URL. |
|
| 75 | + self::$upload_url = Redux_Functions_Ex::wp_normalize_path( Redux_Core::$upload_url . 'social-profiles/' ); |
|
| 76 | + |
|
| 77 | + Redux_Functions::init_wp_filesystem(); |
|
| 78 | + } |
|
| 79 | + |
|
| 80 | + /** |
|
| 81 | + * Read data file. |
|
| 82 | + * |
|
| 83 | + * @return array|bool|mixed|object |
|
| 84 | + */ |
|
| 85 | + public static function read_data_file() { |
|
| 86 | + $file = self::get_data_path(); |
|
| 87 | + |
|
| 88 | + if ( file_exists( $file ) ) { |
|
| 89 | + |
|
| 90 | + // Get the contents of the file and stuff it in a variable. |
|
| 91 | + $data = Redux_Core::$filesystem->execute( 'get_contents', $file ); |
|
| 92 | + |
|
| 93 | + // Error or null, set the result to false. |
|
| 94 | + if ( false === $data || null === $data ) { |
|
| 95 | + $arr_data = false; |
|
| 96 | + |
|
| 97 | + // Otherwise, decode the json object and return it. |
|
| 98 | + } else { |
|
| 99 | + $arr = json_decode( $data, true ); |
|
| 100 | + $arr_data = $arr; |
|
| 101 | + } |
|
| 102 | + } else { |
|
| 103 | + $arr_data = false; |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + return $arr_data; |
|
| 107 | + } |
|
| 108 | + |
|
| 109 | + /** |
|
| 110 | + * Write data file. |
|
| 111 | + * |
|
| 112 | + * @param array $arr_data Data. |
|
| 113 | + * @param string $file Filename. |
|
| 114 | + * |
|
| 115 | + * @return bool |
|
| 116 | + */ |
|
| 117 | + public static function write_data_file( array $arr_data, string $file = '' ): bool { |
|
| 118 | + if ( ! is_dir( self::$upload_dir ) ) { |
|
| 119 | + return false; |
|
| 120 | + } |
|
| 121 | + |
|
| 122 | + $file = ( '' === $file ) ? self::get_data_path() : self::$upload_dir . $file; |
|
| 123 | + |
|
| 124 | + // Encode the array data. |
|
| 125 | + $data = wp_json_encode( $arr_data ); |
|
| 126 | + |
|
| 127 | + // Write to its file on the server, return the return value |
|
| 128 | + // True on success, false on error. |
|
| 129 | + return Redux_Core::$filesystem->execute( 'put_contents', $file, array( 'content' => $data ) ); |
|
| 130 | + } |
|
| 131 | + |
|
| 132 | + /** |
|
| 133 | + * Get the data path. |
|
| 134 | + * |
|
| 135 | + * @return mixed|Redux_Functions_Ex|string |
|
| 136 | + */ |
|
| 137 | + public static function get_data_path() { |
|
| 138 | + return Redux_Functions_Ex::wp_normalize_path( self::$upload_dir . '/' . self::$parent->args['opt_name'] . '-' . self::$field_id . '.json' ); |
|
| 139 | + } |
|
| 140 | + |
|
| 141 | + /** |
|
| 142 | + * Get field. |
|
| 143 | + * |
|
| 144 | + * @param array|ReduxFramework $redux ReduxFramework object. |
|
| 145 | + * |
|
| 146 | + * @return mixed |
|
| 147 | + */ |
|
| 148 | + public static function get_field( $redux = array() ) { |
|
| 149 | + global $pagenow; |
|
| 150 | + |
|
| 151 | + if ( is_admin() && ( 'post-new.php' === $pagenow || 'post.php' === $pagenow ) ) { |
|
| 152 | + $inst = Redux_Instances::get_instance( self::$parent->args['opt_name'] ); |
|
| 153 | + |
|
| 154 | + $ext = $inst->extensions; |
|
| 155 | + |
|
| 156 | + if ( isset( $ext['metaboxes'] ) ) { |
|
| 157 | + $obj = $ext['metaboxes']; |
|
| 158 | + $boxes = ( $obj->boxes ); |
|
| 159 | + |
|
| 160 | + foreach ( $boxes as $sections ) { |
|
| 161 | + foreach ( $sections['sections'] as $fields ) { |
|
| 162 | + if ( isset( $fields['fields'] ) ) { |
|
| 163 | + foreach ( $fields['fields'] as $f ) { |
|
| 164 | + if ( 'social_profiles' === $f['type'] ) { |
|
| 165 | + return $f; |
|
| 166 | + } |
|
| 167 | + |
|
| 168 | + if ( 'repeater' === $f['type'] ) { |
|
| 169 | + foreach ( $f['fields'] as $r ) { |
|
| 170 | + if ( 'social_profiles' === $r['type'] ) { |
|
| 171 | + return $r; |
|
| 172 | + } |
|
| 173 | + } |
|
| 174 | + } |
|
| 175 | + } |
|
| 176 | + } |
|
| 177 | + } |
|
| 178 | + } |
|
| 179 | + } |
|
| 180 | + } else { |
|
| 181 | + if ( ! empty( $redux ) ) { |
|
| 182 | + self::$parent = $redux; |
|
| 183 | + } |
|
| 184 | + |
|
| 185 | + if ( isset( self::$parent->field_sections['social_profiles'] ) ) { |
|
| 186 | + return reset( self::$parent->field_sections['social_profiles'] ); |
|
| 187 | + } |
|
| 188 | + |
|
| 189 | + $arr = self::$parent; |
|
| 190 | + |
|
| 191 | + foreach ( $arr as $part => $bla ) { |
|
| 192 | + if ( 'sections' === $part ) { |
|
| 193 | + foreach ( $bla as $field ) { |
|
| 194 | + |
|
| 195 | + foreach ( $field as $arg => $val ) { |
|
| 196 | + if ( 'fields' === $arg ) { |
|
| 197 | + foreach ( $val as $v ) { |
|
| 198 | + if ( ! empty( $v ) ) { |
|
| 199 | + foreach ( $v as $id => $x ) { |
|
| 200 | + if ( 'type' === $id ) { |
|
| 201 | + if ( 'social_profiles' === $x ) { |
|
| 202 | + return $v; |
|
| 203 | + } |
|
| 204 | + } |
|
| 205 | + } |
|
| 206 | + } |
|
| 207 | + } |
|
| 208 | + } |
|
| 209 | + } |
|
| 210 | + } |
|
| 211 | + } |
|
| 212 | + } |
|
| 213 | + } |
|
| 214 | + |
|
| 215 | + return null; |
|
| 216 | + } |
|
| 217 | + |
|
| 218 | + /** |
|
| 219 | + * Add extra icons. |
|
| 220 | + * |
|
| 221 | + * @param array $defaults Default values. |
|
| 222 | + * |
|
| 223 | + * @return array |
|
| 224 | + */ |
|
| 225 | + public static function add_extra_icons( array $defaults ): array { |
|
| 226 | + if ( empty( self::$field ) ) { |
|
| 227 | + self::$field = self::get_field(); |
|
| 228 | + } |
|
| 229 | + |
|
| 230 | + if ( isset( self::$field['icons'] ) && ! empty( self::$field['icons'] ) ) { |
|
| 231 | + $cur_count = count( $defaults ); |
|
| 232 | + |
|
| 233 | + foreach ( self::$field['icons'] as $arr ) { |
|
| 234 | + |
|
| 235 | + $skip_add = false; |
|
| 236 | + foreach ( $defaults as $i => $v ) { |
|
| 237 | + if ( $arr['id'] === $v['id'] ) { |
|
| 238 | + |
|
| 239 | + $defaults[ $i ] = array_replace( $v, $arr ); |
|
| 240 | + $skip_add = true; |
|
| 241 | + break; |
|
| 242 | + } |
|
| 243 | + } |
|
| 244 | + |
|
| 245 | + if ( ! $skip_add ) { |
|
| 246 | + $arr['order'] = $cur_count; |
|
| 247 | + $arr['class'] = $arr['class'] ?? 'fa'; |
|
| 248 | + $defaults[ $cur_count ] = $arr; |
|
| 249 | + ++$cur_count; |
|
| 250 | + } |
|
| 251 | + } |
|
| 252 | + } |
|
| 253 | + |
|
| 254 | + return $defaults; |
|
| 255 | + } |
|
| 256 | + |
|
| 257 | + /** |
|
| 258 | + * Get Included files. |
|
| 259 | + * |
|
| 260 | + * @param array $val Value. |
|
| 261 | + * |
|
| 262 | + * @return array |
|
| 263 | + */ |
|
| 264 | + private static function get_includes( array $val ): array { |
|
| 265 | + if ( empty( self::$field ) ) { |
|
| 266 | + self::$field = self::get_field(); |
|
| 267 | + } |
|
| 268 | + |
|
| 269 | + if ( isset( self::$field['include'] ) && is_array( self::$field['include'] ) && ! empty( self::$field['include'] ) ) { |
|
| 270 | + $icons = self::$field['include']; |
|
| 271 | + |
|
| 272 | + $new_arr = array(); |
|
| 273 | + |
|
| 274 | + $idx = 0; |
|
| 275 | + foreach ( $val as $arr ) { |
|
| 276 | + foreach ( $icons as $icon ) { |
|
| 277 | + if ( $icon === $arr['id'] ) { |
|
| 278 | + $arr['order'] = $idx; |
|
| 279 | + $new_arr[ $idx ] = $arr; |
|
| 280 | + ++$idx; |
|
| 281 | + break; |
|
| 282 | + } |
|
| 283 | + } |
|
| 284 | + } |
|
| 285 | + } else { |
|
| 286 | + $new_arr = $val; |
|
| 287 | + } |
|
| 288 | + |
|
| 289 | + return $new_arr; |
|
| 290 | + } |
|
| 291 | + |
|
| 292 | + /** |
|
| 293 | + * Returns default data from config. |
|
| 294 | + * |
|
| 295 | + * @return array |
|
| 296 | + */ |
|
| 297 | + public static function get_default_data(): array { |
|
| 298 | + $data = Redux_Social_Profiles_Defaults::get_social_media_defaults(); |
|
| 299 | + $data = self::get_includes( $data ); |
|
| 300 | + |
|
| 301 | + return self::add_extra_icons( $data ); |
|
| 302 | + } |
|
| 303 | + |
|
| 304 | + /** |
|
| 305 | + * Static function to render the social icon. |
|
| 306 | + * |
|
| 307 | + * @param string $icon_class Icon class. |
|
| 308 | + * @param string $icon Icon css. |
|
| 309 | + * @param string $color Hex color. |
|
| 310 | + * @param string $background Background color. |
|
| 311 | + * @param string $title Icon title. |
|
| 312 | + * @param bool $output Print or echo. |
|
| 313 | + * |
|
| 314 | + * @return string|void |
|
| 315 | + */ |
|
| 316 | + public static function render_icon( string $icon_class, string $icon, string $color, string $background, string $title, bool $output = true ) { |
|
| 317 | + if ( $color || $background ) { |
|
| 318 | + if ( '' === $color ) { |
|
| 319 | + $color = 'transparent'; |
|
| 320 | + } |
|
| 321 | + |
|
| 322 | + if ( '' === $background ) { |
|
| 323 | + $background = 'transparent'; |
|
| 324 | + } |
|
| 325 | + |
|
| 326 | + $inline = 'style="color:' . esc_attr( $color ) . ';background-color:' . esc_attr( $background ) . ';"'; |
|
| 327 | + } else { |
|
| 328 | + $inline = ''; |
|
| 329 | + } |
|
| 330 | + |
|
| 331 | + $str = '<i class="' . $icon_class . ' ' . $icon . '" ' . $inline . ' title="' . $title . '"></i>'; |
|
| 332 | + |
|
| 333 | + if ( $output ) { |
|
| 334 | + echo $str; // phpcs:ignore WordPress.Security.EscapeOutput |
|
| 335 | + } else { |
|
| 336 | + return $str; |
|
| 337 | + } |
|
| 338 | + } |
|
| 339 | + } |
|
| 340 | 340 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * |
| 35 | 35 | * @var array|null |
| 36 | 36 | */ |
| 37 | - public static ?array $field; |
|
| 37 | + public static ? array $field; |
|
| 38 | 38 | |
| 39 | 39 | /** |
| 40 | 40 | * WordPress upload directory. |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | foreach ( $defaults as $i => $v ) { |
| 237 | 237 | if ( $arr['id'] === $v['id'] ) { |
| 238 | 238 | |
| 239 | - $defaults[ $i ] = array_replace( $v, $arr ); |
|
| 239 | + $defaults[$i] = array_replace( $v, $arr ); |
|
| 240 | 240 | $skip_add = true; |
| 241 | 241 | break; |
| 242 | 242 | } |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | if ( ! $skip_add ) { |
| 246 | 246 | $arr['order'] = $cur_count; |
| 247 | 247 | $arr['class'] = $arr['class'] ?? 'fa'; |
| 248 | - $defaults[ $cur_count ] = $arr; |
|
| 248 | + $defaults[$cur_count] = $arr; |
|
| 249 | 249 | ++$cur_count; |
| 250 | 250 | } |
| 251 | 251 | } |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | foreach ( $icons as $icon ) { |
| 277 | 277 | if ( $icon === $arr['id'] ) { |
| 278 | 278 | $arr['order'] = $idx; |
| 279 | - $new_arr[ $idx ] = $arr; |
|
| 279 | + $new_arr[$idx] = $arr; |
|
| 280 | 280 | ++$idx; |
| 281 | 281 | break; |
| 282 | 282 | } |
@@ -11,922 +11,922 @@ |
||
| 11 | 11 | |
| 12 | 12 | if ( ! class_exists( 'Redux_Social_Profiles_Defaults' ) ) { |
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Class Redux_Social_Profiles_Defaults |
|
| 16 | - */ |
|
| 17 | - class Redux_Social_Profiles_Defaults { |
|
| 14 | + /** |
|
| 15 | + * Class Redux_Social_Profiles_Defaults |
|
| 16 | + */ |
|
| 17 | + class Redux_Social_Profiles_Defaults { |
|
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * Get defaults array. |
|
| 21 | - * |
|
| 22 | - * @return array |
|
| 23 | - */ |
|
| 24 | - public static function get_social_media_defaults(): array { |
|
| 25 | - return array( |
|
| 26 | - 0 => array( |
|
| 27 | - 'id' => 'adn', |
|
| 28 | - 'icon' => 'fa-adn', |
|
| 29 | - 'class' => 'fa', |
|
| 30 | - 'enabled' => false, |
|
| 31 | - 'name' => esc_html__( 'ADN', 'redux-framework' ), |
|
| 32 | - 'background' => '', |
|
| 33 | - 'color' => '#000000', |
|
| 34 | - 'url' => '', |
|
| 35 | - 'order' => 0, |
|
| 36 | - ), |
|
| 37 | - 1 => array( |
|
| 38 | - 'id' => 'android', |
|
| 39 | - 'icon' => 'fa-android', |
|
| 40 | - 'class' => 'fa', |
|
| 41 | - 'enabled' => false, |
|
| 42 | - 'name' => esc_html__( 'Android', 'redux-framework' ), |
|
| 43 | - 'background' => '', |
|
| 44 | - 'color' => '#A4C639', |
|
| 45 | - 'url' => '', |
|
| 46 | - 'order' => 1, |
|
| 47 | - ), |
|
| 48 | - 2 => array( |
|
| 49 | - 'id' => 'apple', |
|
| 50 | - 'icon' => 'fa-apple', |
|
| 51 | - 'class' => 'fa', |
|
| 52 | - 'enabled' => false, |
|
| 53 | - 'name' => esc_html__( 'Apple', 'redux-framework' ), |
|
| 54 | - 'style' => '', |
|
| 55 | - 'background' => '', |
|
| 56 | - 'color' => '#e4e4e5', |
|
| 57 | - 'url' => '', |
|
| 58 | - 'order' => 2, |
|
| 59 | - ), |
|
| 60 | - 3 => array( |
|
| 61 | - 'id' => 'behance', |
|
| 62 | - 'icon' => 'fa-behance', |
|
| 63 | - 'class' => 'fa', |
|
| 64 | - 'enabled' => false, |
|
| 65 | - 'name' => esc_html__( 'behance', 'redux-framework' ), |
|
| 66 | - 'background' => '', |
|
| 67 | - 'color' => '#1769ff', |
|
| 68 | - 'url' => '', |
|
| 69 | - 'order' => 3, |
|
| 70 | - ), |
|
| 71 | - 4 => array( |
|
| 72 | - 'id' => 'behance-square', |
|
| 73 | - 'icon' => 'fa-behance-square', |
|
| 74 | - 'class' => 'fa', |
|
| 75 | - 'enabled' => false, |
|
| 76 | - 'name' => esc_html__( 'behance square', 'redux-framework' ), |
|
| 77 | - 'background' => '', |
|
| 78 | - 'color' => '#1769ff', |
|
| 79 | - 'url' => '', |
|
| 80 | - 'order' => 4, |
|
| 81 | - ), |
|
| 82 | - 5 => array( |
|
| 83 | - 'id' => 'bitbucket', |
|
| 84 | - 'icon' => 'fa-bitbucket', |
|
| 85 | - 'class' => 'fa', |
|
| 86 | - 'enabled' => false, |
|
| 87 | - 'name' => esc_html__( 'Bitbucket', 'redux-framework' ), |
|
| 88 | - 'background' => '', |
|
| 89 | - 'color' => '#205081', |
|
| 90 | - 'url' => '', |
|
| 91 | - 'order' => 5, |
|
| 92 | - ), |
|
| 93 | - 6 => array( |
|
| 94 | - 'id' => 'bitbucket-square', |
|
| 95 | - 'icon' => 'fa-bitbucket-square', |
|
| 96 | - 'class' => 'fa', |
|
| 97 | - 'enabled' => false, |
|
| 98 | - 'name' => esc_html__( 'Bitbucket square', 'redux-framework' ), |
|
| 99 | - 'background' => '', |
|
| 100 | - 'color' => '#205081', |
|
| 101 | - 'url' => '', |
|
| 102 | - 'order' => 6, |
|
| 103 | - ), |
|
| 104 | - 7 => array( |
|
| 105 | - 'id' => 'bitcoin', |
|
| 106 | - 'icon' => 'fa-btc', |
|
| 107 | - 'class' => 'fa', |
|
| 108 | - 'enabled' => false, |
|
| 109 | - 'name' => esc_html__( 'Bitcoin', 'redux-framework' ), |
|
| 110 | - 'background' => '', |
|
| 111 | - 'color' => '#000000', |
|
| 112 | - 'url' => '', |
|
| 113 | - 'order' => 7, |
|
| 114 | - ), |
|
| 115 | - 8 => array( |
|
| 116 | - 'id' => 'codepen', |
|
| 117 | - 'icon' => 'fa-codepen', |
|
| 118 | - 'class' => 'fa', |
|
| 119 | - 'enabled' => false, |
|
| 120 | - 'name' => esc_html__( 'CodePen', 'redux-framework' ), |
|
| 121 | - 'background' => '', |
|
| 122 | - 'color' => '#000000', |
|
| 123 | - 'url' => '', |
|
| 124 | - 'order' => 8, |
|
| 125 | - ), |
|
| 126 | - 9 => array( |
|
| 127 | - 'id' => 'css3', |
|
| 128 | - 'icon' => 'fa-css3', |
|
| 129 | - 'class' => 'fa', |
|
| 130 | - 'enabled' => false, |
|
| 131 | - 'name' => esc_html__( 'CSS3', 'redux-framework' ), |
|
| 132 | - 'background' => '', |
|
| 133 | - 'color' => '#000000', |
|
| 134 | - 'url' => '', |
|
| 135 | - 'order' => 9, |
|
| 136 | - ), |
|
| 137 | - 10 => array( |
|
| 138 | - 'id' => 'delicious', |
|
| 139 | - 'icon' => 'fa-delicious', |
|
| 140 | - 'class' => 'fa', |
|
| 141 | - 'enabled' => false, |
|
| 142 | - 'name' => esc_html__( 'Delicious', 'redux-framework' ), |
|
| 143 | - 'background' => '', |
|
| 144 | - 'color' => '#3399ff', |
|
| 145 | - 'url' => '', |
|
| 146 | - 'order' => 10, |
|
| 147 | - ), |
|
| 148 | - 11 => array( |
|
| 149 | - 'id' => 'deviantart', |
|
| 150 | - 'icon' => 'fa-deviantart', |
|
| 151 | - 'class' => 'fa', |
|
| 152 | - 'enabled' => false, |
|
| 153 | - 'name' => esc_html__( 'Deviantart', 'redux-framework' ), |
|
| 154 | - 'background' => '', |
|
| 155 | - 'color' => '#4e6252', |
|
| 156 | - 'url' => '', |
|
| 157 | - 'order' => 11, |
|
| 158 | - ), |
|
| 159 | - 12 => array( |
|
| 160 | - 'id' => 'digg', |
|
| 161 | - 'icon' => 'fa-digg', |
|
| 162 | - 'class' => 'fa', |
|
| 163 | - 'enabled' => false, |
|
| 164 | - 'name' => esc_html__( 'Digg', 'redux-framework' ), |
|
| 165 | - 'background' => '', |
|
| 166 | - 'color' => '#000000', |
|
| 167 | - 'url' => '', |
|
| 168 | - 'order' => 12, |
|
| 169 | - ), |
|
| 170 | - 13 => array( |
|
| 171 | - 'id' => 'dribbble', |
|
| 172 | - 'icon' => 'fa-dribbble', |
|
| 173 | - 'class' => 'fa', |
|
| 174 | - 'enabled' => false, |
|
| 175 | - 'name' => esc_html__( 'Dribbble', 'redux-framework' ), |
|
| 176 | - 'background' => '', |
|
| 177 | - 'color' => '#444444', |
|
| 178 | - 'url' => '', |
|
| 179 | - 'order' => 13, |
|
| 180 | - ), |
|
| 181 | - 14 => array( |
|
| 182 | - 'id' => 'dropbox', |
|
| 183 | - 'icon' => 'fa-dropbox', |
|
| 184 | - 'class' => 'fa', |
|
| 185 | - 'enabled' => false, |
|
| 186 | - 'name' => esc_html__( 'Dropbox', 'redux-framework' ), |
|
| 187 | - 'background' => '', |
|
| 188 | - 'color' => '#007ee5', |
|
| 189 | - 'url' => '', |
|
| 190 | - 'order' => 14, |
|
| 191 | - ), |
|
| 192 | - 15 => array( |
|
| 193 | - 'id' => 'drupal', |
|
| 194 | - 'icon' => 'fa-drupal', |
|
| 195 | - 'class' => 'fa', |
|
| 196 | - 'enabled' => false, |
|
| 197 | - 'name' => esc_html__( 'Drupal', 'redux-framework' ), |
|
| 198 | - 'background' => '', |
|
| 199 | - 'color' => '#0077c0', |
|
| 200 | - 'url' => '', |
|
| 201 | - 'order' => 15, |
|
| 202 | - ), |
|
| 203 | - 16 => array( |
|
| 204 | - 'id' => 'empire', |
|
| 205 | - 'icon' => 'fa-empire', |
|
| 206 | - 'class' => 'fa', |
|
| 207 | - 'enabled' => false, |
|
| 208 | - 'name' => esc_html__( 'Empire', 'redux-framework' ), |
|
| 209 | - 'background' => '', |
|
| 210 | - 'color' => '#000000', |
|
| 211 | - 'url' => '', |
|
| 212 | - 'order' => 16, |
|
| 213 | - ), |
|
| 214 | - 17 => array( |
|
| 215 | - 'id' => 'facebook', |
|
| 216 | - 'icon' => 'fa-facebook', |
|
| 217 | - 'class' => 'fa', |
|
| 218 | - 'enabled' => false, |
|
| 219 | - 'name' => esc_html__( 'Facebook', 'redux-framework' ), |
|
| 220 | - 'background' => '', |
|
| 221 | - 'color' => '#3b5998', |
|
| 222 | - 'url' => '', |
|
| 223 | - 'order' => 17, |
|
| 224 | - ), |
|
| 225 | - 18 => array( |
|
| 226 | - 'id' => 'facebook-square', |
|
| 227 | - 'icon' => 'fa-facebook-square', |
|
| 228 | - 'class' => 'fa', |
|
| 229 | - 'enabled' => false, |
|
| 230 | - 'name' => esc_html__( 'Facebook square', 'redux-framework' ), |
|
| 231 | - 'background' => '', |
|
| 232 | - 'color' => '#3b5998', |
|
| 233 | - 'url' => '', |
|
| 234 | - 'order' => 18, |
|
| 235 | - ), |
|
| 236 | - 19 => array( |
|
| 237 | - 'id' => 'flickr', |
|
| 238 | - 'icon' => 'fa-flickr', |
|
| 239 | - 'class' => 'fa', |
|
| 240 | - 'enabled' => false, |
|
| 241 | - 'name' => esc_html__( 'Flickr', 'redux-framework' ), |
|
| 242 | - 'background' => '', |
|
| 243 | - 'color' => '#0063dc', |
|
| 244 | - 'url' => '', |
|
| 245 | - 'order' => 19, |
|
| 246 | - ), |
|
| 247 | - 20 => array( |
|
| 248 | - 'id' => 'foursquare', |
|
| 249 | - 'icon' => 'fa-foursquare', |
|
| 250 | - 'class' => 'fa', |
|
| 251 | - 'enabled' => false, |
|
| 252 | - 'name' => esc_html__( 'FourSquare', 'redux-framework' ), |
|
| 253 | - 'background' => '', |
|
| 254 | - 'color' => '#0072b1', |
|
| 255 | - 'url' => '', |
|
| 256 | - 'order' => 20, |
|
| 257 | - ), |
|
| 258 | - 21 => array( |
|
| 259 | - 'id' => 'git', |
|
| 260 | - 'icon' => 'fa-git', |
|
| 261 | - 'class' => 'fa', |
|
| 262 | - 'enabled' => false, |
|
| 263 | - 'name' => esc_html__( 'git', 'redux-framework' ), |
|
| 264 | - 'background' => '', |
|
| 265 | - 'color' => '#000000', |
|
| 266 | - 'url' => '', |
|
| 267 | - 'order' => 21, |
|
| 268 | - ), |
|
| 269 | - 22 => array( |
|
| 270 | - 'id' => 'git-square', |
|
| 271 | - 'icon' => 'fa-git-square', |
|
| 272 | - 'class' => 'fa', |
|
| 273 | - 'enabled' => false, |
|
| 274 | - 'name' => esc_html__( 'git square', 'redux-framework' ), |
|
| 275 | - 'background' => '', |
|
| 276 | - 'color' => '#000000', |
|
| 277 | - 'url' => '', |
|
| 278 | - 'order' => 22, |
|
| 279 | - ), |
|
| 280 | - 23 => array( |
|
| 281 | - 'id' => 'github', |
|
| 282 | - 'icon' => 'fa-github', |
|
| 283 | - 'class' => 'fa', |
|
| 284 | - 'enabled' => false, |
|
| 285 | - 'name' => esc_html__( 'github', 'redux-framework' ), |
|
| 286 | - 'background' => '', |
|
| 287 | - 'color' => '#4183c4', |
|
| 288 | - 'url' => '', |
|
| 289 | - 'order' => 23, |
|
| 290 | - ), |
|
| 291 | - 24 => array( |
|
| 292 | - 'id' => 'github-alt', |
|
| 293 | - 'icon' => 'fa-github-alt', |
|
| 294 | - 'class' => 'fa', |
|
| 295 | - 'enabled' => false, |
|
| 296 | - 'name' => esc_html__( 'github alt', 'redux-framework' ), |
|
| 297 | - 'background' => '', |
|
| 298 | - 'color' => '#4183c4', |
|
| 299 | - 'url' => '', |
|
| 300 | - 'order' => 24, |
|
| 301 | - ), |
|
| 302 | - 25 => array( |
|
| 303 | - 'id' => 'github-square', |
|
| 304 | - 'icon' => 'fa-github-square', |
|
| 305 | - 'class' => 'fa', |
|
| 306 | - 'enabled' => false, |
|
| 307 | - 'name' => esc_html__( 'github square', 'redux-framework' ), |
|
| 308 | - 'background' => '', |
|
| 309 | - 'color' => '#4183c4', |
|
| 310 | - 'url' => '', |
|
| 311 | - 'order' => 25, |
|
| 312 | - ), |
|
| 313 | - 26 => array( |
|
| 314 | - 'id' => 'gittip', |
|
| 315 | - 'icon' => 'fa-gittip', |
|
| 316 | - 'class' => 'fa', |
|
| 317 | - 'enabled' => false, |
|
| 318 | - 'name' => esc_html__( 'git tip', 'redux-framework' ), |
|
| 319 | - 'background' => '', |
|
| 320 | - 'color' => '#000000', |
|
| 321 | - 'url' => '', |
|
| 322 | - 'order' => 26, |
|
| 323 | - ), |
|
| 324 | - 27 => array( |
|
| 325 | - 'id' => 'google', |
|
| 326 | - 'icon' => 'fa-google', |
|
| 327 | - 'class' => 'fa', |
|
| 328 | - 'enabled' => false, |
|
| 329 | - 'name' => esc_html__( 'Google', 'redux-framework' ), |
|
| 330 | - 'background' => '', |
|
| 331 | - 'color' => '#dd4b39', |
|
| 332 | - 'url' => '', |
|
| 333 | - 'order' => 27, |
|
| 334 | - ), |
|
| 335 | - 28 => array( |
|
| 336 | - 'id' => 'google-plus', |
|
| 337 | - 'icon' => 'fa-google-plus', |
|
| 338 | - 'class' => 'fa', |
|
| 339 | - 'enabled' => false, |
|
| 340 | - 'name' => esc_html__( 'Google Plus', 'redux-framework' ), |
|
| 341 | - 'background' => '', |
|
| 342 | - 'color' => '#dd4b39', |
|
| 343 | - 'url' => '', |
|
| 344 | - 'order' => 28, |
|
| 345 | - ), |
|
| 346 | - 29 => array( |
|
| 347 | - 'id' => 'google-plus-square', |
|
| 348 | - 'icon' => 'fa-google-plus-square', |
|
| 349 | - 'class' => 'fa', |
|
| 350 | - 'enabled' => false, |
|
| 351 | - 'name' => esc_html__( 'Google Plus square', 'redux-framework' ), |
|
| 352 | - 'background' => '', |
|
| 353 | - 'color' => '#dd4b39', |
|
| 354 | - 'url' => '', |
|
| 355 | - 'order' => 29, |
|
| 356 | - ), |
|
| 357 | - 30 => array( |
|
| 358 | - 'id' => 'hacker-news', |
|
| 359 | - 'icon' => 'fa-hacker-news', |
|
| 360 | - 'class' => 'fa', |
|
| 361 | - 'enabled' => false, |
|
| 362 | - 'name' => esc_html__( 'Hacker News', 'redux-framework' ), |
|
| 363 | - 'background' => '', |
|
| 364 | - 'color' => '#ff6600', |
|
| 365 | - 'url' => '', |
|
| 366 | - 'order' => 30, |
|
| 367 | - ), |
|
| 368 | - 31 => array( |
|
| 369 | - 'id' => 'html5', |
|
| 370 | - 'icon' => 'fa-html5', |
|
| 371 | - 'class' => 'fa', |
|
| 372 | - 'enabled' => false, |
|
| 373 | - 'name' => esc_html__( 'HTML5', 'redux-framework' ), |
|
| 374 | - 'background' => '', |
|
| 375 | - 'color' => '#e34f26', |
|
| 376 | - 'url' => '', |
|
| 377 | - 'order' => 31, |
|
| 378 | - ), |
|
| 379 | - 32 => array( |
|
| 380 | - 'id' => 'instagram', |
|
| 381 | - 'icon' => 'fa-instagram', |
|
| 382 | - 'class' => 'fa', |
|
| 383 | - 'enabled' => false, |
|
| 384 | - 'name' => esc_html__( 'Instagram', 'redux-framework' ), |
|
| 385 | - 'background' => '', |
|
| 386 | - 'color' => '#3f729b', |
|
| 387 | - 'url' => '', |
|
| 388 | - 'order' => 32, |
|
| 389 | - ), |
|
| 390 | - 33 => array( |
|
| 391 | - 'id' => 'joomla', |
|
| 392 | - 'icon' => 'fa-joomla', |
|
| 393 | - 'class' => 'fa', |
|
| 394 | - 'enabled' => false, |
|
| 395 | - 'name' => esc_html__( 'Joomla', 'redux-framework' ), |
|
| 396 | - 'background' => '', |
|
| 397 | - 'color' => '#000000', |
|
| 398 | - 'url' => '', |
|
| 399 | - 'order' => 33, |
|
| 400 | - ), |
|
| 401 | - 34 => array( |
|
| 402 | - 'id' => 'jsfiddle', |
|
| 403 | - 'icon' => 'fa-jsfiddle', |
|
| 404 | - 'class' => 'fa', |
|
| 405 | - 'enabled' => false, |
|
| 406 | - 'name' => esc_html__( 'JS Fiddle', 'redux-framework' ), |
|
| 407 | - 'background' => '', |
|
| 408 | - 'color' => '#000000', |
|
| 409 | - 'url' => '', |
|
| 410 | - 'order' => 34, |
|
| 411 | - ), |
|
| 412 | - 35 => array( |
|
| 413 | - 'id' => 'linkedin', |
|
| 414 | - 'icon' => 'fa-linkedin', |
|
| 415 | - 'class' => 'fa', |
|
| 416 | - 'enabled' => false, |
|
| 417 | - 'name' => esc_html__( 'LinkedIn', 'redux-framework' ), |
|
| 418 | - 'background' => '', |
|
| 419 | - 'color' => '#0976b4', |
|
| 420 | - 'url' => '', |
|
| 421 | - 'order' => 35, |
|
| 422 | - ), |
|
| 423 | - 36 => array( |
|
| 424 | - 'id' => 'linkedin-square', |
|
| 425 | - 'icon' => 'fa-linkedin-square', |
|
| 426 | - 'class' => 'fa', |
|
| 427 | - 'enabled' => false, |
|
| 428 | - 'name' => esc_html__( 'LinkedIn square', 'redux-framework' ), |
|
| 429 | - 'background' => '', |
|
| 430 | - 'color' => '#0976b4', |
|
| 431 | - 'url' => '', |
|
| 432 | - 'order' => 36, |
|
| 433 | - ), |
|
| 434 | - 37 => array( |
|
| 435 | - 'id' => 'linux', |
|
| 436 | - 'icon' => 'fa-linux', |
|
| 437 | - 'class' => 'fa', |
|
| 438 | - 'enabled' => false, |
|
| 439 | - 'name' => esc_html__( 'Linux', 'redux-framework' ), |
|
| 440 | - 'background' => '', |
|
| 441 | - 'color' => '#333333', |
|
| 442 | - 'url' => '', |
|
| 443 | - 'order' => 37, |
|
| 444 | - ), |
|
| 445 | - 38 => array( |
|
| 446 | - 'id' => 'maxcdn', |
|
| 447 | - 'icon' => 'fa-maxcdn', |
|
| 448 | - 'class' => 'fa', |
|
| 449 | - 'enabled' => false, |
|
| 450 | - 'name' => esc_html__( 'MaxCDN', 'redux-framework' ), |
|
| 451 | - 'background' => '', |
|
| 452 | - 'color' => '#f8711e', |
|
| 453 | - 'url' => '', |
|
| 454 | - 'order' => 38, |
|
| 455 | - ), |
|
| 456 | - 39 => array( |
|
| 457 | - 'id' => 'openid', |
|
| 458 | - 'icon' => 'fa-openid', |
|
| 459 | - 'class' => 'fa', |
|
| 460 | - 'enabled' => false, |
|
| 461 | - 'name' => esc_html__( 'OpenID', 'redux-framework' ), |
|
| 462 | - 'background' => '', |
|
| 463 | - 'color' => '#000000', |
|
| 464 | - 'url' => '', |
|
| 465 | - 'order' => 39, |
|
| 466 | - ), |
|
| 467 | - 40 => array( |
|
| 468 | - 'id' => 'pagelines', |
|
| 469 | - 'icon' => 'fa-pagelines', |
|
| 470 | - 'class' => 'fa', |
|
| 471 | - 'enabled' => false, |
|
| 472 | - 'name' => esc_html__( 'Page Lines', 'redux-framework' ), |
|
| 473 | - 'background' => '', |
|
| 474 | - 'color' => '#000000', |
|
| 475 | - 'url' => '', |
|
| 476 | - 'order' => 40, |
|
| 477 | - ), |
|
| 478 | - 41 => array( |
|
| 479 | - 'id' => 'pied-piper', |
|
| 480 | - 'icon' => 'fa-pied-piper', |
|
| 481 | - 'class' => 'fa', |
|
| 482 | - 'enabled' => false, |
|
| 483 | - 'name' => esc_html__( 'Pied Piper', 'redux-framework' ), |
|
| 484 | - 'background' => '', |
|
| 485 | - 'color' => '#000000', |
|
| 486 | - 'url' => '', |
|
| 487 | - 'order' => 41, |
|
| 488 | - ), |
|
| 489 | - 42 => array( |
|
| 490 | - 'id' => 'pied-piper-alt', |
|
| 491 | - 'icon' => 'fa-pied-piper-alt', |
|
| 492 | - 'class' => 'fa', |
|
| 493 | - 'enabled' => false, |
|
| 494 | - 'name' => esc_html__( 'Pied Piper alt', 'redux-framework' ), |
|
| 495 | - 'background' => '', |
|
| 496 | - 'color' => '#000000', |
|
| 497 | - 'url' => '', |
|
| 498 | - 'order' => 42, |
|
| 499 | - ), |
|
| 500 | - 43 => array( |
|
| 501 | - 'id' => 'pinterest', |
|
| 502 | - 'icon' => 'fa-pinterest', |
|
| 503 | - 'class' => 'fa', |
|
| 504 | - 'enabled' => false, |
|
| 505 | - 'name' => esc_html__( 'Pinterest', 'redux-framework' ), |
|
| 506 | - 'background' => '', |
|
| 507 | - 'color' => '#1769ff', |
|
| 508 | - 'url' => '', |
|
| 509 | - 'order' => 43, |
|
| 510 | - ), |
|
| 511 | - 44 => array( |
|
| 512 | - 'id' => 'pinterest-square', |
|
| 513 | - 'icon' => 'fa-pinterest-square', |
|
| 514 | - 'class' => 'fa', |
|
| 515 | - 'enabled' => false, |
|
| 516 | - 'name' => esc_html__( 'Pinterest square', 'redux-framework' ), |
|
| 517 | - 'background' => '', |
|
| 518 | - 'color' => '#1769ff', |
|
| 519 | - 'url' => '', |
|
| 520 | - 'order' => 44, |
|
| 521 | - ), |
|
| 522 | - 45 => array( |
|
| 523 | - 'id' => 'qq', |
|
| 524 | - 'icon' => 'fa-qq', |
|
| 525 | - 'class' => 'fa', |
|
| 526 | - 'enabled' => false, |
|
| 527 | - 'name' => esc_html__( 'QQ', 'redux-framework' ), |
|
| 528 | - 'background' => '', |
|
| 529 | - 'color' => '#000000', |
|
| 530 | - 'url' => '', |
|
| 531 | - 'order' => 45, |
|
| 532 | - ), |
|
| 533 | - 46 => array( |
|
| 534 | - 'id' => 'rebel', |
|
| 535 | - 'icon' => 'fa-rebel', |
|
| 536 | - 'class' => 'fa', |
|
| 537 | - 'enabled' => false, |
|
| 538 | - 'name' => esc_html__( 'Rebel', 'redux-framework' ), |
|
| 539 | - 'background' => '', |
|
| 540 | - 'color' => '#517fa4', |
|
| 541 | - 'url' => '', |
|
| 542 | - 'order' => 46, |
|
| 543 | - ), |
|
| 544 | - 47 => array( |
|
| 545 | - 'id' => 'reddit', |
|
| 546 | - 'icon' => 'fa-reddit', |
|
| 547 | - 'class' => 'fa', |
|
| 548 | - 'enabled' => false, |
|
| 549 | - 'name' => esc_html__( 'Reddit', 'redux-framework' ), |
|
| 550 | - 'background' => '', |
|
| 551 | - 'color' => '#ff4500', |
|
| 552 | - 'url' => '', |
|
| 553 | - 'order' => 47, |
|
| 554 | - ), |
|
| 555 | - 48 => array( |
|
| 556 | - 'id' => 'reddit-square', |
|
| 557 | - 'icon' => 'fa-reddit-square', |
|
| 558 | - 'class' => 'fa', |
|
| 559 | - 'enabled' => false, |
|
| 560 | - 'name' => esc_html__( 'Reddit square', 'redux-framework' ), |
|
| 561 | - 'background' => '', |
|
| 562 | - 'color' => '#ff4500', |
|
| 563 | - 'url' => '', |
|
| 564 | - 'order' => 48, |
|
| 565 | - ), |
|
| 566 | - 49 => array( |
|
| 567 | - 'id' => 'renren', |
|
| 568 | - 'icon' => 'fa-renren', |
|
| 569 | - 'class' => 'fa', |
|
| 570 | - 'enabled' => false, |
|
| 571 | - 'name' => esc_html__( 'Ren Ren', 'redux-framework' ), |
|
| 572 | - 'background' => '', |
|
| 573 | - 'color' => '#007bb6', |
|
| 574 | - 'url' => '', |
|
| 575 | - 'order' => 49, |
|
| 576 | - ), |
|
| 577 | - 50 => array( |
|
| 578 | - 'id' => 'share-alt', |
|
| 579 | - 'icon' => 'fa-share-alt', |
|
| 580 | - 'class' => 'fa', |
|
| 581 | - 'enabled' => false, |
|
| 582 | - 'name' => esc_html__( 'Share alt', 'redux-framework' ), |
|
| 583 | - 'background' => '', |
|
| 584 | - 'color' => '#000000', |
|
| 585 | - 'url' => '', |
|
| 586 | - 'order' => 50, |
|
| 587 | - ), |
|
| 588 | - 51 => array( |
|
| 589 | - 'id' => 'share-alt-square', |
|
| 590 | - 'icon' => 'fa-share-alt-square', |
|
| 591 | - 'class' => 'fa', |
|
| 592 | - 'enabled' => false, |
|
| 593 | - 'name' => esc_html__( 'Share square', 'redux-framework' ), |
|
| 594 | - 'background' => '', |
|
| 595 | - 'color' => '#000000', |
|
| 596 | - 'url' => '', |
|
| 597 | - 'order' => 51, |
|
| 598 | - ), |
|
| 599 | - 52 => array( |
|
| 600 | - 'id' => 'skype', |
|
| 601 | - 'icon' => 'fa-skype', |
|
| 602 | - 'class' => 'fa', |
|
| 603 | - 'enabled' => false, |
|
| 604 | - 'name' => esc_html__( 'Skype', 'redux-framework' ), |
|
| 605 | - 'background' => '', |
|
| 606 | - 'color' => '#00aff0', |
|
| 607 | - 'url' => '', |
|
| 608 | - 'order' => 52, |
|
| 609 | - ), |
|
| 610 | - 53 => array( |
|
| 611 | - 'id' => 'slack', |
|
| 612 | - 'icon' => 'fa-slack', |
|
| 613 | - 'class' => 'fa', |
|
| 614 | - 'enabled' => false, |
|
| 615 | - 'name' => esc_html__( 'Slack', 'redux-framework' ), |
|
| 616 | - 'background' => '', |
|
| 617 | - 'color' => '#000000', |
|
| 618 | - 'url' => '', |
|
| 619 | - 'order' => 53, |
|
| 620 | - ), |
|
| 621 | - 54 => array( |
|
| 622 | - 'id' => 'soundcloud', |
|
| 623 | - 'icon' => 'fa-soundcloud', |
|
| 624 | - 'class' => 'fa', |
|
| 625 | - 'enabled' => false, |
|
| 626 | - 'name' => esc_html__( 'Sound Cloud', 'redux-framework' ), |
|
| 627 | - 'background' => '', |
|
| 628 | - 'color' => '#f80', |
|
| 629 | - 'url' => '', |
|
| 630 | - 'order' => 54, |
|
| 631 | - ), |
|
| 632 | - 55 => array( |
|
| 633 | - 'id' => 'spotify', |
|
| 634 | - 'icon' => 'fa-spotify', |
|
| 635 | - 'class' => 'fa', |
|
| 636 | - 'enabled' => false, |
|
| 637 | - 'name' => esc_html__( 'Spotify', 'redux-framework' ), |
|
| 638 | - 'background' => '', |
|
| 639 | - 'color' => '#7ab800', |
|
| 640 | - 'url' => '', |
|
| 641 | - 'order' => 55, |
|
| 642 | - ), |
|
| 643 | - 56 => array( |
|
| 644 | - 'id' => 'stack-exchange', |
|
| 645 | - 'icon' => 'fa-stack-exchange', |
|
| 646 | - 'class' => 'fa', |
|
| 647 | - 'enabled' => false, |
|
| 648 | - 'name' => esc_html__( 'Stack Exchange', 'redux-framework' ), |
|
| 649 | - 'background' => '', |
|
| 650 | - 'color' => '#000000', |
|
| 651 | - 'url' => '', |
|
| 652 | - 'order' => 56, |
|
| 653 | - ), |
|
| 654 | - 57 => array( |
|
| 655 | - 'id' => 'stack-overflow', |
|
| 656 | - 'icon' => 'fa-stack-overflow', |
|
| 657 | - 'class' => 'fa', |
|
| 658 | - 'enabled' => false, |
|
| 659 | - 'name' => esc_html__( 'Stack Overflow', 'redux-framework' ), |
|
| 660 | - 'background' => '', |
|
| 661 | - 'color' => '#fe7a15', |
|
| 662 | - 'url' => '', |
|
| 663 | - 'order' => 57, |
|
| 664 | - ), |
|
| 665 | - 58 => array( |
|
| 666 | - 'id' => 'steam', |
|
| 667 | - 'icon' => 'fa-steam', |
|
| 668 | - 'class' => 'fa', |
|
| 669 | - 'enabled' => false, |
|
| 670 | - 'name' => esc_html__( 'Steam', 'redux-framework' ), |
|
| 671 | - 'background' => '', |
|
| 672 | - 'color' => '#000000', |
|
| 673 | - 'url' => '', |
|
| 674 | - 'order' => 58, |
|
| 675 | - ), |
|
| 676 | - 59 => array( |
|
| 677 | - 'id' => 'steam-square', |
|
| 678 | - 'icon' => 'fa-steam-square', |
|
| 679 | - 'class' => 'fa', |
|
| 680 | - 'enabled' => false, |
|
| 681 | - 'name' => esc_html__( 'Steam square', 'redux-framework' ), |
|
| 682 | - 'background' => '', |
|
| 683 | - 'color' => '#000000', |
|
| 684 | - 'url' => '', |
|
| 685 | - 'order' => 59, |
|
| 686 | - ), |
|
| 687 | - 60 => array( |
|
| 688 | - 'id' => 'stumbleupon', |
|
| 689 | - 'icon' => 'fa-stumbleupon', |
|
| 690 | - 'class' => 'fa', |
|
| 691 | - 'enabled' => false, |
|
| 692 | - 'name' => esc_html__( 'Stumble Upon', 'redux-framework' ), |
|
| 693 | - 'background' => '', |
|
| 694 | - 'color' => '#eb4924', |
|
| 695 | - 'url' => '', |
|
| 696 | - 'order' => 60, |
|
| 697 | - ), |
|
| 698 | - 61 => array( |
|
| 699 | - 'id' => 'stumbleupon-circle', |
|
| 700 | - 'icon' => 'fa-stumbleupon-circle', |
|
| 701 | - 'class' => 'fa', |
|
| 702 | - 'enabled' => false, |
|
| 703 | - 'name' => esc_html__( 'Stumble Upon circle', 'redux-framework' ), |
|
| 704 | - 'background' => '', |
|
| 705 | - 'color' => '#eb4924', |
|
| 706 | - 'url' => '', |
|
| 707 | - 'order' => 61, |
|
| 708 | - ), |
|
| 709 | - 62 => array( |
|
| 710 | - 'id' => 'tencent-weibo', |
|
| 711 | - 'icon' => 'fa-tencent-weibo', |
|
| 712 | - 'class' => 'fa', |
|
| 713 | - 'enabled' => false, |
|
| 714 | - 'name' => esc_html__( 'Tencent Weibo', 'redux-framework' ), |
|
| 715 | - 'background' => '', |
|
| 716 | - 'color' => '#000000', |
|
| 717 | - 'url' => '', |
|
| 718 | - 'order' => 62, |
|
| 719 | - ), |
|
| 720 | - 63 => array( |
|
| 721 | - 'id' => 'trello', |
|
| 722 | - 'icon' => 'fa-trello', |
|
| 723 | - 'class' => 'fa', |
|
| 724 | - 'enabled' => false, |
|
| 725 | - 'name' => esc_html__( 'Trello', 'redux-framework' ), |
|
| 726 | - 'background' => '', |
|
| 727 | - 'color' => '#256a92', |
|
| 728 | - 'url' => '', |
|
| 729 | - 'order' => 63, |
|
| 730 | - ), |
|
| 731 | - 64 => array( |
|
| 732 | - 'id' => 'tumblr', |
|
| 733 | - 'icon' => 'fa-tumblr', |
|
| 734 | - 'class' => 'fa', |
|
| 735 | - 'enabled' => false, |
|
| 736 | - 'name' => esc_html__( 'Tumblr', 'redux-framework' ), |
|
| 737 | - 'background' => '', |
|
| 738 | - 'color' => '#35465c', |
|
| 739 | - 'url' => '', |
|
| 740 | - 'order' => 64, |
|
| 741 | - ), |
|
| 742 | - 65 => array( |
|
| 743 | - 'id' => 'tumblr-square', |
|
| 744 | - 'icon' => 'fa-tumblr-square', |
|
| 745 | - 'class' => 'fa', |
|
| 746 | - 'enabled' => false, |
|
| 747 | - 'name' => esc_html__( 'Tumblr square', 'redux-framework' ), |
|
| 748 | - 'background' => '', |
|
| 749 | - 'color' => '#35465c', |
|
| 750 | - 'url' => '', |
|
| 751 | - 'order' => 65, |
|
| 752 | - ), |
|
| 753 | - 66 => array( |
|
| 754 | - 'id' => 'twitter', |
|
| 755 | - 'icon' => 'fa-x-twitter', |
|
| 756 | - 'class' => 'fa-brands', |
|
| 757 | - 'enabled' => false, |
|
| 758 | - 'name' => esc_html__( 'X', 'redux-framework' ), |
|
| 759 | - 'background' => '', |
|
| 760 | - 'color' => '#55acee', |
|
| 761 | - 'url' => '', |
|
| 762 | - 'order' => 66, |
|
| 763 | - ), |
|
| 764 | - 67 => array( |
|
| 765 | - 'id' => 'twitter-square', |
|
| 766 | - 'icon' => 'fa-square-x-twitter', |
|
| 767 | - 'class' => 'fa-brands', |
|
| 768 | - 'enabled' => false, |
|
| 769 | - 'name' => esc_html__( 'X square', 'redux-framework' ), |
|
| 770 | - 'background' => '', |
|
| 771 | - 'color' => '#55acee', |
|
| 772 | - 'url' => '', |
|
| 773 | - 'order' => 67, |
|
| 774 | - ), |
|
| 775 | - 68 => array( |
|
| 776 | - 'id' => 'vimeo-square', |
|
| 777 | - 'icon' => 'fa-vimeo-square', |
|
| 778 | - 'class' => 'fa', |
|
| 779 | - 'enabled' => false, |
|
| 780 | - 'name' => esc_html__( 'Vimeo square', 'redux-framework' ), |
|
| 781 | - 'background' => '', |
|
| 782 | - 'color' => '#1ab7ea', |
|
| 783 | - 'url' => '', |
|
| 784 | - 'order' => 68, |
|
| 785 | - ), |
|
| 786 | - 69 => array( |
|
| 787 | - 'id' => 'vine', |
|
| 788 | - 'icon' => 'fa-vine', |
|
| 789 | - 'class' => 'fa', |
|
| 790 | - 'enabled' => false, |
|
| 791 | - 'name' => esc_html__( 'Vine', 'redux-framework' ), |
|
| 792 | - 'background' => '', |
|
| 793 | - 'color' => '#00b488', |
|
| 794 | - 'url' => '', |
|
| 795 | - 'order' => 69, |
|
| 796 | - ), |
|
| 797 | - 70 => array( |
|
| 798 | - 'id' => 'vk', |
|
| 799 | - 'icon' => 'fa-vk', |
|
| 800 | - 'class' => 'fa', |
|
| 801 | - 'enabled' => false, |
|
| 802 | - 'name' => esc_html__( 'VK', 'redux-framework' ), |
|
| 803 | - 'background' => '', |
|
| 804 | - 'color' => '#000000', |
|
| 805 | - 'url' => '', |
|
| 806 | - 'order' => 70, |
|
| 807 | - ), |
|
| 808 | - 71 => array( |
|
| 809 | - 'id' => 'weibo', |
|
| 810 | - 'icon' => 'fa-weibo', |
|
| 811 | - 'class' => 'fa', |
|
| 812 | - 'enabled' => false, |
|
| 813 | - 'name' => esc_html__( 'Weibo', 'redux-framework' ), |
|
| 814 | - 'background' => '', |
|
| 815 | - 'color' => '#000000', |
|
| 816 | - 'url' => '', |
|
| 817 | - 'order' => 71, |
|
| 818 | - ), |
|
| 819 | - 72 => array( |
|
| 820 | - 'id' => 'weixin', |
|
| 821 | - 'icon' => 'fa-weixin', |
|
| 822 | - 'class' => 'fa', |
|
| 823 | - 'enabled' => false, |
|
| 824 | - 'name' => esc_html__( 'Weixin', 'redux-framework' ), |
|
| 825 | - 'background' => '', |
|
| 826 | - 'color' => '#000000', |
|
| 827 | - 'url' => '', |
|
| 828 | - 'order' => 72, |
|
| 829 | - ), |
|
| 830 | - 73 => array( |
|
| 831 | - 'id' => 'windows', |
|
| 832 | - 'icon' => 'fa-windows', |
|
| 833 | - 'class' => 'fa', |
|
| 834 | - 'enabled' => false, |
|
| 835 | - 'name' => esc_html__( 'Windows', 'redux-framework' ), |
|
| 836 | - 'background' => '', |
|
| 837 | - 'color' => '#00bcf2', |
|
| 838 | - 'url' => '', |
|
| 839 | - 'order' => 73, |
|
| 840 | - ), |
|
| 841 | - 74 => array( |
|
| 842 | - 'id' => 'wordpress', |
|
| 843 | - 'icon' => 'fa-wordpress', |
|
| 844 | - 'class' => 'fa', |
|
| 845 | - 'enabled' => false, |
|
| 846 | - 'name' => esc_html__( 'WordPress', 'redux-framework' ), |
|
| 847 | - 'background' => '', |
|
| 848 | - 'color' => '#21759b', |
|
| 849 | - 'url' => '', |
|
| 850 | - 'order' => 74, |
|
| 851 | - ), |
|
| 852 | - 75 => array( |
|
| 853 | - 'id' => 'xing', |
|
| 854 | - 'icon' => 'fa-xing', |
|
| 855 | - 'class' => 'fa', |
|
| 856 | - 'enabled' => false, |
|
| 857 | - 'name' => esc_html__( 'Xing', 'redux-framework' ), |
|
| 858 | - 'background' => '', |
|
| 859 | - 'color' => '#026466', |
|
| 860 | - 'url' => '', |
|
| 861 | - 'order' => 75, |
|
| 862 | - ), |
|
| 863 | - 76 => array( |
|
| 864 | - 'id' => 'xing-square', |
|
| 865 | - 'icon' => 'fa-xing-square', |
|
| 866 | - 'class' => 'fa', |
|
| 867 | - 'enabled' => false, |
|
| 868 | - 'name' => esc_html__( 'Xing square', 'redux-framework' ), |
|
| 869 | - 'background' => '', |
|
| 870 | - 'color' => '#026466', |
|
| 871 | - 'url' => '', |
|
| 872 | - 'order' => 76, |
|
| 873 | - ), |
|
| 874 | - 77 => array( |
|
| 875 | - 'id' => 'yahoo', |
|
| 876 | - 'icon' => 'fa-yahoo', |
|
| 877 | - 'class' => 'fa', |
|
| 878 | - 'enabled' => false, |
|
| 879 | - 'name' => esc_html__( 'Yahoo', 'redux-framework' ), |
|
| 880 | - 'background' => '', |
|
| 881 | - 'color' => '#400191', |
|
| 882 | - 'url' => '', |
|
| 883 | - 'order' => 77, |
|
| 884 | - ), |
|
| 885 | - 78 => array( |
|
| 886 | - 'id' => 'yelp', |
|
| 887 | - 'icon' => 'fa-yelp', |
|
| 888 | - 'class' => 'fa', |
|
| 889 | - 'enabled' => false, |
|
| 890 | - 'name' => esc_html__( 'Yelp', 'redux-framework' ), |
|
| 891 | - 'background' => '', |
|
| 892 | - 'color' => '#C93C27', |
|
| 893 | - 'url' => '', |
|
| 894 | - 'order' => 78, |
|
| 895 | - ), |
|
| 896 | - 79 => array( |
|
| 897 | - 'id' => 'youtube', |
|
| 898 | - 'icon' => 'fa-youtube', |
|
| 899 | - 'class' => 'fa', |
|
| 900 | - 'enabled' => false, |
|
| 901 | - 'name' => esc_html__( 'YouTube', 'redux-framework' ), |
|
| 902 | - 'background' => '', |
|
| 903 | - 'color' => '#e52d27', |
|
| 904 | - 'url' => '', |
|
| 905 | - 'order' => 79, |
|
| 906 | - ), |
|
| 907 | - 80 => array( |
|
| 908 | - 'id' => 'youtube-play', |
|
| 909 | - 'icon' => 'fa-youtube-play', |
|
| 910 | - 'class' => 'fa', |
|
| 911 | - 'enabled' => false, |
|
| 912 | - 'name' => esc_html__( 'YouTube play', 'redux-framework' ), |
|
| 913 | - 'background' => '', |
|
| 914 | - 'color' => '#e52d27', |
|
| 915 | - 'url' => '', |
|
| 916 | - 'order' => 80, |
|
| 917 | - ), |
|
| 918 | - 81 => array( |
|
| 919 | - 'id' => 'youtube-square', |
|
| 920 | - 'icon' => 'fa-youtube-square', |
|
| 921 | - 'class' => 'fa', |
|
| 922 | - 'enabled' => false, |
|
| 923 | - 'name' => esc_html__( 'YouTube square', 'redux-framework' ), |
|
| 924 | - 'background' => '', |
|
| 925 | - 'color' => '#e52d27', |
|
| 926 | - 'url' => '', |
|
| 927 | - 'order' => 81, |
|
| 928 | - ), |
|
| 929 | - ); |
|
| 930 | - } |
|
| 931 | - } |
|
| 19 | + /** |
|
| 20 | + * Get defaults array. |
|
| 21 | + * |
|
| 22 | + * @return array |
|
| 23 | + */ |
|
| 24 | + public static function get_social_media_defaults(): array { |
|
| 25 | + return array( |
|
| 26 | + 0 => array( |
|
| 27 | + 'id' => 'adn', |
|
| 28 | + 'icon' => 'fa-adn', |
|
| 29 | + 'class' => 'fa', |
|
| 30 | + 'enabled' => false, |
|
| 31 | + 'name' => esc_html__( 'ADN', 'redux-framework' ), |
|
| 32 | + 'background' => '', |
|
| 33 | + 'color' => '#000000', |
|
| 34 | + 'url' => '', |
|
| 35 | + 'order' => 0, |
|
| 36 | + ), |
|
| 37 | + 1 => array( |
|
| 38 | + 'id' => 'android', |
|
| 39 | + 'icon' => 'fa-android', |
|
| 40 | + 'class' => 'fa', |
|
| 41 | + 'enabled' => false, |
|
| 42 | + 'name' => esc_html__( 'Android', 'redux-framework' ), |
|
| 43 | + 'background' => '', |
|
| 44 | + 'color' => '#A4C639', |
|
| 45 | + 'url' => '', |
|
| 46 | + 'order' => 1, |
|
| 47 | + ), |
|
| 48 | + 2 => array( |
|
| 49 | + 'id' => 'apple', |
|
| 50 | + 'icon' => 'fa-apple', |
|
| 51 | + 'class' => 'fa', |
|
| 52 | + 'enabled' => false, |
|
| 53 | + 'name' => esc_html__( 'Apple', 'redux-framework' ), |
|
| 54 | + 'style' => '', |
|
| 55 | + 'background' => '', |
|
| 56 | + 'color' => '#e4e4e5', |
|
| 57 | + 'url' => '', |
|
| 58 | + 'order' => 2, |
|
| 59 | + ), |
|
| 60 | + 3 => array( |
|
| 61 | + 'id' => 'behance', |
|
| 62 | + 'icon' => 'fa-behance', |
|
| 63 | + 'class' => 'fa', |
|
| 64 | + 'enabled' => false, |
|
| 65 | + 'name' => esc_html__( 'behance', 'redux-framework' ), |
|
| 66 | + 'background' => '', |
|
| 67 | + 'color' => '#1769ff', |
|
| 68 | + 'url' => '', |
|
| 69 | + 'order' => 3, |
|
| 70 | + ), |
|
| 71 | + 4 => array( |
|
| 72 | + 'id' => 'behance-square', |
|
| 73 | + 'icon' => 'fa-behance-square', |
|
| 74 | + 'class' => 'fa', |
|
| 75 | + 'enabled' => false, |
|
| 76 | + 'name' => esc_html__( 'behance square', 'redux-framework' ), |
|
| 77 | + 'background' => '', |
|
| 78 | + 'color' => '#1769ff', |
|
| 79 | + 'url' => '', |
|
| 80 | + 'order' => 4, |
|
| 81 | + ), |
|
| 82 | + 5 => array( |
|
| 83 | + 'id' => 'bitbucket', |
|
| 84 | + 'icon' => 'fa-bitbucket', |
|
| 85 | + 'class' => 'fa', |
|
| 86 | + 'enabled' => false, |
|
| 87 | + 'name' => esc_html__( 'Bitbucket', 'redux-framework' ), |
|
| 88 | + 'background' => '', |
|
| 89 | + 'color' => '#205081', |
|
| 90 | + 'url' => '', |
|
| 91 | + 'order' => 5, |
|
| 92 | + ), |
|
| 93 | + 6 => array( |
|
| 94 | + 'id' => 'bitbucket-square', |
|
| 95 | + 'icon' => 'fa-bitbucket-square', |
|
| 96 | + 'class' => 'fa', |
|
| 97 | + 'enabled' => false, |
|
| 98 | + 'name' => esc_html__( 'Bitbucket square', 'redux-framework' ), |
|
| 99 | + 'background' => '', |
|
| 100 | + 'color' => '#205081', |
|
| 101 | + 'url' => '', |
|
| 102 | + 'order' => 6, |
|
| 103 | + ), |
|
| 104 | + 7 => array( |
|
| 105 | + 'id' => 'bitcoin', |
|
| 106 | + 'icon' => 'fa-btc', |
|
| 107 | + 'class' => 'fa', |
|
| 108 | + 'enabled' => false, |
|
| 109 | + 'name' => esc_html__( 'Bitcoin', 'redux-framework' ), |
|
| 110 | + 'background' => '', |
|
| 111 | + 'color' => '#000000', |
|
| 112 | + 'url' => '', |
|
| 113 | + 'order' => 7, |
|
| 114 | + ), |
|
| 115 | + 8 => array( |
|
| 116 | + 'id' => 'codepen', |
|
| 117 | + 'icon' => 'fa-codepen', |
|
| 118 | + 'class' => 'fa', |
|
| 119 | + 'enabled' => false, |
|
| 120 | + 'name' => esc_html__( 'CodePen', 'redux-framework' ), |
|
| 121 | + 'background' => '', |
|
| 122 | + 'color' => '#000000', |
|
| 123 | + 'url' => '', |
|
| 124 | + 'order' => 8, |
|
| 125 | + ), |
|
| 126 | + 9 => array( |
|
| 127 | + 'id' => 'css3', |
|
| 128 | + 'icon' => 'fa-css3', |
|
| 129 | + 'class' => 'fa', |
|
| 130 | + 'enabled' => false, |
|
| 131 | + 'name' => esc_html__( 'CSS3', 'redux-framework' ), |
|
| 132 | + 'background' => '', |
|
| 133 | + 'color' => '#000000', |
|
| 134 | + 'url' => '', |
|
| 135 | + 'order' => 9, |
|
| 136 | + ), |
|
| 137 | + 10 => array( |
|
| 138 | + 'id' => 'delicious', |
|
| 139 | + 'icon' => 'fa-delicious', |
|
| 140 | + 'class' => 'fa', |
|
| 141 | + 'enabled' => false, |
|
| 142 | + 'name' => esc_html__( 'Delicious', 'redux-framework' ), |
|
| 143 | + 'background' => '', |
|
| 144 | + 'color' => '#3399ff', |
|
| 145 | + 'url' => '', |
|
| 146 | + 'order' => 10, |
|
| 147 | + ), |
|
| 148 | + 11 => array( |
|
| 149 | + 'id' => 'deviantart', |
|
| 150 | + 'icon' => 'fa-deviantart', |
|
| 151 | + 'class' => 'fa', |
|
| 152 | + 'enabled' => false, |
|
| 153 | + 'name' => esc_html__( 'Deviantart', 'redux-framework' ), |
|
| 154 | + 'background' => '', |
|
| 155 | + 'color' => '#4e6252', |
|
| 156 | + 'url' => '', |
|
| 157 | + 'order' => 11, |
|
| 158 | + ), |
|
| 159 | + 12 => array( |
|
| 160 | + 'id' => 'digg', |
|
| 161 | + 'icon' => 'fa-digg', |
|
| 162 | + 'class' => 'fa', |
|
| 163 | + 'enabled' => false, |
|
| 164 | + 'name' => esc_html__( 'Digg', 'redux-framework' ), |
|
| 165 | + 'background' => '', |
|
| 166 | + 'color' => '#000000', |
|
| 167 | + 'url' => '', |
|
| 168 | + 'order' => 12, |
|
| 169 | + ), |
|
| 170 | + 13 => array( |
|
| 171 | + 'id' => 'dribbble', |
|
| 172 | + 'icon' => 'fa-dribbble', |
|
| 173 | + 'class' => 'fa', |
|
| 174 | + 'enabled' => false, |
|
| 175 | + 'name' => esc_html__( 'Dribbble', 'redux-framework' ), |
|
| 176 | + 'background' => '', |
|
| 177 | + 'color' => '#444444', |
|
| 178 | + 'url' => '', |
|
| 179 | + 'order' => 13, |
|
| 180 | + ), |
|
| 181 | + 14 => array( |
|
| 182 | + 'id' => 'dropbox', |
|
| 183 | + 'icon' => 'fa-dropbox', |
|
| 184 | + 'class' => 'fa', |
|
| 185 | + 'enabled' => false, |
|
| 186 | + 'name' => esc_html__( 'Dropbox', 'redux-framework' ), |
|
| 187 | + 'background' => '', |
|
| 188 | + 'color' => '#007ee5', |
|
| 189 | + 'url' => '', |
|
| 190 | + 'order' => 14, |
|
| 191 | + ), |
|
| 192 | + 15 => array( |
|
| 193 | + 'id' => 'drupal', |
|
| 194 | + 'icon' => 'fa-drupal', |
|
| 195 | + 'class' => 'fa', |
|
| 196 | + 'enabled' => false, |
|
| 197 | + 'name' => esc_html__( 'Drupal', 'redux-framework' ), |
|
| 198 | + 'background' => '', |
|
| 199 | + 'color' => '#0077c0', |
|
| 200 | + 'url' => '', |
|
| 201 | + 'order' => 15, |
|
| 202 | + ), |
|
| 203 | + 16 => array( |
|
| 204 | + 'id' => 'empire', |
|
| 205 | + 'icon' => 'fa-empire', |
|
| 206 | + 'class' => 'fa', |
|
| 207 | + 'enabled' => false, |
|
| 208 | + 'name' => esc_html__( 'Empire', 'redux-framework' ), |
|
| 209 | + 'background' => '', |
|
| 210 | + 'color' => '#000000', |
|
| 211 | + 'url' => '', |
|
| 212 | + 'order' => 16, |
|
| 213 | + ), |
|
| 214 | + 17 => array( |
|
| 215 | + 'id' => 'facebook', |
|
| 216 | + 'icon' => 'fa-facebook', |
|
| 217 | + 'class' => 'fa', |
|
| 218 | + 'enabled' => false, |
|
| 219 | + 'name' => esc_html__( 'Facebook', 'redux-framework' ), |
|
| 220 | + 'background' => '', |
|
| 221 | + 'color' => '#3b5998', |
|
| 222 | + 'url' => '', |
|
| 223 | + 'order' => 17, |
|
| 224 | + ), |
|
| 225 | + 18 => array( |
|
| 226 | + 'id' => 'facebook-square', |
|
| 227 | + 'icon' => 'fa-facebook-square', |
|
| 228 | + 'class' => 'fa', |
|
| 229 | + 'enabled' => false, |
|
| 230 | + 'name' => esc_html__( 'Facebook square', 'redux-framework' ), |
|
| 231 | + 'background' => '', |
|
| 232 | + 'color' => '#3b5998', |
|
| 233 | + 'url' => '', |
|
| 234 | + 'order' => 18, |
|
| 235 | + ), |
|
| 236 | + 19 => array( |
|
| 237 | + 'id' => 'flickr', |
|
| 238 | + 'icon' => 'fa-flickr', |
|
| 239 | + 'class' => 'fa', |
|
| 240 | + 'enabled' => false, |
|
| 241 | + 'name' => esc_html__( 'Flickr', 'redux-framework' ), |
|
| 242 | + 'background' => '', |
|
| 243 | + 'color' => '#0063dc', |
|
| 244 | + 'url' => '', |
|
| 245 | + 'order' => 19, |
|
| 246 | + ), |
|
| 247 | + 20 => array( |
|
| 248 | + 'id' => 'foursquare', |
|
| 249 | + 'icon' => 'fa-foursquare', |
|
| 250 | + 'class' => 'fa', |
|
| 251 | + 'enabled' => false, |
|
| 252 | + 'name' => esc_html__( 'FourSquare', 'redux-framework' ), |
|
| 253 | + 'background' => '', |
|
| 254 | + 'color' => '#0072b1', |
|
| 255 | + 'url' => '', |
|
| 256 | + 'order' => 20, |
|
| 257 | + ), |
|
| 258 | + 21 => array( |
|
| 259 | + 'id' => 'git', |
|
| 260 | + 'icon' => 'fa-git', |
|
| 261 | + 'class' => 'fa', |
|
| 262 | + 'enabled' => false, |
|
| 263 | + 'name' => esc_html__( 'git', 'redux-framework' ), |
|
| 264 | + 'background' => '', |
|
| 265 | + 'color' => '#000000', |
|
| 266 | + 'url' => '', |
|
| 267 | + 'order' => 21, |
|
| 268 | + ), |
|
| 269 | + 22 => array( |
|
| 270 | + 'id' => 'git-square', |
|
| 271 | + 'icon' => 'fa-git-square', |
|
| 272 | + 'class' => 'fa', |
|
| 273 | + 'enabled' => false, |
|
| 274 | + 'name' => esc_html__( 'git square', 'redux-framework' ), |
|
| 275 | + 'background' => '', |
|
| 276 | + 'color' => '#000000', |
|
| 277 | + 'url' => '', |
|
| 278 | + 'order' => 22, |
|
| 279 | + ), |
|
| 280 | + 23 => array( |
|
| 281 | + 'id' => 'github', |
|
| 282 | + 'icon' => 'fa-github', |
|
| 283 | + 'class' => 'fa', |
|
| 284 | + 'enabled' => false, |
|
| 285 | + 'name' => esc_html__( 'github', 'redux-framework' ), |
|
| 286 | + 'background' => '', |
|
| 287 | + 'color' => '#4183c4', |
|
| 288 | + 'url' => '', |
|
| 289 | + 'order' => 23, |
|
| 290 | + ), |
|
| 291 | + 24 => array( |
|
| 292 | + 'id' => 'github-alt', |
|
| 293 | + 'icon' => 'fa-github-alt', |
|
| 294 | + 'class' => 'fa', |
|
| 295 | + 'enabled' => false, |
|
| 296 | + 'name' => esc_html__( 'github alt', 'redux-framework' ), |
|
| 297 | + 'background' => '', |
|
| 298 | + 'color' => '#4183c4', |
|
| 299 | + 'url' => '', |
|
| 300 | + 'order' => 24, |
|
| 301 | + ), |
|
| 302 | + 25 => array( |
|
| 303 | + 'id' => 'github-square', |
|
| 304 | + 'icon' => 'fa-github-square', |
|
| 305 | + 'class' => 'fa', |
|
| 306 | + 'enabled' => false, |
|
| 307 | + 'name' => esc_html__( 'github square', 'redux-framework' ), |
|
| 308 | + 'background' => '', |
|
| 309 | + 'color' => '#4183c4', |
|
| 310 | + 'url' => '', |
|
| 311 | + 'order' => 25, |
|
| 312 | + ), |
|
| 313 | + 26 => array( |
|
| 314 | + 'id' => 'gittip', |
|
| 315 | + 'icon' => 'fa-gittip', |
|
| 316 | + 'class' => 'fa', |
|
| 317 | + 'enabled' => false, |
|
| 318 | + 'name' => esc_html__( 'git tip', 'redux-framework' ), |
|
| 319 | + 'background' => '', |
|
| 320 | + 'color' => '#000000', |
|
| 321 | + 'url' => '', |
|
| 322 | + 'order' => 26, |
|
| 323 | + ), |
|
| 324 | + 27 => array( |
|
| 325 | + 'id' => 'google', |
|
| 326 | + 'icon' => 'fa-google', |
|
| 327 | + 'class' => 'fa', |
|
| 328 | + 'enabled' => false, |
|
| 329 | + 'name' => esc_html__( 'Google', 'redux-framework' ), |
|
| 330 | + 'background' => '', |
|
| 331 | + 'color' => '#dd4b39', |
|
| 332 | + 'url' => '', |
|
| 333 | + 'order' => 27, |
|
| 334 | + ), |
|
| 335 | + 28 => array( |
|
| 336 | + 'id' => 'google-plus', |
|
| 337 | + 'icon' => 'fa-google-plus', |
|
| 338 | + 'class' => 'fa', |
|
| 339 | + 'enabled' => false, |
|
| 340 | + 'name' => esc_html__( 'Google Plus', 'redux-framework' ), |
|
| 341 | + 'background' => '', |
|
| 342 | + 'color' => '#dd4b39', |
|
| 343 | + 'url' => '', |
|
| 344 | + 'order' => 28, |
|
| 345 | + ), |
|
| 346 | + 29 => array( |
|
| 347 | + 'id' => 'google-plus-square', |
|
| 348 | + 'icon' => 'fa-google-plus-square', |
|
| 349 | + 'class' => 'fa', |
|
| 350 | + 'enabled' => false, |
|
| 351 | + 'name' => esc_html__( 'Google Plus square', 'redux-framework' ), |
|
| 352 | + 'background' => '', |
|
| 353 | + 'color' => '#dd4b39', |
|
| 354 | + 'url' => '', |
|
| 355 | + 'order' => 29, |
|
| 356 | + ), |
|
| 357 | + 30 => array( |
|
| 358 | + 'id' => 'hacker-news', |
|
| 359 | + 'icon' => 'fa-hacker-news', |
|
| 360 | + 'class' => 'fa', |
|
| 361 | + 'enabled' => false, |
|
| 362 | + 'name' => esc_html__( 'Hacker News', 'redux-framework' ), |
|
| 363 | + 'background' => '', |
|
| 364 | + 'color' => '#ff6600', |
|
| 365 | + 'url' => '', |
|
| 366 | + 'order' => 30, |
|
| 367 | + ), |
|
| 368 | + 31 => array( |
|
| 369 | + 'id' => 'html5', |
|
| 370 | + 'icon' => 'fa-html5', |
|
| 371 | + 'class' => 'fa', |
|
| 372 | + 'enabled' => false, |
|
| 373 | + 'name' => esc_html__( 'HTML5', 'redux-framework' ), |
|
| 374 | + 'background' => '', |
|
| 375 | + 'color' => '#e34f26', |
|
| 376 | + 'url' => '', |
|
| 377 | + 'order' => 31, |
|
| 378 | + ), |
|
| 379 | + 32 => array( |
|
| 380 | + 'id' => 'instagram', |
|
| 381 | + 'icon' => 'fa-instagram', |
|
| 382 | + 'class' => 'fa', |
|
| 383 | + 'enabled' => false, |
|
| 384 | + 'name' => esc_html__( 'Instagram', 'redux-framework' ), |
|
| 385 | + 'background' => '', |
|
| 386 | + 'color' => '#3f729b', |
|
| 387 | + 'url' => '', |
|
| 388 | + 'order' => 32, |
|
| 389 | + ), |
|
| 390 | + 33 => array( |
|
| 391 | + 'id' => 'joomla', |
|
| 392 | + 'icon' => 'fa-joomla', |
|
| 393 | + 'class' => 'fa', |
|
| 394 | + 'enabled' => false, |
|
| 395 | + 'name' => esc_html__( 'Joomla', 'redux-framework' ), |
|
| 396 | + 'background' => '', |
|
| 397 | + 'color' => '#000000', |
|
| 398 | + 'url' => '', |
|
| 399 | + 'order' => 33, |
|
| 400 | + ), |
|
| 401 | + 34 => array( |
|
| 402 | + 'id' => 'jsfiddle', |
|
| 403 | + 'icon' => 'fa-jsfiddle', |
|
| 404 | + 'class' => 'fa', |
|
| 405 | + 'enabled' => false, |
|
| 406 | + 'name' => esc_html__( 'JS Fiddle', 'redux-framework' ), |
|
| 407 | + 'background' => '', |
|
| 408 | + 'color' => '#000000', |
|
| 409 | + 'url' => '', |
|
| 410 | + 'order' => 34, |
|
| 411 | + ), |
|
| 412 | + 35 => array( |
|
| 413 | + 'id' => 'linkedin', |
|
| 414 | + 'icon' => 'fa-linkedin', |
|
| 415 | + 'class' => 'fa', |
|
| 416 | + 'enabled' => false, |
|
| 417 | + 'name' => esc_html__( 'LinkedIn', 'redux-framework' ), |
|
| 418 | + 'background' => '', |
|
| 419 | + 'color' => '#0976b4', |
|
| 420 | + 'url' => '', |
|
| 421 | + 'order' => 35, |
|
| 422 | + ), |
|
| 423 | + 36 => array( |
|
| 424 | + 'id' => 'linkedin-square', |
|
| 425 | + 'icon' => 'fa-linkedin-square', |
|
| 426 | + 'class' => 'fa', |
|
| 427 | + 'enabled' => false, |
|
| 428 | + 'name' => esc_html__( 'LinkedIn square', 'redux-framework' ), |
|
| 429 | + 'background' => '', |
|
| 430 | + 'color' => '#0976b4', |
|
| 431 | + 'url' => '', |
|
| 432 | + 'order' => 36, |
|
| 433 | + ), |
|
| 434 | + 37 => array( |
|
| 435 | + 'id' => 'linux', |
|
| 436 | + 'icon' => 'fa-linux', |
|
| 437 | + 'class' => 'fa', |
|
| 438 | + 'enabled' => false, |
|
| 439 | + 'name' => esc_html__( 'Linux', 'redux-framework' ), |
|
| 440 | + 'background' => '', |
|
| 441 | + 'color' => '#333333', |
|
| 442 | + 'url' => '', |
|
| 443 | + 'order' => 37, |
|
| 444 | + ), |
|
| 445 | + 38 => array( |
|
| 446 | + 'id' => 'maxcdn', |
|
| 447 | + 'icon' => 'fa-maxcdn', |
|
| 448 | + 'class' => 'fa', |
|
| 449 | + 'enabled' => false, |
|
| 450 | + 'name' => esc_html__( 'MaxCDN', 'redux-framework' ), |
|
| 451 | + 'background' => '', |
|
| 452 | + 'color' => '#f8711e', |
|
| 453 | + 'url' => '', |
|
| 454 | + 'order' => 38, |
|
| 455 | + ), |
|
| 456 | + 39 => array( |
|
| 457 | + 'id' => 'openid', |
|
| 458 | + 'icon' => 'fa-openid', |
|
| 459 | + 'class' => 'fa', |
|
| 460 | + 'enabled' => false, |
|
| 461 | + 'name' => esc_html__( 'OpenID', 'redux-framework' ), |
|
| 462 | + 'background' => '', |
|
| 463 | + 'color' => '#000000', |
|
| 464 | + 'url' => '', |
|
| 465 | + 'order' => 39, |
|
| 466 | + ), |
|
| 467 | + 40 => array( |
|
| 468 | + 'id' => 'pagelines', |
|
| 469 | + 'icon' => 'fa-pagelines', |
|
| 470 | + 'class' => 'fa', |
|
| 471 | + 'enabled' => false, |
|
| 472 | + 'name' => esc_html__( 'Page Lines', 'redux-framework' ), |
|
| 473 | + 'background' => '', |
|
| 474 | + 'color' => '#000000', |
|
| 475 | + 'url' => '', |
|
| 476 | + 'order' => 40, |
|
| 477 | + ), |
|
| 478 | + 41 => array( |
|
| 479 | + 'id' => 'pied-piper', |
|
| 480 | + 'icon' => 'fa-pied-piper', |
|
| 481 | + 'class' => 'fa', |
|
| 482 | + 'enabled' => false, |
|
| 483 | + 'name' => esc_html__( 'Pied Piper', 'redux-framework' ), |
|
| 484 | + 'background' => '', |
|
| 485 | + 'color' => '#000000', |
|
| 486 | + 'url' => '', |
|
| 487 | + 'order' => 41, |
|
| 488 | + ), |
|
| 489 | + 42 => array( |
|
| 490 | + 'id' => 'pied-piper-alt', |
|
| 491 | + 'icon' => 'fa-pied-piper-alt', |
|
| 492 | + 'class' => 'fa', |
|
| 493 | + 'enabled' => false, |
|
| 494 | + 'name' => esc_html__( 'Pied Piper alt', 'redux-framework' ), |
|
| 495 | + 'background' => '', |
|
| 496 | + 'color' => '#000000', |
|
| 497 | + 'url' => '', |
|
| 498 | + 'order' => 42, |
|
| 499 | + ), |
|
| 500 | + 43 => array( |
|
| 501 | + 'id' => 'pinterest', |
|
| 502 | + 'icon' => 'fa-pinterest', |
|
| 503 | + 'class' => 'fa', |
|
| 504 | + 'enabled' => false, |
|
| 505 | + 'name' => esc_html__( 'Pinterest', 'redux-framework' ), |
|
| 506 | + 'background' => '', |
|
| 507 | + 'color' => '#1769ff', |
|
| 508 | + 'url' => '', |
|
| 509 | + 'order' => 43, |
|
| 510 | + ), |
|
| 511 | + 44 => array( |
|
| 512 | + 'id' => 'pinterest-square', |
|
| 513 | + 'icon' => 'fa-pinterest-square', |
|
| 514 | + 'class' => 'fa', |
|
| 515 | + 'enabled' => false, |
|
| 516 | + 'name' => esc_html__( 'Pinterest square', 'redux-framework' ), |
|
| 517 | + 'background' => '', |
|
| 518 | + 'color' => '#1769ff', |
|
| 519 | + 'url' => '', |
|
| 520 | + 'order' => 44, |
|
| 521 | + ), |
|
| 522 | + 45 => array( |
|
| 523 | + 'id' => 'qq', |
|
| 524 | + 'icon' => 'fa-qq', |
|
| 525 | + 'class' => 'fa', |
|
| 526 | + 'enabled' => false, |
|
| 527 | + 'name' => esc_html__( 'QQ', 'redux-framework' ), |
|
| 528 | + 'background' => '', |
|
| 529 | + 'color' => '#000000', |
|
| 530 | + 'url' => '', |
|
| 531 | + 'order' => 45, |
|
| 532 | + ), |
|
| 533 | + 46 => array( |
|
| 534 | + 'id' => 'rebel', |
|
| 535 | + 'icon' => 'fa-rebel', |
|
| 536 | + 'class' => 'fa', |
|
| 537 | + 'enabled' => false, |
|
| 538 | + 'name' => esc_html__( 'Rebel', 'redux-framework' ), |
|
| 539 | + 'background' => '', |
|
| 540 | + 'color' => '#517fa4', |
|
| 541 | + 'url' => '', |
|
| 542 | + 'order' => 46, |
|
| 543 | + ), |
|
| 544 | + 47 => array( |
|
| 545 | + 'id' => 'reddit', |
|
| 546 | + 'icon' => 'fa-reddit', |
|
| 547 | + 'class' => 'fa', |
|
| 548 | + 'enabled' => false, |
|
| 549 | + 'name' => esc_html__( 'Reddit', 'redux-framework' ), |
|
| 550 | + 'background' => '', |
|
| 551 | + 'color' => '#ff4500', |
|
| 552 | + 'url' => '', |
|
| 553 | + 'order' => 47, |
|
| 554 | + ), |
|
| 555 | + 48 => array( |
|
| 556 | + 'id' => 'reddit-square', |
|
| 557 | + 'icon' => 'fa-reddit-square', |
|
| 558 | + 'class' => 'fa', |
|
| 559 | + 'enabled' => false, |
|
| 560 | + 'name' => esc_html__( 'Reddit square', 'redux-framework' ), |
|
| 561 | + 'background' => '', |
|
| 562 | + 'color' => '#ff4500', |
|
| 563 | + 'url' => '', |
|
| 564 | + 'order' => 48, |
|
| 565 | + ), |
|
| 566 | + 49 => array( |
|
| 567 | + 'id' => 'renren', |
|
| 568 | + 'icon' => 'fa-renren', |
|
| 569 | + 'class' => 'fa', |
|
| 570 | + 'enabled' => false, |
|
| 571 | + 'name' => esc_html__( 'Ren Ren', 'redux-framework' ), |
|
| 572 | + 'background' => '', |
|
| 573 | + 'color' => '#007bb6', |
|
| 574 | + 'url' => '', |
|
| 575 | + 'order' => 49, |
|
| 576 | + ), |
|
| 577 | + 50 => array( |
|
| 578 | + 'id' => 'share-alt', |
|
| 579 | + 'icon' => 'fa-share-alt', |
|
| 580 | + 'class' => 'fa', |
|
| 581 | + 'enabled' => false, |
|
| 582 | + 'name' => esc_html__( 'Share alt', 'redux-framework' ), |
|
| 583 | + 'background' => '', |
|
| 584 | + 'color' => '#000000', |
|
| 585 | + 'url' => '', |
|
| 586 | + 'order' => 50, |
|
| 587 | + ), |
|
| 588 | + 51 => array( |
|
| 589 | + 'id' => 'share-alt-square', |
|
| 590 | + 'icon' => 'fa-share-alt-square', |
|
| 591 | + 'class' => 'fa', |
|
| 592 | + 'enabled' => false, |
|
| 593 | + 'name' => esc_html__( 'Share square', 'redux-framework' ), |
|
| 594 | + 'background' => '', |
|
| 595 | + 'color' => '#000000', |
|
| 596 | + 'url' => '', |
|
| 597 | + 'order' => 51, |
|
| 598 | + ), |
|
| 599 | + 52 => array( |
|
| 600 | + 'id' => 'skype', |
|
| 601 | + 'icon' => 'fa-skype', |
|
| 602 | + 'class' => 'fa', |
|
| 603 | + 'enabled' => false, |
|
| 604 | + 'name' => esc_html__( 'Skype', 'redux-framework' ), |
|
| 605 | + 'background' => '', |
|
| 606 | + 'color' => '#00aff0', |
|
| 607 | + 'url' => '', |
|
| 608 | + 'order' => 52, |
|
| 609 | + ), |
|
| 610 | + 53 => array( |
|
| 611 | + 'id' => 'slack', |
|
| 612 | + 'icon' => 'fa-slack', |
|
| 613 | + 'class' => 'fa', |
|
| 614 | + 'enabled' => false, |
|
| 615 | + 'name' => esc_html__( 'Slack', 'redux-framework' ), |
|
| 616 | + 'background' => '', |
|
| 617 | + 'color' => '#000000', |
|
| 618 | + 'url' => '', |
|
| 619 | + 'order' => 53, |
|
| 620 | + ), |
|
| 621 | + 54 => array( |
|
| 622 | + 'id' => 'soundcloud', |
|
| 623 | + 'icon' => 'fa-soundcloud', |
|
| 624 | + 'class' => 'fa', |
|
| 625 | + 'enabled' => false, |
|
| 626 | + 'name' => esc_html__( 'Sound Cloud', 'redux-framework' ), |
|
| 627 | + 'background' => '', |
|
| 628 | + 'color' => '#f80', |
|
| 629 | + 'url' => '', |
|
| 630 | + 'order' => 54, |
|
| 631 | + ), |
|
| 632 | + 55 => array( |
|
| 633 | + 'id' => 'spotify', |
|
| 634 | + 'icon' => 'fa-spotify', |
|
| 635 | + 'class' => 'fa', |
|
| 636 | + 'enabled' => false, |
|
| 637 | + 'name' => esc_html__( 'Spotify', 'redux-framework' ), |
|
| 638 | + 'background' => '', |
|
| 639 | + 'color' => '#7ab800', |
|
| 640 | + 'url' => '', |
|
| 641 | + 'order' => 55, |
|
| 642 | + ), |
|
| 643 | + 56 => array( |
|
| 644 | + 'id' => 'stack-exchange', |
|
| 645 | + 'icon' => 'fa-stack-exchange', |
|
| 646 | + 'class' => 'fa', |
|
| 647 | + 'enabled' => false, |
|
| 648 | + 'name' => esc_html__( 'Stack Exchange', 'redux-framework' ), |
|
| 649 | + 'background' => '', |
|
| 650 | + 'color' => '#000000', |
|
| 651 | + 'url' => '', |
|
| 652 | + 'order' => 56, |
|
| 653 | + ), |
|
| 654 | + 57 => array( |
|
| 655 | + 'id' => 'stack-overflow', |
|
| 656 | + 'icon' => 'fa-stack-overflow', |
|
| 657 | + 'class' => 'fa', |
|
| 658 | + 'enabled' => false, |
|
| 659 | + 'name' => esc_html__( 'Stack Overflow', 'redux-framework' ), |
|
| 660 | + 'background' => '', |
|
| 661 | + 'color' => '#fe7a15', |
|
| 662 | + 'url' => '', |
|
| 663 | + 'order' => 57, |
|
| 664 | + ), |
|
| 665 | + 58 => array( |
|
| 666 | + 'id' => 'steam', |
|
| 667 | + 'icon' => 'fa-steam', |
|
| 668 | + 'class' => 'fa', |
|
| 669 | + 'enabled' => false, |
|
| 670 | + 'name' => esc_html__( 'Steam', 'redux-framework' ), |
|
| 671 | + 'background' => '', |
|
| 672 | + 'color' => '#000000', |
|
| 673 | + 'url' => '', |
|
| 674 | + 'order' => 58, |
|
| 675 | + ), |
|
| 676 | + 59 => array( |
|
| 677 | + 'id' => 'steam-square', |
|
| 678 | + 'icon' => 'fa-steam-square', |
|
| 679 | + 'class' => 'fa', |
|
| 680 | + 'enabled' => false, |
|
| 681 | + 'name' => esc_html__( 'Steam square', 'redux-framework' ), |
|
| 682 | + 'background' => '', |
|
| 683 | + 'color' => '#000000', |
|
| 684 | + 'url' => '', |
|
| 685 | + 'order' => 59, |
|
| 686 | + ), |
|
| 687 | + 60 => array( |
|
| 688 | + 'id' => 'stumbleupon', |
|
| 689 | + 'icon' => 'fa-stumbleupon', |
|
| 690 | + 'class' => 'fa', |
|
| 691 | + 'enabled' => false, |
|
| 692 | + 'name' => esc_html__( 'Stumble Upon', 'redux-framework' ), |
|
| 693 | + 'background' => '', |
|
| 694 | + 'color' => '#eb4924', |
|
| 695 | + 'url' => '', |
|
| 696 | + 'order' => 60, |
|
| 697 | + ), |
|
| 698 | + 61 => array( |
|
| 699 | + 'id' => 'stumbleupon-circle', |
|
| 700 | + 'icon' => 'fa-stumbleupon-circle', |
|
| 701 | + 'class' => 'fa', |
|
| 702 | + 'enabled' => false, |
|
| 703 | + 'name' => esc_html__( 'Stumble Upon circle', 'redux-framework' ), |
|
| 704 | + 'background' => '', |
|
| 705 | + 'color' => '#eb4924', |
|
| 706 | + 'url' => '', |
|
| 707 | + 'order' => 61, |
|
| 708 | + ), |
|
| 709 | + 62 => array( |
|
| 710 | + 'id' => 'tencent-weibo', |
|
| 711 | + 'icon' => 'fa-tencent-weibo', |
|
| 712 | + 'class' => 'fa', |
|
| 713 | + 'enabled' => false, |
|
| 714 | + 'name' => esc_html__( 'Tencent Weibo', 'redux-framework' ), |
|
| 715 | + 'background' => '', |
|
| 716 | + 'color' => '#000000', |
|
| 717 | + 'url' => '', |
|
| 718 | + 'order' => 62, |
|
| 719 | + ), |
|
| 720 | + 63 => array( |
|
| 721 | + 'id' => 'trello', |
|
| 722 | + 'icon' => 'fa-trello', |
|
| 723 | + 'class' => 'fa', |
|
| 724 | + 'enabled' => false, |
|
| 725 | + 'name' => esc_html__( 'Trello', 'redux-framework' ), |
|
| 726 | + 'background' => '', |
|
| 727 | + 'color' => '#256a92', |
|
| 728 | + 'url' => '', |
|
| 729 | + 'order' => 63, |
|
| 730 | + ), |
|
| 731 | + 64 => array( |
|
| 732 | + 'id' => 'tumblr', |
|
| 733 | + 'icon' => 'fa-tumblr', |
|
| 734 | + 'class' => 'fa', |
|
| 735 | + 'enabled' => false, |
|
| 736 | + 'name' => esc_html__( 'Tumblr', 'redux-framework' ), |
|
| 737 | + 'background' => '', |
|
| 738 | + 'color' => '#35465c', |
|
| 739 | + 'url' => '', |
|
| 740 | + 'order' => 64, |
|
| 741 | + ), |
|
| 742 | + 65 => array( |
|
| 743 | + 'id' => 'tumblr-square', |
|
| 744 | + 'icon' => 'fa-tumblr-square', |
|
| 745 | + 'class' => 'fa', |
|
| 746 | + 'enabled' => false, |
|
| 747 | + 'name' => esc_html__( 'Tumblr square', 'redux-framework' ), |
|
| 748 | + 'background' => '', |
|
| 749 | + 'color' => '#35465c', |
|
| 750 | + 'url' => '', |
|
| 751 | + 'order' => 65, |
|
| 752 | + ), |
|
| 753 | + 66 => array( |
|
| 754 | + 'id' => 'twitter', |
|
| 755 | + 'icon' => 'fa-x-twitter', |
|
| 756 | + 'class' => 'fa-brands', |
|
| 757 | + 'enabled' => false, |
|
| 758 | + 'name' => esc_html__( 'X', 'redux-framework' ), |
|
| 759 | + 'background' => '', |
|
| 760 | + 'color' => '#55acee', |
|
| 761 | + 'url' => '', |
|
| 762 | + 'order' => 66, |
|
| 763 | + ), |
|
| 764 | + 67 => array( |
|
| 765 | + 'id' => 'twitter-square', |
|
| 766 | + 'icon' => 'fa-square-x-twitter', |
|
| 767 | + 'class' => 'fa-brands', |
|
| 768 | + 'enabled' => false, |
|
| 769 | + 'name' => esc_html__( 'X square', 'redux-framework' ), |
|
| 770 | + 'background' => '', |
|
| 771 | + 'color' => '#55acee', |
|
| 772 | + 'url' => '', |
|
| 773 | + 'order' => 67, |
|
| 774 | + ), |
|
| 775 | + 68 => array( |
|
| 776 | + 'id' => 'vimeo-square', |
|
| 777 | + 'icon' => 'fa-vimeo-square', |
|
| 778 | + 'class' => 'fa', |
|
| 779 | + 'enabled' => false, |
|
| 780 | + 'name' => esc_html__( 'Vimeo square', 'redux-framework' ), |
|
| 781 | + 'background' => '', |
|
| 782 | + 'color' => '#1ab7ea', |
|
| 783 | + 'url' => '', |
|
| 784 | + 'order' => 68, |
|
| 785 | + ), |
|
| 786 | + 69 => array( |
|
| 787 | + 'id' => 'vine', |
|
| 788 | + 'icon' => 'fa-vine', |
|
| 789 | + 'class' => 'fa', |
|
| 790 | + 'enabled' => false, |
|
| 791 | + 'name' => esc_html__( 'Vine', 'redux-framework' ), |
|
| 792 | + 'background' => '', |
|
| 793 | + 'color' => '#00b488', |
|
| 794 | + 'url' => '', |
|
| 795 | + 'order' => 69, |
|
| 796 | + ), |
|
| 797 | + 70 => array( |
|
| 798 | + 'id' => 'vk', |
|
| 799 | + 'icon' => 'fa-vk', |
|
| 800 | + 'class' => 'fa', |
|
| 801 | + 'enabled' => false, |
|
| 802 | + 'name' => esc_html__( 'VK', 'redux-framework' ), |
|
| 803 | + 'background' => '', |
|
| 804 | + 'color' => '#000000', |
|
| 805 | + 'url' => '', |
|
| 806 | + 'order' => 70, |
|
| 807 | + ), |
|
| 808 | + 71 => array( |
|
| 809 | + 'id' => 'weibo', |
|
| 810 | + 'icon' => 'fa-weibo', |
|
| 811 | + 'class' => 'fa', |
|
| 812 | + 'enabled' => false, |
|
| 813 | + 'name' => esc_html__( 'Weibo', 'redux-framework' ), |
|
| 814 | + 'background' => '', |
|
| 815 | + 'color' => '#000000', |
|
| 816 | + 'url' => '', |
|
| 817 | + 'order' => 71, |
|
| 818 | + ), |
|
| 819 | + 72 => array( |
|
| 820 | + 'id' => 'weixin', |
|
| 821 | + 'icon' => 'fa-weixin', |
|
| 822 | + 'class' => 'fa', |
|
| 823 | + 'enabled' => false, |
|
| 824 | + 'name' => esc_html__( 'Weixin', 'redux-framework' ), |
|
| 825 | + 'background' => '', |
|
| 826 | + 'color' => '#000000', |
|
| 827 | + 'url' => '', |
|
| 828 | + 'order' => 72, |
|
| 829 | + ), |
|
| 830 | + 73 => array( |
|
| 831 | + 'id' => 'windows', |
|
| 832 | + 'icon' => 'fa-windows', |
|
| 833 | + 'class' => 'fa', |
|
| 834 | + 'enabled' => false, |
|
| 835 | + 'name' => esc_html__( 'Windows', 'redux-framework' ), |
|
| 836 | + 'background' => '', |
|
| 837 | + 'color' => '#00bcf2', |
|
| 838 | + 'url' => '', |
|
| 839 | + 'order' => 73, |
|
| 840 | + ), |
|
| 841 | + 74 => array( |
|
| 842 | + 'id' => 'wordpress', |
|
| 843 | + 'icon' => 'fa-wordpress', |
|
| 844 | + 'class' => 'fa', |
|
| 845 | + 'enabled' => false, |
|
| 846 | + 'name' => esc_html__( 'WordPress', 'redux-framework' ), |
|
| 847 | + 'background' => '', |
|
| 848 | + 'color' => '#21759b', |
|
| 849 | + 'url' => '', |
|
| 850 | + 'order' => 74, |
|
| 851 | + ), |
|
| 852 | + 75 => array( |
|
| 853 | + 'id' => 'xing', |
|
| 854 | + 'icon' => 'fa-xing', |
|
| 855 | + 'class' => 'fa', |
|
| 856 | + 'enabled' => false, |
|
| 857 | + 'name' => esc_html__( 'Xing', 'redux-framework' ), |
|
| 858 | + 'background' => '', |
|
| 859 | + 'color' => '#026466', |
|
| 860 | + 'url' => '', |
|
| 861 | + 'order' => 75, |
|
| 862 | + ), |
|
| 863 | + 76 => array( |
|
| 864 | + 'id' => 'xing-square', |
|
| 865 | + 'icon' => 'fa-xing-square', |
|
| 866 | + 'class' => 'fa', |
|
| 867 | + 'enabled' => false, |
|
| 868 | + 'name' => esc_html__( 'Xing square', 'redux-framework' ), |
|
| 869 | + 'background' => '', |
|
| 870 | + 'color' => '#026466', |
|
| 871 | + 'url' => '', |
|
| 872 | + 'order' => 76, |
|
| 873 | + ), |
|
| 874 | + 77 => array( |
|
| 875 | + 'id' => 'yahoo', |
|
| 876 | + 'icon' => 'fa-yahoo', |
|
| 877 | + 'class' => 'fa', |
|
| 878 | + 'enabled' => false, |
|
| 879 | + 'name' => esc_html__( 'Yahoo', 'redux-framework' ), |
|
| 880 | + 'background' => '', |
|
| 881 | + 'color' => '#400191', |
|
| 882 | + 'url' => '', |
|
| 883 | + 'order' => 77, |
|
| 884 | + ), |
|
| 885 | + 78 => array( |
|
| 886 | + 'id' => 'yelp', |
|
| 887 | + 'icon' => 'fa-yelp', |
|
| 888 | + 'class' => 'fa', |
|
| 889 | + 'enabled' => false, |
|
| 890 | + 'name' => esc_html__( 'Yelp', 'redux-framework' ), |
|
| 891 | + 'background' => '', |
|
| 892 | + 'color' => '#C93C27', |
|
| 893 | + 'url' => '', |
|
| 894 | + 'order' => 78, |
|
| 895 | + ), |
|
| 896 | + 79 => array( |
|
| 897 | + 'id' => 'youtube', |
|
| 898 | + 'icon' => 'fa-youtube', |
|
| 899 | + 'class' => 'fa', |
|
| 900 | + 'enabled' => false, |
|
| 901 | + 'name' => esc_html__( 'YouTube', 'redux-framework' ), |
|
| 902 | + 'background' => '', |
|
| 903 | + 'color' => '#e52d27', |
|
| 904 | + 'url' => '', |
|
| 905 | + 'order' => 79, |
|
| 906 | + ), |
|
| 907 | + 80 => array( |
|
| 908 | + 'id' => 'youtube-play', |
|
| 909 | + 'icon' => 'fa-youtube-play', |
|
| 910 | + 'class' => 'fa', |
|
| 911 | + 'enabled' => false, |
|
| 912 | + 'name' => esc_html__( 'YouTube play', 'redux-framework' ), |
|
| 913 | + 'background' => '', |
|
| 914 | + 'color' => '#e52d27', |
|
| 915 | + 'url' => '', |
|
| 916 | + 'order' => 80, |
|
| 917 | + ), |
|
| 918 | + 81 => array( |
|
| 919 | + 'id' => 'youtube-square', |
|
| 920 | + 'icon' => 'fa-youtube-square', |
|
| 921 | + 'class' => 'fa', |
|
| 922 | + 'enabled' => false, |
|
| 923 | + 'name' => esc_html__( 'YouTube square', 'redux-framework' ), |
|
| 924 | + 'background' => '', |
|
| 925 | + 'color' => '#e52d27', |
|
| 926 | + 'url' => '', |
|
| 927 | + 'order' => 81, |
|
| 928 | + ), |
|
| 929 | + ); |
|
| 930 | + } |
|
| 931 | + } |
|
| 932 | 932 | } |
@@ -11,358 +11,358 @@ |
||
| 11 | 11 | |
| 12 | 12 | if ( ! class_exists( 'Redux_Social_Profiles' ) ) { |
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Main Redux_Social_Profiles class |
|
| 16 | - * |
|
| 17 | - * @since 1.0.0 |
|
| 18 | - */ |
|
| 19 | - class Redux_Social_Profiles extends Redux_Field { |
|
| 20 | - |
|
| 21 | - /** |
|
| 22 | - * Field ID. |
|
| 23 | - * |
|
| 24 | - * @var null|string |
|
| 25 | - */ |
|
| 26 | - public ?string $field_id; |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * Panel opt_name. |
|
| 30 | - * |
|
| 31 | - * @var null|string |
|
| 32 | - */ |
|
| 33 | - public ?string $opt_name; |
|
| 34 | - |
|
| 35 | - /** |
|
| 36 | - * Defaults array. |
|
| 37 | - * |
|
| 38 | - * @var null|array |
|
| 39 | - */ |
|
| 40 | - |
|
| 41 | - private ?array $defaults = array(); |
|
| 42 | - |
|
| 43 | - /** |
|
| 44 | - * Set defaults. |
|
| 45 | - */ |
|
| 46 | - public function set_defaults() { |
|
| 47 | - $this->opt_name = $this->parent->args['opt_name']; |
|
| 48 | - $this->field_id = $this->field['id']; |
|
| 49 | - |
|
| 50 | - $this->defaults = Redux_Social_Profiles_Functions::get_default_data(); |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - /** |
|
| 54 | - * Rebuild Settings. |
|
| 55 | - * |
|
| 56 | - * @param array $settings Settings array. |
|
| 57 | - * |
|
| 58 | - * @return array |
|
| 59 | - */ |
|
| 60 | - private function rebuild_setttings( array $settings ): array { |
|
| 61 | - $fixed_arr = array(); |
|
| 62 | - $stock = ''; |
|
| 63 | - |
|
| 64 | - foreach ( $this->defaults as $key => $arr ) { |
|
| 65 | - $search_default = true; |
|
| 66 | - |
|
| 67 | - $default_id = $arr['id']; |
|
| 68 | - |
|
| 69 | - foreach ( $settings as $a ) { |
|
| 70 | - if ( isset( $a['data'] ) ) { |
|
| 71 | - $a['data'] = rawurldecode( $a['data'] ); |
|
| 72 | - $a = (array) json_decode( $a['data'] ); |
|
| 73 | - } |
|
| 74 | - |
|
| 75 | - if ( $default_id === $a['id'] ) { |
|
| 76 | - $search_default = false; |
|
| 77 | - $fixed_arr[ $key ] = $a; |
|
| 78 | - break; |
|
| 79 | - } |
|
| 80 | - } |
|
| 81 | - |
|
| 82 | - if ( $search_default ) { |
|
| 83 | - if ( '' === $stock ) { |
|
| 84 | - $stock = Redux_Social_Profiles_Defaults::get_social_media_defaults(); |
|
| 85 | - $stock = Redux_Social_Profiles_Functions::add_extra_icons( $stock ); |
|
| 86 | - } |
|
| 87 | - |
|
| 88 | - foreach ( $stock as $def_arr ) { |
|
| 89 | - if ( $default_id === $def_arr['id'] ) { |
|
| 90 | - $fixed_arr[ $key ] = $def_arr; |
|
| 91 | - break; |
|
| 92 | - } |
|
| 93 | - } |
|
| 94 | - } |
|
| 95 | - } |
|
| 96 | - |
|
| 97 | - return $fixed_arr; |
|
| 98 | - } |
|
| 99 | - |
|
| 100 | - /** |
|
| 101 | - * Field Render Function. |
|
| 102 | - * Takes the vars and outputs the HTML for the field in the settings |
|
| 103 | - * |
|
| 104 | - * @since 1.0.0 |
|
| 105 | - * @access public |
|
| 106 | - * @return void |
|
| 107 | - */ |
|
| 108 | - public function render() { |
|
| 109 | - if ( empty( $this->field ) ) { |
|
| 110 | - return; |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - global $pagenow, $post; |
|
| 114 | - |
|
| 115 | - $redux_settings = get_option( $this->opt_name ); |
|
| 116 | - $settings = $redux_settings[ $this->field_id ] ?? array(); |
|
| 117 | - |
|
| 118 | - if ( is_admin() && ( 'post-new.php' === $pagenow || 'post.php' === $pagenow ) ) { |
|
| 119 | - $post_settings = get_post_meta( $post->ID, $this->field_id, true ); |
|
| 120 | - |
|
| 121 | - if ( ! empty( $post_settings ) ) { |
|
| 122 | - $settings = $post_settings; |
|
| 123 | - } |
|
| 124 | - } |
|
| 125 | - |
|
| 126 | - $color_pickers = $this->field['color_pickers'] ?? true; |
|
| 127 | - |
|
| 128 | - // Icon container. |
|
| 129 | - echo '<div |
|
| 14 | + /** |
|
| 15 | + * Main Redux_Social_Profiles class |
|
| 16 | + * |
|
| 17 | + * @since 1.0.0 |
|
| 18 | + */ |
|
| 19 | + class Redux_Social_Profiles extends Redux_Field { |
|
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * Field ID. |
|
| 23 | + * |
|
| 24 | + * @var null|string |
|
| 25 | + */ |
|
| 26 | + public ?string $field_id; |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * Panel opt_name. |
|
| 30 | + * |
|
| 31 | + * @var null|string |
|
| 32 | + */ |
|
| 33 | + public ?string $opt_name; |
|
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * Defaults array. |
|
| 37 | + * |
|
| 38 | + * @var null|array |
|
| 39 | + */ |
|
| 40 | + |
|
| 41 | + private ?array $defaults = array(); |
|
| 42 | + |
|
| 43 | + /** |
|
| 44 | + * Set defaults. |
|
| 45 | + */ |
|
| 46 | + public function set_defaults() { |
|
| 47 | + $this->opt_name = $this->parent->args['opt_name']; |
|
| 48 | + $this->field_id = $this->field['id']; |
|
| 49 | + |
|
| 50 | + $this->defaults = Redux_Social_Profiles_Functions::get_default_data(); |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + /** |
|
| 54 | + * Rebuild Settings. |
|
| 55 | + * |
|
| 56 | + * @param array $settings Settings array. |
|
| 57 | + * |
|
| 58 | + * @return array |
|
| 59 | + */ |
|
| 60 | + private function rebuild_setttings( array $settings ): array { |
|
| 61 | + $fixed_arr = array(); |
|
| 62 | + $stock = ''; |
|
| 63 | + |
|
| 64 | + foreach ( $this->defaults as $key => $arr ) { |
|
| 65 | + $search_default = true; |
|
| 66 | + |
|
| 67 | + $default_id = $arr['id']; |
|
| 68 | + |
|
| 69 | + foreach ( $settings as $a ) { |
|
| 70 | + if ( isset( $a['data'] ) ) { |
|
| 71 | + $a['data'] = rawurldecode( $a['data'] ); |
|
| 72 | + $a = (array) json_decode( $a['data'] ); |
|
| 73 | + } |
|
| 74 | + |
|
| 75 | + if ( $default_id === $a['id'] ) { |
|
| 76 | + $search_default = false; |
|
| 77 | + $fixed_arr[ $key ] = $a; |
|
| 78 | + break; |
|
| 79 | + } |
|
| 80 | + } |
|
| 81 | + |
|
| 82 | + if ( $search_default ) { |
|
| 83 | + if ( '' === $stock ) { |
|
| 84 | + $stock = Redux_Social_Profiles_Defaults::get_social_media_defaults(); |
|
| 85 | + $stock = Redux_Social_Profiles_Functions::add_extra_icons( $stock ); |
|
| 86 | + } |
|
| 87 | + |
|
| 88 | + foreach ( $stock as $def_arr ) { |
|
| 89 | + if ( $default_id === $def_arr['id'] ) { |
|
| 90 | + $fixed_arr[ $key ] = $def_arr; |
|
| 91 | + break; |
|
| 92 | + } |
|
| 93 | + } |
|
| 94 | + } |
|
| 95 | + } |
|
| 96 | + |
|
| 97 | + return $fixed_arr; |
|
| 98 | + } |
|
| 99 | + |
|
| 100 | + /** |
|
| 101 | + * Field Render Function. |
|
| 102 | + * Takes the vars and outputs the HTML for the field in the settings |
|
| 103 | + * |
|
| 104 | + * @since 1.0.0 |
|
| 105 | + * @access public |
|
| 106 | + * @return void |
|
| 107 | + */ |
|
| 108 | + public function render() { |
|
| 109 | + if ( empty( $this->field ) ) { |
|
| 110 | + return; |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + global $pagenow, $post; |
|
| 114 | + |
|
| 115 | + $redux_settings = get_option( $this->opt_name ); |
|
| 116 | + $settings = $redux_settings[ $this->field_id ] ?? array(); |
|
| 117 | + |
|
| 118 | + if ( is_admin() && ( 'post-new.php' === $pagenow || 'post.php' === $pagenow ) ) { |
|
| 119 | + $post_settings = get_post_meta( $post->ID, $this->field_id, true ); |
|
| 120 | + |
|
| 121 | + if ( ! empty( $post_settings ) ) { |
|
| 122 | + $settings = $post_settings; |
|
| 123 | + } |
|
| 124 | + } |
|
| 125 | + |
|
| 126 | + $color_pickers = $this->field['color_pickers'] ?? true; |
|
| 127 | + |
|
| 128 | + // Icon container. |
|
| 129 | + echo '<div |
|
| 130 | 130 | class="redux-social-profiles-container ' . esc_attr( $this->field['class'] ) . '" |
| 131 | 131 | data-opt-name="' . esc_attr( $this->opt_name ) . '" |
| 132 | 132 | data-id="' . esc_attr( $this->field_id ) . '" |
| 133 | 133 | >'; |
| 134 | 134 | |
| 135 | - $show_msg = $this->field['hide_widget_msg'] ?? true; |
|
| 135 | + $show_msg = $this->field['hide_widget_msg'] ?? true; |
|
| 136 | 136 | |
| 137 | - // translators: %1$s: Widget page HTML/URL. %s: widget admin URL. |
|
| 138 | - $def_msg = sprintf( esc_html__( 'Go to the %1$s page to add the Redux Social Widget to any active widget area.', 'redux-framework' ), sprintf( '<a href="%s">' . esc_html__( 'Widgets', 'redux-framework' ) . '</a> ', admin_url( 'widgets.php' ) ) ); |
|
| 137 | + // translators: %1$s: Widget page HTML/URL. %s: widget admin URL. |
|
| 138 | + $def_msg = sprintf( esc_html__( 'Go to the %1$s page to add the Redux Social Widget to any active widget area.', 'redux-framework' ), sprintf( '<a href="%s">' . esc_html__( 'Widgets', 'redux-framework' ) . '</a> ', admin_url( 'widgets.php' ) ) ); |
|
| 139 | 139 | |
| 140 | - $msg = $this->field['widget_msg'] ?? $def_msg; |
|
| 140 | + $msg = $this->field['widget_msg'] ?? $def_msg; |
|
| 141 | 141 | |
| 142 | - if ( ! $show_msg ) { |
|
| 143 | - echo '<div class="redux-social-profiles-header">'; |
|
| 144 | - echo $msg; // phpcs:ignore WordPress.Security.EscapeOutput |
|
| 145 | - echo '</div>'; |
|
| 146 | - } |
|
| 142 | + if ( ! $show_msg ) { |
|
| 143 | + echo '<div class="redux-social-profiles-header">'; |
|
| 144 | + echo $msg; // phpcs:ignore WordPress.Security.EscapeOutput |
|
| 145 | + echo '</div>'; |
|
| 146 | + } |
|
| 147 | 147 | |
| 148 | - echo '<div class="redux-social-profiles-selector-container">'; |
|
| 149 | - echo '<ul id="redux-social-profiles-selector-list">'; |
|
| 148 | + echo '<div class="redux-social-profiles-selector-container">'; |
|
| 149 | + echo '<ul id="redux-social-profiles-selector-list">'; |
|
| 150 | 150 | |
| 151 | - $settings = $this->rebuild_setttings( $settings ); |
|
| 151 | + $settings = $this->rebuild_setttings( $settings ); |
|
| 152 | 152 | |
| 153 | - foreach ( $this->defaults as $key => $social_provider_default ) { |
|
| 154 | - $social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[ $key ] : null; |
|
| 153 | + foreach ( $this->defaults as $key => $social_provider_default ) { |
|
| 154 | + $social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[ $key ] : null; |
|
| 155 | 155 | |
| 156 | - $icon = ( $social_provider_option && array_key_exists( 'icon', $social_provider_option ) && $social_provider_option['icon'] ) ? $social_provider_option['icon'] : $social_provider_default['icon']; |
|
| 157 | - $name = ( $social_provider_option && array_key_exists( 'name', $social_provider_option ) && $social_provider_option['name'] ) ? $social_provider_option['name'] : $social_provider_default['name']; |
|
| 158 | - $class = ( $social_provider_option && array_key_exists( 'class', $social_provider_option ) && $social_provider_option['class'] ) ? $social_provider_option['class'] : $social_provider_default['class']; |
|
| 159 | - $order = ( $social_provider_option && array_key_exists( 'order', $social_provider_option ) ) ? $social_provider_option['order'] : $key; |
|
| 160 | - $order = intval( $order ); |
|
| 161 | - $enabled = ( $social_provider_option && array_key_exists( 'enabled', $social_provider_option ) && $social_provider_option['enabled'] ) ? $social_provider_option['enabled'] : $social_provider_default['enabled']; |
|
| 162 | - $display = ( $enabled ) ? 'enabled' : ''; |
|
| 156 | + $icon = ( $social_provider_option && array_key_exists( 'icon', $social_provider_option ) && $social_provider_option['icon'] ) ? $social_provider_option['icon'] : $social_provider_default['icon']; |
|
| 157 | + $name = ( $social_provider_option && array_key_exists( 'name', $social_provider_option ) && $social_provider_option['name'] ) ? $social_provider_option['name'] : $social_provider_default['name']; |
|
| 158 | + $class = ( $social_provider_option && array_key_exists( 'class', $social_provider_option ) && $social_provider_option['class'] ) ? $social_provider_option['class'] : $social_provider_default['class']; |
|
| 159 | + $order = ( $social_provider_option && array_key_exists( 'order', $social_provider_option ) ) ? $social_provider_option['order'] : $key; |
|
| 160 | + $order = intval( $order ); |
|
| 161 | + $enabled = ( $social_provider_option && array_key_exists( 'enabled', $social_provider_option ) && $social_provider_option['enabled'] ) ? $social_provider_option['enabled'] : $social_provider_default['enabled']; |
|
| 162 | + $display = ( $enabled ) ? 'enabled' : ''; |
|
| 163 | 163 | |
| 164 | - echo '<li class="redux-social-profiles-item-enable ' . esc_attr( $display ) . '" id="redux-social-profiles-item-enable-' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" data-order="' . esc_attr( $order ) . '">'; |
|
| 165 | - Redux_Social_Profiles_Functions::render_icon( $class, $icon, '', '', $name ); |
|
| 166 | - echo '</li>'; |
|
| 167 | - } |
|
| 164 | + echo '<li class="redux-social-profiles-item-enable ' . esc_attr( $display ) . '" id="redux-social-profiles-item-enable-' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" data-order="' . esc_attr( $order ) . '">'; |
|
| 165 | + Redux_Social_Profiles_Functions::render_icon( $class, $icon, '', '', $name ); |
|
| 166 | + echo '</li>'; |
|
| 167 | + } |
|
| 168 | 168 | |
| 169 | - echo '</ul>'; |
|
| 170 | - echo '</div>'; |
|
| 169 | + echo '</ul>'; |
|
| 170 | + echo '</div>'; |
|
| 171 | 171 | |
| 172 | - echo '<ul id="redux-social-profiles-list">'; |
|
| 172 | + echo '<ul id="redux-social-profiles-list">'; |
|
| 173 | 173 | |
| 174 | - foreach ( $this->defaults as $key => $social_provider_default ) { |
|
| 175 | - echo '<li id="redux-social-item-' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" style="display: none;">'; |
|
| 176 | - echo '<div class="redux-social-item-container">'; |
|
| 174 | + foreach ( $this->defaults as $key => $social_provider_default ) { |
|
| 175 | + echo '<li id="redux-social-item-' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" style="display: none;">'; |
|
| 176 | + echo '<div class="redux-social-item-container">'; |
|
| 177 | 177 | |
| 178 | - $social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[ $key ] : null; |
|
| 179 | - $icon = ( $social_provider_option && array_key_exists( 'icon', $social_provider_option ) && $social_provider_option['icon'] ) ? $social_provider_option['icon'] : $social_provider_default['icon']; |
|
| 180 | - $id = ( $social_provider_option && array_key_exists( 'id', $social_provider_option ) && $social_provider_option['id'] ) ? $social_provider_option['id'] : $social_provider_default['id']; |
|
| 181 | - $class = ( $social_provider_option && array_key_exists( 'class', $social_provider_option ) && $social_provider_option['class'] ) ? $social_provider_option['class'] : $social_provider_default['class']; |
|
| 182 | - $enabled = ( $social_provider_option && array_key_exists( 'enabled', $social_provider_option ) && $social_provider_option['enabled'] ) ? $social_provider_option['enabled'] : $social_provider_default['enabled']; |
|
| 183 | - $name = ( $social_provider_option && array_key_exists( 'name', $social_provider_option ) && $social_provider_option['name'] ) ? $social_provider_option['name'] : $social_provider_default['name']; |
|
| 178 | + $social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[ $key ] : null; |
|
| 179 | + $icon = ( $social_provider_option && array_key_exists( 'icon', $social_provider_option ) && $social_provider_option['icon'] ) ? $social_provider_option['icon'] : $social_provider_default['icon']; |
|
| 180 | + $id = ( $social_provider_option && array_key_exists( 'id', $social_provider_option ) && $social_provider_option['id'] ) ? $social_provider_option['id'] : $social_provider_default['id']; |
|
| 181 | + $class = ( $social_provider_option && array_key_exists( 'class', $social_provider_option ) && $social_provider_option['class'] ) ? $social_provider_option['class'] : $social_provider_default['class']; |
|
| 182 | + $enabled = ( $social_provider_option && array_key_exists( 'enabled', $social_provider_option ) && $social_provider_option['enabled'] ) ? $social_provider_option['enabled'] : $social_provider_default['enabled']; |
|
| 183 | + $name = ( $social_provider_option && array_key_exists( 'name', $social_provider_option ) && $social_provider_option['name'] ) ? $social_provider_option['name'] : $social_provider_default['name']; |
|
| 184 | 184 | |
| 185 | - $label = ( $social_provider_option && array_key_exists( 'label', $social_provider_option ) && $social_provider_option['label'] ) ? $social_provider_option['label'] : __( 'Link URL', 'redux-framework' ); |
|
| 185 | + $label = ( $social_provider_option && array_key_exists( 'label', $social_provider_option ) && $social_provider_option['label'] ) ? $social_provider_option['label'] : __( 'Link URL', 'redux-framework' ); |
|
| 186 | 186 | |
| 187 | - $color = ( $social_provider_option && array_key_exists( 'color', $social_provider_option ) ) ? $social_provider_option['color'] : $social_provider_default['color']; |
|
| 188 | - $color = esc_attr( $color ); |
|
| 187 | + $color = ( $social_provider_option && array_key_exists( 'color', $social_provider_option ) ) ? $social_provider_option['color'] : $social_provider_default['color']; |
|
| 188 | + $color = esc_attr( $color ); |
|
| 189 | 189 | |
| 190 | - $background = ( $social_provider_option && array_key_exists( 'background', $social_provider_option ) ) ? $social_provider_option['background'] : $social_provider_default['background']; |
|
| 191 | - $background = esc_attr( $background ); |
|
| 190 | + $background = ( $social_provider_option && array_key_exists( 'background', $social_provider_option ) ) ? $social_provider_option['background'] : $social_provider_default['background']; |
|
| 191 | + $background = esc_attr( $background ); |
|
| 192 | 192 | |
| 193 | - $order = ( $social_provider_option && array_key_exists( 'order', $social_provider_option ) ) ? $social_provider_option['order'] : $key; |
|
| 194 | - $order = intval( $order ); |
|
| 193 | + $order = ( $social_provider_option && array_key_exists( 'order', $social_provider_option ) ) ? $social_provider_option['order'] : $key; |
|
| 194 | + $order = intval( $order ); |
|
| 195 | 195 | |
| 196 | - $url = ( $social_provider_option && array_key_exists( 'url', $social_provider_option ) ) ? $social_provider_option['url'] : $social_provider_default['url']; |
|
| 197 | - $url = esc_attr( $url ); |
|
| 196 | + $url = ( $social_provider_option && array_key_exists( 'url', $social_provider_option ) ) ? $social_provider_option['url'] : $social_provider_default['url']; |
|
| 197 | + $url = esc_attr( $url ); |
|
| 198 | 198 | |
| 199 | - $profile_data = array( |
|
| 200 | - 'id' => $id, |
|
| 201 | - 'class' => $class, |
|
| 202 | - 'icon' => $icon, |
|
| 203 | - 'enabled' => $enabled, |
|
| 204 | - 'url' => $url, |
|
| 205 | - 'color' => $color, |
|
| 206 | - 'background' => $background, |
|
| 207 | - 'order' => $order, |
|
| 208 | - 'name' => $name, |
|
| 209 | - 'label' => $label, |
|
| 210 | - ); |
|
| 199 | + $profile_data = array( |
|
| 200 | + 'id' => $id, |
|
| 201 | + 'class' => $class, |
|
| 202 | + 'icon' => $icon, |
|
| 203 | + 'enabled' => $enabled, |
|
| 204 | + 'url' => $url, |
|
| 205 | + 'color' => $color, |
|
| 206 | + 'background' => $background, |
|
| 207 | + 'order' => $order, |
|
| 208 | + 'name' => $name, |
|
| 209 | + 'label' => $label, |
|
| 210 | + ); |
|
| 211 | 211 | |
| 212 | - $profile_data = rawurlencode( wp_json_encode( $profile_data ) ); |
|
| 212 | + $profile_data = rawurlencode( wp_json_encode( $profile_data ) ); |
|
| 213 | 213 | |
| 214 | - echo '<input |
|
| 214 | + echo '<input |
|
| 215 | 215 | type="hidden" |
| 216 | 216 | class="redux-social-profiles-hidden-data-' . esc_attr( $key ) . '" |
| 217 | 217 | id="' . esc_attr( $this->field_id ) . '-' . esc_attr( $id ) . '-data" |
| 218 | 218 | name="' . esc_attr( $this->field['name'] ) . esc_attr( $this->field['name_suffix'] ) . '[' . esc_attr( $key ) . '][data]" |
| 219 | 219 | value="' . $profile_data . '" />'; // phpcs:ignore WordPress.Security.EscapeOutput |
| 220 | 220 | |
| 221 | - echo '<div class="redux-icon-preview">'; |
|
| 222 | - Redux_Social_Profiles_Functions::render_icon( $class, $icon, $color, $background, $name ); |
|
| 223 | - echo ' </div>'; |
|
| 221 | + echo '<div class="redux-icon-preview">'; |
|
| 222 | + Redux_Social_Profiles_Functions::render_icon( $class, $icon, $color, $background, $name ); |
|
| 223 | + echo ' </div>'; |
|
| 224 | 224 | |
| 225 | - echo '<div class="redux-social-profiles-item-name">'; |
|
| 226 | - echo esc_html( $name ); |
|
| 227 | - echo '</div>'; |
|
| 225 | + echo '<div class="redux-social-profiles-item-name">'; |
|
| 226 | + echo esc_html( $name ); |
|
| 227 | + echo '</div>'; |
|
| 228 | 228 | |
| 229 | - echo '<div class="redux-social-profiles-item-enabled">'; |
|
| 230 | - $checked = ( $enabled ) ? 'checked' : ''; |
|
| 231 | - echo '<input type="checkbox" id="' . esc_attr( $this->field['id'] ) . '-checkbox-' . esc_attr( $key ) . '" class="checkbox-' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" value="1" ' . esc_attr( $checked ) . '/>'; |
|
| 232 | - esc_html_e( 'Enabled', 'redux-framework' ); |
|
| 233 | - echo '</div>'; |
|
| 229 | + echo '<div class="redux-social-profiles-item-enabled">'; |
|
| 230 | + $checked = ( $enabled ) ? 'checked' : ''; |
|
| 231 | + echo '<input type="checkbox" id="' . esc_attr( $this->field['id'] ) . '-checkbox-' . esc_attr( $key ) . '" class="checkbox-' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" value="1" ' . esc_attr( $checked ) . '/>'; |
|
| 232 | + esc_html_e( 'Enabled', 'redux-framework' ); |
|
| 233 | + echo '</div>'; |
|
| 234 | 234 | |
| 235 | - $color_class = $color_pickers ? '' : ' no-color-pickers'; |
|
| 235 | + $color_class = $color_pickers ? '' : ' no-color-pickers'; |
|
| 236 | 236 | |
| 237 | - echo '<div class="redux-social-profiles-link-url input_wrapper' . esc_attr( $color_class ) . '">'; |
|
| 238 | - echo '<label for="redux-social-profiles-url-' . esc_attr( $key ) . '-text" class="redux-text-url-label">' . esc_html( $label ) . '</label>'; |
|
| 239 | - echo '<input id="redux-social-profiles-url-' . esc_attr( $key ) . '-text" class="redux-social-profiles-url-text" data-key="' . esc_attr( $key ) . '" type="text" value="' . esc_url( $url ) . '" />'; |
|
| 240 | - echo '</div>'; |
|
| 237 | + echo '<div class="redux-social-profiles-link-url input_wrapper' . esc_attr( $color_class ) . '">'; |
|
| 238 | + echo '<label for="redux-social-profiles-url-' . esc_attr( $key ) . '-text" class="redux-text-url-label">' . esc_html( $label ) . '</label>'; |
|
| 239 | + echo '<input id="redux-social-profiles-url-' . esc_attr( $key ) . '-text" class="redux-social-profiles-url-text" data-key="' . esc_attr( $key ) . '" type="text" value="' . esc_url( $url ) . '" />'; |
|
| 240 | + echo '</div>'; |
|
| 241 | 241 | |
| 242 | - $reset_text = __( 'Reset', 'redux-framework' ); |
|
| 243 | - echo '<div class="redux-social-profiles-item-reset">'; |
|
| 244 | - echo '<a class="button" data-value="' . esc_attr( $key ) . '" value="' . esc_attr( $reset_text ) . '" />' . esc_html( $reset_text ) . '</a>'; |
|
| 245 | - echo '</div>'; |
|
| 242 | + $reset_text = __( 'Reset', 'redux-framework' ); |
|
| 243 | + echo '<div class="redux-social-profiles-item-reset">'; |
|
| 244 | + echo '<a class="button" data-value="' . esc_attr( $key ) . '" value="' . esc_attr( $reset_text ) . '" />' . esc_html( $reset_text ) . '</a>'; |
|
| 245 | + echo '</div>'; |
|
| 246 | 246 | |
| 247 | - if ( $color_pickers ) { |
|
| 248 | - // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 249 | - $label = apply_filters( 'redux/extensions/social_profiles/' . $this->opt_name . '/color_picker/text', esc_html__( 'Text', 'redux-framework' ) ); |
|
| 247 | + if ( $color_pickers ) { |
|
| 248 | + // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 249 | + $label = apply_filters( 'redux/extensions/social_profiles/' . $this->opt_name . '/color_picker/text', esc_html__( 'Text', 'redux-framework' ) ); |
|
| 250 | 250 | |
| 251 | - echo '<div class="redux-social-profiles-text-color picker_wrapper" >'; |
|
| 252 | - echo '<label for="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' text" class="redux-text-color-label">' . esc_html( $label ) . '</label>'; |
|
| 253 | - echo '<input |
|
| 251 | + echo '<div class="redux-social-profiles-text-color picker_wrapper" >'; |
|
| 252 | + echo '<label for="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' text" class="redux-text-color-label">' . esc_html( $label ) . '</label>'; |
|
| 253 | + echo '<input |
|
| 254 | 254 | class="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' text" |
| 255 | 255 | id="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' text" |
| 256 | 256 | type="text" |
| 257 | 257 | value="' . esc_attr( $color ) . '" |
| 258 | 258 | data-key="' . esc_attr( $key ) . '" |
| 259 | 259 | />'; |
| 260 | - echo '</div>'; |
|
| 260 | + echo '</div>'; |
|
| 261 | 261 | |
| 262 | - // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 263 | - $label = apply_filters( 'redux/extensions/social_profiles/' . $this->opt_name . '/color_picker/background', esc_html__( 'Background', 'redux-framework' ) ); |
|
| 262 | + // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 263 | + $label = apply_filters( 'redux/extensions/social_profiles/' . $this->opt_name . '/color_picker/background', esc_html__( 'Background', 'redux-framework' ) ); |
|
| 264 | 264 | |
| 265 | - echo '<div class="redux-social-profiles-background-color picker_wrapper">'; |
|
| 266 | - echo '<label for="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' background" class="redux-background-color-label" for="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' background">' . esc_html( $label ) . '</label>'; |
|
| 267 | - echo '<input |
|
| 265 | + echo '<div class="redux-social-profiles-background-color picker_wrapper">'; |
|
| 266 | + echo '<label for="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' background" class="redux-background-color-label" for="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' background">' . esc_html( $label ) . '</label>'; |
|
| 267 | + echo '<input |
|
| 268 | 268 | class="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' background" |
| 269 | 269 | id="redux-social-profiles-color-picker-' . esc_attr( $key ) . ' background" |
| 270 | 270 | type="text" |
| 271 | 271 | value="' . esc_attr( $background ) . '" |
| 272 | 272 | data-key="' . esc_attr( $key ) . '" |
| 273 | 273 | />'; |
| 274 | - echo '</div>'; |
|
| 275 | - } |
|
| 274 | + echo '</div>'; |
|
| 275 | + } |
|
| 276 | 276 | |
| 277 | - echo '<div class="redux-social-profiles-item-order">'; |
|
| 278 | - echo '<input |
|
| 277 | + echo '<div class="redux-social-profiles-item-order">'; |
|
| 278 | + echo '<input |
|
| 279 | 279 | id="' . esc_attr( $this->field['id'] ) . '-item-order-' . esc_attr( $key ) . '" |
| 280 | 280 | type="hidden" |
| 281 | 281 | value="' . esc_attr( $order ) . '" |
| 282 | 282 | />'; |
| 283 | - echo '</div>'; |
|
| 284 | - |
|
| 285 | - echo '</div>'; |
|
| 286 | - echo '</li>'; |
|
| 287 | - } |
|
| 288 | - |
|
| 289 | - echo '</ul>'; |
|
| 290 | - echo '</div>'; |
|
| 291 | - } |
|
| 292 | - |
|
| 293 | - /** |
|
| 294 | - * This function is unused, but necessary to trigger output. |
|
| 295 | - * |
|
| 296 | - * @param mixed $data CSS data. |
|
| 297 | - * |
|
| 298 | - * @return mixed|string|void |
|
| 299 | - */ |
|
| 300 | - public function css_style( $data ) { |
|
| 301 | - return $data; |
|
| 302 | - } |
|
| 303 | - |
|
| 304 | - /** |
|
| 305 | - * Used to enqueue to the front-end |
|
| 306 | - * |
|
| 307 | - * @param string|null|array $style Style. |
|
| 308 | - */ |
|
| 309 | - public function output( $style = '' ) { |
|
| 310 | - if ( ! empty( $this->value ) ) { |
|
| 311 | - foreach ( $this->value as $arr ) { |
|
| 312 | - |
|
| 313 | - // For customizer. |
|
| 314 | - if ( isset( $arr['data'] ) ) { |
|
| 315 | - $arr = rawurldecode( $arr['data'] ); |
|
| 316 | - $arr = (array) json_decode( $arr ); |
|
| 317 | - } |
|
| 318 | - |
|
| 319 | - if ( $arr['enabled'] ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement |
|
| 320 | - Redux_Functions_Ex::enqueue_font_awesome(); |
|
| 321 | - } |
|
| 322 | - } |
|
| 323 | - } |
|
| 324 | - } |
|
| 325 | - |
|
| 326 | - /** |
|
| 327 | - * Enqueue Function. |
|
| 328 | - * If this field requires any scripts, or css define this function and register/enqueue the scripts/css |
|
| 329 | - * |
|
| 330 | - * @since 1.0.0 |
|
| 331 | - * @access public |
|
| 332 | - * @return void |
|
| 333 | - */ |
|
| 334 | - public function enqueue() { |
|
| 335 | - if ( empty( $this->field ) ) { |
|
| 336 | - return; |
|
| 337 | - } |
|
| 338 | - |
|
| 339 | - $min = Redux_Functions::isMin(); |
|
| 340 | - |
|
| 341 | - Redux_Functions_Ex::enqueue_font_awesome(); |
|
| 342 | - |
|
| 343 | - // Field dependent JS. |
|
| 344 | - wp_enqueue_script( |
|
| 345 | - 'redux-field-social-profiles', |
|
| 346 | - $this->url . 'redux-social-profiles' . $min . '.js', |
|
| 347 | - array( 'jquery', 'jquery-ui-sortable', 'redux-spectrum-js', 'redux-js' ), |
|
| 348 | - Redux_Extension_Social_Profiles::$version, |
|
| 349 | - true |
|
| 350 | - ); |
|
| 351 | - |
|
| 352 | - wp_localize_script( |
|
| 353 | - 'redux-field-social-profiles', |
|
| 354 | - 'reduxSocialDefaults', |
|
| 355 | - $this->defaults |
|
| 356 | - ); |
|
| 357 | - |
|
| 358 | - if ( $this->parent->args['dev_mode'] ) { |
|
| 359 | - wp_enqueue_style( |
|
| 360 | - 'redux-field-social-profiles', |
|
| 361 | - $this->url . 'redux-social-profiles.css', |
|
| 362 | - array( 'redux-spectrum-css' ), |
|
| 363 | - Redux_Extension_Social_Profiles::$version |
|
| 364 | - ); |
|
| 365 | - } |
|
| 366 | - } |
|
| 367 | - } |
|
| 283 | + echo '</div>'; |
|
| 284 | + |
|
| 285 | + echo '</div>'; |
|
| 286 | + echo '</li>'; |
|
| 287 | + } |
|
| 288 | + |
|
| 289 | + echo '</ul>'; |
|
| 290 | + echo '</div>'; |
|
| 291 | + } |
|
| 292 | + |
|
| 293 | + /** |
|
| 294 | + * This function is unused, but necessary to trigger output. |
|
| 295 | + * |
|
| 296 | + * @param mixed $data CSS data. |
|
| 297 | + * |
|
| 298 | + * @return mixed|string|void |
|
| 299 | + */ |
|
| 300 | + public function css_style( $data ) { |
|
| 301 | + return $data; |
|
| 302 | + } |
|
| 303 | + |
|
| 304 | + /** |
|
| 305 | + * Used to enqueue to the front-end |
|
| 306 | + * |
|
| 307 | + * @param string|null|array $style Style. |
|
| 308 | + */ |
|
| 309 | + public function output( $style = '' ) { |
|
| 310 | + if ( ! empty( $this->value ) ) { |
|
| 311 | + foreach ( $this->value as $arr ) { |
|
| 312 | + |
|
| 313 | + // For customizer. |
|
| 314 | + if ( isset( $arr['data'] ) ) { |
|
| 315 | + $arr = rawurldecode( $arr['data'] ); |
|
| 316 | + $arr = (array) json_decode( $arr ); |
|
| 317 | + } |
|
| 318 | + |
|
| 319 | + if ( $arr['enabled'] ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement |
|
| 320 | + Redux_Functions_Ex::enqueue_font_awesome(); |
|
| 321 | + } |
|
| 322 | + } |
|
| 323 | + } |
|
| 324 | + } |
|
| 325 | + |
|
| 326 | + /** |
|
| 327 | + * Enqueue Function. |
|
| 328 | + * If this field requires any scripts, or css define this function and register/enqueue the scripts/css |
|
| 329 | + * |
|
| 330 | + * @since 1.0.0 |
|
| 331 | + * @access public |
|
| 332 | + * @return void |
|
| 333 | + */ |
|
| 334 | + public function enqueue() { |
|
| 335 | + if ( empty( $this->field ) ) { |
|
| 336 | + return; |
|
| 337 | + } |
|
| 338 | + |
|
| 339 | + $min = Redux_Functions::isMin(); |
|
| 340 | + |
|
| 341 | + Redux_Functions_Ex::enqueue_font_awesome(); |
|
| 342 | + |
|
| 343 | + // Field dependent JS. |
|
| 344 | + wp_enqueue_script( |
|
| 345 | + 'redux-field-social-profiles', |
|
| 346 | + $this->url . 'redux-social-profiles' . $min . '.js', |
|
| 347 | + array( 'jquery', 'jquery-ui-sortable', 'redux-spectrum-js', 'redux-js' ), |
|
| 348 | + Redux_Extension_Social_Profiles::$version, |
|
| 349 | + true |
|
| 350 | + ); |
|
| 351 | + |
|
| 352 | + wp_localize_script( |
|
| 353 | + 'redux-field-social-profiles', |
|
| 354 | + 'reduxSocialDefaults', |
|
| 355 | + $this->defaults |
|
| 356 | + ); |
|
| 357 | + |
|
| 358 | + if ( $this->parent->args['dev_mode'] ) { |
|
| 359 | + wp_enqueue_style( |
|
| 360 | + 'redux-field-social-profiles', |
|
| 361 | + $this->url . 'redux-social-profiles.css', |
|
| 362 | + array( 'redux-spectrum-css' ), |
|
| 363 | + Redux_Extension_Social_Profiles::$version |
|
| 364 | + ); |
|
| 365 | + } |
|
| 366 | + } |
|
| 367 | + } |
|
| 368 | 368 | } |
@@ -69,12 +69,12 @@ discard block |
||
| 69 | 69 | foreach ( $settings as $a ) { |
| 70 | 70 | if ( isset( $a['data'] ) ) { |
| 71 | 71 | $a['data'] = rawurldecode( $a['data'] ); |
| 72 | - $a = (array) json_decode( $a['data'] ); |
|
| 72 | + $a = ( array ) json_decode( $a['data'] ); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | if ( $default_id === $a['id'] ) { |
| 76 | 76 | $search_default = false; |
| 77 | - $fixed_arr[ $key ] = $a; |
|
| 77 | + $fixed_arr[$key] = $a; |
|
| 78 | 78 | break; |
| 79 | 79 | } |
| 80 | 80 | } |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | foreach ( $stock as $def_arr ) { |
| 89 | 89 | if ( $default_id === $def_arr['id'] ) { |
| 90 | - $fixed_arr[ $key ] = $def_arr; |
|
| 90 | + $fixed_arr[$key] = $def_arr; |
|
| 91 | 91 | break; |
| 92 | 92 | } |
| 93 | 93 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | global $pagenow, $post; |
| 114 | 114 | |
| 115 | 115 | $redux_settings = get_option( $this->opt_name ); |
| 116 | - $settings = $redux_settings[ $this->field_id ] ?? array(); |
|
| 116 | + $settings = $redux_settings[$this->field_id] ?? array(); |
|
| 117 | 117 | |
| 118 | 118 | if ( is_admin() && ( 'post-new.php' === $pagenow || 'post.php' === $pagenow ) ) { |
| 119 | 119 | $post_settings = get_post_meta( $post->ID, $this->field_id, true ); |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $settings = $this->rebuild_setttings( $settings ); |
| 152 | 152 | |
| 153 | 153 | foreach ( $this->defaults as $key => $social_provider_default ) { |
| 154 | - $social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[ $key ] : null; |
|
| 154 | + $social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[$key] : null; |
|
| 155 | 155 | |
| 156 | 156 | $icon = ( $social_provider_option && array_key_exists( 'icon', $social_provider_option ) && $social_provider_option['icon'] ) ? $social_provider_option['icon'] : $social_provider_default['icon']; |
| 157 | 157 | $name = ( $social_provider_option && array_key_exists( 'name', $social_provider_option ) && $social_provider_option['name'] ) ? $social_provider_option['name'] : $social_provider_default['name']; |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | echo '<li id="redux-social-item-' . esc_attr( $key ) . '" data-key="' . esc_attr( $key ) . '" style="display: none;">'; |
| 176 | 176 | echo '<div class="redux-social-item-container">'; |
| 177 | 177 | |
| 178 | - $social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[ $key ] : null; |
|
| 178 | + $social_provider_option = ( $settings && is_array( $settings ) && array_key_exists( $key, $settings ) ) ? $settings[$key] : null; |
|
| 179 | 179 | $icon = ( $social_provider_option && array_key_exists( 'icon', $social_provider_option ) && $social_provider_option['icon'] ) ? $social_provider_option['icon'] : $social_provider_default['icon']; |
| 180 | 180 | $id = ( $social_provider_option && array_key_exists( 'id', $social_provider_option ) && $social_provider_option['id'] ) ? $social_provider_option['id'] : $social_provider_default['id']; |
| 181 | 181 | $class = ( $social_provider_option && array_key_exists( 'class', $social_provider_option ) && $social_provider_option['class'] ) ? $social_provider_option['class'] : $social_provider_default['class']; |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | // For customizer. |
| 314 | 314 | if ( isset( $arr['data'] ) ) { |
| 315 | 315 | $arr = rawurldecode( $arr['data'] ); |
| 316 | - $arr = (array) json_decode( $arr ); |
|
| 316 | + $arr = ( array ) json_decode( $arr ); |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | if ( $arr['enabled'] ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement |
@@ -16,82 +16,82 @@ |
||
| 16 | 16 | require_once Redux_Core::$dir . 'inc/extensions/icon_select/font-awesome-5-free.php'; |
| 17 | 17 | |
| 18 | 18 | Redux::set_section( |
| 19 | - $opt_name, |
|
| 20 | - array( |
|
| 21 | - 'title' => esc_html__( 'Icon Select', 'your-textdomain-here' ), |
|
| 22 | - 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-extensions/icon-select.html" target="_blank">https://devs.redux.io/core-extensions/icon-select.html</a>', |
|
| 23 | - 'subsection' => true, |
|
| 24 | - 'fields' => array( |
|
| 19 | + $opt_name, |
|
| 20 | + array( |
|
| 21 | + 'title' => esc_html__( 'Icon Select', 'your-textdomain-here' ), |
|
| 22 | + 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-extensions/icon-select.html" target="_blank">https://devs.redux.io/core-extensions/icon-select.html</a>', |
|
| 23 | + 'subsection' => true, |
|
| 24 | + 'fields' => array( |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * This field was left in the sample config to display that every effort to maintain backward compatibility with older |
|
| 28 | - * versions of Icon Select has been implemented. |
|
| 29 | - * Please do NOT use argument in this field in your projects. |
|
| 30 | - * They are considered deprecated. |
|
| 31 | - */ |
|
| 32 | - array( |
|
| 33 | - 'id' => 'icon-select-legacy', |
|
| 34 | - 'type' => 'icon_select', |
|
| 35 | - 'title' => esc_html__( 'Legacy Icon Select', 'your-textdomain-here' ), |
|
| 36 | - 'subtitle' => esc_html__( 'Original Icon Select field that maintains backward compatibility with the original extension.', 'your-textdomain-here' ), |
|
| 37 | - 'default' => '', |
|
| 38 | - 'options' => redux_icon_select_fa_5_free(), |
|
| 26 | + /** |
|
| 27 | + * This field was left in the sample config to display that every effort to maintain backward compatibility with older |
|
| 28 | + * versions of Icon Select has been implemented. |
|
| 29 | + * Please do NOT use argument in this field in your projects. |
|
| 30 | + * They are considered deprecated. |
|
| 31 | + */ |
|
| 32 | + array( |
|
| 33 | + 'id' => 'icon-select-legacy', |
|
| 34 | + 'type' => 'icon_select', |
|
| 35 | + 'title' => esc_html__( 'Legacy Icon Select', 'your-textdomain-here' ), |
|
| 36 | + 'subtitle' => esc_html__( 'Original Icon Select field that maintains backward compatibility with the original extension.', 'your-textdomain-here' ), |
|
| 37 | + 'default' => '', |
|
| 38 | + 'options' => redux_icon_select_fa_5_free(), |
|
| 39 | 39 | |
| 40 | - // Disable auto-enqueue of stylesheet if present in the panel. |
|
| 41 | - 'enqueue' => true, |
|
| 40 | + // Disable auto-enqueue of stylesheet if present in the panel. |
|
| 41 | + 'enqueue' => true, |
|
| 42 | 42 | |
| 43 | - // Disable auto-enqueue of stylesheet on the front-end. |
|
| 44 | - 'enqueue_frontend' => true, |
|
| 43 | + // Disable auto-enqueue of stylesheet on the front-end. |
|
| 44 | + 'enqueue_frontend' => true, |
|
| 45 | 45 | |
| 46 | - // Stylesheet URL. |
|
| 47 | - //'stylesheet' => 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/all.css', |
|
| 46 | + // Stylesheet URL. |
|
| 47 | + //'stylesheet' => 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/all.css', |
|
| 48 | 48 | |
| 49 | - // (Optional) Specify a class prefix if one is needed to initialize the icon. |
|
| 50 | - 'prefix' => 'fa', |
|
| 51 | - ), |
|
| 49 | + // (Optional) Specify a class prefix if one is needed to initialize the icon. |
|
| 50 | + 'prefix' => 'fa', |
|
| 51 | + ), |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * When creating fields for Icon Select, use this as a template instead. |
|
| 55 | - * For detailed documentation, see: https://devs.redux.io/core-extensions/icon-select.html |
|
| 56 | - */ |
|
| 57 | - array( |
|
| 58 | - 'id' => 'icon-select', |
|
| 59 | - 'type' => 'icon_select', |
|
| 60 | - 'title' => esc_html__( 'Icon Select', 'your-textdomain-here' ), |
|
| 61 | - 'subtitle' => esc_html__( 'Select an icon.', 'your-textdomain-here' ), |
|
| 62 | - 'default' => 'fas fa-1', |
|
| 53 | + /** |
|
| 54 | + * When creating fields for Icon Select, use this as a template instead. |
|
| 55 | + * For detailed documentation, see: https://devs.redux.io/core-extensions/icon-select.html |
|
| 56 | + */ |
|
| 57 | + array( |
|
| 58 | + 'id' => 'icon-select', |
|
| 59 | + 'type' => 'icon_select', |
|
| 60 | + 'title' => esc_html__( 'Icon Select', 'your-textdomain-here' ), |
|
| 61 | + 'subtitle' => esc_html__( 'Select an icon.', 'your-textdomain-here' ), |
|
| 62 | + 'default' => 'fas fa-1', |
|
| 63 | 63 | |
| 64 | - // Disable auto-enqueue of stylesheet if present in the panel. |
|
| 65 | - 'enqueue' => true, |
|
| 64 | + // Disable auto-enqueue of stylesheet if present in the panel. |
|
| 65 | + 'enqueue' => true, |
|
| 66 | 66 | |
| 67 | - // Disable auto-enqueue of stylesheet on the front-end. |
|
| 68 | - 'enqueue_frontend' => true, |
|
| 67 | + // Disable auto-enqueue of stylesheet on the front-end. |
|
| 68 | + 'enqueue_frontend' => true, |
|
| 69 | 69 | |
| 70 | - // Stylesheet data. |
|
| 71 | - 'stylesheet' => array( |
|
| 72 | - array( |
|
| 73 | - 'url' => 'https://cdnjs.cloudflare.com/ajax/libs/MaterialDesign-Webfont/7.2.96/css/materialdesignicons.css', |
|
| 74 | - 'title' => 'Material Icons', |
|
| 75 | - 'prefix' => 'mdi-set', |
|
| 76 | - ), |
|
| 77 | - array( |
|
| 78 | - 'url' => 'https://icons.getbootstrap.com/assets/font/bootstrap-icons.min.css', |
|
| 79 | - 'title' => 'Bootstrap', |
|
| 80 | - 'prefix' => 'bi', |
|
| 81 | - ), |
|
| 82 | - array( |
|
| 83 | - 'url' => 'https://cdn.lineicons.com/4.0/lineicons.css', |
|
| 84 | - 'title' => 'Line Icons', |
|
| 85 | - 'prefix' => 'lni', |
|
| 86 | - ), |
|
| 87 | - array( |
|
| 88 | - 'url' => 'https://cdn.jsdelivr.net/gh/devicons/[email protected]/devicon.min.css', |
|
| 89 | - 'title' => 'Dev Icons', |
|
| 90 | - 'prefix' => '', |
|
| 91 | - ), |
|
| 92 | - ), |
|
| 93 | - ), |
|
| 94 | - ), |
|
| 95 | - ) |
|
| 70 | + // Stylesheet data. |
|
| 71 | + 'stylesheet' => array( |
|
| 72 | + array( |
|
| 73 | + 'url' => 'https://cdnjs.cloudflare.com/ajax/libs/MaterialDesign-Webfont/7.2.96/css/materialdesignicons.css', |
|
| 74 | + 'title' => 'Material Icons', |
|
| 75 | + 'prefix' => 'mdi-set', |
|
| 76 | + ), |
|
| 77 | + array( |
|
| 78 | + 'url' => 'https://icons.getbootstrap.com/assets/font/bootstrap-icons.min.css', |
|
| 79 | + 'title' => 'Bootstrap', |
|
| 80 | + 'prefix' => 'bi', |
|
| 81 | + ), |
|
| 82 | + array( |
|
| 83 | + 'url' => 'https://cdn.lineicons.com/4.0/lineicons.css', |
|
| 84 | + 'title' => 'Line Icons', |
|
| 85 | + 'prefix' => 'lni', |
|
| 86 | + ), |
|
| 87 | + array( |
|
| 88 | + 'url' => 'https://cdn.jsdelivr.net/gh/devicons/[email protected]/devicon.min.css', |
|
| 89 | + 'title' => 'Dev Icons', |
|
| 90 | + 'prefix' => '', |
|
| 91 | + ), |
|
| 92 | + ), |
|
| 93 | + ), |
|
| 94 | + ), |
|
| 95 | + ) |
|
| 96 | 96 | ); |
| 97 | 97 | // phpcs:enable |
@@ -11,241 +11,241 @@ |
||
| 11 | 11 | |
| 12 | 12 | if ( ! class_exists( 'Redux_Validation', false ) ) { |
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Class Redux_Validation |
|
| 16 | - */ |
|
| 17 | - class Redux_Validation extends Redux_Class { |
|
| 18 | - |
|
| 19 | - /** |
|
| 20 | - * Validate values from options form (used in settings api validate function) |
|
| 21 | - * calls the custom validation class for the field so authors can override with custom classes |
|
| 22 | - * |
|
| 23 | - * @since 1.0.0 |
|
| 24 | - * @access public |
|
| 25 | - * |
|
| 26 | - * @param array $plugin_options Plugin Options. |
|
| 27 | - * @param array $options Options. |
|
| 28 | - * @param array $sections Sections array. |
|
| 29 | - * |
|
| 30 | - * @return array $plugin_options |
|
| 31 | - */ |
|
| 32 | - public function validate( array $plugin_options, array $options, array $sections ): array { |
|
| 33 | - $core = $this->core(); |
|
| 34 | - |
|
| 35 | - if (null === $core) { |
|
| 36 | - return $plugin_options; |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - foreach ( $sections as $k => $section ) { |
|
| 40 | - if ( isset( $section['fields'] ) ) { |
|
| 41 | - foreach ( $section['fields'] as $fkey => $field ) { |
|
| 42 | - if ( is_array( $field ) ) { |
|
| 43 | - $field['section_id'] = $k; |
|
| 44 | - } |
|
| 45 | - |
|
| 46 | - if ( isset( $field['type'] ) && ( 'checkbox' === $field['type'] || 'checkbox_hide_below' === $field['type'] || 'checkbox_hide_all' === $field['type'] ) ) { |
|
| 47 | - if ( ! isset( $plugin_options[ $field['id'] ] ) ) { |
|
| 48 | - $plugin_options[ $field['id'] ] = 0; |
|
| 49 | - } |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - // Part of Dovy's serialize typography effort. Preserved here in case it becomes a thing. - kp. |
|
| 53 | - /** |
|
| 54 | - * If ( isset ( $field['type'] ) && $field['type'] == 'typography' ) { |
|
| 55 | - * if ( ! is_array( $plugin_options[ $field['id'] ] ) && ! empty( $plugin_options[ $field['id'] ] ) ) { |
|
| 56 | - * $plugin_options[ $field['id'] ] = json_decode( $plugin_options[ $field['id'] ], true ); |
|
| 57 | - * } |
|
| 58 | - * } |
|
| 59 | - */ |
|
| 60 | - |
|
| 61 | - if ( isset( $core->extensions[ $field['type'] ] ) && method_exists( $core->extensions[ $field['type'] ], '_validate_values' ) ) { |
|
| 62 | - $plugin_options = $core->extensions[ $field['type'] ]->_validate_values( $plugin_options, $field, $sections ); |
|
| 63 | - } |
|
| 64 | - |
|
| 65 | - // Make sure 'validate' field is set. |
|
| 66 | - if ( isset( $field['validate'] ) ) { |
|
| 67 | - |
|
| 68 | - // Can we make this an array of validations? |
|
| 69 | - $val_arr = array(); |
|
| 70 | - |
|
| 71 | - if ( is_array( $field['validate'] ) ) { |
|
| 72 | - $val_arr = $field['validate']; |
|
| 73 | - } else { |
|
| 74 | - $val_arr[] = $field['validate']; |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - foreach ( $val_arr as $idx => $val ) { |
|
| 78 | - // shim for old *_not_empty validations. |
|
| 79 | - if ( 'email_not_empty' === $val || 'numeric_not_empty' === $val ) { |
|
| 80 | - $val = 'not_empty'; |
|
| 81 | - } |
|
| 82 | - |
|
| 83 | - // Make sure 'validate field' is set to 'not_empty'. |
|
| 84 | - $is_not_empty = false; |
|
| 85 | - |
|
| 86 | - if ( 'not_empty' === $val ) { |
|
| 87 | - // Set the flag. |
|
| 88 | - $is_not_empty = true; |
|
| 89 | - } |
|
| 90 | - |
|
| 91 | - // Check for empty id value. |
|
| 92 | - if ( ! isset( $field['id'] ) || ! isset( $plugin_options[ $field['id'] ] ) || ( '' === $plugin_options[ $field['id'] ] ) ) { |
|
| 93 | - |
|
| 94 | - // If we are looking for an empty value, in the case of 'not_empty' |
|
| 95 | - // then we need to keep processing. |
|
| 96 | - if ( ! $is_not_empty ) { |
|
| 97 | - |
|
| 98 | - // Empty id and not checking for 'not_empty'. Bail out... |
|
| 99 | - if ( ! isset( $field['validate_callback'] ) ) { |
|
| 100 | - continue; |
|
| 101 | - } |
|
| 102 | - } |
|
| 103 | - } |
|
| 104 | - |
|
| 105 | - // Force validate of custom field types. |
|
| 106 | - if ( isset( $field['type'] ) && ! isset( $val ) && ! isset( $field['validate_callback'] ) ) { |
|
| 107 | - if ( 'color' === $field['type'] || 'color_gradient' === $field['type'] ) { |
|
| 108 | - $val = 'color'; |
|
| 109 | - } elseif ( 'date' === $field['type'] ) { |
|
| 110 | - $val = 'date'; |
|
| 111 | - } |
|
| 112 | - } |
|
| 113 | - |
|
| 114 | - // No need. Spectrum self validates. |
|
| 115 | - if ( 'color_rgba' === $field['type'] ) { |
|
| 116 | - continue; |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - // Shim out old color rgba validators. |
|
| 120 | - if ( 'color_rgba' === $val || 'colorrgba' === $val ) { |
|
| 121 | - $val = 'color'; |
|
| 122 | - } |
|
| 123 | - |
|
| 124 | - $validate = 'Redux_Validation_' . $val; |
|
| 125 | - |
|
| 126 | - if ( ! class_exists( $validate ) ) { |
|
| 127 | - $file = str_replace( '_', '-', $val ); |
|
| 128 | - |
|
| 129 | - /** |
|
| 130 | - * Filter 'redux/validate/{opt_name}/class/{field.validate}' |
|
| 131 | - * |
|
| 132 | - * @param string $validate validation class file path |
|
| 133 | - */ |
|
| 134 | - |
|
| 135 | - // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 136 | - $class_file = apply_filters( "redux/validate/{$core->args['opt_name']}/class/$val", Redux_Core::$dir . "inc/validation/$val/class-redux-validation-$file.php", $validate ); |
|
| 137 | - |
|
| 138 | - if ( $class_file ) { |
|
| 139 | - if ( file_exists( $class_file ) ) { |
|
| 140 | - require_once $class_file; |
|
| 141 | - } |
|
| 142 | - } |
|
| 143 | - } |
|
| 144 | - |
|
| 145 | - if ( class_exists( $validate ) ) { |
|
| 146 | - if ( empty( $options[ $field['id'] ] ) ) { |
|
| 147 | - $options[ $field['id'] ] = ''; |
|
| 148 | - } |
|
| 149 | - |
|
| 150 | - if ( isset( $plugin_options[ $field['id'] ] ) && is_array( $plugin_options[ $field['id'] ] ) && ! empty( $plugin_options[ $field['id'] ] ) ) { |
|
| 151 | - foreach ( $plugin_options[ $field['id'] ] as $key => $value ) { |
|
| 152 | - $before = null; |
|
| 153 | - $after = null; |
|
| 154 | - |
|
| 155 | - if ( isset( $plugin_options[ $field['id'] ][ $key ] ) && ( ! empty( $plugin_options[ $field['id'] ][ $key ] ) || '0' === $plugin_options[ $field['id'] ][ $key ] ) ) { |
|
| 156 | - if ( is_array( $plugin_options[ $field['id'] ][ $key ] ) ) { |
|
| 157 | - $before = $plugin_options[ $field['id'] ][ $key ]; |
|
| 158 | - } else { |
|
| 159 | - $before = trim( $plugin_options[ $field['id'] ][ $key ] ); |
|
| 160 | - } |
|
| 161 | - } |
|
| 162 | - |
|
| 163 | - if ( isset( $options[ $field['id'] ][ $key ] ) && ( ! empty( $plugin_options[ $field['id'] ][ $key ] ) || '0' === $plugin_options[ $field['id'] ][ $key ] ) ) { |
|
| 164 | - $after = $options[ $field['id'] ][ $key ]; |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - $validation = new $validate( $core, $field, $before, $after ); |
|
| 168 | - |
|
| 169 | - if ( ! empty( $validation->value ) || '0' === $validation->value ) { |
|
| 170 | - $plugin_options[ $field['id'] ][ $key ] = $validation->value; |
|
| 171 | - } else { |
|
| 172 | - unset( $plugin_options[ $field['id'] ][ $key ] ); |
|
| 173 | - } |
|
| 174 | - |
|
| 175 | - if ( ! empty( $validation->error ) ) { |
|
| 176 | - $core->errors[] = $validation->error; |
|
| 177 | - } |
|
| 178 | - |
|
| 179 | - if ( ! empty( $validation->warning ) ) { |
|
| 180 | - $core->warnings[] = $validation->warning; |
|
| 181 | - } |
|
| 182 | - |
|
| 183 | - if ( ! empty( $validation->sanitize ) ) { |
|
| 184 | - $core->sanitize[] = $validation->sanitize; |
|
| 185 | - } |
|
| 186 | - } |
|
| 187 | - } else { |
|
| 188 | - if ( isset( $plugin_options[ $field['id'] ] ) ) { |
|
| 189 | - if ( is_array( $plugin_options[ $field['id'] ] ) ) { |
|
| 190 | - $pofi = $plugin_options[ $field['id'] ]; |
|
| 191 | - } else { |
|
| 192 | - $pofi = trim( $plugin_options[ $field['id'] ] ); |
|
| 193 | - } |
|
| 194 | - } else { |
|
| 195 | - $pofi = null; |
|
| 196 | - } |
|
| 197 | - |
|
| 198 | - $validation = new $validate( $core, $field, $pofi, $options[ $field['id'] ] ); |
|
| 199 | - $plugin_options[ $field['id'] ] = $validation->value; |
|
| 200 | - |
|
| 201 | - if ( ! empty( $validation->error ) ) { |
|
| 202 | - $core->errors[] = $validation->error; |
|
| 203 | - } |
|
| 204 | - |
|
| 205 | - if ( ! empty( $validation->warning ) ) { |
|
| 206 | - $core->warnings[] = $validation->warning; |
|
| 207 | - } |
|
| 208 | - |
|
| 209 | - if ( ! empty( $validation->sanitize ) ) { |
|
| 210 | - $core->sanitize[] = $validation->sanitize; |
|
| 211 | - } |
|
| 212 | - } |
|
| 213 | - |
|
| 214 | - break; |
|
| 215 | - } |
|
| 216 | - } |
|
| 217 | - } |
|
| 218 | - |
|
| 219 | - if ( isset( $field['validate_callback'] ) && ( is_callable( $field['validate_callback'] ) || ( is_string( $field['validate_callback'] ) && function_exists( $field['validate_callback'] ) ) ) ) { |
|
| 220 | - $callback = $field['validate_callback']; |
|
| 221 | - unset( $field['validate_callback'] ); |
|
| 222 | - |
|
| 223 | - $plugin_option = $plugin_options[ $field['id'] ] ?? null; |
|
| 224 | - $option = $options[ $field['id'] ] ?? null; |
|
| 225 | - |
|
| 226 | - if ( null !== $plugin_option ) { |
|
| 227 | - $callbackvalues = call_user_func( $callback, $field, $plugin_option, $option ); |
|
| 228 | - |
|
| 229 | - $plugin_options[ $field['id'] ] = $callbackvalues['value']; |
|
| 230 | - |
|
| 231 | - if ( isset( $callbackvalues['error'] ) ) { |
|
| 232 | - $core->errors[] = $callbackvalues['error']; |
|
| 233 | - } |
|
| 234 | - |
|
| 235 | - if ( isset( $callbackvalues['warning'] ) ) { |
|
| 236 | - $core->warnings[] = $callbackvalues['warning']; |
|
| 237 | - } |
|
| 238 | - |
|
| 239 | - if ( isset( $callbackvalues['sanitize'] ) ) { |
|
| 240 | - $core->sanitize[] = $callbackvalues['sanitize']; |
|
| 241 | - } |
|
| 242 | - } |
|
| 243 | - } |
|
| 244 | - } |
|
| 245 | - } |
|
| 246 | - } |
|
| 247 | - |
|
| 248 | - return $plugin_options; |
|
| 249 | - } |
|
| 250 | - } |
|
| 14 | + /** |
|
| 15 | + * Class Redux_Validation |
|
| 16 | + */ |
|
| 17 | + class Redux_Validation extends Redux_Class { |
|
| 18 | + |
|
| 19 | + /** |
|
| 20 | + * Validate values from options form (used in settings api validate function) |
|
| 21 | + * calls the custom validation class for the field so authors can override with custom classes |
|
| 22 | + * |
|
| 23 | + * @since 1.0.0 |
|
| 24 | + * @access public |
|
| 25 | + * |
|
| 26 | + * @param array $plugin_options Plugin Options. |
|
| 27 | + * @param array $options Options. |
|
| 28 | + * @param array $sections Sections array. |
|
| 29 | + * |
|
| 30 | + * @return array $plugin_options |
|
| 31 | + */ |
|
| 32 | + public function validate( array $plugin_options, array $options, array $sections ): array { |
|
| 33 | + $core = $this->core(); |
|
| 34 | + |
|
| 35 | + if (null === $core) { |
|
| 36 | + return $plugin_options; |
|
| 37 | + } |
|
| 38 | + |
|
| 39 | + foreach ( $sections as $k => $section ) { |
|
| 40 | + if ( isset( $section['fields'] ) ) { |
|
| 41 | + foreach ( $section['fields'] as $fkey => $field ) { |
|
| 42 | + if ( is_array( $field ) ) { |
|
| 43 | + $field['section_id'] = $k; |
|
| 44 | + } |
|
| 45 | + |
|
| 46 | + if ( isset( $field['type'] ) && ( 'checkbox' === $field['type'] || 'checkbox_hide_below' === $field['type'] || 'checkbox_hide_all' === $field['type'] ) ) { |
|
| 47 | + if ( ! isset( $plugin_options[ $field['id'] ] ) ) { |
|
| 48 | + $plugin_options[ $field['id'] ] = 0; |
|
| 49 | + } |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + // Part of Dovy's serialize typography effort. Preserved here in case it becomes a thing. - kp. |
|
| 53 | + /** |
|
| 54 | + * If ( isset ( $field['type'] ) && $field['type'] == 'typography' ) { |
|
| 55 | + * if ( ! is_array( $plugin_options[ $field['id'] ] ) && ! empty( $plugin_options[ $field['id'] ] ) ) { |
|
| 56 | + * $plugin_options[ $field['id'] ] = json_decode( $plugin_options[ $field['id'] ], true ); |
|
| 57 | + * } |
|
| 58 | + * } |
|
| 59 | + */ |
|
| 60 | + |
|
| 61 | + if ( isset( $core->extensions[ $field['type'] ] ) && method_exists( $core->extensions[ $field['type'] ], '_validate_values' ) ) { |
|
| 62 | + $plugin_options = $core->extensions[ $field['type'] ]->_validate_values( $plugin_options, $field, $sections ); |
|
| 63 | + } |
|
| 64 | + |
|
| 65 | + // Make sure 'validate' field is set. |
|
| 66 | + if ( isset( $field['validate'] ) ) { |
|
| 67 | + |
|
| 68 | + // Can we make this an array of validations? |
|
| 69 | + $val_arr = array(); |
|
| 70 | + |
|
| 71 | + if ( is_array( $field['validate'] ) ) { |
|
| 72 | + $val_arr = $field['validate']; |
|
| 73 | + } else { |
|
| 74 | + $val_arr[] = $field['validate']; |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + foreach ( $val_arr as $idx => $val ) { |
|
| 78 | + // shim for old *_not_empty validations. |
|
| 79 | + if ( 'email_not_empty' === $val || 'numeric_not_empty' === $val ) { |
|
| 80 | + $val = 'not_empty'; |
|
| 81 | + } |
|
| 82 | + |
|
| 83 | + // Make sure 'validate field' is set to 'not_empty'. |
|
| 84 | + $is_not_empty = false; |
|
| 85 | + |
|
| 86 | + if ( 'not_empty' === $val ) { |
|
| 87 | + // Set the flag. |
|
| 88 | + $is_not_empty = true; |
|
| 89 | + } |
|
| 90 | + |
|
| 91 | + // Check for empty id value. |
|
| 92 | + if ( ! isset( $field['id'] ) || ! isset( $plugin_options[ $field['id'] ] ) || ( '' === $plugin_options[ $field['id'] ] ) ) { |
|
| 93 | + |
|
| 94 | + // If we are looking for an empty value, in the case of 'not_empty' |
|
| 95 | + // then we need to keep processing. |
|
| 96 | + if ( ! $is_not_empty ) { |
|
| 97 | + |
|
| 98 | + // Empty id and not checking for 'not_empty'. Bail out... |
|
| 99 | + if ( ! isset( $field['validate_callback'] ) ) { |
|
| 100 | + continue; |
|
| 101 | + } |
|
| 102 | + } |
|
| 103 | + } |
|
| 104 | + |
|
| 105 | + // Force validate of custom field types. |
|
| 106 | + if ( isset( $field['type'] ) && ! isset( $val ) && ! isset( $field['validate_callback'] ) ) { |
|
| 107 | + if ( 'color' === $field['type'] || 'color_gradient' === $field['type'] ) { |
|
| 108 | + $val = 'color'; |
|
| 109 | + } elseif ( 'date' === $field['type'] ) { |
|
| 110 | + $val = 'date'; |
|
| 111 | + } |
|
| 112 | + } |
|
| 113 | + |
|
| 114 | + // No need. Spectrum self validates. |
|
| 115 | + if ( 'color_rgba' === $field['type'] ) { |
|
| 116 | + continue; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + // Shim out old color rgba validators. |
|
| 120 | + if ( 'color_rgba' === $val || 'colorrgba' === $val ) { |
|
| 121 | + $val = 'color'; |
|
| 122 | + } |
|
| 123 | + |
|
| 124 | + $validate = 'Redux_Validation_' . $val; |
|
| 125 | + |
|
| 126 | + if ( ! class_exists( $validate ) ) { |
|
| 127 | + $file = str_replace( '_', '-', $val ); |
|
| 128 | + |
|
| 129 | + /** |
|
| 130 | + * Filter 'redux/validate/{opt_name}/class/{field.validate}' |
|
| 131 | + * |
|
| 132 | + * @param string $validate validation class file path |
|
| 133 | + */ |
|
| 134 | + |
|
| 135 | + // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 136 | + $class_file = apply_filters( "redux/validate/{$core->args['opt_name']}/class/$val", Redux_Core::$dir . "inc/validation/$val/class-redux-validation-$file.php", $validate ); |
|
| 137 | + |
|
| 138 | + if ( $class_file ) { |
|
| 139 | + if ( file_exists( $class_file ) ) { |
|
| 140 | + require_once $class_file; |
|
| 141 | + } |
|
| 142 | + } |
|
| 143 | + } |
|
| 144 | + |
|
| 145 | + if ( class_exists( $validate ) ) { |
|
| 146 | + if ( empty( $options[ $field['id'] ] ) ) { |
|
| 147 | + $options[ $field['id'] ] = ''; |
|
| 148 | + } |
|
| 149 | + |
|
| 150 | + if ( isset( $plugin_options[ $field['id'] ] ) && is_array( $plugin_options[ $field['id'] ] ) && ! empty( $plugin_options[ $field['id'] ] ) ) { |
|
| 151 | + foreach ( $plugin_options[ $field['id'] ] as $key => $value ) { |
|
| 152 | + $before = null; |
|
| 153 | + $after = null; |
|
| 154 | + |
|
| 155 | + if ( isset( $plugin_options[ $field['id'] ][ $key ] ) && ( ! empty( $plugin_options[ $field['id'] ][ $key ] ) || '0' === $plugin_options[ $field['id'] ][ $key ] ) ) { |
|
| 156 | + if ( is_array( $plugin_options[ $field['id'] ][ $key ] ) ) { |
|
| 157 | + $before = $plugin_options[ $field['id'] ][ $key ]; |
|
| 158 | + } else { |
|
| 159 | + $before = trim( $plugin_options[ $field['id'] ][ $key ] ); |
|
| 160 | + } |
|
| 161 | + } |
|
| 162 | + |
|
| 163 | + if ( isset( $options[ $field['id'] ][ $key ] ) && ( ! empty( $plugin_options[ $field['id'] ][ $key ] ) || '0' === $plugin_options[ $field['id'] ][ $key ] ) ) { |
|
| 164 | + $after = $options[ $field['id'] ][ $key ]; |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + $validation = new $validate( $core, $field, $before, $after ); |
|
| 168 | + |
|
| 169 | + if ( ! empty( $validation->value ) || '0' === $validation->value ) { |
|
| 170 | + $plugin_options[ $field['id'] ][ $key ] = $validation->value; |
|
| 171 | + } else { |
|
| 172 | + unset( $plugin_options[ $field['id'] ][ $key ] ); |
|
| 173 | + } |
|
| 174 | + |
|
| 175 | + if ( ! empty( $validation->error ) ) { |
|
| 176 | + $core->errors[] = $validation->error; |
|
| 177 | + } |
|
| 178 | + |
|
| 179 | + if ( ! empty( $validation->warning ) ) { |
|
| 180 | + $core->warnings[] = $validation->warning; |
|
| 181 | + } |
|
| 182 | + |
|
| 183 | + if ( ! empty( $validation->sanitize ) ) { |
|
| 184 | + $core->sanitize[] = $validation->sanitize; |
|
| 185 | + } |
|
| 186 | + } |
|
| 187 | + } else { |
|
| 188 | + if ( isset( $plugin_options[ $field['id'] ] ) ) { |
|
| 189 | + if ( is_array( $plugin_options[ $field['id'] ] ) ) { |
|
| 190 | + $pofi = $plugin_options[ $field['id'] ]; |
|
| 191 | + } else { |
|
| 192 | + $pofi = trim( $plugin_options[ $field['id'] ] ); |
|
| 193 | + } |
|
| 194 | + } else { |
|
| 195 | + $pofi = null; |
|
| 196 | + } |
|
| 197 | + |
|
| 198 | + $validation = new $validate( $core, $field, $pofi, $options[ $field['id'] ] ); |
|
| 199 | + $plugin_options[ $field['id'] ] = $validation->value; |
|
| 200 | + |
|
| 201 | + if ( ! empty( $validation->error ) ) { |
|
| 202 | + $core->errors[] = $validation->error; |
|
| 203 | + } |
|
| 204 | + |
|
| 205 | + if ( ! empty( $validation->warning ) ) { |
|
| 206 | + $core->warnings[] = $validation->warning; |
|
| 207 | + } |
|
| 208 | + |
|
| 209 | + if ( ! empty( $validation->sanitize ) ) { |
|
| 210 | + $core->sanitize[] = $validation->sanitize; |
|
| 211 | + } |
|
| 212 | + } |
|
| 213 | + |
|
| 214 | + break; |
|
| 215 | + } |
|
| 216 | + } |
|
| 217 | + } |
|
| 218 | + |
|
| 219 | + if ( isset( $field['validate_callback'] ) && ( is_callable( $field['validate_callback'] ) || ( is_string( $field['validate_callback'] ) && function_exists( $field['validate_callback'] ) ) ) ) { |
|
| 220 | + $callback = $field['validate_callback']; |
|
| 221 | + unset( $field['validate_callback'] ); |
|
| 222 | + |
|
| 223 | + $plugin_option = $plugin_options[ $field['id'] ] ?? null; |
|
| 224 | + $option = $options[ $field['id'] ] ?? null; |
|
| 225 | + |
|
| 226 | + if ( null !== $plugin_option ) { |
|
| 227 | + $callbackvalues = call_user_func( $callback, $field, $plugin_option, $option ); |
|
| 228 | + |
|
| 229 | + $plugin_options[ $field['id'] ] = $callbackvalues['value']; |
|
| 230 | + |
|
| 231 | + if ( isset( $callbackvalues['error'] ) ) { |
|
| 232 | + $core->errors[] = $callbackvalues['error']; |
|
| 233 | + } |
|
| 234 | + |
|
| 235 | + if ( isset( $callbackvalues['warning'] ) ) { |
|
| 236 | + $core->warnings[] = $callbackvalues['warning']; |
|
| 237 | + } |
|
| 238 | + |
|
| 239 | + if ( isset( $callbackvalues['sanitize'] ) ) { |
|
| 240 | + $core->sanitize[] = $callbackvalues['sanitize']; |
|
| 241 | + } |
|
| 242 | + } |
|
| 243 | + } |
|
| 244 | + } |
|
| 245 | + } |
|
| 246 | + } |
|
| 247 | + |
|
| 248 | + return $plugin_options; |
|
| 249 | + } |
|
| 250 | + } |
|
| 251 | 251 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | public function validate( array $plugin_options, array $options, array $sections ): array { |
| 33 | 33 | $core = $this->core(); |
| 34 | 34 | |
| 35 | - if (null === $core) { |
|
| 35 | + if ( null === $core ) { |
|
| 36 | 36 | return $plugin_options; |
| 37 | 37 | } |
| 38 | 38 | |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | if ( isset( $field['type'] ) && ( 'checkbox' === $field['type'] || 'checkbox_hide_below' === $field['type'] || 'checkbox_hide_all' === $field['type'] ) ) { |
| 47 | - if ( ! isset( $plugin_options[ $field['id'] ] ) ) { |
|
| 48 | - $plugin_options[ $field['id'] ] = 0; |
|
| 47 | + if ( ! isset( $plugin_options[$field['id']] ) ) { |
|
| 48 | + $plugin_options[$field['id']] = 0; |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
@@ -58,8 +58,8 @@ discard block |
||
| 58 | 58 | * } |
| 59 | 59 | */ |
| 60 | 60 | |
| 61 | - if ( isset( $core->extensions[ $field['type'] ] ) && method_exists( $core->extensions[ $field['type'] ], '_validate_values' ) ) { |
|
| 62 | - $plugin_options = $core->extensions[ $field['type'] ]->_validate_values( $plugin_options, $field, $sections ); |
|
| 61 | + if ( isset( $core->extensions[$field['type']] ) && method_exists( $core->extensions[$field['type']], '_validate_values' ) ) { |
|
| 62 | + $plugin_options = $core->extensions[$field['type']]->_validate_values( $plugin_options, $field, $sections ); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | // Make sure 'validate' field is set. |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | // Check for empty id value. |
| 92 | - if ( ! isset( $field['id'] ) || ! isset( $plugin_options[ $field['id'] ] ) || ( '' === $plugin_options[ $field['id'] ] ) ) { |
|
| 92 | + if ( ! isset( $field['id'] ) || ! isset( $plugin_options[$field['id']] ) || ( '' === $plugin_options[$field['id']] ) ) { |
|
| 93 | 93 | |
| 94 | 94 | // If we are looking for an empty value, in the case of 'not_empty' |
| 95 | 95 | // then we need to keep processing. |
@@ -143,33 +143,33 @@ discard block |
||
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | if ( class_exists( $validate ) ) { |
| 146 | - if ( empty( $options[ $field['id'] ] ) ) { |
|
| 147 | - $options[ $field['id'] ] = ''; |
|
| 146 | + if ( empty( $options[$field['id']] ) ) { |
|
| 147 | + $options[$field['id']] = ''; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | - if ( isset( $plugin_options[ $field['id'] ] ) && is_array( $plugin_options[ $field['id'] ] ) && ! empty( $plugin_options[ $field['id'] ] ) ) { |
|
| 151 | - foreach ( $plugin_options[ $field['id'] ] as $key => $value ) { |
|
| 150 | + if ( isset( $plugin_options[$field['id']] ) && is_array( $plugin_options[$field['id']] ) && ! empty( $plugin_options[$field['id']] ) ) { |
|
| 151 | + foreach ( $plugin_options[$field['id']] as $key => $value ) { |
|
| 152 | 152 | $before = null; |
| 153 | 153 | $after = null; |
| 154 | 154 | |
| 155 | - if ( isset( $plugin_options[ $field['id'] ][ $key ] ) && ( ! empty( $plugin_options[ $field['id'] ][ $key ] ) || '0' === $plugin_options[ $field['id'] ][ $key ] ) ) { |
|
| 156 | - if ( is_array( $plugin_options[ $field['id'] ][ $key ] ) ) { |
|
| 157 | - $before = $plugin_options[ $field['id'] ][ $key ]; |
|
| 155 | + if ( isset( $plugin_options[$field['id']][$key] ) && ( ! empty( $plugin_options[$field['id']][$key] ) || '0' === $plugin_options[$field['id']][$key] ) ) { |
|
| 156 | + if ( is_array( $plugin_options[$field['id']][$key] ) ) { |
|
| 157 | + $before = $plugin_options[$field['id']][$key]; |
|
| 158 | 158 | } else { |
| 159 | - $before = trim( $plugin_options[ $field['id'] ][ $key ] ); |
|
| 159 | + $before = trim( $plugin_options[$field['id']][$key] ); |
|
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - if ( isset( $options[ $field['id'] ][ $key ] ) && ( ! empty( $plugin_options[ $field['id'] ][ $key ] ) || '0' === $plugin_options[ $field['id'] ][ $key ] ) ) { |
|
| 164 | - $after = $options[ $field['id'] ][ $key ]; |
|
| 163 | + if ( isset( $options[$field['id']][$key] ) && ( ! empty( $plugin_options[$field['id']][$key] ) || '0' === $plugin_options[$field['id']][$key] ) ) { |
|
| 164 | + $after = $options[$field['id']][$key]; |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | $validation = new $validate( $core, $field, $before, $after ); |
| 168 | 168 | |
| 169 | 169 | if ( ! empty( $validation->value ) || '0' === $validation->value ) { |
| 170 | - $plugin_options[ $field['id'] ][ $key ] = $validation->value; |
|
| 170 | + $plugin_options[$field['id']][$key] = $validation->value; |
|
| 171 | 171 | } else { |
| 172 | - unset( $plugin_options[ $field['id'] ][ $key ] ); |
|
| 172 | + unset( $plugin_options[$field['id']][$key] ); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | if ( ! empty( $validation->error ) ) { |
@@ -185,18 +185,18 @@ discard block |
||
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | } else { |
| 188 | - if ( isset( $plugin_options[ $field['id'] ] ) ) { |
|
| 189 | - if ( is_array( $plugin_options[ $field['id'] ] ) ) { |
|
| 190 | - $pofi = $plugin_options[ $field['id'] ]; |
|
| 188 | + if ( isset( $plugin_options[$field['id']] ) ) { |
|
| 189 | + if ( is_array( $plugin_options[$field['id']] ) ) { |
|
| 190 | + $pofi = $plugin_options[$field['id']]; |
|
| 191 | 191 | } else { |
| 192 | - $pofi = trim( $plugin_options[ $field['id'] ] ); |
|
| 192 | + $pofi = trim( $plugin_options[$field['id']] ); |
|
| 193 | 193 | } |
| 194 | 194 | } else { |
| 195 | 195 | $pofi = null; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | - $validation = new $validate( $core, $field, $pofi, $options[ $field['id'] ] ); |
|
| 199 | - $plugin_options[ $field['id'] ] = $validation->value; |
|
| 198 | + $validation = new $validate( $core, $field, $pofi, $options[$field['id']] ); |
|
| 199 | + $plugin_options[$field['id']] = $validation->value; |
|
| 200 | 200 | |
| 201 | 201 | if ( ! empty( $validation->error ) ) { |
| 202 | 202 | $core->errors[] = $validation->error; |
@@ -220,13 +220,13 @@ discard block |
||
| 220 | 220 | $callback = $field['validate_callback']; |
| 221 | 221 | unset( $field['validate_callback'] ); |
| 222 | 222 | |
| 223 | - $plugin_option = $plugin_options[ $field['id'] ] ?? null; |
|
| 224 | - $option = $options[ $field['id'] ] ?? null; |
|
| 223 | + $plugin_option = $plugin_options[$field['id']] ?? null; |
|
| 224 | + $option = $options[$field['id']] ?? null; |
|
| 225 | 225 | |
| 226 | 226 | if ( null !== $plugin_option ) { |
| 227 | 227 | $callbackvalues = call_user_func( $callback, $field, $plugin_option, $option ); |
| 228 | 228 | |
| 229 | - $plugin_options[ $field['id'] ] = $callbackvalues['value']; |
|
| 229 | + $plugin_options[$field['id']] = $callbackvalues['value']; |
|
| 230 | 230 | |
| 231 | 231 | if ( isset( $callbackvalues['error'] ) ) { |
| 232 | 232 | $core->errors[] = $callbackvalues['error']; |