@@ -14,13 +14,13 @@ |
||
| 14 | 14 | echo '<style id="redux-template-overrides">' . ReduxTemplates\Template_Overrides::get_overrides() . '</style>'; |
| 15 | 15 | |
| 16 | 16 | while ( have_posts() ) : |
| 17 | - the_post(); |
|
| 18 | - the_content(); |
|
| 17 | + the_post(); |
|
| 18 | + the_content(); |
|
| 19 | 19 | |
| 20 | - // If comments are open, or we have at least one comment, load up the comment template. |
|
| 21 | - if ( comments_open() || get_comments_number() ) : |
|
| 22 | - comments_template(); |
|
| 23 | - endif; |
|
| 20 | + // If comments are open, or we have at least one comment, load up the comment template. |
|
| 21 | + if ( comments_open() || get_comments_number() ) : |
|
| 22 | + comments_template(); |
|
| 23 | + endif; |
|
| 24 | 24 | endwhile; // End of the loop. |
| 25 | 25 | |
| 26 | 26 | get_footer(); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | if ( ! is_numeric( $counter ) ) { |
| 162 | 162 | $new_name = $name . ' 1'; |
| 163 | 163 | } else { |
| 164 | - $new_name = substr( $name, 0, - 1 ) . ( (int) $counter + 1 ); |
|
| 164 | + $new_name = substr( $name, 0, - 1 ) . ( ( int ) $counter + 1 ); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | $name = $this->check_widget_area_name( $new_name ); |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $key = array_search( $name, $this->widget_areas, true ); |
| 253 | 253 | |
| 254 | 254 | if ( $key >= 0 ) { |
| 255 | - unset( $this->widget_areas[ $key ] ); |
|
| 255 | + unset( $this->widget_areas[$key] ); |
|
| 256 | 256 | $this->save_widget_areas(); |
| 257 | 257 | } |
| 258 | 258 | |
@@ -12,84 +12,84 @@ discard block |
||
| 12 | 12 | // Don't duplicate me! |
| 13 | 13 | if ( ! class_exists( 'Redux_Widget_Areas' ) ) { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Main ReduxFramework customizer extension class |
|
| 17 | - * |
|
| 18 | - * @since 1.0.0 |
|
| 19 | - */ |
|
| 20 | - class Redux_Widget_Areas { |
|
| 21 | - |
|
| 22 | - /** |
|
| 23 | - * Extension URI. |
|
| 24 | - * |
|
| 25 | - * @var null|string |
|
| 26 | - */ |
|
| 27 | - private ?string $extension_url; |
|
| 28 | - |
|
| 29 | - /** Extension directory. |
|
| 30 | - * |
|
| 31 | - * @var string |
|
| 32 | - */ |
|
| 33 | - private string $extension_dir; |
|
| 34 | - |
|
| 35 | - /** |
|
| 36 | - * Array of enabled widget_areas |
|
| 37 | - * |
|
| 38 | - * @since 1.0.0 |
|
| 39 | - * @var array |
|
| 40 | - */ |
|
| 41 | - protected array $widget_areas = array(); |
|
| 42 | - |
|
| 43 | - /** |
|
| 44 | - * Widget array. |
|
| 45 | - * |
|
| 46 | - * @var array |
|
| 47 | - */ |
|
| 48 | - protected array $orig = array(); |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * ReduxFramework object. |
|
| 52 | - * |
|
| 53 | - * @var ReduxFramework |
|
| 54 | - */ |
|
| 55 | - private ReduxFramework $parent; |
|
| 56 | - |
|
| 57 | - /** |
|
| 58 | - * Redux_Widget_Areas constructor. |
|
| 59 | - * |
|
| 60 | - * @param ReduxFramework $redux ReduxFramework pointer. |
|
| 61 | - */ |
|
| 62 | - public function __construct( ReduxFramework $redux ) { |
|
| 63 | - global $pagenow; |
|
| 64 | - |
|
| 65 | - $this->parent = $redux; |
|
| 66 | - |
|
| 67 | - if ( empty( $this->extension_dir ) ) { |
|
| 68 | - $this->extension_dir = trailingslashit( str_replace( '\\', '/', __DIR__ ) ); |
|
| 69 | - $this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) ); |
|
| 70 | - } |
|
| 71 | - |
|
| 72 | - add_action( 'init', array( &$this, 'register_custom_widget_areas' ), 1000 ); |
|
| 73 | - |
|
| 74 | - if ( 'widgets.php' === $pagenow ) { |
|
| 75 | - if ( true === $redux->args['widget_area'] ) { |
|
| 76 | - add_action( 'admin_print_scripts', array( $this, 'add_new_widget_area_box' ) ); |
|
| 77 | - } |
|
| 78 | - add_action( 'load-widgets.php', array( $this, 'add_widget_area_area' ), 100 ); |
|
| 79 | - add_action( 'load-widgets.php', array( $this, 'enqueue' ), 100 ); |
|
| 80 | - } |
|
| 81 | - } |
|
| 82 | - |
|
| 83 | - /** |
|
| 84 | - * Function to create the HTML used to create widget_areas. |
|
| 85 | - * |
|
| 86 | - * @since 1.0.0 |
|
| 87 | - */ |
|
| 88 | - public function add_new_widget_area_box() { |
|
| 89 | - $nonce = wp_create_nonce( 'add-redux-widget_area-nonce' ); |
|
| 90 | - $del_nonce = wp_create_nonce( 'delete-redux-widget_area-nonce' ); |
|
| 91 | - |
|
| 92 | - ?> |
|
| 15 | + /** |
|
| 16 | + * Main ReduxFramework customizer extension class |
|
| 17 | + * |
|
| 18 | + * @since 1.0.0 |
|
| 19 | + */ |
|
| 20 | + class Redux_Widget_Areas { |
|
| 21 | + |
|
| 22 | + /** |
|
| 23 | + * Extension URI. |
|
| 24 | + * |
|
| 25 | + * @var null|string |
|
| 26 | + */ |
|
| 27 | + private ?string $extension_url; |
|
| 28 | + |
|
| 29 | + /** Extension directory. |
|
| 30 | + * |
|
| 31 | + * @var string |
|
| 32 | + */ |
|
| 33 | + private string $extension_dir; |
|
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * Array of enabled widget_areas |
|
| 37 | + * |
|
| 38 | + * @since 1.0.0 |
|
| 39 | + * @var array |
|
| 40 | + */ |
|
| 41 | + protected array $widget_areas = array(); |
|
| 42 | + |
|
| 43 | + /** |
|
| 44 | + * Widget array. |
|
| 45 | + * |
|
| 46 | + * @var array |
|
| 47 | + */ |
|
| 48 | + protected array $orig = array(); |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * ReduxFramework object. |
|
| 52 | + * |
|
| 53 | + * @var ReduxFramework |
|
| 54 | + */ |
|
| 55 | + private ReduxFramework $parent; |
|
| 56 | + |
|
| 57 | + /** |
|
| 58 | + * Redux_Widget_Areas constructor. |
|
| 59 | + * |
|
| 60 | + * @param ReduxFramework $redux ReduxFramework pointer. |
|
| 61 | + */ |
|
| 62 | + public function __construct( ReduxFramework $redux ) { |
|
| 63 | + global $pagenow; |
|
| 64 | + |
|
| 65 | + $this->parent = $redux; |
|
| 66 | + |
|
| 67 | + if ( empty( $this->extension_dir ) ) { |
|
| 68 | + $this->extension_dir = trailingslashit( str_replace( '\\', '/', __DIR__ ) ); |
|
| 69 | + $this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) ); |
|
| 70 | + } |
|
| 71 | + |
|
| 72 | + add_action( 'init', array( &$this, 'register_custom_widget_areas' ), 1000 ); |
|
| 73 | + |
|
| 74 | + if ( 'widgets.php' === $pagenow ) { |
|
| 75 | + if ( true === $redux->args['widget_area'] ) { |
|
| 76 | + add_action( 'admin_print_scripts', array( $this, 'add_new_widget_area_box' ) ); |
|
| 77 | + } |
|
| 78 | + add_action( 'load-widgets.php', array( $this, 'add_widget_area_area' ), 100 ); |
|
| 79 | + add_action( 'load-widgets.php', array( $this, 'enqueue' ), 100 ); |
|
| 80 | + } |
|
| 81 | + } |
|
| 82 | + |
|
| 83 | + /** |
|
| 84 | + * Function to create the HTML used to create widget_areas. |
|
| 85 | + * |
|
| 86 | + * @since 1.0.0 |
|
| 87 | + */ |
|
| 88 | + public function add_new_widget_area_box() { |
|
| 89 | + $nonce = wp_create_nonce( 'add-redux-widget_area-nonce' ); |
|
| 90 | + $del_nonce = wp_create_nonce( 'delete-redux-widget_area-nonce' ); |
|
| 91 | + |
|
| 92 | + ?> |
|
| 93 | 93 | <script type="text/html" id="redux-add-widget-template"> |
| 94 | 94 | <div id="redux-add-widget" class="widgets-holder-wrap"> |
| 95 | 95 | <div class=""> |
@@ -122,191 +122,191 @@ discard block |
||
| 122 | 122 | </div> |
| 123 | 123 | </script> |
| 124 | 124 | <?php |
| 125 | - } |
|
| 126 | - |
|
| 127 | - /** |
|
| 128 | - * Add widget area. |
|
| 129 | - */ |
|
| 130 | - public function add_widget_area_area() { |
|
| 131 | - if ( isset( $_POST ) && isset( $_POST['redux-add-widget-nonce'] ) && wp_verify_nonce( sanitize_key( wp_unslash( $_POST['redux-add-widget-nonce'] ) ), 'add-redux-widget_area-nonce' ) ) { |
|
| 132 | - if ( ! empty( $_POST['redux-add-widget-input'] ) ) { |
|
| 133 | - $this->widget_areas = $this->get_widget_areas(); |
|
| 134 | - |
|
| 135 | - $this->widget_areas[] = $this->check_widget_area_name( sanitize_text_field( wp_unslash( $_POST['redux-add-widget-input'] ) ) ); |
|
| 136 | - |
|
| 137 | - $this->save_widget_areas(); |
|
| 138 | - |
|
| 139 | - wp_safe_redirect( admin_url( 'widgets.php' ) ); |
|
| 140 | - |
|
| 141 | - die(); |
|
| 142 | - } |
|
| 143 | - } |
|
| 144 | - } |
|
| 145 | - |
|
| 146 | - /** |
|
| 147 | - * Before we create a new widget_area, verify it doesn't already exist. If it does, append a number to the name. |
|
| 148 | - * |
|
| 149 | - * @param string $name Name of the widget_area to be created. |
|
| 150 | - * |
|
| 151 | - * @return string|void $name Name of the new widget_area just created. |
|
| 152 | - * @since 1.0.0 |
|
| 153 | - */ |
|
| 154 | - private function check_widget_area_name( string $name ) { |
|
| 155 | - if ( empty( $GLOBALS['wp_registered_widget_areas'] ) ) { |
|
| 156 | - return $name; |
|
| 157 | - } |
|
| 158 | - |
|
| 159 | - $taken = array(); |
|
| 160 | - |
|
| 161 | - foreach ( $GLOBALS['wp_registered_widget_areas'] as $widget_area ) { |
|
| 162 | - $taken[] = $widget_area['name']; |
|
| 163 | - } |
|
| 164 | - |
|
| 165 | - $taken = array_merge( $taken, $this->widget_areas ); |
|
| 166 | - |
|
| 167 | - if ( in_array( $name, $taken, true ) ) { |
|
| 168 | - $counter = substr( $name, - 1 ); |
|
| 169 | - |
|
| 170 | - if ( ! is_numeric( $counter ) ) { |
|
| 171 | - $new_name = $name . ' 1'; |
|
| 172 | - } else { |
|
| 173 | - $new_name = substr( $name, 0, - 1 ) . ( (int) $counter + 1 ); |
|
| 174 | - } |
|
| 175 | - |
|
| 176 | - $name = $this->check_widget_area_name( $new_name ); |
|
| 177 | - } |
|
| 178 | - |
|
| 179 | - echo $name; // phpcs:disable WordPress.Security.EscapeOutput |
|
| 180 | - |
|
| 181 | - exit(); |
|
| 182 | - } |
|
| 183 | - |
|
| 184 | - /** |
|
| 185 | - * Save Widget Areas. |
|
| 186 | - */ |
|
| 187 | - private function save_widget_areas() { |
|
| 188 | - set_theme_mod( 'redux-widget-areas', array_unique( $this->widget_areas ) ); |
|
| 189 | - } |
|
| 190 | - |
|
| 191 | - /** |
|
| 192 | - * Register and display the custom widget_area areas we have set. |
|
| 193 | - * |
|
| 194 | - * @since 1.0.0 |
|
| 195 | - */ |
|
| 196 | - public function register_custom_widget_areas() { |
|
| 197 | - |
|
| 198 | - // If the single instance hasn't been set, set it now. |
|
| 199 | - if ( empty( $this->widget_areas ) ) { |
|
| 200 | - $this->widget_areas = $this->get_widget_areas(); |
|
| 201 | - } |
|
| 202 | - |
|
| 203 | - // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 204 | - $this->orig = array_unique( apply_filters( 'redux/' . $this->parent->args['opt_name'] . '/widget_areas', array() ) ); |
|
| 205 | - |
|
| 206 | - if ( ! empty( $this->orig ) && $this->orig !== $this->widget_areas ) { |
|
| 207 | - $this->widget_areas = array_unique( array_merge( $this->widget_areas, $this->orig ) ); |
|
| 208 | - $this->save_widget_areas(); |
|
| 209 | - } |
|
| 210 | - |
|
| 211 | - $options = array( |
|
| 212 | - 'before_title' => '<h3 class="widgettitle">', |
|
| 213 | - 'after_title' => '</h3>', |
|
| 214 | - 'before_widget' => '<div id="%1$s" class="widget clearfix %2$s">', |
|
| 215 | - 'after_widget' => '</div>', |
|
| 216 | - ); |
|
| 217 | - |
|
| 218 | - $options = apply_filters( 'redux_custom_widget_args', $options ); |
|
| 219 | - |
|
| 220 | - foreach ( array_unique( $this->widget_areas ) as $widget_area ) { |
|
| 221 | - $options['class'] = 'redux-custom'; |
|
| 222 | - $options['name'] = $widget_area; |
|
| 223 | - $options['id'] = sanitize_key( $widget_area ); |
|
| 224 | - |
|
| 225 | - register_sidebar( $options ); |
|
| 226 | - } |
|
| 227 | - } |
|
| 228 | - |
|
| 229 | - |
|
| 230 | - /** |
|
| 231 | - * Return the widget_areas array. |
|
| 232 | - * |
|
| 233 | - * @since 1.0.0 |
|
| 234 | - * @return array If not empty, active redux widget_areas are returned. |
|
| 235 | - */ |
|
| 236 | - public function get_widget_areas(): array { |
|
| 237 | - |
|
| 238 | - // If the single instance hasn't been set, set it now. |
|
| 239 | - if ( ! empty( $this->widget_areas ) ) { |
|
| 240 | - return $this->widget_areas; |
|
| 241 | - } |
|
| 242 | - |
|
| 243 | - $db = get_theme_mod( 'redux-widget-areas' ); |
|
| 244 | - |
|
| 245 | - if ( ! empty( $db ) ) { |
|
| 246 | - $this->widget_areas = array_unique( array_merge( $this->widget_areas, $db ) ); |
|
| 247 | - } |
|
| 248 | - |
|
| 249 | - return $this->widget_areas; |
|
| 250 | - } |
|
| 251 | - |
|
| 252 | - /** |
|
| 253 | - * Delete widget area. |
|
| 254 | - */ |
|
| 255 | - public function redux_delete_widget_area_area() { |
|
| 256 | - if ( isset( $_POST ) && isset( $_POST['_wpnonce'] ) && wp_verify_nonce( sanitize_key( wp_unslash( $_POST['_wpnonce'] ) ), 'delete-redux-widget_area-nonce' ) ) { |
|
| 257 | - if ( isset( $_POST['name'] ) && ! empty( sanitize_text_field( wp_unslash( $_POST['name'] ) ) ) ) { |
|
| 258 | - $name = sanitize_text_field( wp_unslash( $_POST['name'] ) ); |
|
| 259 | - $this->widget_areas = $this->get_widget_areas(); |
|
| 260 | - $key = array_search( $name, $this->widget_areas, true ); |
|
| 261 | - |
|
| 262 | - if ( $key >= 0 ) { |
|
| 263 | - unset( $this->widget_areas[ $key ] ); |
|
| 264 | - $this->save_widget_areas(); |
|
| 265 | - } |
|
| 266 | - |
|
| 267 | - echo 'widget_area-deleted'; |
|
| 268 | - } |
|
| 269 | - } |
|
| 270 | - |
|
| 271 | - die(); |
|
| 272 | - } |
|
| 273 | - |
|
| 274 | - /** |
|
| 275 | - * Enqueue support files. |
|
| 276 | - */ |
|
| 277 | - public function enqueue() { |
|
| 278 | - $min = Redux_Functions::is_min(); |
|
| 279 | - |
|
| 280 | - wp_enqueue_style( 'dashicons' ); |
|
| 281 | - |
|
| 282 | - wp_enqueue_script( |
|
| 283 | - 'redux-widget-areas', |
|
| 284 | - $this->extension_url . 'redux-extension-widget-areas' . $min . '.js', |
|
| 285 | - array( 'jquery' ), |
|
| 286 | - Redux_Extension_Widget_Areas::$version, |
|
| 287 | - true |
|
| 288 | - ); |
|
| 289 | - |
|
| 290 | - if ( $this->parent->args['dev_mode'] ) { |
|
| 291 | - wp_enqueue_style( |
|
| 292 | - 'redux-widget-areas', |
|
| 293 | - $this->extension_url . 'redux-extension-widget-areas.css', |
|
| 294 | - array(), |
|
| 295 | - Redux_Extension_Widget_Areas::$version |
|
| 296 | - ); |
|
| 297 | - } |
|
| 298 | - |
|
| 299 | - // Localize script. |
|
| 300 | - wp_localize_script( |
|
| 301 | - 'redux-widget-areas', |
|
| 302 | - 'reduxWidgetAreasLocalize', |
|
| 303 | - array( |
|
| 304 | - 'count' => count( $this->orig ), |
|
| 305 | - 'delete' => esc_html__( 'Delete', 'redux-framework' ), |
|
| 306 | - 'confirm' => esc_html__( 'Confirm', 'redux-framework' ), |
|
| 307 | - 'cancel' => esc_html__( 'Cancel', 'redux-framework' ), |
|
| 308 | - ) |
|
| 309 | - ); |
|
| 310 | - } |
|
| 311 | - } |
|
| 125 | + } |
|
| 126 | + |
|
| 127 | + /** |
|
| 128 | + * Add widget area. |
|
| 129 | + */ |
|
| 130 | + public function add_widget_area_area() { |
|
| 131 | + if ( isset( $_POST ) && isset( $_POST['redux-add-widget-nonce'] ) && wp_verify_nonce( sanitize_key( wp_unslash( $_POST['redux-add-widget-nonce'] ) ), 'add-redux-widget_area-nonce' ) ) { |
|
| 132 | + if ( ! empty( $_POST['redux-add-widget-input'] ) ) { |
|
| 133 | + $this->widget_areas = $this->get_widget_areas(); |
|
| 134 | + |
|
| 135 | + $this->widget_areas[] = $this->check_widget_area_name( sanitize_text_field( wp_unslash( $_POST['redux-add-widget-input'] ) ) ); |
|
| 136 | + |
|
| 137 | + $this->save_widget_areas(); |
|
| 138 | + |
|
| 139 | + wp_safe_redirect( admin_url( 'widgets.php' ) ); |
|
| 140 | + |
|
| 141 | + die(); |
|
| 142 | + } |
|
| 143 | + } |
|
| 144 | + } |
|
| 145 | + |
|
| 146 | + /** |
|
| 147 | + * Before we create a new widget_area, verify it doesn't already exist. If it does, append a number to the name. |
|
| 148 | + * |
|
| 149 | + * @param string $name Name of the widget_area to be created. |
|
| 150 | + * |
|
| 151 | + * @return string|void $name Name of the new widget_area just created. |
|
| 152 | + * @since 1.0.0 |
|
| 153 | + */ |
|
| 154 | + private function check_widget_area_name( string $name ) { |
|
| 155 | + if ( empty( $GLOBALS['wp_registered_widget_areas'] ) ) { |
|
| 156 | + return $name; |
|
| 157 | + } |
|
| 158 | + |
|
| 159 | + $taken = array(); |
|
| 160 | + |
|
| 161 | + foreach ( $GLOBALS['wp_registered_widget_areas'] as $widget_area ) { |
|
| 162 | + $taken[] = $widget_area['name']; |
|
| 163 | + } |
|
| 164 | + |
|
| 165 | + $taken = array_merge( $taken, $this->widget_areas ); |
|
| 166 | + |
|
| 167 | + if ( in_array( $name, $taken, true ) ) { |
|
| 168 | + $counter = substr( $name, - 1 ); |
|
| 169 | + |
|
| 170 | + if ( ! is_numeric( $counter ) ) { |
|
| 171 | + $new_name = $name . ' 1'; |
|
| 172 | + } else { |
|
| 173 | + $new_name = substr( $name, 0, - 1 ) . ( (int) $counter + 1 ); |
|
| 174 | + } |
|
| 175 | + |
|
| 176 | + $name = $this->check_widget_area_name( $new_name ); |
|
| 177 | + } |
|
| 178 | + |
|
| 179 | + echo $name; // phpcs:disable WordPress.Security.EscapeOutput |
|
| 180 | + |
|
| 181 | + exit(); |
|
| 182 | + } |
|
| 183 | + |
|
| 184 | + /** |
|
| 185 | + * Save Widget Areas. |
|
| 186 | + */ |
|
| 187 | + private function save_widget_areas() { |
|
| 188 | + set_theme_mod( 'redux-widget-areas', array_unique( $this->widget_areas ) ); |
|
| 189 | + } |
|
| 190 | + |
|
| 191 | + /** |
|
| 192 | + * Register and display the custom widget_area areas we have set. |
|
| 193 | + * |
|
| 194 | + * @since 1.0.0 |
|
| 195 | + */ |
|
| 196 | + public function register_custom_widget_areas() { |
|
| 197 | + |
|
| 198 | + // If the single instance hasn't been set, set it now. |
|
| 199 | + if ( empty( $this->widget_areas ) ) { |
|
| 200 | + $this->widget_areas = $this->get_widget_areas(); |
|
| 201 | + } |
|
| 202 | + |
|
| 203 | + // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 204 | + $this->orig = array_unique( apply_filters( 'redux/' . $this->parent->args['opt_name'] . '/widget_areas', array() ) ); |
|
| 205 | + |
|
| 206 | + if ( ! empty( $this->orig ) && $this->orig !== $this->widget_areas ) { |
|
| 207 | + $this->widget_areas = array_unique( array_merge( $this->widget_areas, $this->orig ) ); |
|
| 208 | + $this->save_widget_areas(); |
|
| 209 | + } |
|
| 210 | + |
|
| 211 | + $options = array( |
|
| 212 | + 'before_title' => '<h3 class="widgettitle">', |
|
| 213 | + 'after_title' => '</h3>', |
|
| 214 | + 'before_widget' => '<div id="%1$s" class="widget clearfix %2$s">', |
|
| 215 | + 'after_widget' => '</div>', |
|
| 216 | + ); |
|
| 217 | + |
|
| 218 | + $options = apply_filters( 'redux_custom_widget_args', $options ); |
|
| 219 | + |
|
| 220 | + foreach ( array_unique( $this->widget_areas ) as $widget_area ) { |
|
| 221 | + $options['class'] = 'redux-custom'; |
|
| 222 | + $options['name'] = $widget_area; |
|
| 223 | + $options['id'] = sanitize_key( $widget_area ); |
|
| 224 | + |
|
| 225 | + register_sidebar( $options ); |
|
| 226 | + } |
|
| 227 | + } |
|
| 228 | + |
|
| 229 | + |
|
| 230 | + /** |
|
| 231 | + * Return the widget_areas array. |
|
| 232 | + * |
|
| 233 | + * @since 1.0.0 |
|
| 234 | + * @return array If not empty, active redux widget_areas are returned. |
|
| 235 | + */ |
|
| 236 | + public function get_widget_areas(): array { |
|
| 237 | + |
|
| 238 | + // If the single instance hasn't been set, set it now. |
|
| 239 | + if ( ! empty( $this->widget_areas ) ) { |
|
| 240 | + return $this->widget_areas; |
|
| 241 | + } |
|
| 242 | + |
|
| 243 | + $db = get_theme_mod( 'redux-widget-areas' ); |
|
| 244 | + |
|
| 245 | + if ( ! empty( $db ) ) { |
|
| 246 | + $this->widget_areas = array_unique( array_merge( $this->widget_areas, $db ) ); |
|
| 247 | + } |
|
| 248 | + |
|
| 249 | + return $this->widget_areas; |
|
| 250 | + } |
|
| 251 | + |
|
| 252 | + /** |
|
| 253 | + * Delete widget area. |
|
| 254 | + */ |
|
| 255 | + public function redux_delete_widget_area_area() { |
|
| 256 | + if ( isset( $_POST ) && isset( $_POST['_wpnonce'] ) && wp_verify_nonce( sanitize_key( wp_unslash( $_POST['_wpnonce'] ) ), 'delete-redux-widget_area-nonce' ) ) { |
|
| 257 | + if ( isset( $_POST['name'] ) && ! empty( sanitize_text_field( wp_unslash( $_POST['name'] ) ) ) ) { |
|
| 258 | + $name = sanitize_text_field( wp_unslash( $_POST['name'] ) ); |
|
| 259 | + $this->widget_areas = $this->get_widget_areas(); |
|
| 260 | + $key = array_search( $name, $this->widget_areas, true ); |
|
| 261 | + |
|
| 262 | + if ( $key >= 0 ) { |
|
| 263 | + unset( $this->widget_areas[ $key ] ); |
|
| 264 | + $this->save_widget_areas(); |
|
| 265 | + } |
|
| 266 | + |
|
| 267 | + echo 'widget_area-deleted'; |
|
| 268 | + } |
|
| 269 | + } |
|
| 270 | + |
|
| 271 | + die(); |
|
| 272 | + } |
|
| 273 | + |
|
| 274 | + /** |
|
| 275 | + * Enqueue support files. |
|
| 276 | + */ |
|
| 277 | + public function enqueue() { |
|
| 278 | + $min = Redux_Functions::is_min(); |
|
| 279 | + |
|
| 280 | + wp_enqueue_style( 'dashicons' ); |
|
| 281 | + |
|
| 282 | + wp_enqueue_script( |
|
| 283 | + 'redux-widget-areas', |
|
| 284 | + $this->extension_url . 'redux-extension-widget-areas' . $min . '.js', |
|
| 285 | + array( 'jquery' ), |
|
| 286 | + Redux_Extension_Widget_Areas::$version, |
|
| 287 | + true |
|
| 288 | + ); |
|
| 289 | + |
|
| 290 | + if ( $this->parent->args['dev_mode'] ) { |
|
| 291 | + wp_enqueue_style( |
|
| 292 | + 'redux-widget-areas', |
|
| 293 | + $this->extension_url . 'redux-extension-widget-areas.css', |
|
| 294 | + array(), |
|
| 295 | + Redux_Extension_Widget_Areas::$version |
|
| 296 | + ); |
|
| 297 | + } |
|
| 298 | + |
|
| 299 | + // Localize script. |
|
| 300 | + wp_localize_script( |
|
| 301 | + 'redux-widget-areas', |
|
| 302 | + 'reduxWidgetAreasLocalize', |
|
| 303 | + array( |
|
| 304 | + 'count' => count( $this->orig ), |
|
| 305 | + 'delete' => esc_html__( 'Delete', 'redux-framework' ), |
|
| 306 | + 'confirm' => esc_html__( 'Confirm', 'redux-framework' ), |
|
| 307 | + 'cancel' => esc_html__( 'Cancel', 'redux-framework' ), |
|
| 308 | + ) |
|
| 309 | + ); |
|
| 310 | + } |
|
| 311 | + } |
|
| 312 | 312 | } |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | 'full_width' => true, |
| 41 | 41 | 'default' => array( |
| 42 | 42 | 'latitude' => 38.8976758, |
| 43 | - 'longitude' => - 77.03648229999999, |
|
| 43 | + 'longitude' => -77.03648229999999, |
|
| 44 | 44 | 'zoom' => 7, |
| 45 | 45 | ), |
| 46 | 46 | ), |
@@ -10,42 +10,42 @@ |
||
| 10 | 10 | defined( 'ABSPATH' ) || exit; |
| 11 | 11 | |
| 12 | 12 | Redux::set_section( |
| 13 | - $opt_name, |
|
| 14 | - array( |
|
| 15 | - 'title' => esc_html__( 'Google Maps', 'your-textdomain-here' ), |
|
| 16 | - 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-extensions/google-maps.html" target="_blank">https://devs.redux.io/core-extensions/google-maps.html</a>', |
|
| 17 | - 'subsection' => true, |
|
| 18 | - 'fields' => array( |
|
| 19 | - array( |
|
| 20 | - 'id' => 'location_geocode', |
|
| 21 | - 'type' => 'google_maps', |
|
| 22 | - 'title' => esc_html__( 'Google Maps', 'your-textdomain-here' ), |
|
| 23 | - 'subtitle' => esc_html__( 'This map is set using only address information with a zoom factor of 3. Lat/Long is returned automatically.', 'your-textdomain-here' ), |
|
| 24 | - 'show_api_key' => true, |
|
| 25 | - 'default' => array( |
|
| 26 | - 'zoom' => '17', // Zoom far: 3 zoom close 17. |
|
| 27 | - 'street_number' => '1600', // Address. |
|
| 28 | - 'route' => 'Pennsylvania Avenue', // STREET. |
|
| 29 | - 'locality' => 'Washington', // CITY. |
|
| 30 | - 'administrative_area_level_1' => 'DC', // STATE. |
|
| 31 | - 'postal_code' => '20500', |
|
| 32 | - 'country' => 'United States', |
|
| 33 | - ), |
|
| 34 | - ), |
|
| 35 | - array( |
|
| 36 | - 'id' => 'location_geocode2', |
|
| 37 | - 'type' => 'google_maps', |
|
| 38 | - 'title' => esc_html__( 'Google Maps', 'your-textdomain-here' ), |
|
| 39 | - 'subtitle' => esc_html__( 'This map is set using only latitude and longitude with a zoom factor of 7. When setting a Google map using lat/long, address information will not be returned.', 'your-textdomain-here' ), |
|
| 40 | - 'show_api_key' => false, |
|
| 41 | - 'full_width' => true, |
|
| 42 | - 'default' => array( |
|
| 43 | - 'latitude' => 38.8976758, |
|
| 44 | - 'longitude' => - 77.03648229999999, |
|
| 45 | - 'zoom' => 7, |
|
| 46 | - ), |
|
| 47 | - ), |
|
| 48 | - ), |
|
| 49 | - ) |
|
| 13 | + $opt_name, |
|
| 14 | + array( |
|
| 15 | + 'title' => esc_html__( 'Google Maps', 'your-textdomain-here' ), |
|
| 16 | + 'desc' => esc_html__( 'For full documentation on this field, visit: ', 'your-textdomain-here' ) . '<a href="https://devs.redux.io/core-extensions/google-maps.html" target="_blank">https://devs.redux.io/core-extensions/google-maps.html</a>', |
|
| 17 | + 'subsection' => true, |
|
| 18 | + 'fields' => array( |
|
| 19 | + array( |
|
| 20 | + 'id' => 'location_geocode', |
|
| 21 | + 'type' => 'google_maps', |
|
| 22 | + 'title' => esc_html__( 'Google Maps', 'your-textdomain-here' ), |
|
| 23 | + 'subtitle' => esc_html__( 'This map is set using only address information with a zoom factor of 3. Lat/Long is returned automatically.', 'your-textdomain-here' ), |
|
| 24 | + 'show_api_key' => true, |
|
| 25 | + 'default' => array( |
|
| 26 | + 'zoom' => '17', // Zoom far: 3 zoom close 17. |
|
| 27 | + 'street_number' => '1600', // Address. |
|
| 28 | + 'route' => 'Pennsylvania Avenue', // STREET. |
|
| 29 | + 'locality' => 'Washington', // CITY. |
|
| 30 | + 'administrative_area_level_1' => 'DC', // STATE. |
|
| 31 | + 'postal_code' => '20500', |
|
| 32 | + 'country' => 'United States', |
|
| 33 | + ), |
|
| 34 | + ), |
|
| 35 | + array( |
|
| 36 | + 'id' => 'location_geocode2', |
|
| 37 | + 'type' => 'google_maps', |
|
| 38 | + 'title' => esc_html__( 'Google Maps', 'your-textdomain-here' ), |
|
| 39 | + 'subtitle' => esc_html__( 'This map is set using only latitude and longitude with a zoom factor of 7. When setting a Google map using lat/long, address information will not be returned.', 'your-textdomain-here' ), |
|
| 40 | + 'show_api_key' => false, |
|
| 41 | + 'full_width' => true, |
|
| 42 | + 'default' => array( |
|
| 43 | + 'latitude' => 38.8976758, |
|
| 44 | + 'longitude' => - 77.03648229999999, |
|
| 45 | + 'zoom' => 7, |
|
| 46 | + ), |
|
| 47 | + ), |
|
| 48 | + ), |
|
| 49 | + ) |
|
| 50 | 50 | ); |
| 51 | 51 | // phpcs:enable |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | 'street_number' => $def_street_number, |
| 59 | 59 | 'route' => $def_route, |
| 60 | 60 | 'locality' => $def_locality, |
| 61 | - 'administrative_area_level_1' => $def_state, // <-dickheads at google. lol, srsly...wtf? |
|
| 61 | + 'administrative_area_level_1' => $def_state, // <-dickheads at google. lol, srsly...wtf? |
|
| 62 | 62 | // level_1 huh? maybe It's for multiple planets one day. |
| 63 | 63 | 'postal_code' => $def_postal, |
| 64 | 64 | 'country' => $def_country, |
@@ -11,145 +11,145 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | if ( ! class_exists( 'Redux_Google_Maps' ) ) { |
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Main ReduxFramework_google_maps class |
|
| 16 | - * |
|
| 17 | - * @since 1.0.0 |
|
| 18 | - */ |
|
| 19 | - class Redux_Google_Maps extends Redux_Field { |
|
| 20 | - |
|
| 21 | - /** |
|
| 22 | - * API Key. |
|
| 23 | - * |
|
| 24 | - * @var string|null |
|
| 25 | - */ |
|
| 26 | - private ?string $api_key = ''; |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * Get field defaults. |
|
| 30 | - */ |
|
| 31 | - public function set_defaults() { |
|
| 32 | - $field = array( |
|
| 33 | - 'api_key' => '', |
|
| 34 | - 'map_version' => 'weekly', |
|
| 35 | - ); |
|
| 36 | - |
|
| 37 | - $this->field = wp_parse_args( $this->field, $field ); |
|
| 38 | - |
|
| 39 | - $this->api_key = null; |
|
| 40 | - |
|
| 41 | - $this->field['api_key'] = $this->field['api_key'] ?? ''; |
|
| 42 | - |
|
| 43 | - if ( empty( $this->field['api_key'] ) ) { |
|
| 44 | - $redux = get_option( $this->parent->args['opt_name'] ); |
|
| 45 | - $this->api_key = $redux['google_map_api_key'] ?? ''; |
|
| 46 | - } else { |
|
| 47 | - $this->api_key = $this->field['api_key']; |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - // Necessary, in case the user doesn't fill out a default array. |
|
| 51 | - $def_street_number = $this->field['default']['street_number'] ?? ''; |
|
| 52 | - $def_route = $this->field['default']['route'] ?? ''; |
|
| 53 | - $def_locality = $this->field['default']['locality'] ?? ''; |
|
| 54 | - $def_state = $this->field['default']['administrative_area_level_1'] ?? ''; |
|
| 55 | - $def_postal = $this->field['default']['postal_code'] ?? ''; |
|
| 56 | - $def_country = $this->field['default']['country'] ?? ''; |
|
| 57 | - $def_lat = $this->field['default']['latitude'] ?? ''; |
|
| 58 | - $def_long = $this->field['default']['longitude'] ?? ''; |
|
| 59 | - $def_marker_info = $this->field['default']['marker_info'] ?? ''; |
|
| 60 | - $def_zoom = $this->field['default']['zoom'] ?? ''; |
|
| 61 | - |
|
| 62 | - $defaults = array( |
|
| 63 | - 'latitude' => $def_lat, |
|
| 64 | - 'longitude' => $def_long, |
|
| 65 | - 'street_number' => $def_street_number, |
|
| 66 | - 'route' => $def_route, |
|
| 67 | - 'locality' => $def_locality, |
|
| 68 | - 'administrative_area_level_1' => $def_state, // <-dickheads at google. lol, srsly...wtf? |
|
| 69 | - // level_1 huh? maybe It's for multiple planets one day. |
|
| 70 | - 'postal_code' => $def_postal, |
|
| 71 | - 'country' => $def_country, |
|
| 72 | - 'marker_info' => $def_marker_info, |
|
| 73 | - 'zoom' => $def_zoom, |
|
| 74 | - ); |
|
| 75 | - |
|
| 76 | - $this->value = wp_parse_args( $this->value, $defaults ); |
|
| 77 | - } |
|
| 78 | - |
|
| 79 | - |
|
| 80 | - /** |
|
| 81 | - * Field Render Function. |
|
| 82 | - * Takes the vars and outputs the HTML for the field in the settings |
|
| 83 | - * |
|
| 84 | - * @since 1.0.0 |
|
| 85 | - * @access public |
|
| 86 | - * @return void |
|
| 87 | - */ |
|
| 88 | - public function render() { |
|
| 89 | - |
|
| 90 | - // Set default or saved zoom |
|
| 91 | - // USA: 39.11676722061108,-100.47761000000003 |
|
| 92 | - // Zoom far: 3 |
|
| 93 | - // zoom close 17. |
|
| 94 | - if ( empty( $this->value['zoom'] ) ) { |
|
| 95 | - if ( $this->value['street_number'] ) { |
|
| 96 | - $the_zoom = 17; // make it close if the street is included. |
|
| 97 | - } else { |
|
| 98 | - $the_zoom = 3; // make it far if it's not. |
|
| 99 | - } |
|
| 100 | - } else { |
|
| 101 | - $the_zoom = $this->value['zoom']; |
|
| 102 | - } |
|
| 103 | - |
|
| 104 | - // Make full address. |
|
| 105 | - $locality = ! empty( $this->value['locality'] ) ? $this->value['locality'] . ', ' : ''; |
|
| 106 | - $route = ! empty( $this->value['route'] ) ? $this->value['route'] . ', ' : ''; |
|
| 107 | - $country = ! empty( $this->value['country'] ) ? ', ' . $this->value['country'] : ''; |
|
| 108 | - |
|
| 109 | - $full = $this->value['street_number'] . ' ' . $route . ' ' . $locality . $this->value['administrative_area_level_1'] . ' ' . $this->value['postal_code'] . $country; |
|
| 110 | - $data_full = rawurlencode( $full ); |
|
| 111 | - |
|
| 112 | - // Hide/show various input fields. |
|
| 113 | - $show_address = $this->field['show_address'] ?? true; |
|
| 114 | - $show_city = $this->field['show_city'] ?? true; |
|
| 115 | - $show_state = $this->field['show_state'] ?? true; |
|
| 116 | - $show_postal = $this->field['show_postal'] ?? true; |
|
| 117 | - $show_country = $this->field['show_country'] ?? true; |
|
| 118 | - $show_lat = $this->field['show_latitude'] ?? true; |
|
| 119 | - $show_long = $this->field['show_longitude'] ?? true; |
|
| 120 | - $show_marker_info = $this->field['show_marker_info'] ?? true; |
|
| 121 | - $show_controls = $this->field['show_controls'] ?? true; |
|
| 122 | - |
|
| 123 | - $this->field['placeholder'] = $this->field['placeholder'] ?? esc_html__( 'Enter your address', 'redux-framework' ); |
|
| 124 | - $this->field['marker_tooltip'] = $this->field['marker_tooltip'] ?? esc_html__( 'Left mouse down on top of me to move me!', 'redux-framework' ); |
|
| 125 | - $this->field['no_geometry_alert'] = $this->field['no_geometry_alert'] ?? esc_html__( 'The returned place contains no geometric data.', 'redux-framework' ); |
|
| 126 | - $this->field['delay_render'] = $this->field['delay_render'] ?? false; |
|
| 127 | - $this->field['class'] = $this->field['class'] ?? ''; |
|
| 128 | - $this->field['show_api_key'] = $this->field['show_api_key'] ?? true; |
|
| 129 | - $this->field['street_view_control'] = $this->field['street_view_control'] ?? true; |
|
| 130 | - $this->field['map_type_control'] = $this->field['map_type_control'] ?? true; |
|
| 131 | - $this->field['scroll_wheel'] = $this->field['scroll_wheel'] ?? false; |
|
| 132 | - $this->field['map_height'] = $this->field['map_height'] ?? ''; |
|
| 133 | - |
|
| 134 | - $map_height = ''; |
|
| 135 | - |
|
| 136 | - if ( ! empty( $this->field['map_height'] ) ) { |
|
| 137 | - $map_height = 'style="height:' . esc_attr( $this->field['map_height'] ) . ';"'; |
|
| 138 | - } |
|
| 139 | - |
|
| 140 | - $geo_alert = rawurlencode( $this->field['no_geometry_alert'] ); |
|
| 141 | - |
|
| 142 | - // admin defined. |
|
| 143 | - $the_lat = $this->value['latitude']; |
|
| 144 | - $the_long = $this->value['longitude']; |
|
| 145 | - $marker_tooltip = rawurlencode( $this->field['marker_tooltip'] ); |
|
| 146 | - |
|
| 147 | - if ( ! empty( $the_lat ) && ! empty( $the_long ) ) { |
|
| 148 | - $full = ''; |
|
| 149 | - } |
|
| 150 | - |
|
| 151 | - $hidden_style = ' style="display: none!important;" '; |
|
| 152 | - ?> |
|
| 14 | + /** |
|
| 15 | + * Main ReduxFramework_google_maps class |
|
| 16 | + * |
|
| 17 | + * @since 1.0.0 |
|
| 18 | + */ |
|
| 19 | + class Redux_Google_Maps extends Redux_Field { |
|
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * API Key. |
|
| 23 | + * |
|
| 24 | + * @var string|null |
|
| 25 | + */ |
|
| 26 | + private ?string $api_key = ''; |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * Get field defaults. |
|
| 30 | + */ |
|
| 31 | + public function set_defaults() { |
|
| 32 | + $field = array( |
|
| 33 | + 'api_key' => '', |
|
| 34 | + 'map_version' => 'weekly', |
|
| 35 | + ); |
|
| 36 | + |
|
| 37 | + $this->field = wp_parse_args( $this->field, $field ); |
|
| 38 | + |
|
| 39 | + $this->api_key = null; |
|
| 40 | + |
|
| 41 | + $this->field['api_key'] = $this->field['api_key'] ?? ''; |
|
| 42 | + |
|
| 43 | + if ( empty( $this->field['api_key'] ) ) { |
|
| 44 | + $redux = get_option( $this->parent->args['opt_name'] ); |
|
| 45 | + $this->api_key = $redux['google_map_api_key'] ?? ''; |
|
| 46 | + } else { |
|
| 47 | + $this->api_key = $this->field['api_key']; |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + // Necessary, in case the user doesn't fill out a default array. |
|
| 51 | + $def_street_number = $this->field['default']['street_number'] ?? ''; |
|
| 52 | + $def_route = $this->field['default']['route'] ?? ''; |
|
| 53 | + $def_locality = $this->field['default']['locality'] ?? ''; |
|
| 54 | + $def_state = $this->field['default']['administrative_area_level_1'] ?? ''; |
|
| 55 | + $def_postal = $this->field['default']['postal_code'] ?? ''; |
|
| 56 | + $def_country = $this->field['default']['country'] ?? ''; |
|
| 57 | + $def_lat = $this->field['default']['latitude'] ?? ''; |
|
| 58 | + $def_long = $this->field['default']['longitude'] ?? ''; |
|
| 59 | + $def_marker_info = $this->field['default']['marker_info'] ?? ''; |
|
| 60 | + $def_zoom = $this->field['default']['zoom'] ?? ''; |
|
| 61 | + |
|
| 62 | + $defaults = array( |
|
| 63 | + 'latitude' => $def_lat, |
|
| 64 | + 'longitude' => $def_long, |
|
| 65 | + 'street_number' => $def_street_number, |
|
| 66 | + 'route' => $def_route, |
|
| 67 | + 'locality' => $def_locality, |
|
| 68 | + 'administrative_area_level_1' => $def_state, // <-dickheads at google. lol, srsly...wtf? |
|
| 69 | + // level_1 huh? maybe It's for multiple planets one day. |
|
| 70 | + 'postal_code' => $def_postal, |
|
| 71 | + 'country' => $def_country, |
|
| 72 | + 'marker_info' => $def_marker_info, |
|
| 73 | + 'zoom' => $def_zoom, |
|
| 74 | + ); |
|
| 75 | + |
|
| 76 | + $this->value = wp_parse_args( $this->value, $defaults ); |
|
| 77 | + } |
|
| 78 | + |
|
| 79 | + |
|
| 80 | + /** |
|
| 81 | + * Field Render Function. |
|
| 82 | + * Takes the vars and outputs the HTML for the field in the settings |
|
| 83 | + * |
|
| 84 | + * @since 1.0.0 |
|
| 85 | + * @access public |
|
| 86 | + * @return void |
|
| 87 | + */ |
|
| 88 | + public function render() { |
|
| 89 | + |
|
| 90 | + // Set default or saved zoom |
|
| 91 | + // USA: 39.11676722061108,-100.47761000000003 |
|
| 92 | + // Zoom far: 3 |
|
| 93 | + // zoom close 17. |
|
| 94 | + if ( empty( $this->value['zoom'] ) ) { |
|
| 95 | + if ( $this->value['street_number'] ) { |
|
| 96 | + $the_zoom = 17; // make it close if the street is included. |
|
| 97 | + } else { |
|
| 98 | + $the_zoom = 3; // make it far if it's not. |
|
| 99 | + } |
|
| 100 | + } else { |
|
| 101 | + $the_zoom = $this->value['zoom']; |
|
| 102 | + } |
|
| 103 | + |
|
| 104 | + // Make full address. |
|
| 105 | + $locality = ! empty( $this->value['locality'] ) ? $this->value['locality'] . ', ' : ''; |
|
| 106 | + $route = ! empty( $this->value['route'] ) ? $this->value['route'] . ', ' : ''; |
|
| 107 | + $country = ! empty( $this->value['country'] ) ? ', ' . $this->value['country'] : ''; |
|
| 108 | + |
|
| 109 | + $full = $this->value['street_number'] . ' ' . $route . ' ' . $locality . $this->value['administrative_area_level_1'] . ' ' . $this->value['postal_code'] . $country; |
|
| 110 | + $data_full = rawurlencode( $full ); |
|
| 111 | + |
|
| 112 | + // Hide/show various input fields. |
|
| 113 | + $show_address = $this->field['show_address'] ?? true; |
|
| 114 | + $show_city = $this->field['show_city'] ?? true; |
|
| 115 | + $show_state = $this->field['show_state'] ?? true; |
|
| 116 | + $show_postal = $this->field['show_postal'] ?? true; |
|
| 117 | + $show_country = $this->field['show_country'] ?? true; |
|
| 118 | + $show_lat = $this->field['show_latitude'] ?? true; |
|
| 119 | + $show_long = $this->field['show_longitude'] ?? true; |
|
| 120 | + $show_marker_info = $this->field['show_marker_info'] ?? true; |
|
| 121 | + $show_controls = $this->field['show_controls'] ?? true; |
|
| 122 | + |
|
| 123 | + $this->field['placeholder'] = $this->field['placeholder'] ?? esc_html__( 'Enter your address', 'redux-framework' ); |
|
| 124 | + $this->field['marker_tooltip'] = $this->field['marker_tooltip'] ?? esc_html__( 'Left mouse down on top of me to move me!', 'redux-framework' ); |
|
| 125 | + $this->field['no_geometry_alert'] = $this->field['no_geometry_alert'] ?? esc_html__( 'The returned place contains no geometric data.', 'redux-framework' ); |
|
| 126 | + $this->field['delay_render'] = $this->field['delay_render'] ?? false; |
|
| 127 | + $this->field['class'] = $this->field['class'] ?? ''; |
|
| 128 | + $this->field['show_api_key'] = $this->field['show_api_key'] ?? true; |
|
| 129 | + $this->field['street_view_control'] = $this->field['street_view_control'] ?? true; |
|
| 130 | + $this->field['map_type_control'] = $this->field['map_type_control'] ?? true; |
|
| 131 | + $this->field['scroll_wheel'] = $this->field['scroll_wheel'] ?? false; |
|
| 132 | + $this->field['map_height'] = $this->field['map_height'] ?? ''; |
|
| 133 | + |
|
| 134 | + $map_height = ''; |
|
| 135 | + |
|
| 136 | + if ( ! empty( $this->field['map_height'] ) ) { |
|
| 137 | + $map_height = 'style="height:' . esc_attr( $this->field['map_height'] ) . ';"'; |
|
| 138 | + } |
|
| 139 | + |
|
| 140 | + $geo_alert = rawurlencode( $this->field['no_geometry_alert'] ); |
|
| 141 | + |
|
| 142 | + // admin defined. |
|
| 143 | + $the_lat = $this->value['latitude']; |
|
| 144 | + $the_long = $this->value['longitude']; |
|
| 145 | + $marker_tooltip = rawurlencode( $this->field['marker_tooltip'] ); |
|
| 146 | + |
|
| 147 | + if ( ! empty( $the_lat ) && ! empty( $the_long ) ) { |
|
| 148 | + $full = ''; |
|
| 149 | + } |
|
| 150 | + |
|
| 151 | + $hidden_style = ' style="display: none!important;" '; |
|
| 152 | + ?> |
|
| 153 | 153 | |
| 154 | 154 | <div |
| 155 | 155 | class="redux_framework_google_maps <?php echo esc_attr( $this->field['class'] ); ?>" |
@@ -317,12 +317,12 @@ discard block |
||
| 317 | 317 | <div class="google_m_api_key_wrapper"> |
| 318 | 318 | <p class="description" id="google_m_api_key_description"> |
| 319 | 319 | <?php |
| 320 | - $api_key_site = ' ' . sprintf( '<a href="https://console.developers.google.com/flows/enableapi?apiid=maps_backend&keyType=CLIENT_SIDE&reusekey=true" target="_blank">%s</a>', esc_html__( 'Get an API Key', 'redux-framework' ) ) . ' '; |
|
| 321 | - $usage_limit_site = ' ' . sprintf( '<a href="https://developers.google.com/maps/documentation/javascript/usage" target="_blank">%s</a>', esc_html__( 'Google Map Usage Limits', 'redux-framework' ) ) . ' '; |
|
| 320 | + $api_key_site = ' ' . sprintf( '<a href="https://console.developers.google.com/flows/enableapi?apiid=maps_backend&keyType=CLIENT_SIDE&reusekey=true" target="_blank">%s</a>', esc_html__( 'Get an API Key', 'redux-framework' ) ) . ' '; |
|
| 321 | + $usage_limit_site = ' ' . sprintf( '<a href="https://developers.google.com/maps/documentation/javascript/usage" target="_blank">%s</a>', esc_html__( 'Google Map Usage Limits', 'redux-framework' ) ) . ' '; |
|
| 322 | 322 | |
| 323 | - // translators: %1$s: Google Maps API Key url. %2$s: Google Maps Usage URL. |
|
| 324 | - echo sprintf( esc_html__( 'Google Maps supports 25,000 free map loads per 24 hours for 90 consecutive days. In the events you run a high volume site, you may need to obtain an API Key to continue using Google Map output beyond the free quota. To sign up for an API Key, please visit the %1$s site. For more information about Google Map usage limits, please visit the %2$s guide.', 'redux-framework' ), $api_key_site, $usage_limit_site ) . '<br><br>' . esc_html__( 'Once you have obtained an API Key, please enter it in the text box below and save the options panel.', 'redux-framework' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 325 | - ?> |
|
| 323 | + // translators: %1$s: Google Maps API Key url. %2$s: Google Maps Usage URL. |
|
| 324 | + echo sprintf( esc_html__( 'Google Maps supports 25,000 free map loads per 24 hours for 90 consecutive days. In the events you run a high volume site, you may need to obtain an API Key to continue using Google Map output beyond the free quota. To sign up for an API Key, please visit the %1$s site. For more information about Google Map usage limits, please visit the %2$s guide.', 'redux-framework' ), $api_key_site, $usage_limit_site ) . '<br><br>' . esc_html__( 'Once you have obtained an API Key, please enter it in the text box below and save the options panel.', 'redux-framework' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 325 | + ?> |
|
| 326 | 326 | </p> |
| 327 | 327 | <label for="google_m_api_key_input"><?php esc_html_e( 'API Key', 'redux-framework' ); ?></label> |
| 328 | 328 | <input |
@@ -336,51 +336,51 @@ discard block |
||
| 336 | 336 | </div> |
| 337 | 337 | |
| 338 | 338 | <?php |
| 339 | - } |
|
| 340 | - |
|
| 341 | - /** |
|
| 342 | - * Enqueue Function. |
|
| 343 | - * If this field requires any scripts, or css define this function and register/enqueue the scripts/css |
|
| 344 | - * |
|
| 345 | - * @since 1.0.0 |
|
| 346 | - * @access public |
|
| 347 | - * @return void |
|
| 348 | - */ |
|
| 349 | - public function enqueue() { |
|
| 350 | - $min = Redux_Functions::isMin(); |
|
| 351 | - |
|
| 352 | - $api_key = ''; |
|
| 353 | - if ( ! empty( $this->api_key ) ) { |
|
| 354 | - $api_key = $this->api_key; |
|
| 355 | - } |
|
| 356 | - |
|
| 357 | - wp_register_script( |
|
| 358 | - 'redux-field-google-maps', |
|
| 359 | - $this->url . 'redux-google-maps' . $min . '.js', |
|
| 360 | - array( 'jquery', 'redux-js' ), |
|
| 361 | - Redux_Extension_Google_Maps::$version, |
|
| 362 | - true |
|
| 363 | - ); |
|
| 364 | - |
|
| 365 | - if ( ! wp_script_is( 'redux-field-google-maps' ) ) { |
|
| 366 | - $script = '(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({ |
|
| 339 | + } |
|
| 340 | + |
|
| 341 | + /** |
|
| 342 | + * Enqueue Function. |
|
| 343 | + * If this field requires any scripts, or css define this function and register/enqueue the scripts/css |
|
| 344 | + * |
|
| 345 | + * @since 1.0.0 |
|
| 346 | + * @access public |
|
| 347 | + * @return void |
|
| 348 | + */ |
|
| 349 | + public function enqueue() { |
|
| 350 | + $min = Redux_Functions::isMin(); |
|
| 351 | + |
|
| 352 | + $api_key = ''; |
|
| 353 | + if ( ! empty( $this->api_key ) ) { |
|
| 354 | + $api_key = $this->api_key; |
|
| 355 | + } |
|
| 356 | + |
|
| 357 | + wp_register_script( |
|
| 358 | + 'redux-field-google-maps', |
|
| 359 | + $this->url . 'redux-google-maps' . $min . '.js', |
|
| 360 | + array( 'jquery', 'redux-js' ), |
|
| 361 | + Redux_Extension_Google_Maps::$version, |
|
| 362 | + true |
|
| 363 | + ); |
|
| 364 | + |
|
| 365 | + if ( ! wp_script_is( 'redux-field-google-maps' ) ) { |
|
| 366 | + $script = '(g=>{var h,a,k,p="The Google Maps JavaScript API",c="google",l="importLibrary",q="__ib__",m=document,b=window;b=b[c]||(b[c]={});var d=b.maps||(b.maps={}),r=new Set,e=new URLSearchParams,u=()=>h||(h=new Promise(async(f,n)=>{await (a=m.createElement("script"));e.set("libraries",[...r]+"");for(k in g)e.set(k.replace(/[A-Z]/g,t=>"_"+t[0].toLowerCase()),g[k]);e.set("callback",c+".maps."+q);a.src=`https://maps.${c}apis.com/maps/api/js?`+e;d[q]=f;a.onerror=()=>h=n(Error(p+" could not load."));a.nonce=m.querySelector("script[nonce]")?.nonce||"";m.head.append(a)}));d[l]?console.warn(p+" only loads once. Ignoring:",g):d[l]=(f,...n)=>r.add(f)&&u().then(()=>d[l](f,...n))})({ |
|
| 367 | 367 | key:"' . $api_key . '", |
| 368 | 368 | v:"' . $this->field['map_version'] . '", |
| 369 | 369 | });'; |
| 370 | 370 | |
| 371 | - wp_add_inline_script( 'redux-field-google-maps', $script ); |
|
| 372 | - } |
|
| 373 | - |
|
| 374 | - wp_enqueue_script( 'redux-field-google-maps' ); |
|
| 375 | - |
|
| 376 | - if ( $this->parent->args['dev_mode'] ) { |
|
| 377 | - wp_enqueue_style( |
|
| 378 | - 'redux-field-google-maps', |
|
| 379 | - $this->url . 'redux-google-maps.css', |
|
| 380 | - array(), |
|
| 381 | - Redux_Extension_Google_Maps::$version |
|
| 382 | - ); |
|
| 383 | - } |
|
| 384 | - } |
|
| 385 | - } |
|
| 371 | + wp_add_inline_script( 'redux-field-google-maps', $script ); |
|
| 372 | + } |
|
| 373 | + |
|
| 374 | + wp_enqueue_script( 'redux-field-google-maps' ); |
|
| 375 | + |
|
| 376 | + if ( $this->parent->args['dev_mode'] ) { |
|
| 377 | + wp_enqueue_style( |
|
| 378 | + 'redux-field-google-maps', |
|
| 379 | + $this->url . 'redux-google-maps.css', |
|
| 380 | + array(), |
|
| 381 | + Redux_Extension_Google_Maps::$version |
|
| 382 | + ); |
|
| 383 | + } |
|
| 384 | + } |
|
| 385 | + } |
|
| 386 | 386 | } |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | |
| 57 | 57 | $nonce = wp_create_nonce( 'redux_custom_fonts' ); |
| 58 | 58 | |
| 59 | - $this->field['custom_fonts'] = apply_filters( "redux/{$this->parent->args[ 'opt_name' ]}/field/typography/custom_fonts", array() ); // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 59 | + $this->field['custom_fonts'] = apply_filters( "redux/{$this->parent->args['opt_name']}/field/typography/custom_fonts", array() ); // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 60 | 60 | |
| 61 | 61 | if ( $can_convert ) { |
| 62 | 62 | echo '<div class="">'; |
@@ -11,194 +11,194 @@ |
||
| 11 | 11 | |
| 12 | 12 | if ( ! class_exists( 'Redux_Custom_Fonts' ) ) { |
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Main ReduxFramework_custom_fonts class |
|
| 16 | - * |
|
| 17 | - * @since 1.0.0 |
|
| 18 | - */ |
|
| 19 | - class Redux_Custom_Fonts extends Redux_Field { |
|
| 20 | - |
|
| 21 | - /** |
|
| 22 | - * Set field defaults. |
|
| 23 | - */ |
|
| 24 | - public function set_defaults() { |
|
| 25 | - $defaults = array( |
|
| 26 | - 'convert' => false, |
|
| 27 | - 'eot' => false, |
|
| 28 | - 'svg' => false, |
|
| 29 | - 'ttf' => false, |
|
| 30 | - 'woff' => true, |
|
| 31 | - 'woff2' => true, |
|
| 32 | - ); |
|
| 33 | - |
|
| 34 | - $this->value = wp_parse_args( $this->value, $defaults ); |
|
| 35 | - } |
|
| 36 | - |
|
| 37 | - /** |
|
| 38 | - * Field Render Function. |
|
| 39 | - * Takes the vars and outputs the HTML for the field in the settings |
|
| 40 | - * |
|
| 41 | - * @return void |
|
| 42 | - * @since 1.0.0 |
|
| 43 | - * @access public |
|
| 44 | - */ |
|
| 45 | - public function render() { |
|
| 46 | - echo '</fieldset></td></tr>'; |
|
| 47 | - echo '<tr>'; |
|
| 48 | - echo '<td colspan="2">'; |
|
| 49 | - echo '<fieldset |
|
| 14 | + /** |
|
| 15 | + * Main ReduxFramework_custom_fonts class |
|
| 16 | + * |
|
| 17 | + * @since 1.0.0 |
|
| 18 | + */ |
|
| 19 | + class Redux_Custom_Fonts extends Redux_Field { |
|
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * Set field defaults. |
|
| 23 | + */ |
|
| 24 | + public function set_defaults() { |
|
| 25 | + $defaults = array( |
|
| 26 | + 'convert' => false, |
|
| 27 | + 'eot' => false, |
|
| 28 | + 'svg' => false, |
|
| 29 | + 'ttf' => false, |
|
| 30 | + 'woff' => true, |
|
| 31 | + 'woff2' => true, |
|
| 32 | + ); |
|
| 33 | + |
|
| 34 | + $this->value = wp_parse_args( $this->value, $defaults ); |
|
| 35 | + } |
|
| 36 | + |
|
| 37 | + /** |
|
| 38 | + * Field Render Function. |
|
| 39 | + * Takes the vars and outputs the HTML for the field in the settings |
|
| 40 | + * |
|
| 41 | + * @return void |
|
| 42 | + * @since 1.0.0 |
|
| 43 | + * @access public |
|
| 44 | + */ |
|
| 45 | + public function render() { |
|
| 46 | + echo '</fieldset></td></tr>'; |
|
| 47 | + echo '<tr>'; |
|
| 48 | + echo '<td colspan="2">'; |
|
| 49 | + echo '<fieldset |
|
| 50 | 50 | class="redux-field-container redux-field redux-field-init redux-container-custom_font" |
| 51 | 51 | data-type="' . esc_attr( $this->field['type'] ) . '" |
| 52 | 52 | data-id="' . esc_attr( $this->field['id'] ) . '" |
| 53 | 53 | >'; |
| 54 | 54 | |
| 55 | - $can_convert = true; |
|
| 56 | - |
|
| 57 | - $nonce = wp_create_nonce( 'redux_custom_fonts' ); |
|
| 58 | - |
|
| 59 | - $this->field['custom_fonts'] = apply_filters( "redux/{$this->parent->args[ 'opt_name' ]}/field/typography/custom_fonts", array() ); // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 60 | - |
|
| 61 | - if ( $can_convert ) { |
|
| 62 | - echo '<div class="">'; |
|
| 63 | - echo '<label for="custom-font-convert">'; |
|
| 64 | - echo '<input type="hidden" class="checkbox-check" data-val="1" name="' . esc_attr( $this->field['name'] ) . '[convert]" value="' . esc_attr( $this->value['convert'] ) . '"/>'; |
|
| 65 | - echo '<input type="checkbox" class="checkbox" id="custom-font-convert" value="1"' . checked( $this->value['convert'], '1', false ) . '">'; |
|
| 66 | - echo 'Enable font conversion'; |
|
| 67 | - echo '</label>'; |
|
| 68 | - echo '</div>'; |
|
| 69 | - echo '</div>'; |
|
| 70 | - } |
|
| 71 | - |
|
| 72 | - if ( ! empty( $this->field['custom_fonts'] ) ) { |
|
| 73 | - foreach ( $this->field['custom_fonts'] as $section => $fonts ) { |
|
| 74 | - if ( empty( $fonts ) ) { |
|
| 75 | - continue; |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - echo '<h3>' . esc_html( $section ) . '</h3>'; |
|
| 79 | - echo '<div class="font-error" style="display: none;"><p><strong>' . esc_html__( 'Error', 'redux-framework' ) . '</strong>: <span></span></p></div>'; |
|
| 80 | - |
|
| 81 | - echo '<table class="wp-list-table widefat plugins" style="border-spacing:0;"><tbody>'; |
|
| 82 | - |
|
| 83 | - foreach ( $fonts as $font => $pieces ) { |
|
| 84 | - echo '<tr class="active">'; |
|
| 85 | - echo '<td class="plugin-title" style="min-width: 40%"><strong>' . esc_html( $font ) . '</strong></td>'; |
|
| 86 | - echo '<td class="column-description desc">'; |
|
| 87 | - echo '<div class="plugin-description">'; |
|
| 88 | - |
|
| 89 | - if ( is_array( $pieces ) && ! empty( $pieces ) ) { |
|
| 90 | - foreach ( $pieces as $piece ) { |
|
| 91 | - echo '<span class="button button-primary button-small font-pieces">' . esc_html( $piece ) . '</span>'; |
|
| 92 | - } |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - echo '</div>'; |
|
| 96 | - echo '</td>'; |
|
| 97 | - echo '<td style="width: 140px;"><div class="action-row visible">'; |
|
| 98 | - echo '<span style="display:none;"><a href="#" class="rename">Rename</a> | </span>'; |
|
| 99 | - echo '<a href="#" class="fontDelete delete" data-section="' . esc_attr( $section ) . '" data-name="' . esc_attr( $font ) . '" data-type="delete">' . esc_html__( 'Delete', 'redux-framework' ) . '</a>'; |
|
| 100 | - echo '<span class="spinner" style="display:none; visibility: visible;"></span>'; |
|
| 101 | - echo '</div>'; |
|
| 102 | - echo '</td>'; |
|
| 103 | - echo '</tr>'; |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - echo '</tbody></table>'; |
|
| 107 | - } |
|
| 108 | - |
|
| 109 | - echo '<div class="upload_button_div"><span class="button media_add_font" data-nonce="' . esc_attr( $nonce ) . '" id="' . esc_attr( $this->field['id'] ) . '-custom_fonts">' . esc_html__( 'Add Font', 'redux-framework' ) . '</span></div><br />'; |
|
| 110 | - } else { |
|
| 111 | - echo '<h3>' . esc_html__( 'No Custom Fonts Found', 'redux-framework' ) . '</h3>'; |
|
| 112 | - echo '<div class="upload_button_div"><span class="button media_add_font" data-nonce="' . esc_attr( $nonce ) . '" id="' . esc_attr( $this->field['id'] ) . '-custom_fonts">' . esc_html__( 'Add Font', 'redux-framework' ) . '</span></div>'; |
|
| 113 | - } |
|
| 114 | - |
|
| 115 | - echo '</fieldset></td></tr>'; |
|
| 116 | - } |
|
| 117 | - |
|
| 118 | - /** |
|
| 119 | - * Functions to pass data from the PHP to the JS at render time. |
|
| 120 | - * |
|
| 121 | - * @param array $field Field. |
|
| 122 | - * @param string $value Value. |
|
| 123 | - * |
|
| 124 | - * @return array |
|
| 125 | - */ |
|
| 126 | - public function localize( $field, $value = '' ): array { |
|
| 127 | - $params = array(); |
|
| 128 | - |
|
| 129 | - if ( ! isset( $field['mode'] ) ) { |
|
| 130 | - $field['mode'] = 'image'; |
|
| 131 | - } |
|
| 132 | - |
|
| 133 | - $params['mode'] = $field['mode']; |
|
| 134 | - |
|
| 135 | - if ( empty( $value ) && isset( $this->value ) ) { |
|
| 136 | - $value = $this->value; |
|
| 137 | - } |
|
| 138 | - |
|
| 139 | - $params['val'] = $value; |
|
| 140 | - |
|
| 141 | - return $params; |
|
| 142 | - } |
|
| 143 | - |
|
| 144 | - /** |
|
| 145 | - * Enqueue Function. |
|
| 146 | - * If this field requires any scripts, or css define this function and register/enqueue the scripts/css |
|
| 147 | - * |
|
| 148 | - * @return void |
|
| 149 | - * @since 1.0.0 |
|
| 150 | - * @access public |
|
| 151 | - */ |
|
| 152 | - public function enqueue() { |
|
| 153 | - $min = Redux_Functions::isMin(); |
|
| 154 | - |
|
| 155 | - wp_enqueue_script( |
|
| 156 | - 'redux-field-custom-fonts', |
|
| 157 | - $this->url . '/redux-custom-fonts' . $min . '.js', |
|
| 158 | - array( 'jquery', 'redux-block-ui' ), |
|
| 159 | - Redux_Extension_Custom_Fonts::$version, |
|
| 160 | - true |
|
| 161 | - ); |
|
| 162 | - |
|
| 163 | - wp_localize_script( |
|
| 164 | - 'redux-field-custom-fonts', |
|
| 165 | - 'redux_custom_fonts_l10', |
|
| 166 | - apply_filters( |
|
| 167 | - 'redux_custom_fonts_localized_data', |
|
| 168 | - array( |
|
| 169 | - 'delete_error' => esc_html__( 'There was an error deleting your font:', 'redux-framework' ), |
|
| 170 | - 'unzip' => esc_html__( 'Unzipping archive and generating any missing font files.', 'redux-framework' ), |
|
| 171 | - 'convert' => esc_html__( 'Converting font file(s)...', 'redux-framework' ), |
|
| 172 | - 'partial' => esc_html__( 'The only file(s) imported were those uploaded. Please refresh the page to continue (making note of any errors before doing so, please).', 'redux-framework' ), |
|
| 173 | - 'unknown' => esc_html__( 'An unknown error occurred. Please try again.', 'redux-framework' ), |
|
| 174 | - 'complete' => esc_html__( 'Conversion complete. Refreshing page...', 'redux-framework' ), |
|
| 175 | - 'media_title' => esc_html__( 'Choose Font file or ZIP of font files.', 'redux-framework' ), |
|
| 176 | - 'media_button' => esc_html__( 'Update', 'redux-framework' ), |
|
| 177 | - ) |
|
| 178 | - ) |
|
| 179 | - ); |
|
| 180 | - |
|
| 181 | - if ( $this->parent->args['dev_mode'] ) { |
|
| 182 | - wp_enqueue_style( |
|
| 183 | - 'redux-field-custom-fonts', |
|
| 184 | - $this->url . 'redux-custom-fonts.css', |
|
| 185 | - array(), |
|
| 186 | - Redux_Extension_Custom_Fonts::$version |
|
| 187 | - ); |
|
| 188 | - } |
|
| 189 | - |
|
| 190 | - $class = Redux_Extension_Custom_Fonts::$instance; |
|
| 191 | - |
|
| 192 | - if ( ! empty( $class->custom_fonts ) ) { |
|
| 193 | - if ( file_exists( $class->upload_dir . 'fonts.css' ) ) { |
|
| 194 | - wp_enqueue_style( |
|
| 195 | - 'redux-custom_fonts', |
|
| 196 | - $class->upload_url . 'fonts.css', |
|
| 197 | - array(), |
|
| 198 | - filemtime( $class->upload_dir . 'fonts.css' ) |
|
| 199 | - ); |
|
| 200 | - } |
|
| 201 | - } |
|
| 202 | - } |
|
| 203 | - } |
|
| 55 | + $can_convert = true; |
|
| 56 | + |
|
| 57 | + $nonce = wp_create_nonce( 'redux_custom_fonts' ); |
|
| 58 | + |
|
| 59 | + $this->field['custom_fonts'] = apply_filters( "redux/{$this->parent->args[ 'opt_name' ]}/field/typography/custom_fonts", array() ); // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 60 | + |
|
| 61 | + if ( $can_convert ) { |
|
| 62 | + echo '<div class="">'; |
|
| 63 | + echo '<label for="custom-font-convert">'; |
|
| 64 | + echo '<input type="hidden" class="checkbox-check" data-val="1" name="' . esc_attr( $this->field['name'] ) . '[convert]" value="' . esc_attr( $this->value['convert'] ) . '"/>'; |
|
| 65 | + echo '<input type="checkbox" class="checkbox" id="custom-font-convert" value="1"' . checked( $this->value['convert'], '1', false ) . '">'; |
|
| 66 | + echo 'Enable font conversion'; |
|
| 67 | + echo '</label>'; |
|
| 68 | + echo '</div>'; |
|
| 69 | + echo '</div>'; |
|
| 70 | + } |
|
| 71 | + |
|
| 72 | + if ( ! empty( $this->field['custom_fonts'] ) ) { |
|
| 73 | + foreach ( $this->field['custom_fonts'] as $section => $fonts ) { |
|
| 74 | + if ( empty( $fonts ) ) { |
|
| 75 | + continue; |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + echo '<h3>' . esc_html( $section ) . '</h3>'; |
|
| 79 | + echo '<div class="font-error" style="display: none;"><p><strong>' . esc_html__( 'Error', 'redux-framework' ) . '</strong>: <span></span></p></div>'; |
|
| 80 | + |
|
| 81 | + echo '<table class="wp-list-table widefat plugins" style="border-spacing:0;"><tbody>'; |
|
| 82 | + |
|
| 83 | + foreach ( $fonts as $font => $pieces ) { |
|
| 84 | + echo '<tr class="active">'; |
|
| 85 | + echo '<td class="plugin-title" style="min-width: 40%"><strong>' . esc_html( $font ) . '</strong></td>'; |
|
| 86 | + echo '<td class="column-description desc">'; |
|
| 87 | + echo '<div class="plugin-description">'; |
|
| 88 | + |
|
| 89 | + if ( is_array( $pieces ) && ! empty( $pieces ) ) { |
|
| 90 | + foreach ( $pieces as $piece ) { |
|
| 91 | + echo '<span class="button button-primary button-small font-pieces">' . esc_html( $piece ) . '</span>'; |
|
| 92 | + } |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + echo '</div>'; |
|
| 96 | + echo '</td>'; |
|
| 97 | + echo '<td style="width: 140px;"><div class="action-row visible">'; |
|
| 98 | + echo '<span style="display:none;"><a href="#" class="rename">Rename</a> | </span>'; |
|
| 99 | + echo '<a href="#" class="fontDelete delete" data-section="' . esc_attr( $section ) . '" data-name="' . esc_attr( $font ) . '" data-type="delete">' . esc_html__( 'Delete', 'redux-framework' ) . '</a>'; |
|
| 100 | + echo '<span class="spinner" style="display:none; visibility: visible;"></span>'; |
|
| 101 | + echo '</div>'; |
|
| 102 | + echo '</td>'; |
|
| 103 | + echo '</tr>'; |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + echo '</tbody></table>'; |
|
| 107 | + } |
|
| 108 | + |
|
| 109 | + echo '<div class="upload_button_div"><span class="button media_add_font" data-nonce="' . esc_attr( $nonce ) . '" id="' . esc_attr( $this->field['id'] ) . '-custom_fonts">' . esc_html__( 'Add Font', 'redux-framework' ) . '</span></div><br />'; |
|
| 110 | + } else { |
|
| 111 | + echo '<h3>' . esc_html__( 'No Custom Fonts Found', 'redux-framework' ) . '</h3>'; |
|
| 112 | + echo '<div class="upload_button_div"><span class="button media_add_font" data-nonce="' . esc_attr( $nonce ) . '" id="' . esc_attr( $this->field['id'] ) . '-custom_fonts">' . esc_html__( 'Add Font', 'redux-framework' ) . '</span></div>'; |
|
| 113 | + } |
|
| 114 | + |
|
| 115 | + echo '</fieldset></td></tr>'; |
|
| 116 | + } |
|
| 117 | + |
|
| 118 | + /** |
|
| 119 | + * Functions to pass data from the PHP to the JS at render time. |
|
| 120 | + * |
|
| 121 | + * @param array $field Field. |
|
| 122 | + * @param string $value Value. |
|
| 123 | + * |
|
| 124 | + * @return array |
|
| 125 | + */ |
|
| 126 | + public function localize( $field, $value = '' ): array { |
|
| 127 | + $params = array(); |
|
| 128 | + |
|
| 129 | + if ( ! isset( $field['mode'] ) ) { |
|
| 130 | + $field['mode'] = 'image'; |
|
| 131 | + } |
|
| 132 | + |
|
| 133 | + $params['mode'] = $field['mode']; |
|
| 134 | + |
|
| 135 | + if ( empty( $value ) && isset( $this->value ) ) { |
|
| 136 | + $value = $this->value; |
|
| 137 | + } |
|
| 138 | + |
|
| 139 | + $params['val'] = $value; |
|
| 140 | + |
|
| 141 | + return $params; |
|
| 142 | + } |
|
| 143 | + |
|
| 144 | + /** |
|
| 145 | + * Enqueue Function. |
|
| 146 | + * If this field requires any scripts, or css define this function and register/enqueue the scripts/css |
|
| 147 | + * |
|
| 148 | + * @return void |
|
| 149 | + * @since 1.0.0 |
|
| 150 | + * @access public |
|
| 151 | + */ |
|
| 152 | + public function enqueue() { |
|
| 153 | + $min = Redux_Functions::isMin(); |
|
| 154 | + |
|
| 155 | + wp_enqueue_script( |
|
| 156 | + 'redux-field-custom-fonts', |
|
| 157 | + $this->url . '/redux-custom-fonts' . $min . '.js', |
|
| 158 | + array( 'jquery', 'redux-block-ui' ), |
|
| 159 | + Redux_Extension_Custom_Fonts::$version, |
|
| 160 | + true |
|
| 161 | + ); |
|
| 162 | + |
|
| 163 | + wp_localize_script( |
|
| 164 | + 'redux-field-custom-fonts', |
|
| 165 | + 'redux_custom_fonts_l10', |
|
| 166 | + apply_filters( |
|
| 167 | + 'redux_custom_fonts_localized_data', |
|
| 168 | + array( |
|
| 169 | + 'delete_error' => esc_html__( 'There was an error deleting your font:', 'redux-framework' ), |
|
| 170 | + 'unzip' => esc_html__( 'Unzipping archive and generating any missing font files.', 'redux-framework' ), |
|
| 171 | + 'convert' => esc_html__( 'Converting font file(s)...', 'redux-framework' ), |
|
| 172 | + 'partial' => esc_html__( 'The only file(s) imported were those uploaded. Please refresh the page to continue (making note of any errors before doing so, please).', 'redux-framework' ), |
|
| 173 | + 'unknown' => esc_html__( 'An unknown error occurred. Please try again.', 'redux-framework' ), |
|
| 174 | + 'complete' => esc_html__( 'Conversion complete. Refreshing page...', 'redux-framework' ), |
|
| 175 | + 'media_title' => esc_html__( 'Choose Font file or ZIP of font files.', 'redux-framework' ), |
|
| 176 | + 'media_button' => esc_html__( 'Update', 'redux-framework' ), |
|
| 177 | + ) |
|
| 178 | + ) |
|
| 179 | + ); |
|
| 180 | + |
|
| 181 | + if ( $this->parent->args['dev_mode'] ) { |
|
| 182 | + wp_enqueue_style( |
|
| 183 | + 'redux-field-custom-fonts', |
|
| 184 | + $this->url . 'redux-custom-fonts.css', |
|
| 185 | + array(), |
|
| 186 | + Redux_Extension_Custom_Fonts::$version |
|
| 187 | + ); |
|
| 188 | + } |
|
| 189 | + |
|
| 190 | + $class = Redux_Extension_Custom_Fonts::$instance; |
|
| 191 | + |
|
| 192 | + if ( ! empty( $class->custom_fonts ) ) { |
|
| 193 | + if ( file_exists( $class->upload_dir . 'fonts.css' ) ) { |
|
| 194 | + wp_enqueue_style( |
|
| 195 | + 'redux-custom_fonts', |
|
| 196 | + $class->upload_url . 'fonts.css', |
|
| 197 | + array(), |
|
| 198 | + filemtime( $class->upload_dir . 'fonts.css' ) |
|
| 199 | + ); |
|
| 200 | + } |
|
| 201 | + } |
|
| 202 | + } |
|
| 203 | + } |
|
| 204 | 204 | } |
@@ -16,355 +16,355 @@ |
||
| 16 | 16 | * @return array |
| 17 | 17 | */ |
| 18 | 18 | function redux_get_dashicons(): array { |
| 19 | - return array( |
|
| 20 | - 'dashicons dashicons-admin-appearance', |
|
| 21 | - 'dashicons dashicons-admin-collapse', |
|
| 22 | - 'dashicons dashicons-admin-comments', |
|
| 23 | - 'dashicons dashicons-admin-customizer', |
|
| 24 | - 'dashicons dashicons-admin-generic', |
|
| 25 | - 'dashicons dashicons-admin-home', |
|
| 26 | - 'dashicons dashicons-admin-links', |
|
| 27 | - 'dashicons dashicons-admin-media', |
|
| 28 | - 'dashicons dashicons-admin-multisite', |
|
| 29 | - 'dashicons dashicons-admin-network', |
|
| 30 | - 'dashicons dashicons-admin-page', |
|
| 31 | - 'dashicons dashicons-admin-plugins', |
|
| 32 | - 'dashicons dashicons-admin-post', |
|
| 33 | - 'dashicons dashicons-admin-settings', |
|
| 34 | - 'dashicons dashicons-admin-site-alt', |
|
| 35 | - 'dashicons dashicons-admin-site-alt2', |
|
| 36 | - 'dashicons dashicons-admin-site-alt3', |
|
| 37 | - 'dashicons dashicons-admin-site', |
|
| 38 | - 'dashicons dashicons-admin-tools', |
|
| 39 | - 'dashicons dashicons-admin-users', |
|
| 40 | - 'dashicons dashicons-airplane', |
|
| 41 | - 'dashicons dashicons-album', |
|
| 42 | - 'dashicons dashicons-align-center', |
|
| 43 | - 'dashicons dashicons-align-full-width', |
|
| 44 | - 'dashicons dashicons-align-left', |
|
| 45 | - 'dashicons dashicons-align-none', |
|
| 46 | - 'dashicons dashicons-align-pull-left', |
|
| 47 | - 'dashicons dashicons-align-pull-right', |
|
| 48 | - 'dashicons dashicons-align-right', |
|
| 49 | - 'dashicons dashicons-align-wide', |
|
| 50 | - 'dashicons dashicons-amazon', |
|
| 51 | - 'dashicons dashicons-analytics', |
|
| 52 | - 'dashicons dashicons-archive', |
|
| 53 | - 'dashicons dashicons-arrow-down-alt', |
|
| 54 | - 'dashicons dashicons-arrow-down-alt2', |
|
| 55 | - 'dashicons dashicons-arrow-down', |
|
| 56 | - 'dashicons dashicons-arrow-left-alt', |
|
| 57 | - 'dashicons dashicons-arrow-left-alt2', |
|
| 58 | - 'dashicons dashicons-arrow-left', |
|
| 59 | - 'dashicons dashicons-arrow-right-alt', |
|
| 60 | - 'dashicons dashicons-arrow-right-alt2', |
|
| 61 | - 'dashicons dashicons-arrow-right', |
|
| 62 | - 'dashicons dashicons-arrow-up-alt', |
|
| 63 | - 'dashicons dashicons-arrow-up-alt2', |
|
| 64 | - 'dashicons dashicons-arrow-up-duplicate', |
|
| 65 | - 'dashicons dashicons-arrow-up', |
|
| 66 | - 'dashicons dashicons-art', |
|
| 67 | - 'dashicons dashicons-awards', |
|
| 68 | - 'dashicons dashicons-backup', |
|
| 69 | - 'dashicons dashicons-bank', |
|
| 70 | - 'dashicons dashicons-beer', |
|
| 71 | - 'dashicons dashicons-bell', |
|
| 72 | - 'dashicons dashicons-block-default', |
|
| 73 | - 'dashicons dashicons-book-alt', |
|
| 74 | - 'dashicons dashicons-book', |
|
| 75 | - 'dashicons dashicons-buddicons-activity', |
|
| 76 | - 'dashicons dashicons-buddicons-bbpress-logo', |
|
| 77 | - 'dashicons dashicons-buddicons-buddypress-logo', |
|
| 78 | - 'dashicons dashicons-buddicons-community', |
|
| 79 | - 'dashicons dashicons-buddicons-forums', |
|
| 80 | - 'dashicons dashicons-buddicons-friends', |
|
| 81 | - 'dashicons dashicons-buddicons-groups', |
|
| 82 | - 'dashicons dashicons-buddicons-pm', |
|
| 83 | - 'dashicons dashicons-buddicons-replies', |
|
| 84 | - 'dashicons dashicons-buddicons-topics', |
|
| 85 | - 'dashicons dashicons-buddicons-tracking', |
|
| 86 | - 'dashicons dashicons-building', |
|
| 87 | - 'dashicons dashicons-businessman', |
|
| 88 | - 'dashicons dashicons-businessperson', |
|
| 89 | - 'dashicons dashicons-businesswoman', |
|
| 90 | - 'dashicons dashicons-button', |
|
| 91 | - 'dashicons dashicons-calculator', |
|
| 92 | - 'dashicons dashicons-calendar-alt', |
|
| 93 | - 'dashicons dashicons-calendar', |
|
| 94 | - 'dashicons dashicons-camera-alt', |
|
| 95 | - 'dashicons dashicons-camera', |
|
| 96 | - 'dashicons dashicons-car', |
|
| 97 | - 'dashicons dashicons-carrot', |
|
| 98 | - 'dashicons dashicons-cart', |
|
| 99 | - 'dashicons dashicons-category', |
|
| 100 | - 'dashicons dashicons-chart-area', |
|
| 101 | - 'dashicons dashicons-chart-bar', |
|
| 102 | - 'dashicons dashicons-chart-line', |
|
| 103 | - 'dashicons dashicons-chart-pie', |
|
| 104 | - 'dashicons dashicons-clipboard', |
|
| 105 | - 'dashicons dashicons-clock', |
|
| 106 | - 'dashicons dashicons-cloud-saved', |
|
| 107 | - 'dashicons dashicons-cloud-upload', |
|
| 108 | - 'dashicons dashicons-cloud', |
|
| 109 | - 'dashicons dashicons-code-standards', |
|
| 110 | - 'dashicons dashicons-coffee', |
|
| 111 | - 'dashicons dashicons-color-picker', |
|
| 112 | - 'dashicons dashicons-columns', |
|
| 113 | - 'dashicons dashicons-controls-back', |
|
| 114 | - 'dashicons dashicons-controls-forward', |
|
| 115 | - 'dashicons dashicons-controls-pause', |
|
| 116 | - 'dashicons dashicons-controls-play', |
|
| 117 | - 'dashicons dashicons-controls-repeat', |
|
| 118 | - 'dashicons dashicons-controls-skipback', |
|
| 119 | - 'dashicons dashicons-controls-skipforward', |
|
| 120 | - 'dashicons dashicons-controls-volumeoff', |
|
| 121 | - 'dashicons dashicons-controls-volumeon', |
|
| 122 | - 'dashicons dashicons-cover-image', |
|
| 123 | - 'dashicons dashicons-dashboard', |
|
| 124 | - 'dashicons dashicons-database-add', |
|
| 125 | - 'dashicons dashicons-database-export', |
|
| 126 | - 'dashicons dashicons-database-import', |
|
| 127 | - 'dashicons dashicons-database-remove', |
|
| 128 | - 'dashicons dashicons-database-view', |
|
| 129 | - 'dashicons dashicons-database', |
|
| 130 | - 'dashicons dashicons-desktop', |
|
| 131 | - 'dashicons dashicons-dismiss', |
|
| 132 | - 'dashicons dashicons-download', |
|
| 133 | - 'dashicons dashicons-drumstick', |
|
| 134 | - 'dashicons dashicons-edit-large', |
|
| 135 | - 'dashicons dashicons-edit-page', |
|
| 136 | - 'dashicons dashicons-edit', |
|
| 137 | - 'dashicons dashicons-editor-aligncenter', |
|
| 138 | - 'dashicons dashicons-editor-alignleft', |
|
| 139 | - 'dashicons dashicons-editor-alignright', |
|
| 140 | - 'dashicons dashicons-editor-bold', |
|
| 141 | - 'dashicons dashicons-editor-break', |
|
| 142 | - 'dashicons dashicons-editor-code-duplicate', |
|
| 143 | - 'dashicons dashicons-editor-code', |
|
| 144 | - 'dashicons dashicons-editor-contract', |
|
| 145 | - 'dashicons dashicons-editor-customchar', |
|
| 146 | - 'dashicons dashicons-editor-expand', |
|
| 147 | - 'dashicons dashicons-editor-help', |
|
| 148 | - 'dashicons dashicons-editor-indent', |
|
| 149 | - 'dashicons dashicons-editor-insertmore', |
|
| 150 | - 'dashicons dashicons-editor-italic', |
|
| 151 | - 'dashicons dashicons-editor-justify', |
|
| 152 | - 'dashicons dashicons-editor-kitchensink', |
|
| 153 | - 'dashicons dashicons-editor-ltr', |
|
| 154 | - 'dashicons dashicons-editor-ol-rtl', |
|
| 155 | - 'dashicons dashicons-editor-ol', |
|
| 156 | - 'dashicons dashicons-editor-outdent', |
|
| 157 | - 'dashicons dashicons-editor-paragraph', |
|
| 158 | - 'dashicons dashicons-editor-paste-text', |
|
| 159 | - 'dashicons dashicons-editor-paste-word', |
|
| 160 | - 'dashicons dashicons-editor-quote', |
|
| 161 | - 'dashicons dashicons-editor-removeformatting', |
|
| 162 | - 'dashicons dashicons-editor-rtl', |
|
| 163 | - 'dashicons dashicons-editor-spellcheck', |
|
| 164 | - 'dashicons dashicons-editor-strikethrough', |
|
| 165 | - 'dashicons dashicons-editor-table', |
|
| 166 | - 'dashicons dashicons-editor-textcolor', |
|
| 167 | - 'dashicons dashicons-editor-ul', |
|
| 168 | - 'dashicons dashicons-editor-underline', |
|
| 169 | - 'dashicons dashicons-editor-unlink', |
|
| 170 | - 'dashicons dashicons-editor-video', |
|
| 171 | - 'dashicons dashicons-ellipsis', |
|
| 172 | - 'dashicons dashicons-email-alt', |
|
| 173 | - 'dashicons dashicons-email-alt2', |
|
| 174 | - 'dashicons dashicons-email', |
|
| 175 | - 'dashicons dashicons-embed-audio', |
|
| 176 | - 'dashicons dashicons-embed-generic', |
|
| 177 | - 'dashicons dashicons-embed-photo', |
|
| 178 | - 'dashicons dashicons-embed-post', |
|
| 179 | - 'dashicons dashicons-embed-video', |
|
| 180 | - 'dashicons dashicons-excerpt-view', |
|
| 181 | - 'dashicons dashicons-exit', |
|
| 182 | - 'dashicons dashicons-external', |
|
| 183 | - 'dashicons dashicons-facebook-alt', |
|
| 184 | - 'dashicons dashicons-facebook', |
|
| 185 | - 'dashicons dashicons-feedback', |
|
| 186 | - 'dashicons dashicons-filter', |
|
| 187 | - 'dashicons dashicons-flag', |
|
| 188 | - 'dashicons dashicons-food', |
|
| 189 | - 'dashicons dashicons-format-aside', |
|
| 190 | - 'dashicons dashicons-format-audio', |
|
| 191 | - 'dashicons dashicons-format-chat', |
|
| 192 | - 'dashicons dashicons-format-gallery', |
|
| 193 | - 'dashicons dashicons-format-image', |
|
| 194 | - 'dashicons dashicons-format-quote', |
|
| 195 | - 'dashicons dashicons-format-status', |
|
| 196 | - 'dashicons dashicons-format-video', |
|
| 197 | - 'dashicons dashicons-forms', |
|
| 198 | - 'dashicons dashicons-fullscreen-alt', |
|
| 199 | - 'dashicons dashicons-fullscreen-exit-alt', |
|
| 200 | - 'dashicons dashicons-games', |
|
| 201 | - 'dashicons dashicons-google', |
|
| 202 | - 'dashicons dashicons-googleplus', |
|
| 203 | - 'dashicons dashicons-grid-view', |
|
| 204 | - 'dashicons dashicons-groups', |
|
| 205 | - 'dashicons dashicons-hammer', |
|
| 206 | - 'dashicons dashicons-heading', |
|
| 207 | - 'dashicons dashicons-heart', |
|
| 208 | - 'dashicons dashicons-hidden', |
|
| 209 | - 'dashicons dashicons-hourglass', |
|
| 210 | - 'dashicons dashicons-html', |
|
| 211 | - 'dashicons dashicons-id-alt', |
|
| 212 | - 'dashicons dashicons-id', |
|
| 213 | - 'dashicons dashicons-image-crop', |
|
| 214 | - 'dashicons dashicons-image-filter', |
|
| 215 | - 'dashicons dashicons-image-flip-horizontal', |
|
| 216 | - 'dashicons dashicons-image-flip-vertical', |
|
| 217 | - 'dashicons dashicons-image-rotate-left', |
|
| 218 | - 'dashicons dashicons-image-rotate-right', |
|
| 219 | - 'dashicons dashicons-image-rotate', |
|
| 220 | - 'dashicons dashicons-images-alt', |
|
| 221 | - 'dashicons dashicons-images-alt2', |
|
| 222 | - 'dashicons dashicons-index-card', |
|
| 223 | - 'dashicons dashicons-info-outline', |
|
| 224 | - 'dashicons dashicons-info', |
|
| 225 | - 'dashicons dashicons-insert-after', |
|
| 226 | - 'dashicons dashicons-insert-before', |
|
| 227 | - 'dashicons dashicons-insert', |
|
| 228 | - 'dashicons dashicons-instagram', |
|
| 229 | - 'dashicons dashicons-laptop', |
|
| 230 | - 'dashicons dashicons-layout', |
|
| 231 | - 'dashicons dashicons-leftright', |
|
| 232 | - 'dashicons dashicons-lightbulb', |
|
| 233 | - 'dashicons dashicons-linkedin', |
|
| 234 | - 'dashicons dashicons-list-view', |
|
| 235 | - 'dashicons dashicons-location-alt', |
|
| 236 | - 'dashicons dashicons-location', |
|
| 237 | - 'dashicons dashicons-lock-duplicate', |
|
| 238 | - 'dashicons dashicons-lock', |
|
| 239 | - 'dashicons dashicons-marker', |
|
| 240 | - 'dashicons dashicons-media-archive', |
|
| 241 | - 'dashicons dashicons-media-audio', |
|
| 242 | - 'dashicons dashicons-media-code', |
|
| 243 | - 'dashicons dashicons-media-default', |
|
| 244 | - 'dashicons dashicons-media-document', |
|
| 245 | - 'dashicons dashicons-media-interactive', |
|
| 246 | - 'dashicons dashicons-media-spreadsheet', |
|
| 247 | - 'dashicons dashicons-media-text', |
|
| 248 | - 'dashicons dashicons-media-video', |
|
| 249 | - 'dashicons dashicons-megaphone', |
|
| 250 | - 'dashicons dashicons-menu-alt', |
|
| 251 | - 'dashicons dashicons-menu-alt2', |
|
| 252 | - 'dashicons dashicons-menu-alt3', |
|
| 253 | - 'dashicons dashicons-menu', |
|
| 254 | - 'dashicons dashicons-microphone', |
|
| 255 | - 'dashicons dashicons-migrate', |
|
| 256 | - 'dashicons dashicons-minus', |
|
| 257 | - 'dashicons dashicons-money-alt', |
|
| 258 | - 'dashicons dashicons-money', |
|
| 259 | - 'dashicons dashicons-move', |
|
| 260 | - 'dashicons dashicons-nametag', |
|
| 261 | - 'dashicons dashicons-networking', |
|
| 262 | - 'dashicons dashicons-no-alt', |
|
| 263 | - 'dashicons dashicons-no', |
|
| 264 | - 'dashicons dashicons-open-folder', |
|
| 265 | - 'dashicons dashicons-palmtree', |
|
| 266 | - 'dashicons dashicons-paperclip', |
|
| 267 | - 'dashicons dashicons-pdf', |
|
| 268 | - 'dashicons dashicons-performance', |
|
| 269 | - 'dashicons dashicons-pets', |
|
| 270 | - 'dashicons dashicons-phone', |
|
| 271 | - 'dashicons dashicons-pinterest', |
|
| 272 | - 'dashicons dashicons-playlist-audio', |
|
| 273 | - 'dashicons dashicons-playlist-video', |
|
| 274 | - 'dashicons dashicons-plugins-checked', |
|
| 275 | - 'dashicons dashicons-plus-alt', |
|
| 276 | - 'dashicons dashicons-plus-alt2', |
|
| 277 | - 'dashicons dashicons-plus', |
|
| 278 | - 'dashicons dashicons-podio', |
|
| 279 | - 'dashicons dashicons-portfolio', |
|
| 280 | - 'dashicons dashicons-post-status', |
|
| 281 | - 'dashicons dashicons-pressthis', |
|
| 282 | - 'dashicons dashicons-printer', |
|
| 283 | - 'dashicons dashicons-privacy', |
|
| 284 | - 'dashicons dashicons-products', |
|
| 285 | - 'dashicons dashicons-randomize', |
|
| 286 | - 'dashicons dashicons-reddit', |
|
| 287 | - 'dashicons dashicons-redo', |
|
| 288 | - 'dashicons dashicons-remove', |
|
| 289 | - 'dashicons dashicons-rest-api', |
|
| 290 | - 'dashicons dashicons-rss', |
|
| 291 | - 'dashicons dashicons-saved', |
|
| 292 | - 'dashicons dashicons-schedule', |
|
| 293 | - 'dashicons dashicons-screenoptions', |
|
| 294 | - 'dashicons dashicons-search', |
|
| 295 | - 'dashicons dashicons-share-alt', |
|
| 296 | - 'dashicons dashicons-share-alt2', |
|
| 297 | - 'dashicons dashicons-share', |
|
| 298 | - 'dashicons dashicons-shield-alt', |
|
| 299 | - 'dashicons dashicons-shield', |
|
| 300 | - 'dashicons dashicons-shortcode', |
|
| 301 | - 'dashicons dashicons-slides', |
|
| 302 | - 'dashicons dashicons-smartphone', |
|
| 303 | - 'dashicons dashicons-smiley', |
|
| 304 | - 'dashicons dashicons-sort', |
|
| 305 | - 'dashicons dashicons-sos', |
|
| 306 | - 'dashicons dashicons-spotify', |
|
| 307 | - 'dashicons dashicons-star-empty', |
|
| 308 | - 'dashicons dashicons-star-filled', |
|
| 309 | - 'dashicons dashicons-star-half', |
|
| 310 | - 'dashicons dashicons-sticky', |
|
| 311 | - 'dashicons dashicons-store', |
|
| 312 | - 'dashicons dashicons-superhero-alt', |
|
| 313 | - 'dashicons dashicons-superhero', |
|
| 314 | - 'dashicons dashicons-table-col-after', |
|
| 315 | - 'dashicons dashicons-table-col-before', |
|
| 316 | - 'dashicons dashicons-table-col-delete', |
|
| 317 | - 'dashicons dashicons-table-row-after', |
|
| 318 | - 'dashicons dashicons-table-row-before', |
|
| 319 | - 'dashicons dashicons-table-row-delete', |
|
| 320 | - 'dashicons dashicons-tablet', |
|
| 321 | - 'dashicons dashicons-tag', |
|
| 322 | - 'dashicons dashicons-tagcloud', |
|
| 323 | - 'dashicons dashicons-testimonial', |
|
| 324 | - 'dashicons dashicons-text-page', |
|
| 325 | - 'dashicons dashicons-text', |
|
| 326 | - 'dashicons dashicons-thumbs-down', |
|
| 327 | - 'dashicons dashicons-thumbs-up', |
|
| 328 | - 'dashicons dashicons-tickets-alt', |
|
| 329 | - 'dashicons dashicons-tickets', |
|
| 330 | - 'dashicons dashicons-tide', |
|
| 331 | - 'dashicons dashicons-translation', |
|
| 332 | - 'dashicons dashicons-trash', |
|
| 333 | - 'dashicons dashicons-twitch', |
|
| 334 | - 'dashicons dashicons-twitter-alt', |
|
| 335 | - 'dashicons dashicons-twitter', |
|
| 336 | - 'dashicons dashicons-undo', |
|
| 337 | - 'dashicons dashicons-universal-access-alt', |
|
| 338 | - 'dashicons dashicons-universal-access', |
|
| 339 | - 'dashicons dashicons-unlock', |
|
| 340 | - 'dashicons dashicons-update-alt', |
|
| 341 | - 'dashicons dashicons-update', |
|
| 342 | - 'dashicons dashicons-upload', |
|
| 343 | - 'dashicons dashicons-vault', |
|
| 344 | - 'dashicons dashicons-video-alt', |
|
| 345 | - 'dashicons dashicons-video-alt2', |
|
| 346 | - 'dashicons dashicons-video-alt3', |
|
| 347 | - 'dashicons dashicons-visibility', |
|
| 348 | - 'dashicons dashicons-warning', |
|
| 349 | - 'dashicons dashicons-welcome-add-page', |
|
| 350 | - 'dashicons dashicons-welcome-comments', |
|
| 351 | - 'dashicons dashicons-welcome-learn-more', |
|
| 352 | - 'dashicons dashicons-welcome-view-site', |
|
| 353 | - 'dashicons dashicons-welcome-widgets-menus', |
|
| 354 | - 'dashicons dashicons-welcome-write-blog', |
|
| 355 | - 'dashicons dashicons-whatsapp', |
|
| 356 | - 'dashicons dashicons-wordpress-alt', |
|
| 357 | - 'dashicons dashicons-wordpress', |
|
| 358 | - 'dashicons dashicons-xing', |
|
| 359 | - 'dashicons dashicons-yes-alt', |
|
| 360 | - 'dashicons dashicons-yes', |
|
| 361 | - 'dashicons dashicons-youtube', |
|
| 362 | - 'dashicons dashicons-editor-distractionfree', |
|
| 363 | - 'dashicons dashicons-exerpt-view', |
|
| 364 | - 'dashicons dashicons-format-links', |
|
| 365 | - 'dashicons dashicons-format-standard', |
|
| 366 | - 'dashicons dashicons-post-trash', |
|
| 367 | - 'dashicons dashicons-share1', |
|
| 368 | - 'dashicons dashicons-welcome-edit-page', |
|
| 369 | - ); |
|
| 19 | + return array( |
|
| 20 | + 'dashicons dashicons-admin-appearance', |
|
| 21 | + 'dashicons dashicons-admin-collapse', |
|
| 22 | + 'dashicons dashicons-admin-comments', |
|
| 23 | + 'dashicons dashicons-admin-customizer', |
|
| 24 | + 'dashicons dashicons-admin-generic', |
|
| 25 | + 'dashicons dashicons-admin-home', |
|
| 26 | + 'dashicons dashicons-admin-links', |
|
| 27 | + 'dashicons dashicons-admin-media', |
|
| 28 | + 'dashicons dashicons-admin-multisite', |
|
| 29 | + 'dashicons dashicons-admin-network', |
|
| 30 | + 'dashicons dashicons-admin-page', |
|
| 31 | + 'dashicons dashicons-admin-plugins', |
|
| 32 | + 'dashicons dashicons-admin-post', |
|
| 33 | + 'dashicons dashicons-admin-settings', |
|
| 34 | + 'dashicons dashicons-admin-site-alt', |
|
| 35 | + 'dashicons dashicons-admin-site-alt2', |
|
| 36 | + 'dashicons dashicons-admin-site-alt3', |
|
| 37 | + 'dashicons dashicons-admin-site', |
|
| 38 | + 'dashicons dashicons-admin-tools', |
|
| 39 | + 'dashicons dashicons-admin-users', |
|
| 40 | + 'dashicons dashicons-airplane', |
|
| 41 | + 'dashicons dashicons-album', |
|
| 42 | + 'dashicons dashicons-align-center', |
|
| 43 | + 'dashicons dashicons-align-full-width', |
|
| 44 | + 'dashicons dashicons-align-left', |
|
| 45 | + 'dashicons dashicons-align-none', |
|
| 46 | + 'dashicons dashicons-align-pull-left', |
|
| 47 | + 'dashicons dashicons-align-pull-right', |
|
| 48 | + 'dashicons dashicons-align-right', |
|
| 49 | + 'dashicons dashicons-align-wide', |
|
| 50 | + 'dashicons dashicons-amazon', |
|
| 51 | + 'dashicons dashicons-analytics', |
|
| 52 | + 'dashicons dashicons-archive', |
|
| 53 | + 'dashicons dashicons-arrow-down-alt', |
|
| 54 | + 'dashicons dashicons-arrow-down-alt2', |
|
| 55 | + 'dashicons dashicons-arrow-down', |
|
| 56 | + 'dashicons dashicons-arrow-left-alt', |
|
| 57 | + 'dashicons dashicons-arrow-left-alt2', |
|
| 58 | + 'dashicons dashicons-arrow-left', |
|
| 59 | + 'dashicons dashicons-arrow-right-alt', |
|
| 60 | + 'dashicons dashicons-arrow-right-alt2', |
|
| 61 | + 'dashicons dashicons-arrow-right', |
|
| 62 | + 'dashicons dashicons-arrow-up-alt', |
|
| 63 | + 'dashicons dashicons-arrow-up-alt2', |
|
| 64 | + 'dashicons dashicons-arrow-up-duplicate', |
|
| 65 | + 'dashicons dashicons-arrow-up', |
|
| 66 | + 'dashicons dashicons-art', |
|
| 67 | + 'dashicons dashicons-awards', |
|
| 68 | + 'dashicons dashicons-backup', |
|
| 69 | + 'dashicons dashicons-bank', |
|
| 70 | + 'dashicons dashicons-beer', |
|
| 71 | + 'dashicons dashicons-bell', |
|
| 72 | + 'dashicons dashicons-block-default', |
|
| 73 | + 'dashicons dashicons-book-alt', |
|
| 74 | + 'dashicons dashicons-book', |
|
| 75 | + 'dashicons dashicons-buddicons-activity', |
|
| 76 | + 'dashicons dashicons-buddicons-bbpress-logo', |
|
| 77 | + 'dashicons dashicons-buddicons-buddypress-logo', |
|
| 78 | + 'dashicons dashicons-buddicons-community', |
|
| 79 | + 'dashicons dashicons-buddicons-forums', |
|
| 80 | + 'dashicons dashicons-buddicons-friends', |
|
| 81 | + 'dashicons dashicons-buddicons-groups', |
|
| 82 | + 'dashicons dashicons-buddicons-pm', |
|
| 83 | + 'dashicons dashicons-buddicons-replies', |
|
| 84 | + 'dashicons dashicons-buddicons-topics', |
|
| 85 | + 'dashicons dashicons-buddicons-tracking', |
|
| 86 | + 'dashicons dashicons-building', |
|
| 87 | + 'dashicons dashicons-businessman', |
|
| 88 | + 'dashicons dashicons-businessperson', |
|
| 89 | + 'dashicons dashicons-businesswoman', |
|
| 90 | + 'dashicons dashicons-button', |
|
| 91 | + 'dashicons dashicons-calculator', |
|
| 92 | + 'dashicons dashicons-calendar-alt', |
|
| 93 | + 'dashicons dashicons-calendar', |
|
| 94 | + 'dashicons dashicons-camera-alt', |
|
| 95 | + 'dashicons dashicons-camera', |
|
| 96 | + 'dashicons dashicons-car', |
|
| 97 | + 'dashicons dashicons-carrot', |
|
| 98 | + 'dashicons dashicons-cart', |
|
| 99 | + 'dashicons dashicons-category', |
|
| 100 | + 'dashicons dashicons-chart-area', |
|
| 101 | + 'dashicons dashicons-chart-bar', |
|
| 102 | + 'dashicons dashicons-chart-line', |
|
| 103 | + 'dashicons dashicons-chart-pie', |
|
| 104 | + 'dashicons dashicons-clipboard', |
|
| 105 | + 'dashicons dashicons-clock', |
|
| 106 | + 'dashicons dashicons-cloud-saved', |
|
| 107 | + 'dashicons dashicons-cloud-upload', |
|
| 108 | + 'dashicons dashicons-cloud', |
|
| 109 | + 'dashicons dashicons-code-standards', |
|
| 110 | + 'dashicons dashicons-coffee', |
|
| 111 | + 'dashicons dashicons-color-picker', |
|
| 112 | + 'dashicons dashicons-columns', |
|
| 113 | + 'dashicons dashicons-controls-back', |
|
| 114 | + 'dashicons dashicons-controls-forward', |
|
| 115 | + 'dashicons dashicons-controls-pause', |
|
| 116 | + 'dashicons dashicons-controls-play', |
|
| 117 | + 'dashicons dashicons-controls-repeat', |
|
| 118 | + 'dashicons dashicons-controls-skipback', |
|
| 119 | + 'dashicons dashicons-controls-skipforward', |
|
| 120 | + 'dashicons dashicons-controls-volumeoff', |
|
| 121 | + 'dashicons dashicons-controls-volumeon', |
|
| 122 | + 'dashicons dashicons-cover-image', |
|
| 123 | + 'dashicons dashicons-dashboard', |
|
| 124 | + 'dashicons dashicons-database-add', |
|
| 125 | + 'dashicons dashicons-database-export', |
|
| 126 | + 'dashicons dashicons-database-import', |
|
| 127 | + 'dashicons dashicons-database-remove', |
|
| 128 | + 'dashicons dashicons-database-view', |
|
| 129 | + 'dashicons dashicons-database', |
|
| 130 | + 'dashicons dashicons-desktop', |
|
| 131 | + 'dashicons dashicons-dismiss', |
|
| 132 | + 'dashicons dashicons-download', |
|
| 133 | + 'dashicons dashicons-drumstick', |
|
| 134 | + 'dashicons dashicons-edit-large', |
|
| 135 | + 'dashicons dashicons-edit-page', |
|
| 136 | + 'dashicons dashicons-edit', |
|
| 137 | + 'dashicons dashicons-editor-aligncenter', |
|
| 138 | + 'dashicons dashicons-editor-alignleft', |
|
| 139 | + 'dashicons dashicons-editor-alignright', |
|
| 140 | + 'dashicons dashicons-editor-bold', |
|
| 141 | + 'dashicons dashicons-editor-break', |
|
| 142 | + 'dashicons dashicons-editor-code-duplicate', |
|
| 143 | + 'dashicons dashicons-editor-code', |
|
| 144 | + 'dashicons dashicons-editor-contract', |
|
| 145 | + 'dashicons dashicons-editor-customchar', |
|
| 146 | + 'dashicons dashicons-editor-expand', |
|
| 147 | + 'dashicons dashicons-editor-help', |
|
| 148 | + 'dashicons dashicons-editor-indent', |
|
| 149 | + 'dashicons dashicons-editor-insertmore', |
|
| 150 | + 'dashicons dashicons-editor-italic', |
|
| 151 | + 'dashicons dashicons-editor-justify', |
|
| 152 | + 'dashicons dashicons-editor-kitchensink', |
|
| 153 | + 'dashicons dashicons-editor-ltr', |
|
| 154 | + 'dashicons dashicons-editor-ol-rtl', |
|
| 155 | + 'dashicons dashicons-editor-ol', |
|
| 156 | + 'dashicons dashicons-editor-outdent', |
|
| 157 | + 'dashicons dashicons-editor-paragraph', |
|
| 158 | + 'dashicons dashicons-editor-paste-text', |
|
| 159 | + 'dashicons dashicons-editor-paste-word', |
|
| 160 | + 'dashicons dashicons-editor-quote', |
|
| 161 | + 'dashicons dashicons-editor-removeformatting', |
|
| 162 | + 'dashicons dashicons-editor-rtl', |
|
| 163 | + 'dashicons dashicons-editor-spellcheck', |
|
| 164 | + 'dashicons dashicons-editor-strikethrough', |
|
| 165 | + 'dashicons dashicons-editor-table', |
|
| 166 | + 'dashicons dashicons-editor-textcolor', |
|
| 167 | + 'dashicons dashicons-editor-ul', |
|
| 168 | + 'dashicons dashicons-editor-underline', |
|
| 169 | + 'dashicons dashicons-editor-unlink', |
|
| 170 | + 'dashicons dashicons-editor-video', |
|
| 171 | + 'dashicons dashicons-ellipsis', |
|
| 172 | + 'dashicons dashicons-email-alt', |
|
| 173 | + 'dashicons dashicons-email-alt2', |
|
| 174 | + 'dashicons dashicons-email', |
|
| 175 | + 'dashicons dashicons-embed-audio', |
|
| 176 | + 'dashicons dashicons-embed-generic', |
|
| 177 | + 'dashicons dashicons-embed-photo', |
|
| 178 | + 'dashicons dashicons-embed-post', |
|
| 179 | + 'dashicons dashicons-embed-video', |
|
| 180 | + 'dashicons dashicons-excerpt-view', |
|
| 181 | + 'dashicons dashicons-exit', |
|
| 182 | + 'dashicons dashicons-external', |
|
| 183 | + 'dashicons dashicons-facebook-alt', |
|
| 184 | + 'dashicons dashicons-facebook', |
|
| 185 | + 'dashicons dashicons-feedback', |
|
| 186 | + 'dashicons dashicons-filter', |
|
| 187 | + 'dashicons dashicons-flag', |
|
| 188 | + 'dashicons dashicons-food', |
|
| 189 | + 'dashicons dashicons-format-aside', |
|
| 190 | + 'dashicons dashicons-format-audio', |
|
| 191 | + 'dashicons dashicons-format-chat', |
|
| 192 | + 'dashicons dashicons-format-gallery', |
|
| 193 | + 'dashicons dashicons-format-image', |
|
| 194 | + 'dashicons dashicons-format-quote', |
|
| 195 | + 'dashicons dashicons-format-status', |
|
| 196 | + 'dashicons dashicons-format-video', |
|
| 197 | + 'dashicons dashicons-forms', |
|
| 198 | + 'dashicons dashicons-fullscreen-alt', |
|
| 199 | + 'dashicons dashicons-fullscreen-exit-alt', |
|
| 200 | + 'dashicons dashicons-games', |
|
| 201 | + 'dashicons dashicons-google', |
|
| 202 | + 'dashicons dashicons-googleplus', |
|
| 203 | + 'dashicons dashicons-grid-view', |
|
| 204 | + 'dashicons dashicons-groups', |
|
| 205 | + 'dashicons dashicons-hammer', |
|
| 206 | + 'dashicons dashicons-heading', |
|
| 207 | + 'dashicons dashicons-heart', |
|
| 208 | + 'dashicons dashicons-hidden', |
|
| 209 | + 'dashicons dashicons-hourglass', |
|
| 210 | + 'dashicons dashicons-html', |
|
| 211 | + 'dashicons dashicons-id-alt', |
|
| 212 | + 'dashicons dashicons-id', |
|
| 213 | + 'dashicons dashicons-image-crop', |
|
| 214 | + 'dashicons dashicons-image-filter', |
|
| 215 | + 'dashicons dashicons-image-flip-horizontal', |
|
| 216 | + 'dashicons dashicons-image-flip-vertical', |
|
| 217 | + 'dashicons dashicons-image-rotate-left', |
|
| 218 | + 'dashicons dashicons-image-rotate-right', |
|
| 219 | + 'dashicons dashicons-image-rotate', |
|
| 220 | + 'dashicons dashicons-images-alt', |
|
| 221 | + 'dashicons dashicons-images-alt2', |
|
| 222 | + 'dashicons dashicons-index-card', |
|
| 223 | + 'dashicons dashicons-info-outline', |
|
| 224 | + 'dashicons dashicons-info', |
|
| 225 | + 'dashicons dashicons-insert-after', |
|
| 226 | + 'dashicons dashicons-insert-before', |
|
| 227 | + 'dashicons dashicons-insert', |
|
| 228 | + 'dashicons dashicons-instagram', |
|
| 229 | + 'dashicons dashicons-laptop', |
|
| 230 | + 'dashicons dashicons-layout', |
|
| 231 | + 'dashicons dashicons-leftright', |
|
| 232 | + 'dashicons dashicons-lightbulb', |
|
| 233 | + 'dashicons dashicons-linkedin', |
|
| 234 | + 'dashicons dashicons-list-view', |
|
| 235 | + 'dashicons dashicons-location-alt', |
|
| 236 | + 'dashicons dashicons-location', |
|
| 237 | + 'dashicons dashicons-lock-duplicate', |
|
| 238 | + 'dashicons dashicons-lock', |
|
| 239 | + 'dashicons dashicons-marker', |
|
| 240 | + 'dashicons dashicons-media-archive', |
|
| 241 | + 'dashicons dashicons-media-audio', |
|
| 242 | + 'dashicons dashicons-media-code', |
|
| 243 | + 'dashicons dashicons-media-default', |
|
| 244 | + 'dashicons dashicons-media-document', |
|
| 245 | + 'dashicons dashicons-media-interactive', |
|
| 246 | + 'dashicons dashicons-media-spreadsheet', |
|
| 247 | + 'dashicons dashicons-media-text', |
|
| 248 | + 'dashicons dashicons-media-video', |
|
| 249 | + 'dashicons dashicons-megaphone', |
|
| 250 | + 'dashicons dashicons-menu-alt', |
|
| 251 | + 'dashicons dashicons-menu-alt2', |
|
| 252 | + 'dashicons dashicons-menu-alt3', |
|
| 253 | + 'dashicons dashicons-menu', |
|
| 254 | + 'dashicons dashicons-microphone', |
|
| 255 | + 'dashicons dashicons-migrate', |
|
| 256 | + 'dashicons dashicons-minus', |
|
| 257 | + 'dashicons dashicons-money-alt', |
|
| 258 | + 'dashicons dashicons-money', |
|
| 259 | + 'dashicons dashicons-move', |
|
| 260 | + 'dashicons dashicons-nametag', |
|
| 261 | + 'dashicons dashicons-networking', |
|
| 262 | + 'dashicons dashicons-no-alt', |
|
| 263 | + 'dashicons dashicons-no', |
|
| 264 | + 'dashicons dashicons-open-folder', |
|
| 265 | + 'dashicons dashicons-palmtree', |
|
| 266 | + 'dashicons dashicons-paperclip', |
|
| 267 | + 'dashicons dashicons-pdf', |
|
| 268 | + 'dashicons dashicons-performance', |
|
| 269 | + 'dashicons dashicons-pets', |
|
| 270 | + 'dashicons dashicons-phone', |
|
| 271 | + 'dashicons dashicons-pinterest', |
|
| 272 | + 'dashicons dashicons-playlist-audio', |
|
| 273 | + 'dashicons dashicons-playlist-video', |
|
| 274 | + 'dashicons dashicons-plugins-checked', |
|
| 275 | + 'dashicons dashicons-plus-alt', |
|
| 276 | + 'dashicons dashicons-plus-alt2', |
|
| 277 | + 'dashicons dashicons-plus', |
|
| 278 | + 'dashicons dashicons-podio', |
|
| 279 | + 'dashicons dashicons-portfolio', |
|
| 280 | + 'dashicons dashicons-post-status', |
|
| 281 | + 'dashicons dashicons-pressthis', |
|
| 282 | + 'dashicons dashicons-printer', |
|
| 283 | + 'dashicons dashicons-privacy', |
|
| 284 | + 'dashicons dashicons-products', |
|
| 285 | + 'dashicons dashicons-randomize', |
|
| 286 | + 'dashicons dashicons-reddit', |
|
| 287 | + 'dashicons dashicons-redo', |
|
| 288 | + 'dashicons dashicons-remove', |
|
| 289 | + 'dashicons dashicons-rest-api', |
|
| 290 | + 'dashicons dashicons-rss', |
|
| 291 | + 'dashicons dashicons-saved', |
|
| 292 | + 'dashicons dashicons-schedule', |
|
| 293 | + 'dashicons dashicons-screenoptions', |
|
| 294 | + 'dashicons dashicons-search', |
|
| 295 | + 'dashicons dashicons-share-alt', |
|
| 296 | + 'dashicons dashicons-share-alt2', |
|
| 297 | + 'dashicons dashicons-share', |
|
| 298 | + 'dashicons dashicons-shield-alt', |
|
| 299 | + 'dashicons dashicons-shield', |
|
| 300 | + 'dashicons dashicons-shortcode', |
|
| 301 | + 'dashicons dashicons-slides', |
|
| 302 | + 'dashicons dashicons-smartphone', |
|
| 303 | + 'dashicons dashicons-smiley', |
|
| 304 | + 'dashicons dashicons-sort', |
|
| 305 | + 'dashicons dashicons-sos', |
|
| 306 | + 'dashicons dashicons-spotify', |
|
| 307 | + 'dashicons dashicons-star-empty', |
|
| 308 | + 'dashicons dashicons-star-filled', |
|
| 309 | + 'dashicons dashicons-star-half', |
|
| 310 | + 'dashicons dashicons-sticky', |
|
| 311 | + 'dashicons dashicons-store', |
|
| 312 | + 'dashicons dashicons-superhero-alt', |
|
| 313 | + 'dashicons dashicons-superhero', |
|
| 314 | + 'dashicons dashicons-table-col-after', |
|
| 315 | + 'dashicons dashicons-table-col-before', |
|
| 316 | + 'dashicons dashicons-table-col-delete', |
|
| 317 | + 'dashicons dashicons-table-row-after', |
|
| 318 | + 'dashicons dashicons-table-row-before', |
|
| 319 | + 'dashicons dashicons-table-row-delete', |
|
| 320 | + 'dashicons dashicons-tablet', |
|
| 321 | + 'dashicons dashicons-tag', |
|
| 322 | + 'dashicons dashicons-tagcloud', |
|
| 323 | + 'dashicons dashicons-testimonial', |
|
| 324 | + 'dashicons dashicons-text-page', |
|
| 325 | + 'dashicons dashicons-text', |
|
| 326 | + 'dashicons dashicons-thumbs-down', |
|
| 327 | + 'dashicons dashicons-thumbs-up', |
|
| 328 | + 'dashicons dashicons-tickets-alt', |
|
| 329 | + 'dashicons dashicons-tickets', |
|
| 330 | + 'dashicons dashicons-tide', |
|
| 331 | + 'dashicons dashicons-translation', |
|
| 332 | + 'dashicons dashicons-trash', |
|
| 333 | + 'dashicons dashicons-twitch', |
|
| 334 | + 'dashicons dashicons-twitter-alt', |
|
| 335 | + 'dashicons dashicons-twitter', |
|
| 336 | + 'dashicons dashicons-undo', |
|
| 337 | + 'dashicons dashicons-universal-access-alt', |
|
| 338 | + 'dashicons dashicons-universal-access', |
|
| 339 | + 'dashicons dashicons-unlock', |
|
| 340 | + 'dashicons dashicons-update-alt', |
|
| 341 | + 'dashicons dashicons-update', |
|
| 342 | + 'dashicons dashicons-upload', |
|
| 343 | + 'dashicons dashicons-vault', |
|
| 344 | + 'dashicons dashicons-video-alt', |
|
| 345 | + 'dashicons dashicons-video-alt2', |
|
| 346 | + 'dashicons dashicons-video-alt3', |
|
| 347 | + 'dashicons dashicons-visibility', |
|
| 348 | + 'dashicons dashicons-warning', |
|
| 349 | + 'dashicons dashicons-welcome-add-page', |
|
| 350 | + 'dashicons dashicons-welcome-comments', |
|
| 351 | + 'dashicons dashicons-welcome-learn-more', |
|
| 352 | + 'dashicons dashicons-welcome-view-site', |
|
| 353 | + 'dashicons dashicons-welcome-widgets-menus', |
|
| 354 | + 'dashicons dashicons-welcome-write-blog', |
|
| 355 | + 'dashicons dashicons-whatsapp', |
|
| 356 | + 'dashicons dashicons-wordpress-alt', |
|
| 357 | + 'dashicons dashicons-wordpress', |
|
| 358 | + 'dashicons dashicons-xing', |
|
| 359 | + 'dashicons dashicons-yes-alt', |
|
| 360 | + 'dashicons dashicons-yes', |
|
| 361 | + 'dashicons dashicons-youtube', |
|
| 362 | + 'dashicons dashicons-editor-distractionfree', |
|
| 363 | + 'dashicons dashicons-exerpt-view', |
|
| 364 | + 'dashicons dashicons-format-links', |
|
| 365 | + 'dashicons dashicons-format-standard', |
|
| 366 | + 'dashicons dashicons-post-trash', |
|
| 367 | + 'dashicons dashicons-share1', |
|
| 368 | + 'dashicons dashicons-welcome-edit-page', |
|
| 369 | + ); |
|
| 370 | 370 | } |
@@ -11,126 +11,126 @@ |
||
| 11 | 11 | |
| 12 | 12 | if ( ! class_exists( 'Redux_Js_Button' ) ) { |
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Main ReduxFramework_Js_Button class |
|
| 16 | - * |
|
| 17 | - * @since 1.0.0 |
|
| 18 | - */ |
|
| 19 | - class Redux_Js_Button extends Redux_Field { |
|
| 20 | - |
|
| 21 | - /** |
|
| 22 | - * Field Render Function. |
|
| 23 | - * Takes the vars and outputs the HTML for the field in the settings |
|
| 24 | - * |
|
| 25 | - * @since 1.0.0 |
|
| 26 | - * @access public |
|
| 27 | - * @return void |
|
| 28 | - */ |
|
| 29 | - public function render() { |
|
| 30 | - $field_id = $this->field['id']; |
|
| 31 | - |
|
| 32 | - // primary container. |
|
| 33 | - echo '<div |
|
| 14 | + /** |
|
| 15 | + * Main ReduxFramework_Js_Button class |
|
| 16 | + * |
|
| 17 | + * @since 1.0.0 |
|
| 18 | + */ |
|
| 19 | + class Redux_Js_Button extends Redux_Field { |
|
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * Field Render Function. |
|
| 23 | + * Takes the vars and outputs the HTML for the field in the settings |
|
| 24 | + * |
|
| 25 | + * @since 1.0.0 |
|
| 26 | + * @access public |
|
| 27 | + * @return void |
|
| 28 | + */ |
|
| 29 | + public function render() { |
|
| 30 | + $field_id = $this->field['id']; |
|
| 31 | + |
|
| 32 | + // primary container. |
|
| 33 | + echo '<div |
|
| 34 | 34 | class="redux-js-button-container ' . esc_attr( $this->field['class'] ) . '" |
| 35 | 35 | id="' . esc_attr( $field_id ) . '_container" |
| 36 | 36 | data-id="' . esc_attr( $field_id ) . '" |
| 37 | 37 | style="width: 0px;" |
| 38 | 38 | >'; |
| 39 | 39 | |
| 40 | - // Button render. |
|
| 41 | - if ( isset( $this->field['buttons'] ) && is_array( $this->field['buttons'] ) ) { |
|
| 42 | - echo '<div |
|
| 40 | + // Button render. |
|
| 41 | + if ( isset( $this->field['buttons'] ) && is_array( $this->field['buttons'] ) ) { |
|
| 42 | + echo '<div |
|
| 43 | 43 | class="redux-js-button-button-container" |
| 44 | 44 | id="redux-js-button-button-container" |
| 45 | 45 | style="display: inline-flex;" |
| 46 | 46 | >'; |
| 47 | 47 | |
| 48 | - foreach ( $this->field['buttons'] as $idx => $arr ) { |
|
| 49 | - $button_text = $arr['text']; |
|
| 50 | - $button_class = $arr['class']; |
|
| 51 | - $button_func = $arr['function']; |
|
| 48 | + foreach ( $this->field['buttons'] as $idx => $arr ) { |
|
| 49 | + $button_text = $arr['text']; |
|
| 50 | + $button_class = $arr['class']; |
|
| 51 | + $button_func = $arr['function']; |
|
| 52 | 52 | |
| 53 | - echo '<input |
|
| 53 | + echo '<input |
|
| 54 | 54 | id="' . esc_attr( $field_id ) . '_input-' . intval( $idx ) . '" |
| 55 | 55 | class="hide-if-no-js button ' . esc_attr( $button_class ) . '" |
| 56 | 56 | type="button" |
| 57 | 57 | data-function="' . esc_attr( $button_func ) . '" |
| 58 | 58 | value="' . esc_attr( $button_text ) . '" |
| 59 | 59 | /> '; |
| 60 | - } |
|
| 61 | - |
|
| 62 | - echo '</div>'; |
|
| 63 | - } |
|
| 64 | - |
|
| 65 | - // Close container. |
|
| 66 | - echo '</div>'; |
|
| 67 | - } |
|
| 68 | - |
|
| 69 | - |
|
| 70 | - /** |
|
| 71 | - * Do enqueue for every field instance. |
|
| 72 | - * |
|
| 73 | - * @return void |
|
| 74 | - */ |
|
| 75 | - public function always_enqueue() { |
|
| 76 | - // Make sure script data exists first. |
|
| 77 | - if ( isset( $this->field['script'] ) && ! empty( $this->field['script'] ) ) { |
|
| 78 | - |
|
| 79 | - // URI location of script to enqueue. |
|
| 80 | - $script_url = $this->field['script']['url'] ?? ''; |
|
| 81 | - |
|
| 82 | - // Get deps, if any. |
|
| 83 | - $script_dep = $this->field['script']['dep'] ?? array(); |
|
| 84 | - |
|
| 85 | - // Get ver, if any. |
|
| 86 | - $script_ver = $this->field['script']['ver'] ?? time(); |
|
| 87 | - |
|
| 88 | - // Script location in HTML. |
|
| 89 | - $script_footer = $this->field['script']['in_footer'] ?? true; |
|
| 90 | - |
|
| 91 | - // If a script exists, enqueue it. |
|
| 92 | - if ( '' !== $script_url ) { |
|
| 93 | - wp_enqueue_script( |
|
| 94 | - 'redux-js-button-' . $this->field['id'], |
|
| 95 | - $script_url, |
|
| 96 | - $script_dep, |
|
| 97 | - $script_ver, |
|
| 98 | - $script_footer |
|
| 99 | - ); |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - if ( isset( $this->field['enqueue_ajax'] ) && $this->field['enqueue_ajax'] ) { |
|
| 103 | - wp_localize_script( |
|
| 104 | - 'redux-js-button-' . $this->field['id'], |
|
| 105 | - 'redux_ajax_script', |
|
| 106 | - array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) |
|
| 107 | - ); |
|
| 108 | - } |
|
| 109 | - } |
|
| 110 | - } |
|
| 111 | - |
|
| 112 | - /** |
|
| 113 | - * Enqueue Function. |
|
| 114 | - * If this field requires any scripts, or css define this function and register/enqueue the scripts/css |
|
| 115 | - * |
|
| 116 | - * @since 1.0.0 |
|
| 117 | - * @access public |
|
| 118 | - * @return void |
|
| 119 | - */ |
|
| 120 | - public function enqueue() { |
|
| 121 | - |
|
| 122 | - // Set up min files for dev_mode = false. |
|
| 123 | - $min = Redux_Functions::isMin(); |
|
| 124 | - |
|
| 125 | - // Field dependent JS. |
|
| 126 | - wp_enqueue_script( |
|
| 127 | - 'redux-field-js-button', |
|
| 128 | - // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 129 | - apply_filters( "redux/js_button/{$this->parent->args['opt_name']}/enqueue/redux-field-js-button-js", $this->url . 'redux-js-button' . $min . '.js' ), |
|
| 130 | - array( 'jquery' ), |
|
| 131 | - Redux_Extension_Js_Button::$version, |
|
| 132 | - true |
|
| 133 | - ); |
|
| 134 | - } |
|
| 135 | - } |
|
| 60 | + } |
|
| 61 | + |
|
| 62 | + echo '</div>'; |
|
| 63 | + } |
|
| 64 | + |
|
| 65 | + // Close container. |
|
| 66 | + echo '</div>'; |
|
| 67 | + } |
|
| 68 | + |
|
| 69 | + |
|
| 70 | + /** |
|
| 71 | + * Do enqueue for every field instance. |
|
| 72 | + * |
|
| 73 | + * @return void |
|
| 74 | + */ |
|
| 75 | + public function always_enqueue() { |
|
| 76 | + // Make sure script data exists first. |
|
| 77 | + if ( isset( $this->field['script'] ) && ! empty( $this->field['script'] ) ) { |
|
| 78 | + |
|
| 79 | + // URI location of script to enqueue. |
|
| 80 | + $script_url = $this->field['script']['url'] ?? ''; |
|
| 81 | + |
|
| 82 | + // Get deps, if any. |
|
| 83 | + $script_dep = $this->field['script']['dep'] ?? array(); |
|
| 84 | + |
|
| 85 | + // Get ver, if any. |
|
| 86 | + $script_ver = $this->field['script']['ver'] ?? time(); |
|
| 87 | + |
|
| 88 | + // Script location in HTML. |
|
| 89 | + $script_footer = $this->field['script']['in_footer'] ?? true; |
|
| 90 | + |
|
| 91 | + // If a script exists, enqueue it. |
|
| 92 | + if ( '' !== $script_url ) { |
|
| 93 | + wp_enqueue_script( |
|
| 94 | + 'redux-js-button-' . $this->field['id'], |
|
| 95 | + $script_url, |
|
| 96 | + $script_dep, |
|
| 97 | + $script_ver, |
|
| 98 | + $script_footer |
|
| 99 | + ); |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + if ( isset( $this->field['enqueue_ajax'] ) && $this->field['enqueue_ajax'] ) { |
|
| 103 | + wp_localize_script( |
|
| 104 | + 'redux-js-button-' . $this->field['id'], |
|
| 105 | + 'redux_ajax_script', |
|
| 106 | + array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) |
|
| 107 | + ); |
|
| 108 | + } |
|
| 109 | + } |
|
| 110 | + } |
|
| 111 | + |
|
| 112 | + /** |
|
| 113 | + * Enqueue Function. |
|
| 114 | + * If this field requires any scripts, or css define this function and register/enqueue the scripts/css |
|
| 115 | + * |
|
| 116 | + * @since 1.0.0 |
|
| 117 | + * @access public |
|
| 118 | + * @return void |
|
| 119 | + */ |
|
| 120 | + public function enqueue() { |
|
| 121 | + |
|
| 122 | + // Set up min files for dev_mode = false. |
|
| 123 | + $min = Redux_Functions::isMin(); |
|
| 124 | + |
|
| 125 | + // Field dependent JS. |
|
| 126 | + wp_enqueue_script( |
|
| 127 | + 'redux-field-js-button', |
|
| 128 | + // phpcs:ignore WordPress.NamingConventions.ValidHookName |
|
| 129 | + apply_filters( "redux/js_button/{$this->parent->args['opt_name']}/enqueue/redux-field-js-button-js", $this->url . 'redux-js-button' . $min . '.js' ), |
|
| 130 | + array( 'jquery' ), |
|
| 131 | + Redux_Extension_Js_Button::$version, |
|
| 132 | + true |
|
| 133 | + ); |
|
| 134 | + } |
|
| 135 | + } |
|
| 136 | 136 | } |
@@ -12,76 +12,76 @@ discard block |
||
| 12 | 12 | // Don't duplicate me! |
| 13 | 13 | if ( ! class_exists( 'Redux_Section', false ) ) { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Main Redux_heading class |
|
| 17 | - * |
|
| 18 | - * @since 1.0.0 |
|
| 19 | - */ |
|
| 20 | - class Redux_Section extends Redux_Field { |
|
| 21 | - |
|
| 22 | - /** |
|
| 23 | - * Set field and value defaults. |
|
| 24 | - */ |
|
| 25 | - public function set_defaults() { |
|
| 26 | - // No errors please. |
|
| 27 | - $defaults = array( |
|
| 28 | - 'indent' => true, |
|
| 29 | - 'style' => '', |
|
| 30 | - 'class' => '', |
|
| 31 | - 'title' => '', |
|
| 32 | - 'subtitle' => '', |
|
| 33 | - ); |
|
| 34 | - |
|
| 35 | - $this->field = wp_parse_args( $this->field, $defaults ); |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - /** |
|
| 39 | - * Field Render Function. |
|
| 40 | - * Takes the vars and outputs the HTML for the field in the settings |
|
| 41 | - * |
|
| 42 | - * @since 1.0.0 |
|
| 43 | - * @access public |
|
| 44 | - * @return void |
|
| 45 | - */ |
|
| 46 | - public function render() { |
|
| 47 | - $guid = uniqid(); |
|
| 48 | - |
|
| 49 | - if ( true === $this->field['indent'] ) { |
|
| 50 | - $this->field['class'] .= ' redux-section-indent-start'; |
|
| 51 | - } |
|
| 52 | - |
|
| 53 | - $add_class = ''; |
|
| 54 | - if ( isset( $this->field['indent'] ) && true === $this->field['indent'] ) { |
|
| 55 | - $add_class = ' form-table-section-indented'; |
|
| 56 | - } elseif ( ! isset( $this->field['indent'] ) || ( isset( $this->field['indent'] ) && false !== $this->field['indent'] ) ) { |
|
| 57 | - $add_class = ' hide'; |
|
| 58 | - } |
|
| 59 | - |
|
| 60 | - echo '<input type="hidden" id="' . esc_attr( $this->field['id'] ) . '-marker"></td></tr></table>'; |
|
| 61 | - |
|
| 62 | - if ( isset( $this->field['indent'] ) && true === $this->field['indent'] ) { |
|
| 63 | - echo '<div class="indent-section-container">'; |
|
| 64 | - } |
|
| 65 | - |
|
| 66 | - echo '<div id="section-' . esc_attr( $this->field['id'] ) . '" class="redux-section-field redux-field ' . esc_attr( $this->field['style'] ) . ' ' . esc_attr( $this->field['class'] ) . ' ">'; |
|
| 67 | - |
|
| 68 | - if ( ! empty( $this->field['title'] ) ) { |
|
| 69 | - echo '<h3>' . wp_kses_post( $this->field['title'] ) . '</h3>'; |
|
| 70 | - } |
|
| 71 | - |
|
| 72 | - if ( ! empty( $this->field['subtitle'] ) ) { |
|
| 73 | - echo '<div class="redux-section-desc">' . wp_kses_post( $this->field['subtitle'] ) . '</div>'; |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - echo '</div>'; |
|
| 77 | - |
|
| 78 | - if ( isset( $this->field['indent'] ) && true === $this->field['indent'] ) { |
|
| 79 | - echo '</div>'; |
|
| 80 | - } |
|
| 81 | - |
|
| 82 | - echo '<table id="section-table-' . esc_attr( $this->field['id'] ) . '" data-id="' . esc_attr( $this->field['id'] ) . '" class="form-table form-table-section no-border' . esc_attr( $add_class ) . '"><tbody><tr><th></th><td id="' . esc_attr( $guid ) . '">'; |
|
| 83 | - |
|
| 84 | - ?> |
|
| 15 | + /** |
|
| 16 | + * Main Redux_heading class |
|
| 17 | + * |
|
| 18 | + * @since 1.0.0 |
|
| 19 | + */ |
|
| 20 | + class Redux_Section extends Redux_Field { |
|
| 21 | + |
|
| 22 | + /** |
|
| 23 | + * Set field and value defaults. |
|
| 24 | + */ |
|
| 25 | + public function set_defaults() { |
|
| 26 | + // No errors please. |
|
| 27 | + $defaults = array( |
|
| 28 | + 'indent' => true, |
|
| 29 | + 'style' => '', |
|
| 30 | + 'class' => '', |
|
| 31 | + 'title' => '', |
|
| 32 | + 'subtitle' => '', |
|
| 33 | + ); |
|
| 34 | + |
|
| 35 | + $this->field = wp_parse_args( $this->field, $defaults ); |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + /** |
|
| 39 | + * Field Render Function. |
|
| 40 | + * Takes the vars and outputs the HTML for the field in the settings |
|
| 41 | + * |
|
| 42 | + * @since 1.0.0 |
|
| 43 | + * @access public |
|
| 44 | + * @return void |
|
| 45 | + */ |
|
| 46 | + public function render() { |
|
| 47 | + $guid = uniqid(); |
|
| 48 | + |
|
| 49 | + if ( true === $this->field['indent'] ) { |
|
| 50 | + $this->field['class'] .= ' redux-section-indent-start'; |
|
| 51 | + } |
|
| 52 | + |
|
| 53 | + $add_class = ''; |
|
| 54 | + if ( isset( $this->field['indent'] ) && true === $this->field['indent'] ) { |
|
| 55 | + $add_class = ' form-table-section-indented'; |
|
| 56 | + } elseif ( ! isset( $this->field['indent'] ) || ( isset( $this->field['indent'] ) && false !== $this->field['indent'] ) ) { |
|
| 57 | + $add_class = ' hide'; |
|
| 58 | + } |
|
| 59 | + |
|
| 60 | + echo '<input type="hidden" id="' . esc_attr( $this->field['id'] ) . '-marker"></td></tr></table>'; |
|
| 61 | + |
|
| 62 | + if ( isset( $this->field['indent'] ) && true === $this->field['indent'] ) { |
|
| 63 | + echo '<div class="indent-section-container">'; |
|
| 64 | + } |
|
| 65 | + |
|
| 66 | + echo '<div id="section-' . esc_attr( $this->field['id'] ) . '" class="redux-section-field redux-field ' . esc_attr( $this->field['style'] ) . ' ' . esc_attr( $this->field['class'] ) . ' ">'; |
|
| 67 | + |
|
| 68 | + if ( ! empty( $this->field['title'] ) ) { |
|
| 69 | + echo '<h3>' . wp_kses_post( $this->field['title'] ) . '</h3>'; |
|
| 70 | + } |
|
| 71 | + |
|
| 72 | + if ( ! empty( $this->field['subtitle'] ) ) { |
|
| 73 | + echo '<div class="redux-section-desc">' . wp_kses_post( $this->field['subtitle'] ) . '</div>'; |
|
| 74 | + } |
|
| 75 | + |
|
| 76 | + echo '</div>'; |
|
| 77 | + |
|
| 78 | + if ( isset( $this->field['indent'] ) && true === $this->field['indent'] ) { |
|
| 79 | + echo '</div>'; |
|
| 80 | + } |
|
| 81 | + |
|
| 82 | + echo '<table id="section-table-' . esc_attr( $this->field['id'] ) . '" data-id="' . esc_attr( $this->field['id'] ) . '" class="form-table form-table-section no-border' . esc_attr( $add_class ) . '"><tbody><tr><th></th><td id="' . esc_attr( $guid ) . '">'; |
|
| 83 | + |
|
| 84 | + ?> |
|
| 85 | 85 | <script type="text/javascript"> |
| 86 | 86 | jQuery( document ).ready( |
| 87 | 87 | function() { |
@@ -107,22 +107,22 @@ discard block |
||
| 107 | 107 | ); |
| 108 | 108 | </script> |
| 109 | 109 | <?php |
| 110 | - } |
|
| 111 | - |
|
| 112 | - /** |
|
| 113 | - * Enqueue Script and styles. |
|
| 114 | - */ |
|
| 115 | - public function enqueue() { |
|
| 116 | - if ( $this->parent->args['dev_mode'] ) { |
|
| 117 | - wp_enqueue_style( |
|
| 118 | - 'redux-field-section', |
|
| 119 | - Redux_Core::$url . 'inc/fields/section/redux-section.css', |
|
| 120 | - array(), |
|
| 121 | - $this->timestamp |
|
| 122 | - ); |
|
| 123 | - } |
|
| 124 | - } |
|
| 125 | - } |
|
| 110 | + } |
|
| 111 | + |
|
| 112 | + /** |
|
| 113 | + * Enqueue Script and styles. |
|
| 114 | + */ |
|
| 115 | + public function enqueue() { |
|
| 116 | + if ( $this->parent->args['dev_mode'] ) { |
|
| 117 | + wp_enqueue_style( |
|
| 118 | + 'redux-field-section', |
|
| 119 | + Redux_Core::$url . 'inc/fields/section/redux-section.css', |
|
| 120 | + array(), |
|
| 121 | + $this->timestamp |
|
| 122 | + ); |
|
| 123 | + } |
|
| 124 | + } |
|
| 125 | + } |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | class_alias( 'Redux_Section', 'ReduxFramework_Section' ); |
@@ -12,144 +12,144 @@ |
||
| 12 | 12 | // Don't duplicate me! |
| 13 | 13 | if ( ! class_exists( 'Redux_Info', false ) ) { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Main Redux_info class |
|
| 17 | - * |
|
| 18 | - * @since 1.0.0 |
|
| 19 | - */ |
|
| 20 | - class Redux_Info extends Redux_Field { |
|
| 21 | - |
|
| 22 | - /** |
|
| 23 | - * Set field and value defaults. |
|
| 24 | - */ |
|
| 25 | - public function set_defaults() { |
|
| 26 | - $defaults = array( |
|
| 27 | - 'title' => '', |
|
| 28 | - 'desc' => '', |
|
| 29 | - 'indent' => false, |
|
| 30 | - 'notice' => true, |
|
| 31 | - 'style' => '', |
|
| 32 | - 'color' => '', |
|
| 33 | - ); |
|
| 34 | - |
|
| 35 | - $this->field = wp_parse_args( $this->field, $defaults ); |
|
| 36 | - } |
|
| 37 | - |
|
| 38 | - /** |
|
| 39 | - * Field Render Function. |
|
| 40 | - * Takes the vars and outputs the HTML for the field in the settings |
|
| 41 | - * |
|
| 42 | - * @since 1.0.0 |
|
| 43 | - * @access public |
|
| 44 | - * @return void |
|
| 45 | - */ |
|
| 46 | - public function render() { |
|
| 47 | - $styles = array( |
|
| 48 | - 'normal', |
|
| 49 | - 'info', |
|
| 50 | - 'warning', |
|
| 51 | - 'success', |
|
| 52 | - 'critical', |
|
| 53 | - 'custom', |
|
| 54 | - ); |
|
| 55 | - |
|
| 56 | - if ( ! in_array( $this->field['style'], $styles, true ) ) { |
|
| 57 | - $this->field['style'] = 'normal'; |
|
| 58 | - } |
|
| 59 | - |
|
| 60 | - if ( 'custom' === $this->field['style'] ) { |
|
| 61 | - if ( ! empty( $this->field['color'] ) ) { |
|
| 62 | - $this->field['color'] = 'border-color:' . $this->field['color'] . ';'; |
|
| 63 | - } else { |
|
| 64 | - $this->field['style'] = 'normal'; |
|
| 65 | - $this->field['color'] = ''; |
|
| 66 | - } |
|
| 67 | - } else { |
|
| 68 | - $this->field['color'] = ''; |
|
| 69 | - } |
|
| 70 | - |
|
| 71 | - if ( empty( $this->field['desc'] ) && ! empty( $this->field['default'] ) ) { |
|
| 72 | - $this->field['desc'] = $this->field['default']; |
|
| 73 | - unset( $this->field['default'] ); |
|
| 74 | - } |
|
| 75 | - |
|
| 76 | - if ( empty( $this->field['desc'] ) && ! empty( $this->field['subtitle'] ) ) { |
|
| 77 | - $this->field['desc'] = $this->field['subtitle']; |
|
| 78 | - unset( $this->field['subtitle'] ); |
|
| 79 | - } |
|
| 80 | - |
|
| 81 | - if ( empty( $this->field['desc'] ) ) { |
|
| 82 | - $this->field['desc'] = ''; |
|
| 83 | - } |
|
| 84 | - |
|
| 85 | - if ( empty( $this->field['raw_html'] ) ) { |
|
| 86 | - if ( true === $this->field['notice'] ) { |
|
| 87 | - $this->field['class'] .= ' redux-notice-field'; |
|
| 88 | - } else { |
|
| 89 | - $this->field['class'] .= ' redux-info-field'; |
|
| 90 | - } |
|
| 91 | - |
|
| 92 | - $this->field['style'] = 'redux-' . $this->field['style'] . ' '; |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - // Old shim, deprecated arg. |
|
| 96 | - if ( isset( $this->field['sectionIndent'] ) ) { |
|
| 97 | - $this->field['indent'] = $this->field['sectionIndent']; |
|
| 98 | - } |
|
| 99 | - $indent = ( isset( $this->field['indent'] ) && $this->field['indent'] ) ? ' form-table-section-indented' : ''; |
|
| 100 | - |
|
| 101 | - echo '</td></tr></table>'; |
|
| 102 | - echo '<div |
|
| 15 | + /** |
|
| 16 | + * Main Redux_info class |
|
| 17 | + * |
|
| 18 | + * @since 1.0.0 |
|
| 19 | + */ |
|
| 20 | + class Redux_Info extends Redux_Field { |
|
| 21 | + |
|
| 22 | + /** |
|
| 23 | + * Set field and value defaults. |
|
| 24 | + */ |
|
| 25 | + public function set_defaults() { |
|
| 26 | + $defaults = array( |
|
| 27 | + 'title' => '', |
|
| 28 | + 'desc' => '', |
|
| 29 | + 'indent' => false, |
|
| 30 | + 'notice' => true, |
|
| 31 | + 'style' => '', |
|
| 32 | + 'color' => '', |
|
| 33 | + ); |
|
| 34 | + |
|
| 35 | + $this->field = wp_parse_args( $this->field, $defaults ); |
|
| 36 | + } |
|
| 37 | + |
|
| 38 | + /** |
|
| 39 | + * Field Render Function. |
|
| 40 | + * Takes the vars and outputs the HTML for the field in the settings |
|
| 41 | + * |
|
| 42 | + * @since 1.0.0 |
|
| 43 | + * @access public |
|
| 44 | + * @return void |
|
| 45 | + */ |
|
| 46 | + public function render() { |
|
| 47 | + $styles = array( |
|
| 48 | + 'normal', |
|
| 49 | + 'info', |
|
| 50 | + 'warning', |
|
| 51 | + 'success', |
|
| 52 | + 'critical', |
|
| 53 | + 'custom', |
|
| 54 | + ); |
|
| 55 | + |
|
| 56 | + if ( ! in_array( $this->field['style'], $styles, true ) ) { |
|
| 57 | + $this->field['style'] = 'normal'; |
|
| 58 | + } |
|
| 59 | + |
|
| 60 | + if ( 'custom' === $this->field['style'] ) { |
|
| 61 | + if ( ! empty( $this->field['color'] ) ) { |
|
| 62 | + $this->field['color'] = 'border-color:' . $this->field['color'] . ';'; |
|
| 63 | + } else { |
|
| 64 | + $this->field['style'] = 'normal'; |
|
| 65 | + $this->field['color'] = ''; |
|
| 66 | + } |
|
| 67 | + } else { |
|
| 68 | + $this->field['color'] = ''; |
|
| 69 | + } |
|
| 70 | + |
|
| 71 | + if ( empty( $this->field['desc'] ) && ! empty( $this->field['default'] ) ) { |
|
| 72 | + $this->field['desc'] = $this->field['default']; |
|
| 73 | + unset( $this->field['default'] ); |
|
| 74 | + } |
|
| 75 | + |
|
| 76 | + if ( empty( $this->field['desc'] ) && ! empty( $this->field['subtitle'] ) ) { |
|
| 77 | + $this->field['desc'] = $this->field['subtitle']; |
|
| 78 | + unset( $this->field['subtitle'] ); |
|
| 79 | + } |
|
| 80 | + |
|
| 81 | + if ( empty( $this->field['desc'] ) ) { |
|
| 82 | + $this->field['desc'] = ''; |
|
| 83 | + } |
|
| 84 | + |
|
| 85 | + if ( empty( $this->field['raw_html'] ) ) { |
|
| 86 | + if ( true === $this->field['notice'] ) { |
|
| 87 | + $this->field['class'] .= ' redux-notice-field'; |
|
| 88 | + } else { |
|
| 89 | + $this->field['class'] .= ' redux-info-field'; |
|
| 90 | + } |
|
| 91 | + |
|
| 92 | + $this->field['style'] = 'redux-' . $this->field['style'] . ' '; |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + // Old shim, deprecated arg. |
|
| 96 | + if ( isset( $this->field['sectionIndent'] ) ) { |
|
| 97 | + $this->field['indent'] = $this->field['sectionIndent']; |
|
| 98 | + } |
|
| 99 | + $indent = ( isset( $this->field['indent'] ) && $this->field['indent'] ) ? ' form-table-section-indented' : ''; |
|
| 100 | + |
|
| 101 | + echo '</td></tr></table>'; |
|
| 102 | + echo '<div |
|
| 103 | 103 | id="info-' . esc_attr( $this->field['id'] ) . '" |
| 104 | 104 | class="' . ( isset( $this->field['icon'] ) && ! empty( $this->field['icon'] ) && true !== $this->field['icon'] ? 'hasIcon ' : '' ) . esc_attr( $this->field['style'] ) . ' ' . esc_attr( $this->field['class'] ) . ' redux-field-' . esc_attr( $this->field['type'] ) . esc_attr( $indent ) . '"' . ( ! empty( $this->field['color'] ) ? ' style="' . esc_attr( $this->field['color'] ) . '"' : '' ) . '>'; |
| 105 | 105 | |
| 106 | - if ( ! empty( $this->field['raw_html'] ) && $this->field['raw_html'] ) { |
|
| 107 | - echo wp_kses_post( $this->field['desc'] ); |
|
| 108 | - } else { |
|
| 109 | - if ( isset( $this->field['title'] ) && ! empty( $this->field['title'] ) ) { |
|
| 110 | - $this->field['title'] = '<b>' . wp_kses_post( $this->field['title'] ) . '</b><br/>'; |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - if ( isset( $this->field['icon'] ) && ! empty( $this->field['icon'] ) && true !== $this->field['icon'] ) { |
|
| 114 | - echo '<p class="redux-info-icon"><i class="' . esc_attr( $this->field['icon'] ) . ' icon-large"></i></p>'; |
|
| 115 | - } |
|
| 116 | - |
|
| 117 | - if ( isset( $this->field['raw'] ) && ! empty( $this->field['raw'] ) ) { |
|
| 118 | - echo wp_kses_post( $this->field['raw'] ); |
|
| 119 | - } |
|
| 120 | - |
|
| 121 | - if ( ! empty( $this->field['title'] ) || ! empty( $this->field['desc'] ) ) { |
|
| 122 | - echo '<p class="redux-info-desc">' . wp_kses_post( $this->field['title'] ) . wp_kses_post( $this->field['desc'] ) . '</p>'; |
|
| 123 | - } |
|
| 124 | - } |
|
| 125 | - |
|
| 126 | - echo '</div>'; |
|
| 127 | - echo '<table class="form-table no-border" style="margin-top: 0;">'; |
|
| 128 | - echo '<tbody>'; |
|
| 129 | - echo '<tr style="border-bottom:0; display:none;">'; |
|
| 130 | - echo '<th style="padding-top:0;"></th>'; |
|
| 131 | - echo '<td style="padding-top:0;">'; |
|
| 132 | - } |
|
| 133 | - |
|
| 134 | - /** |
|
| 135 | - * Enqueue Function. |
|
| 136 | - * If this field requires any scripts, or css define this function and register/enqueue the scripts/css |
|
| 137 | - * |
|
| 138 | - * @since 1.0.0 |
|
| 139 | - * @access public |
|
| 140 | - * @return void |
|
| 141 | - */ |
|
| 142 | - public function enqueue() { |
|
| 143 | - if ( $this->parent->args['dev_mode'] ) { |
|
| 144 | - wp_enqueue_style( |
|
| 145 | - 'redux-field-info', |
|
| 146 | - Redux_Core::$url . 'inc/fields/info/redux-info.css', |
|
| 147 | - array(), |
|
| 148 | - $this->timestamp |
|
| 149 | - ); |
|
| 150 | - } |
|
| 151 | - } |
|
| 152 | - } |
|
| 106 | + if ( ! empty( $this->field['raw_html'] ) && $this->field['raw_html'] ) { |
|
| 107 | + echo wp_kses_post( $this->field['desc'] ); |
|
| 108 | + } else { |
|
| 109 | + if ( isset( $this->field['title'] ) && ! empty( $this->field['title'] ) ) { |
|
| 110 | + $this->field['title'] = '<b>' . wp_kses_post( $this->field['title'] ) . '</b><br/>'; |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + if ( isset( $this->field['icon'] ) && ! empty( $this->field['icon'] ) && true !== $this->field['icon'] ) { |
|
| 114 | + echo '<p class="redux-info-icon"><i class="' . esc_attr( $this->field['icon'] ) . ' icon-large"></i></p>'; |
|
| 115 | + } |
|
| 116 | + |
|
| 117 | + if ( isset( $this->field['raw'] ) && ! empty( $this->field['raw'] ) ) { |
|
| 118 | + echo wp_kses_post( $this->field['raw'] ); |
|
| 119 | + } |
|
| 120 | + |
|
| 121 | + if ( ! empty( $this->field['title'] ) || ! empty( $this->field['desc'] ) ) { |
|
| 122 | + echo '<p class="redux-info-desc">' . wp_kses_post( $this->field['title'] ) . wp_kses_post( $this->field['desc'] ) . '</p>'; |
|
| 123 | + } |
|
| 124 | + } |
|
| 125 | + |
|
| 126 | + echo '</div>'; |
|
| 127 | + echo '<table class="form-table no-border" style="margin-top: 0;">'; |
|
| 128 | + echo '<tbody>'; |
|
| 129 | + echo '<tr style="border-bottom:0; display:none;">'; |
|
| 130 | + echo '<th style="padding-top:0;"></th>'; |
|
| 131 | + echo '<td style="padding-top:0;">'; |
|
| 132 | + } |
|
| 133 | + |
|
| 134 | + /** |
|
| 135 | + * Enqueue Function. |
|
| 136 | + * If this field requires any scripts, or css define this function and register/enqueue the scripts/css |
|
| 137 | + * |
|
| 138 | + * @since 1.0.0 |
|
| 139 | + * @access public |
|
| 140 | + * @return void |
|
| 141 | + */ |
|
| 142 | + public function enqueue() { |
|
| 143 | + if ( $this->parent->args['dev_mode'] ) { |
|
| 144 | + wp_enqueue_style( |
|
| 145 | + 'redux-field-info', |
|
| 146 | + Redux_Core::$url . 'inc/fields/info/redux-info.css', |
|
| 147 | + array(), |
|
| 148 | + $this->timestamp |
|
| 149 | + ); |
|
| 150 | + } |
|
| 151 | + } |
|
| 152 | + } |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | class_alias( 'Redux_Info', 'ReduxFramework_Info' ); |