PluginProbe
Depicter — Popup & Slider Builder / 1.3.3
Depicter — Popup & Slider Builder v1.3.3
4.8.1 trunk 1.0.0 1.1.0 1.1.2 1.1.4 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.5 1.3.8 1.5.0 1.5.1 1.5.2 1.5.5 1.6.0 1.6.1 1.6.2 1.7.0 All 76 releases
depicter / app / src / Modules / WPBakery / module.php

module.php in Depicter — Popup & Slider Builder 1.3.3, at app/src/Modules/WPBakery/module.php

69 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Depicter\Modules\WPBakery;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit; // Exit if accessed directly.
7 }
8
9 class Module {
10
11 /**
12 * Class constructor
13 */
14 public function __construct() {
15 if ( function_exists( 'vc_map' ) ) {
16 $this->map_vc_shortcodes();
17 }
18 }
19
20 /**
21 * Add depicter shortcode to wpbakery
22 *
23 * @return void
24 */
25 public function map_vc_shortcodes() {
26
27 vc_map([
28 'name' => __( 'Depicter', 'depicter' ),
29 'base' => 'depicter',
30 'category' => __( 'Content', 'depicter' ),
31 'description' => __( 'Make animated and interactive slider', 'depicter' ),
32 'icon' => \Depicter::core()->assets()->getUrl() . '/resources/images/svg/logo-without-text.svg',
33 'params' => [
34 [
35 'type' => 'dropdown',
36 'class' => '',
37 'admin_label' => true,
38 'heading' => __( 'Select Slider', 'depicter' ),
39 'param_name' => 'id',
40 'value' => $this->get_sliders_list(),
41 ]
42 ]
43 ]);
44 }
45
46 /**
47 * get sliders list
48 *
49 * @return array
50 * @throws \Exception
51 */
52 public function get_sliders_list() {
53 if ( ! isset( $_POST['action'] ) || $_POST['action'] != 'vc_edit_form' ) {
54 return [];
55 }
56
57 $list = [
58 __( 'Select Slider', 'depicter' ) => 0
59 ];
60 $documents = \Depicter::documentRepository()->getList();
61 foreach( $documents as $document ) {
62 $list[ "[#{$document['id']}]: " . $document['name'] ] = $document['id'];
63 }
64 return $list;
65 }
66 }
67
68 new Module();
69