| 1 |
<?php |
| 2 |
/** |
| 3 |
* BuilderFns class |
| 4 |
* |
| 5 |
* The builder. |
| 6 |
* |
| 7 |
* @package RadiusTheme\SB |
| 8 |
* @since 1.0.0 |
| 9 |
*/ |
| 10 |
|
| 11 |
namespace RadiusTheme\SB\Elementor\Helper; |
| 12 |
|
| 13 |
// Do not allow directly accessing this file. |
| 14 |
if ( ! defined( 'ABSPATH' ) ) { |
| 15 |
exit( 'This script cannot be accessed directly.' ); |
| 16 |
} |
| 17 |
|
| 18 |
/** |
| 19 |
* BuilderFns class |
| 20 |
*/ |
| 21 |
class ControlHelper { |
| 22 |
/** |
| 23 |
* Widget alignment. |
| 24 |
* |
| 25 |
* @return array |
| 26 |
*/ |
| 27 |
public static function alignment() { |
| 28 |
return [ |
| 29 |
'left' => [ |
| 30 |
'title' => esc_html__( 'Left', 'shopbuilder' ), |
| 31 |
'icon' => 'eicon-text-align-left', |
| 32 |
], |
| 33 |
'center' => [ |
| 34 |
'title' => esc_html__( 'Center', 'shopbuilder' ), |
| 35 |
'icon' => 'eicon-text-align-center', |
| 36 |
], |
| 37 |
'right' => [ |
| 38 |
'title' => esc_html__( 'Right', 'shopbuilder' ), |
| 39 |
'icon' => 'eicon-text-align-right', |
| 40 |
], |
| 41 |
'justify' => [ |
| 42 |
'title' => esc_html__( 'Justified', 'shopbuilder' ), |
| 43 |
'icon' => 'eicon-text-align-justify', |
| 44 |
], |
| 45 |
]; |
| 46 |
} |
| 47 |
/** |
| 48 |
* Widget alignment. |
| 49 |
* |
| 50 |
* @return array |
| 51 |
*/ |
| 52 |
public static function flex_alignment() { |
| 53 |
return [ |
| 54 |
'start' => [ |
| 55 |
'title' => esc_html__( 'Start', 'shopbuilder' ), |
| 56 |
'icon' => 'eicon-text-align-left', |
| 57 |
], |
| 58 |
'center' => [ |
| 59 |
'title' => esc_html__( 'Center', 'shopbuilder' ), |
| 60 |
'icon' => 'eicon-text-align-center', |
| 61 |
], |
| 62 |
'end' => [ |
| 63 |
'title' => esc_html__( 'End', 'shopbuilder' ), |
| 64 |
'icon' => 'eicon-text-align-right', |
| 65 |
], |
| 66 |
]; |
| 67 |
} |
| 68 |
/** |
| 69 |
* Grid Layout Columns |
| 70 |
* |
| 71 |
* @return array |
| 72 |
*/ |
| 73 |
public static function layout_columns() { |
| 74 |
return [ |
| 75 |
0 => esc_html__( 'Layout Default', 'shopbuilder' ), |
| 76 |
1 => esc_html__( '1 Column', 'shopbuilder' ), |
| 77 |
2 => esc_html__( '2 Columns', 'shopbuilder' ), |
| 78 |
3 => esc_html__( '3 Columns', 'shopbuilder' ), |
| 79 |
4 => esc_html__( '4 Columns', 'shopbuilder' ), |
| 80 |
5 => esc_html__( '5 Columns', 'shopbuilder' ), |
| 81 |
6 => esc_html__( '6 Columns', 'shopbuilder' ), |
| 82 |
]; |
| 83 |
} |
| 84 |
|
| 85 |
/** |
| 86 |
* Grid Layouts |
| 87 |
* |
| 88 |
* @return array |
| 89 |
*/ |
| 90 |
public static function grid_layouts() { |
| 91 |
$status = ! rtsb()->has_pro(); |
| 92 |
|
| 93 |
return apply_filters( |
| 94 |
'rtsb/elements/elementor/grid_layouts', |
| 95 |
[ |
| 96 |
'grid-layout1' => [ |
| 97 |
'title' => esc_html__( 'Grid Layout 1', 'shopbuilder' ), |
| 98 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-01.png' ) ), |
| 99 |
], |
| 100 |
|
| 101 |
'grid-layout2' => [ |
| 102 |
'title' => esc_html__( 'Grid Layout 2', 'shopbuilder' ), |
| 103 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-02.png' ) ), |
| 104 |
], |
| 105 |
|
| 106 |
// TODO: Will be activated later. |
| 107 |
// 'grid-layout3' => [ |
| 108 |
// 'title' => esc_html__( 'Grid Layout 3', 'shopbuilder' ), |
| 109 |
// 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-03.png' ) ), |
| 110 |
// 'is_pro' => $status, |
| 111 |
// ], |
| 112 |
|
| 113 |
// 'grid-layout4' => [ |
| 114 |
// 'title' => esc_html__( 'Grid Layout 4', 'shopbuilder' ), |
| 115 |
// 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-02.png' ) ), |
| 116 |
// 'is_pro' => $status, |
| 117 |
// ], |
| 118 |
// |
| 119 |
// 'grid-layout5' => [ |
| 120 |
// 'title' => esc_html__( 'Grid Layout 5', 'shopbuilder' ), |
| 121 |
// 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-01.png' ) ), |
| 122 |
// 'is_pro' => $status, |
| 123 |
// ], |
| 124 |
] |
| 125 |
); |
| 126 |
} |
| 127 |
|
| 128 |
/** |
| 129 |
* Slider Layouts |
| 130 |
* |
| 131 |
* @return array |
| 132 |
*/ |
| 133 |
public static function slider_layouts() { |
| 134 |
$status = ! rtsb()->has_pro(); |
| 135 |
|
| 136 |
return apply_filters( |
| 137 |
'rtsb/elements/elementor/slider_layouts', |
| 138 |
[ |
| 139 |
'slider-layout1' => [ |
| 140 |
'title' => esc_html__( 'Slider Layout 1', 'shopbuilder' ), |
| 141 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-01.png' ) ), |
| 142 |
], |
| 143 |
|
| 144 |
'slider-layout2' => [ |
| 145 |
'title' => esc_html__( 'Slider Layout 2', 'shopbuilder' ), |
| 146 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-02.png' ) ), |
| 147 |
], |
| 148 |
|
| 149 |
// TODO: Will be activated later. |
| 150 |
// 'slider-layout3' => [ |
| 151 |
// 'title' => esc_html__( 'Slider Layout 3', 'shopbuilder' ), |
| 152 |
// 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-03.png' ) ), |
| 153 |
// 'is_pro' => $status, |
| 154 |
// ], |
| 155 |
// |
| 156 |
// 'slider-layout4' => [ |
| 157 |
// 'title' => esc_html__( 'Slider Layout 4', 'shopbuilder' ), |
| 158 |
// 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-02.png' ) ), |
| 159 |
// 'is_pro' => $status, |
| 160 |
// ], |
| 161 |
// |
| 162 |
// 'slider-layout5' => [ |
| 163 |
// 'title' => esc_html__( 'Slider Layout 5', 'shopbuilder' ), |
| 164 |
// 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-01.png' ) ), |
| 165 |
// 'is_pro' => $status, |
| 166 |
// ], |
| 167 |
] |
| 168 |
); |
| 169 |
} |
| 170 |
|
| 171 |
/** |
| 172 |
* List Layouts |
| 173 |
* |
| 174 |
* @return array |
| 175 |
*/ |
| 176 |
public static function list_layouts() { |
| 177 |
$status = ! rtsb()->has_pro(); |
| 178 |
|
| 179 |
return apply_filters( |
| 180 |
'rtsb/elements/elementor/list_layouts', |
| 181 |
[ |
| 182 |
'list-layout1' => [ |
| 183 |
'title' => esc_html__( 'List Layout 1', 'shopbuilder' ), |
| 184 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-01.png' ) ), |
| 185 |
], |
| 186 |
|
| 187 |
'list-layout2' => [ |
| 188 |
'title' => esc_html__( 'List Layout 2', 'shopbuilder' ), |
| 189 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-02.png' ) ), |
| 190 |
], |
| 191 |
|
| 192 |
// TODO: Will be activated later. |
| 193 |
// 'list-layout3' => [ |
| 194 |
// 'title' => esc_html__( 'List Layout 3', 'shopbuilder' ), |
| 195 |
// 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-02.png' ) ), |
| 196 |
// 'is_pro' => $status, |
| 197 |
// ], |
| 198 |
// |
| 199 |
// 'list-layout4' => [ |
| 200 |
// 'title' => esc_html__( 'List Layout 4', 'shopbuilder' ), |
| 201 |
// 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/list-style-01.png' ) ), |
| 202 |
// 'is_pro' => $status, |
| 203 |
// ], |
| 204 |
] |
| 205 |
); |
| 206 |
} |
| 207 |
|
| 208 |
/** |
| 209 |
* Category Layouts |
| 210 |
* |
| 211 |
* @return array |
| 212 |
*/ |
| 213 |
public static function category_layouts() { |
| 214 |
$status = ! rtsb()->has_pro(); |
| 215 |
|
| 216 |
return apply_filters( |
| 217 |
'rtsb/elements/elementor/category_layouts', |
| 218 |
[ |
| 219 |
'category-layout1' => [ |
| 220 |
'title' => esc_html__( 'Category Layout 1', 'shopbuilder' ), |
| 221 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-01.png' ) ), |
| 222 |
], |
| 223 |
|
| 224 |
'category-layout2' => [ |
| 225 |
'title' => esc_html__( 'Category Layout 2', 'shopbuilder' ), |
| 226 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-01.png' ) ), |
| 227 |
], |
| 228 |
|
| 229 |
// TODO: Will be activated later. |
| 230 |
// 'category-layout3' => [ |
| 231 |
// 'title' => esc_html__( 'Category Layout 3', 'shopbuilder' ), |
| 232 |
// 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-01.png' ) ), |
| 233 |
// 'is_pro' => $status, |
| 234 |
// ], |
| 235 |
// |
| 236 |
// 'category-layout4' => [ |
| 237 |
// 'title' => esc_html__( 'Category Layout 4', 'shopbuilder' ), |
| 238 |
// 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-01.png' ) ), |
| 239 |
// 'is_pro' => $status, |
| 240 |
// ], |
| 241 |
] |
| 242 |
); |
| 243 |
} |
| 244 |
|
| 245 |
/** |
| 246 |
* Category Layouts |
| 247 |
* |
| 248 |
* @return array |
| 249 |
*/ |
| 250 |
public static function share_layouts() { |
| 251 |
$status = ! rtsb()->has_pro(); |
| 252 |
|
| 253 |
return apply_filters( |
| 254 |
'rtsb/elements/elementor/share_layouts', |
| 255 |
[ |
| 256 |
'share-layout1' => [ |
| 257 |
'title' => esc_html__( 'Social Share Preset 1', 'shopbuilder' ), |
| 258 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/share-preset-1.png' ) ), |
| 259 |
], |
| 260 |
|
| 261 |
'share-layout2' => [ |
| 262 |
'title' => esc_html__( 'Social Share Preset 2', 'shopbuilder' ), |
| 263 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/share-preset-2.png' ) ), |
| 264 |
], |
| 265 |
|
| 266 |
// TODO: Will be activated later. |
| 267 |
// 'share-layout3' => [ |
| 268 |
// 'title' => esc_html__( 'Social Share Preset 3', 'shopbuilder' ), |
| 269 |
// 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/share-preset-1.png' ) ), |
| 270 |
// 'is_pro' => $status, |
| 271 |
// ], |
| 272 |
] |
| 273 |
); |
| 274 |
} |
| 275 |
|
| 276 |
/** |
| 277 |
* Action Button Presets |
| 278 |
* |
| 279 |
* @return array |
| 280 |
*/ |
| 281 |
public static function action_btn_presets() { |
| 282 |
|
| 283 |
return apply_filters( |
| 284 |
'rtsb/elements/elementor/action_btn_presets', |
| 285 |
[ |
| 286 |
'preset1' => [ |
| 287 |
'title' => esc_html__( 'Preset 1', 'shopbuilder' ), |
| 288 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-1.png' ) ), |
| 289 |
], |
| 290 |
|
| 291 |
'preset2' => [ |
| 292 |
'title' => esc_html__( 'Preset 2', 'shopbuilder' ), |
| 293 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-2.png' ) ), |
| 294 |
], |
| 295 |
|
| 296 |
'preset3' => [ |
| 297 |
'title' => esc_html__( 'Preset 3', 'shopbuilder' ), |
| 298 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-3.png' ) ), |
| 299 |
], |
| 300 |
'preset4' => [ |
| 301 |
'title' => esc_html__( 'Preset 4', 'shopbuilder' ), |
| 302 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/action-preset-4.png' ) ), |
| 303 |
], |
| 304 |
] |
| 305 |
); |
| 306 |
} |
| 307 |
|
| 308 |
/** |
| 309 |
* Badge Presets |
| 310 |
* |
| 311 |
* @return array |
| 312 |
*/ |
| 313 |
public static function badge_presets() { |
| 314 |
$status = ! rtsb()->has_pro(); |
| 315 |
|
| 316 |
return apply_filters( |
| 317 |
'rtsb/elements/elementor/badge_presets', |
| 318 |
[ |
| 319 |
'preset1' => [ |
| 320 |
'title' => esc_html__( 'Preset 1', 'shopbuilder' ), |
| 321 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-1.png' ) ), |
| 322 |
], |
| 323 |
|
| 324 |
'preset2' => [ |
| 325 |
'title' => esc_html__( 'Preset 2', 'shopbuilder' ), |
| 326 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-2.png' ) ), |
| 327 |
], |
| 328 |
|
| 329 |
'preset3' => [ |
| 330 |
'title' => esc_html__( 'Preset 3', 'shopbuilder' ), |
| 331 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-3.png' ) ), |
| 332 |
], |
| 333 |
|
| 334 |
'preset4' => [ |
| 335 |
'title' => esc_html__( 'Preset 4', 'shopbuilder' ), |
| 336 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/badge-preset-4.png' ) ), |
| 337 |
], |
| 338 |
] |
| 339 |
); |
| 340 |
} |
| 341 |
|
| 342 |
/** |
| 343 |
* Single Category Layouts |
| 344 |
* |
| 345 |
* @return array |
| 346 |
*/ |
| 347 |
public static function single_category_layouts() { |
| 348 |
$status = ! rtsb()->has_pro(); |
| 349 |
|
| 350 |
return apply_filters( |
| 351 |
'rtsb/elements/elementor/category_single_layouts', |
| 352 |
[ |
| 353 |
'category-single-layout1' => [ |
| 354 |
'title' => esc_html__( 'Single Category Layout 1', 'shopbuilder' ), |
| 355 |
'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-01.png' ) ), |
| 356 |
], |
| 357 |
|
| 358 |
// TODO: Will be activated later. |
| 359 |
// 'category-single-layout2' => [ |
| 360 |
// 'title' => esc_html__( 'Single Category Layout 2', 'shopbuilder' ), |
| 361 |
// 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-01.png' ) ), |
| 362 |
// 'is_pro' => $status, |
| 363 |
// ], |
| 364 |
// |
| 365 |
// 'category-single-layout3' => [ |
| 366 |
// 'title' => esc_html__( 'Single Category Layout 3', 'shopbuilder' ), |
| 367 |
// 'url' => esc_url( rtsb()->get_assets_uri( 'images/layout/grid-style-01.png' ) ), |
| 368 |
// 'is_pro' => $status, |
| 369 |
// ], |
| 370 |
] |
| 371 |
); |
| 372 |
} |
| 373 |
|
| 374 |
/** |
| 375 |
* Posts Order By. |
| 376 |
* |
| 377 |
* @return array |
| 378 |
*/ |
| 379 |
public static function posts_order_by() { |
| 380 |
return [ |
| 381 |
'ID' => esc_html__( 'Product ID', 'shopbuilder' ), |
| 382 |
'title' => esc_html__( 'Product Title', 'shopbuilder' ), |
| 383 |
'price' => esc_html__( 'Product Price', 'shopbuilder' ), |
| 384 |
'date' => esc_html__( 'Date', 'shopbuilder' ), |
| 385 |
'menu_order' => esc_html__( 'Menu Order', 'shopbuilder' ), |
| 386 |
'rand' => esc_html__( 'Random', 'shopbuilder' ), |
| 387 |
]; |
| 388 |
} |
| 389 |
|
| 390 |
/** |
| 391 |
* Categories Order By. |
| 392 |
* |
| 393 |
* @return array |
| 394 |
*/ |
| 395 |
public static function cats_order_by() { |
| 396 |
return [ |
| 397 |
'id' => esc_html__( 'Category IDs', 'shopbuilder' ), |
| 398 |
'name' => esc_html__( 'Category Name', 'shopbuilder' ), |
| 399 |
'count' => esc_html__( 'Category Count', 'shopbuilder' ), |
| 400 |
'menu_order' => esc_html__( 'Menu Order', 'shopbuilder' ), |
| 401 |
]; |
| 402 |
} |
| 403 |
|
| 404 |
/** |
| 405 |
* Posts Order By. |
| 406 |
* |
| 407 |
* @return array |
| 408 |
*/ |
| 409 |
public static function posts_order() { |
| 410 |
return [ |
| 411 |
'ASC' => esc_html__( 'Ascending', 'shopbuilder' ), |
| 412 |
'DESC' => esc_html__( 'Descending', 'shopbuilder' ), |
| 413 |
]; |
| 414 |
} |
| 415 |
|
| 416 |
/** |
| 417 |
* Filter products |
| 418 |
* |
| 419 |
* @return array |
| 420 |
*/ |
| 421 |
public static function filter_products() { |
| 422 |
return [ |
| 423 |
'recent' => esc_html__( 'Recent Products', 'shopbuilder' ), |
| 424 |
'featured' => esc_html__( 'Featured Products', 'shopbuilder' ), |
| 425 |
'best-selling' => esc_html__( 'Best Selling Products', 'shopbuilder' ), |
| 426 |
'sale' => esc_html__( 'Sale Products', 'shopbuilder' ), |
| 427 |
'top-rated' => esc_html__( 'Top Rated Products', 'shopbuilder' ), |
| 428 |
]; |
| 429 |
} |
| 430 |
|
| 431 |
/** |
| 432 |
* Heading Tags |
| 433 |
* |
| 434 |
* @return array |
| 435 |
*/ |
| 436 |
public static function heading_tags() { |
| 437 |
return [ |
| 438 |
'h1' => esc_html__( 'H1', 'shopbuilder' ), |
| 439 |
'h2' => esc_html__( 'H2', 'shopbuilder' ), |
| 440 |
'h3' => esc_html__( 'H3', 'shopbuilder' ), |
| 441 |
'h4' => esc_html__( 'H4', 'shopbuilder' ), |
| 442 |
'h5' => esc_html__( 'H5', 'shopbuilder' ), |
| 443 |
'h6' => esc_html__( 'H6', 'shopbuilder' ), |
| 444 |
'p' => esc_html__( 'p', 'shopbuilder' ), |
| 445 |
'div' => esc_html__( 'div', 'shopbuilder' ), |
| 446 |
'span' => esc_html__( 'span', 'shopbuilder' ), |
| 447 |
]; |
| 448 |
} |
| 449 |
|
| 450 |
/** |
| 451 |
* General Style Section |
| 452 |
* |
| 453 |
* @param string $id_prefix Section id prefix. |
| 454 |
* @param string $title Section title. |
| 455 |
* @param object $obj Reference object. |
| 456 |
* @param array $condition Condition. |
| 457 |
* @param array $selectors CSS electors. |
| 458 |
* @param array $conditions Conditions. |
| 459 |
* |
| 460 |
* @return array |
| 461 |
*/ |
| 462 |
public static function general_elementor_style( $id_prefix, $title, $obj, $condition, $selectors, $conditions = [] ) { |
| 463 |
$prefix = str_replace( ' ', '_', strtolower( $id_prefix ) ) . '_'; |
| 464 |
|
| 465 |
$fields[ $prefix . 'style_section' ] = $obj->start_section( |
| 466 |
esc_html( $title ), |
| 467 |
'style', |
| 468 |
$conditions, |
| 469 |
$condition |
| 470 |
); |
| 471 |
|
| 472 |
$fields[ $prefix . 'typo_note' ] = $obj->el_heading( esc_html__( 'Typography', 'shopbuilder' ), 'default' ); |
| 473 |
|
| 474 |
$fields[ 'rtsb_el_' . $prefix . 'typography' ] = [ |
| 475 |
'mode' => 'group', |
| 476 |
'type' => 'typography', |
| 477 |
'selector' => ! empty( $selectors['typography'] ) ? $selectors['typography'] : [], |
| 478 |
]; |
| 479 |
|
| 480 |
$fields[ $prefix . 'alignment' ] = [ |
| 481 |
'mode' => 'responsive', |
| 482 |
'type' => 'choose', |
| 483 |
'label' => esc_html__( 'Alignment', 'shopbuilder' ), |
| 484 |
'options' => [ |
| 485 |
'left' => [ |
| 486 |
'title' => esc_html__( 'Left', 'shopbuilder' ), |
| 487 |
'icon' => 'eicon-text-align-left', |
| 488 |
], |
| 489 |
'center' => [ |
| 490 |
'title' => esc_html__( 'Center', 'shopbuilder' ), |
| 491 |
'icon' => 'eicon-text-align-center', |
| 492 |
], |
| 493 |
'right' => [ |
| 494 |
'title' => esc_html__( 'Right', 'shopbuilder' ), |
| 495 |
'icon' => 'eicon-text-align-right', |
| 496 |
], |
| 497 |
], |
| 498 |
'selectors' => ! empty( $selectors['alignment'] ) ? $selectors['alignment'] : [], |
| 499 |
]; |
| 500 |
|
| 501 |
$fields[ $prefix . 'color_note' ] = $obj->el_heading( esc_html__( 'Colors', 'shopbuilder' ), 'before' ); |
| 502 |
|
| 503 |
$fields[ $prefix . 'color_tabs' ] = $obj->start_tab_group(); |
| 504 |
$fields[ $prefix . 'color_tab' ] = $obj->start_tab( esc_html__( 'Normal', 'shopbuilder' ) ); |
| 505 |
|
| 506 |
$fields[ $prefix . 'color' ] = [ |
| 507 |
'type' => 'color', |
| 508 |
'label' => esc_html__( 'Color', 'shopbuilder' ), |
| 509 |
'selectors' => ! empty( $selectors['color'] ) ? $selectors['color'] : [], |
| 510 |
'separator' => 'default', |
| 511 |
]; |
| 512 |
|
| 513 |
$fields[ $prefix . 'bg_color' ] = [ |
| 514 |
'type' => 'color', |
| 515 |
'label' => esc_html__( 'Background Color', 'shopbuilder' ), |
| 516 |
'selectors' => ! empty( $selectors['bg_color'] ) ? $selectors['bg_color'] : [], |
| 517 |
'separator' => 'default', |
| 518 |
]; |
| 519 |
|
| 520 |
$fields[ $prefix . 'color_tab_end' ] = $obj->end_tab(); |
| 521 |
$fields[ $prefix . 'hover_color_tab' ] = $obj->start_tab( esc_html__( 'Hover', 'shopbuilder' ) ); |
| 522 |
|
| 523 |
$fields[ $prefix . 'hover_color' ] = [ |
| 524 |
'type' => 'color', |
| 525 |
'label' => esc_html__( 'Hover Color', 'shopbuilder' ), |
| 526 |
'selectors' => ! empty( $selectors['hover_color'] ) ? $selectors['hover_color'] : [], |
| 527 |
'separator' => 'default', |
| 528 |
]; |
| 529 |
|
| 530 |
$fields[ $prefix . 'hover_bg_color' ] = [ |
| 531 |
'type' => 'color', |
| 532 |
'label' => esc_html__( 'Hover Background Color', 'shopbuilder' ), |
| 533 |
'selectors' => ! empty( $selectors['hover_bg_color'] ) ? $selectors['hover_bg_color'] : [], |
| 534 |
'separator' => 'default', |
| 535 |
]; |
| 536 |
|
| 537 |
$fields[ $prefix . 'hover_color_tab_end' ] = $obj->end_tab(); |
| 538 |
$fields[ $prefix . 'color_tabs_end' ] = $obj->end_tab_group(); |
| 539 |
|
| 540 |
$fields[ $prefix . 'border_note' ] = $obj->el_heading( esc_html__( 'Border', 'shopbuilder' ), 'before' ); |
| 541 |
|
| 542 |
$fields[ 'rtsb_el_' . $prefix . 'border' ] = [ |
| 543 |
'mode' => 'group', |
| 544 |
'type' => 'border', |
| 545 |
'label' => esc_html__( 'Border', 'shopbuilder' ), |
| 546 |
'selector' => ! empty( $selectors['border'] ) ? $selectors['border'] : [], |
| 547 |
'separator' => 'default', |
| 548 |
]; |
| 549 |
|
| 550 |
$fields[ $prefix . 'border_hover_color' ] = [ |
| 551 |
'type' => 'color', |
| 552 |
'label' => esc_html__( 'Hover Color', 'shopbuilder' ), |
| 553 |
'condition' => [ 'rtsb_el_' . $prefix . 'border_border!' => [ '' ] ], |
| 554 |
'selectors' => ! empty( $selectors['border_hover_color'] ) ? $selectors['border_hover_color'] : [], |
| 555 |
]; |
| 556 |
|
| 557 |
$fields[ $prefix . 'spacing_note' ] = $obj->el_heading( esc_html__( 'Spacing', 'shopbuilder' ), 'before' ); |
| 558 |
|
| 559 |
$fields[ $prefix . 'padding' ] = [ |
| 560 |
'mode' => 'responsive', |
| 561 |
'type' => 'dimensions', |
| 562 |
'label' => esc_html__( 'Padding', 'shopbuilder' ), |
| 563 |
'size_units' => [ 'px', '%', 'em' ], |
| 564 |
'selectors' => ! empty( $selectors['padding'] ) ? $selectors['padding'] : [], |
| 565 |
'separator' => 'default', |
| 566 |
]; |
| 567 |
|
| 568 |
$fields[ $prefix . 'margin' ] = [ |
| 569 |
'mode' => 'responsive', |
| 570 |
'type' => 'dimensions', |
| 571 |
'label' => esc_html__( 'Margin', 'shopbuilder' ), |
| 572 |
'size_units' => [ 'px', '%', 'em' ], |
| 573 |
'selectors' => ! empty( $selectors['margin'] ) ? $selectors['margin'] : [], |
| 574 |
]; |
| 575 |
|
| 576 |
$fields[ $prefix . 'style_section_end' ] = $obj->end_section(); |
| 577 |
|
| 578 |
return $fields; |
| 579 |
} |
| 580 |
|
| 581 |
/** |
| 582 |
* Sharing Settings. |
| 583 |
* |
| 584 |
* @return array |
| 585 |
*/ |
| 586 |
public static function sharing_settings() { |
| 587 |
$settings = get_option( 'rtsb_settings' ); |
| 588 |
$share_settings = ! empty( $settings['general']['social_share']['share_platforms'] ) ? $settings['general']['social_share']['share_platforms'] : []; |
| 589 |
|
| 590 |
return ! empty( $share_settings ) && is_array( $share_settings ) ? $share_settings : [ 'facebook', 'twitter' ]; |
| 591 |
} |
| 592 |
} |
| 593 |
|