├── README.md
├── assets
└── images
│ └── pt.svg
├── composer.json
└── vc-shortcodes
├── class-vc-custom-param-types.php
├── class-vc-helpers.php
├── class-vc-shortcode.php
└── shortcodes
├── vc-accordion-item.php
├── vc-brochure-box.php
├── vc-call-to-action.php
├── vc-container-accordion.php
├── vc-container-google-maps.php
├── vc-container-number-counter.php
├── vc-container-social-icons.php
├── vc-container-steps.php
├── vc-container-testimonials.php
├── vc-counter.php
├── vc-facebook.php
├── vc-featured-page.php
├── vc-icon-box.php
├── vc-latest-news.php
├── vc-location.php
├── vc-opening-time.php
├── vc-person-profile.php
├── vc-skype.php
├── vc-social-icon.php
├── vc-step.php
└── vc-testimonial.php
/README.md:
--------------------------------------------------------------------------------
1 | # Visual Composer Elements
2 | Composer package with Visual Composer elements mapped to widgets from ProteusWidgets composer package
3 |
--------------------------------------------------------------------------------
/assets/images/pt.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "proteusthemes/visual-composer-elements",
3 | "description": "Composer package with Visual Composer elements mapped to widgets from ProteusWidgets composer package",
4 | "license": "GPLv2",
5 | "authors": [
6 | {
7 | "name": "Gregor Capuder",
8 | "email": "gregor.capuder@proteusnet.com"
9 | }
10 | ]
11 | }
--------------------------------------------------------------------------------
/vc-shortcodes/class-vc-custom-param-types.php:
--------------------------------------------------------------------------------
1 | fa_click_icons_brochure_box = array(
16 | 'fa-file-o',
17 | 'fa-file-pdf-o',
18 | 'fa-file-word-o',
19 | 'fa-file-text-o',
20 | 'fa-file-image-o',
21 | 'fa-file-powerpoint-o',
22 | 'fa-file-excel-o',
23 | 'fa-file-audio-o',
24 | 'fa-file-video-o',
25 | 'fa-file-archive-o',
26 | 'fa-file-code-o',
27 | 'fa-save',
28 | 'fa-download',
29 | 'fa-print',
30 | 'fa-info-circle',
31 | 'fa-question-circle',
32 | 'fa-cog',
33 | 'fa-link',
34 | );
35 |
36 | // Register custom param types
37 | vc_add_shortcode_param( 'upload_file', array( $this, 'upload_file' ) );
38 | vc_add_shortcode_param( 'select_fa_icon_bb', array( $this, 'select_fa_icon_bb' ) );
39 | vc_add_shortcode_param( 'input_number', array( $this, 'input_number' ) );
40 | vc_add_shortcode_param( 'lined_textarea', array( $this, 'lined_textarea' ) );
41 | }
42 |
43 | // Function for registering the upload_file custom param type
44 | function upload_file( $settings, $value ) {
45 | ob_start();
46 | ?>
47 |
48 |
49 |
50 |
51 |
52 |
53 |
61 |
62 |
63 |
FontAwesome' ); ?>
64 |
65 |
66 |
67 | fa_click_icons_brochure_box as $icon ) :
69 | ?>
70 |
71 |
74 |
75 |
76 |
84 |
85 |
86 |
87 |
88 |
89 |
98 |
99 |
100 |
101 | shortcode_name() , array( $this, 'register_shortcode' ) );
13 | add_action( 'vc_before_init', array( $this, 'vc_map_shortcode' ) );
14 | }
15 |
16 | /**
17 | * Functions that child classes have to implement
18 | */
19 |
20 | // Basic shortcode settings
21 | abstract function shortcode_name();
22 |
23 | // Register the shortcode with WordPress
24 | public abstract function register_shortcode( $atts, $content = null );
25 |
26 | // Map the shortcode parameters with the Visual Composer editor (Add the shortcode to the "Content elements" list)
27 | public abstract function vc_map_shortcode();
28 |
29 | }
30 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-accordion-item.php:
--------------------------------------------------------------------------------
1 | '',
23 | 'item_content' => '',
24 | ), $atts );
25 |
26 | $atts['content'] = $atts['item_content'];
27 |
28 | // The PHP_EOL is added so that it can be used as a separator between multiple accordion items
29 | return PHP_EOL . json_encode( $atts );
30 | }
31 |
32 | // Overwrite the vc_map_shortcode function from the parent class
33 | public function vc_map_shortcode() {
34 | vc_map( array(
35 | 'name' => _x( 'Accordion Item', 'backend', 'vc-elements-pt' ),
36 | 'base' => $this->shortcode_name(),
37 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
38 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
39 | 'as_child' => array( 'only' => 'pt_vc_container_accordion' ),
40 | 'params' => array(
41 | array(
42 | 'type' => 'textfield',
43 | 'heading' => _x( 'Title', 'backend', 'vc-elements-pt' ),
44 | 'param_name' => 'title',
45 | ),
46 | array(
47 | 'type' => 'textarea',
48 | 'heading' => _x( 'Content', 'backend', 'vc-elements-pt' ),
49 | 'param_name' => 'item_content',
50 | ),
51 | )
52 | ) );
53 | }
54 | }
55 |
56 | // Initialize the class
57 | new PT_VC_Accordion_Item;
58 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-brochure-box.php:
--------------------------------------------------------------------------------
1 | '',
22 | 'url' => '',
23 | 'new_tab' => '',
24 | 'text' => '',
25 | 'icon' => 'fa-file-text-o',
26 | ), $atts );
27 |
28 | $instance = array(
29 | 'title' => $atts['title'],
30 | 'brochure_url' => $atts['url'],
31 | 'brochure_icon' => $atts['icon'],
32 | 'brochure_text' => $atts['text'],
33 | 'new_tab' => $atts['new_tab'],
34 | );
35 |
36 | ob_start();
37 | the_widget( 'PW_Brochure_Box', $instance );
38 | return ob_get_clean();
39 | }
40 |
41 | // Overwrite the vc_map_shortcode function from the parent class
42 | public function vc_map_shortcode() {
43 | vc_map( array(
44 | 'name' => _x( 'Brochure Box', 'backend', 'vc-elements-pt' ),
45 | 'base' => $this->shortcode_name(),
46 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
47 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
48 | 'params' => array(
49 | array(
50 | 'type' => 'textfield',
51 | 'holder' => 'div',
52 | 'heading' => _x( 'Title', 'backend', 'vc-elements-pt' ),
53 | 'param_name' => 'title',
54 | ),
55 | array(
56 | 'type' => 'upload_file',
57 | 'heading' => _x( 'Brochure URL', 'backend', 'vc-elements-pt' ),
58 | 'param_name' => 'url',
59 | ),
60 | array(
61 | 'type' => 'checkbox',
62 | 'heading' => _x( 'Open link in new tab', 'backend', 'vc-elements-pt' ),
63 | 'param_name' => 'new_tab',
64 | ),
65 | array(
66 | 'type' => 'textfield',
67 | 'holder' => 'div',
68 | 'heading' => _x( 'Brochure Text', 'backend', 'vc-elements-pt' ),
69 | 'param_name' => 'text',
70 | ),
71 | array(
72 | 'type' => 'select_fa_icon_bb',
73 | 'heading' => _x( 'Brochure Icon', 'backend', 'vc-elements-pt' ),
74 | 'param_name' => 'icon',
75 | 'value' => 'fa-file-text-o',
76 | ),
77 | )
78 | ) );
79 | }
80 | }
81 |
82 | // Initialize the class
83 | new PT_VC_Brochure_Box;
84 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-call-to-action.php:
--------------------------------------------------------------------------------
1 | 'Not sure which solution fits you business needs?',
22 | ), $atts );
23 |
24 | $instance = array(
25 | 'text' => $atts['title'],
26 | 'button_text' => $content,
27 | );
28 |
29 | ob_start();
30 | the_widget( 'PW_Call_To_Action', $instance );
31 | return ob_get_clean();
32 | }
33 |
34 | // Overwrite the vc_map_shortcode function from the parent class
35 | public function vc_map_shortcode() {
36 | vc_map( array(
37 | 'name' => _x( 'Call to Action', 'backend', 'vc-elements-pt' ),
38 | 'base' => $this->shortcode_name(),
39 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
40 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
41 | 'params' => array(
42 | array(
43 | 'type' => 'textfield',
44 | 'holder' => 'div',
45 | 'heading' => _x( 'Title', 'backend', 'vc-elements-pt' ),
46 | 'param_name' => 'title',
47 | ),
48 | array(
49 | 'type' => 'textarea_html',
50 | 'class' => '',
51 | 'heading' => _x( 'Button Area', 'backend', 'vc-elements-pt' ),
52 | 'param_name' => 'content',
53 | 'description' => _x( 'For adding buttons you must use button shortcode which look like this: [button]Text[/button]. Please take a look at the documentation for more details.', 'backend', 'vc-elements-pt' ),
54 | ),
55 | )
56 | ) );
57 | }
58 | }
59 |
60 | // Initialize the class
61 | new PT_VC_Call_To_Action;
62 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-container-accordion.php:
--------------------------------------------------------------------------------
1 | '',
23 | 'read_more_url' => '',
24 | ), $atts );
25 |
26 | $items = PT_VC_Helper_Functions::get_child_elements_data( $content );
27 |
28 | // Set id for each item
29 | foreach ($items as $key => $item) {
30 | $items[ $key ]['id'] = $key;
31 | }
32 |
33 | $instance = array(
34 | 'title' => $atts['title'],
35 | 'read_more_link' => $atts['read_more_url'],
36 | 'items' => $items,
37 | );
38 |
39 | $args['widget_id'] = uniqid( 'widget-' );
40 |
41 | ob_start();
42 | the_widget( 'PW_Accordion', $instance , $args );
43 | return ob_get_clean();
44 | }
45 |
46 | // Overwrite the vc_map_shortcode function from the parent class
47 | public function vc_map_shortcode() {
48 | vc_map( array(
49 | 'name' => _x( 'Accordion', 'backend', 'vc-elements-pt' ),
50 | 'base' => $this->shortcode_name(),
51 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
52 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
53 | 'as_parent' => array( 'only' => 'pt_vc_accordion_item' ),
54 | 'content_element' => true,
55 | 'js_view' => 'VcColumnView',
56 | 'params' => array(
57 | array(
58 | 'type' => 'textfield',
59 | 'holder' => 'div',
60 | 'heading' => _x( 'Title', 'backend', 'vc-elements-pt' ),
61 | 'param_name' => 'title',
62 | ),
63 | array(
64 | 'type' => 'textfield',
65 | 'heading' => _x( 'Read more URL', 'backend', 'vc-elements-pt' ),
66 | 'param_name' => 'read_more_url',
67 | ),
68 | )
69 | ) );
70 | }
71 | }
72 |
73 | // Initialize the class
74 | new PT_VC_Container_Accordion;
75 |
76 | // The "container" content element should extend WPBakeryShortCodesContainer class to inherit all required functionality
77 | if ( class_exists( 'WPBakeryShortCodesContainer' ) ) {
78 | class WPBakeryShortCode_Pt_Vc_Container_Accordion extends WPBakeryShortCodesContainer {}
79 | }
80 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-container-google-maps.php:
--------------------------------------------------------------------------------
1 | '51.5862682,-0.3009941',
23 | 'zoom' => 7,
24 | 'type' => 'roadmap',
25 | 'style' => apply_filters( 'vc_pt/current_theme_google_map_style' , 'CargoPress' ),
26 | 'height' => 380,
27 | ), $atts );
28 |
29 | $locations = PT_VC_Helper_Functions::get_child_elements_data( $content );
30 |
31 | $instance = array(
32 | 'locations' => $locations,
33 | 'latLng' => $atts['lat_long'],
34 | 'zoom' => absint( $atts['zoom'] ),
35 | 'type' => $atts['type'],
36 | 'style' => $atts['style'],
37 | 'height' => absint( $atts['height'] ),
38 | );
39 |
40 | ob_start();
41 | the_widget( 'PW_Google_Map', $instance );
42 | return ob_get_clean();
43 | }
44 |
45 | // Overwrite the vc_map_shortcode function from the parent class
46 | public function vc_map_shortcode() {
47 | vc_map( array(
48 | 'name' => _x( 'Google Map', 'backend', 'vc-elements-pt' ),
49 | 'base' => $this->shortcode_name(),
50 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
51 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
52 | 'as_parent' => array( 'only' => 'pt_vc_location' ),
53 | 'content_element' => true,
54 | 'js_view' => 'VcColumnView',
55 | 'params' => array(
56 | array(
57 | 'type' => 'textfield',
58 | 'heading' => _x( 'Latitude and longitude of the map center', 'backend', 'vc-elements-pt' ),
59 | 'description' => sprintf( __( 'Get this from %s (right click on map and select What\'s here?) or %s. Latitude and longitude separated by comma.', 'vc-elements-pt' ), 'Google Maps', 'this site' ),
60 | 'param_name' => 'lat_long',
61 | 'value' => '51.5862682,-0.3009941',
62 | ),
63 | array(
64 | 'type' => 'dropdown',
65 | 'heading' => _x( 'Zoom of the map', 'backend', 'vc-elements-pt' ),
66 | 'description' => _x( 'Higher number means closer view', 'backend', 'vc-elements-pt' ),
67 | 'param_name' => 'zoom',
68 | 'value' => range( 1, 24 ),
69 | 'std' => 7,
70 | ),
71 | array(
72 | 'type' => 'dropdown',
73 | 'heading' => _x( 'Type', 'backend', 'vc-elements-pt' ),
74 | 'param_name' => 'type',
75 | 'value' => array(
76 | _x( 'Roadmap', 'backend', 'vc-elements-pt' ) => 'roadmap',
77 | _x( 'Satellite', 'backend', 'vc-elements-pt' ) => 'satellite',
78 | _x( 'Hybrid', 'backend', 'vc-elements-pt' ) => 'hybrid',
79 | _x( 'Terrain', 'backend', 'vc-elements-pt' ) => 'terrain',
80 | ),
81 | ),
82 | array(
83 | 'type' => 'dropdown',
84 | 'heading' => _x( 'Style', 'backend', 'vc-elements-pt' ),
85 | 'param_name' => 'style',
86 | 'value' => array(
87 | apply_filters( 'vc_pt/current_theme_google_map_style' , 'CargoPress' ),
88 | 'Default',
89 | 'Subtle Grayscale',
90 | 'Pale Dawn',
91 | 'Blue Water',
92 | 'Gowalla',
93 | ),
94 | ),
95 | array(
96 | 'type' => 'textfield',
97 | 'heading' => _x( 'Height of the map', 'backend', 'vc-elements-pt' ),
98 | 'description' => _x( 'Input height in pixels', 'backend', 'vc-elements-pt' ),
99 | 'param_name' => 'height',
100 | 'value' => 380,
101 | ),
102 | )
103 | ) );
104 | }
105 | }
106 |
107 | // Initialize the class
108 | new PT_VC_Container_Google_Map;
109 |
110 | // The "container" content element should extend WPBakeryShortCodesContainer class to inherit all required functionality
111 | if ( class_exists( 'WPBakeryShortCodesContainer' ) ) {
112 | class WPBakeryShortCode_Pt_Vc_Container_Google_Map extends WPBakeryShortCodesContainer {}
113 | }
114 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-container-number-counter.php:
--------------------------------------------------------------------------------
1 | '1000',
23 | ), $atts );
24 |
25 | $counters = PT_VC_Helper_Functions::get_child_elements_data( $content );
26 |
27 | $instance = array(
28 | 'speed' => absint( $atts['speed'] ),
29 | 'counters' => $counters,
30 | );
31 |
32 | ob_start();
33 | the_widget( 'PW_Number_Counter', $instance );
34 | return ob_get_clean();
35 | }
36 |
37 | // Overwrite the vc_map_shortcode function from the parent class
38 | public function vc_map_shortcode() {
39 | vc_map( array(
40 | 'name' => _x( 'Number Counter', 'backend', 'vc-elements-pt' ),
41 | 'base' => $this->shortcode_name(),
42 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
43 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
44 | 'as_parent' => array( 'only' => 'pt_vc_counter' ),
45 | 'content_element' => true,
46 | 'js_view' => 'VcColumnView',
47 | 'params' => array(
48 | array(
49 | 'type' => 'textfield',
50 | 'heading' => _x( 'Counting time', 'backend', 'vc-elements-pt' ),
51 | 'description' => _x( 'Input time (number) in milliseconds.', 'backend', 'vc-elements-pt' ),
52 | 'param_name' => 'speed',
53 | 'value' => '1000',
54 | ),
55 | )
56 | ) );
57 | }
58 | }
59 |
60 | // Initialize the class
61 | new PT_VC_Container_Number_Counter;
62 |
63 | // The "container" content element should extend WPBakeryShortCodesContainer class to inherit all required functionality
64 | if ( class_exists( 'WPBakeryShortCodesContainer' ) ) {
65 | class WPBakeryShortCode_Pt_Vc_Container_Number_Counter extends WPBakeryShortCodesContainer {}
66 | }
67 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-container-social-icons.php:
--------------------------------------------------------------------------------
1 | '',
23 | ), $atts );
24 |
25 | $social_icons = PT_VC_Helper_Functions::get_child_elements_data( $content );
26 |
27 | $instance = array(
28 | 'new_tab' => $atts['new_tab'],
29 | 'social_icons' => $social_icons,
30 | );
31 |
32 | ob_start();
33 | the_widget( 'PW_Social_Icons', $instance );
34 | return ob_get_clean();
35 | }
36 |
37 | // Overwrite the vc_map_shortcode function from the parent class
38 | public function vc_map_shortcode() {
39 | vc_map( array(
40 | 'name' => _x( 'Social Icons', 'backend', 'vc-elements-pt' ),
41 | 'base' => $this->shortcode_name(),
42 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
43 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
44 | 'as_parent' => array( 'only' => 'pt_vc_social_icon' ),
45 | 'content_element' => true,
46 | 'js_view' => 'VcColumnView',
47 | 'params' => array(
48 | array(
49 | 'type' => 'checkbox',
50 | 'heading' => _x( 'Open link in new tab', 'backend', 'vc-elements-pt' ),
51 | 'param_name' => 'new_tab',
52 | ),
53 | )
54 | ) );
55 | }
56 | }
57 |
58 | // Initialize the class
59 | new PT_VC_Container_Social_Icons;
60 |
61 | // The "container" content element should extend WPBakeryShortCodesContainer class to inherit all required functionality
62 | if ( class_exists( 'WPBakeryShortCodesContainer' ) ) {
63 | class WPBakeryShortCode_Pt_Vc_Container_Social_Icons extends WPBakeryShortCodesContainer {}
64 | }
65 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-container-steps.php:
--------------------------------------------------------------------------------
1 | '',
23 | ), $atts );
24 |
25 | $items = PT_VC_Helper_Functions::get_child_elements_data( $content );
26 |
27 | $instance = array(
28 | 'title' => $atts['title'],
29 | 'items' => $items,
30 | );
31 |
32 | ob_start();
33 | the_widget( 'PW_Steps', $instance );
34 | return ob_get_clean();
35 | }
36 |
37 | // Overwrite the vc_map_shortcode function from the parent class
38 | public function vc_map_shortcode() {
39 | vc_map( array(
40 | 'name' => _x( 'Steps', 'backend', 'vc-elements-pt' ),
41 | 'base' => $this->shortcode_name(),
42 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
43 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
44 | 'as_parent' => array( 'only' => 'pt_vc_step' ),
45 | 'content_element' => true,
46 | 'js_view' => 'VcColumnView',
47 | 'params' => array(
48 | array(
49 | 'type' => 'textfield',
50 | 'holder' => 'div',
51 | 'heading' => _x( 'Title', 'backend', 'vc-elements-pt' ),
52 | 'param_name' => 'title',
53 | ),
54 | )
55 | ) );
56 | }
57 | }
58 |
59 | // Initialize the class
60 | new PT_VC_Container_Steps;
61 |
62 | // The "container" content element should extend WPBakeryShortCodesContainer class to inherit all required functionality
63 | if ( class_exists( 'WPBakeryShortCodesContainer' ) ) {
64 | class WPBakeryShortCode_Pt_Vc_Container_Steps extends WPBakeryShortCodesContainer {}
65 | }
66 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-container-testimonials.php:
--------------------------------------------------------------------------------
1 | __( 'Testimonials', 'vc-elements-pt' ),
23 | 'autocycle' => 'no',
24 | 'interval' => '5000',
25 | ), $atts );
26 |
27 | $testimonials = PT_VC_Helper_Functions::get_child_elements_data( $content );
28 |
29 | $instance = array(
30 | 'title' => $atts['title'],
31 | 'autocycle' => $atts['autocycle'],
32 | 'interval' => absint( $atts['interval'] ),
33 | 'testimonials' => $testimonials,
34 | );
35 |
36 | // Unique widget id so that the navigation/slider for testimonials work properly.
37 | $args = array(
38 | 'widget_id' => uniqid( 'widget-id-' ),
39 | );
40 |
41 | ob_start();
42 | the_widget( 'PW_Testimonials', $instance, $args );
43 | return ob_get_clean();
44 | }
45 |
46 | // Overwrite the vc_map_shortcode function from the parent class
47 | public function vc_map_shortcode() {
48 | vc_map( array(
49 | 'name' => _x( 'Testimonials', 'backend', 'vc-elements-pt' ),
50 | 'base' => $this->shortcode_name(),
51 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
52 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
53 | 'as_parent' => array( 'only' => 'pt_vc_testimonial' ),
54 | 'content_element' => true,
55 | 'js_view' => 'VcColumnView',
56 | 'params' => array(
57 | array(
58 | 'type' => 'textfield',
59 | 'heading' => _x( 'Title', 'backend', 'vc-elements-pt' ),
60 | 'param_name' => 'title',
61 | 'value' => _x( 'Testimonials', 'backend', 'vc-elements-pt' ),
62 | ),
63 | array(
64 | 'type' => 'dropdown',
65 | 'heading' => _x( 'Automatically cycle the carousel?', 'backend', 'vc-elements-pt' ),
66 | 'param_name' => 'autocycle',
67 | 'value' => array(
68 | _x( 'No', 'backend', 'vc-elements-pt' ) => 'no',
69 | _x( 'Yes', 'backend', 'vc-elements-pt' ) => 'yes',
70 | ),
71 | ),
72 | array(
73 | 'type' => 'textfield',
74 | 'heading' => _x( 'Interval', 'backend', 'vc-elements-pt' ),
75 | 'description' => _x( 'Input time (number) in milliseconds.', 'backend', 'vc-elements-pt' ),
76 | 'param_name' => 'interval',
77 | 'value' => '5000',
78 | 'dependency' => array(
79 | 'element' => 'autocycle',
80 | 'value' => array( 'yes' )
81 | ),
82 | ),
83 | )
84 | ) );
85 | }
86 | }
87 |
88 | // Initialize the class
89 | new PT_VC_Container_Testimonials;
90 |
91 | // The "container" content element should extend WPBakeryShortCodesContainer class to inherit all required functionality
92 | if ( class_exists( 'WPBakeryShortCodesContainer' ) ) {
93 | class WPBakeryShortCode_Pt_Vc_Container_Testimonials extends WPBakeryShortCodesContainer {}
94 | }
95 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-counter.php:
--------------------------------------------------------------------------------
1 | __( 'Test Title', 'vc-elements-pt' ),
23 | 'number' => '299',
24 | 'icon' => 'fa fa-home',
25 | ), $atts );
26 |
27 | $atts['number'] = absint( $atts['number'] );
28 |
29 | // The PHP_EOL is added so that it can be used as a separator between multiple counters
30 | return PHP_EOL . json_encode( $atts );
31 | }
32 |
33 | // Overwrite the vc_map_shortcode function from the parent class
34 | public function vc_map_shortcode() {
35 | vc_map( array(
36 | 'name' => _x( 'Counter', 'backend', 'vc-elements-pt' ),
37 | 'base' => $this->shortcode_name(),
38 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
39 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
40 | 'as_child' => array( 'only' => 'pt_vc_container_number_counter' ),
41 | 'params' => array(
42 | array(
43 | 'type' => 'textfield',
44 | 'heading' => _x( 'Title', 'backend', 'vc-elements-pt' ),
45 | 'param_name' => 'title',
46 | ),
47 | array(
48 | 'type' => 'textfield',
49 | 'heading' => _x( 'Number', 'backend', 'vc-elements-pt' ),
50 | 'description' => _x( 'Input a positive number.', 'backend', 'vc-elements-pt' ),
51 | 'param_name' => 'number',
52 | 'min' => '1',
53 | ),
54 | array(
55 | 'type' => 'iconpicker',
56 | 'heading' => _x( 'Icon', 'backend', 'vc-elements-pt' ),
57 | 'param_name' => 'icon',
58 | 'value' => 'fa fa-home',
59 | 'description' => _x( 'Select icon from library.', 'backend', 'vc-elements-pt' ),
60 | 'settings' => array(
61 | 'emptyIcon' => false, // default true, display an "EMPTY" icon?
62 | 'iconsPerPage' => 100, // default 100, how many icons per/page to display
63 | ),
64 | ),
65 | )
66 | ) );
67 | }
68 | }
69 |
70 | // Initialize the class
71 | new PT_VC_Counter;
72 | }
73 |
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-facebook.php:
--------------------------------------------------------------------------------
1 | 'Facebook',
22 | 'fb_page_url' => 'https://www.facebook.com/ProteusThemes',
23 | 'width' => 340,
24 | 'height' => 500,
25 | 'checkbox_options' => '',
26 | ), $atts );
27 |
28 | // Prepare check-boxes data
29 | $atts['checkbox_options'] = explode( ',', $atts['checkbox_options'] );
30 |
31 | $all_checkbox_options = array(
32 | 'hide_cover',
33 | 'show_facepile',
34 | 'show_posts',
35 | 'small_header',
36 | );
37 |
38 | $fb_params_options = array();
39 |
40 | foreach ( $atts['checkbox_options'] as $option ) {
41 | if ( in_array( $option , $all_checkbox_options ) ) {
42 | $fb_params_options[ $option ] = true;
43 | }
44 | }
45 |
46 | $instance = array(
47 | 'title' => $atts['title'],
48 | 'like_link' => $atts['fb_page_url'],
49 | 'width' => $atts['width'],
50 | 'height' => $atts['height'],
51 | );
52 |
53 | $instance = array_merge( $instance, $fb_params_options );
54 |
55 | ob_start();
56 | the_widget( 'PW_Facebook', $instance );
57 | return ob_get_clean();
58 | }
59 |
60 | // Overwrite the vc_map_shortcode function from the parent class
61 | public function vc_map_shortcode() {
62 | vc_map( array(
63 | 'name' => _x( 'Facebook Box', 'backend', 'vc-elements-pt' ),
64 | 'base' => $this->shortcode_name(),
65 | 'category' => _x( 'Social', 'backend', 'vc-elements-pt' ),
66 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
67 | 'params' => array(
68 | array(
69 | 'type' => 'textfield',
70 | 'heading' => _x( 'Title', 'backend', 'vc-elements-pt' ),
71 | 'param_name' => 'title',
72 | 'value' => 'Facebook',
73 | ),
74 | array(
75 | 'type' => 'textfield',
76 | 'heading' => _x( 'FB Page to like', 'backend', 'vc-elements-pt' ),
77 | 'description' => _x( 'Input the whole FB page url. Example: https://www.facebook.com/ProteusThemes', 'backend', 'vc-elements-pt' ),
78 | 'param_name' => 'fb_page_url',
79 | 'value' => 'https://www.facebook.com/ProteusThemes',
80 | ),
81 | array(
82 | 'type' => 'textfield',
83 | 'heading' => _x( 'Width', 'backend', 'vc-elements-pt' ),
84 | 'description' => _x( 'Input width in pixels. Min: 180, Max: 500', 'backend', 'vc-elements-pt' ),
85 | 'param_name' => 'width',
86 | ),
87 | array(
88 | 'type' => 'textfield',
89 | 'heading' => _x( 'Height', 'backend', 'vc-elements-pt' ),
90 | 'description' => _x( 'Input height in pixels. Min: 70', 'backend', 'vc-elements-pt' ),
91 | 'param_name' => 'height',
92 | ),
93 | array(
94 | 'type' => 'checkbox',
95 | 'heading' => _x( 'Options', 'backend', 'vc-elements-pt' ),
96 | 'param_name' => 'checkbox_options',
97 | 'value' => array(
98 | 'Hide Cover Photo' => 'hide_cover',
99 | 'Hide Friend\'s Faces' => 'show_facepile',
100 | 'Show Page Posts' => 'show_posts',
101 | 'Use Small Header' => 'small_header',
102 | ),
103 | ),
104 | )
105 | ) );
106 | }
107 | }
108 |
109 | // Initialize the class
110 | new PT_VC_Facebook;
111 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-featured-page.php:
--------------------------------------------------------------------------------
1 | '',
24 | 'layout' => 'block',
25 | 'read_more_text' => __( 'Read more', 'vc-elements-pt' ),
26 | 'tag' => '',
27 | ), $atts );
28 |
29 | $instance = array(
30 | 'page_id' => absint( $atts['page'] ),
31 | 'layout' => $atts['layout'],
32 | 'read_more_text' => $atts['read_more_text'],
33 | 'tag' => $atts['tag'],
34 | );
35 |
36 | ob_start();
37 | the_widget( 'PW_Featured_Page', $instance );
38 | return ob_get_clean();
39 | }
40 |
41 | // Overwrite the vc_map_shortcode function from the parent class
42 | public function vc_map_shortcode() {
43 |
44 | // Get the settings for the this widget
45 | $this->fields = apply_filters( 'pw/featured_page_fields', array(
46 | 'read_more_text' => true,
47 | 'tag' => false,
48 | ) );
49 |
50 | // Get all pages to use in the dropdown below:
51 | $args = array(
52 | 'sort_order' => 'ASC',
53 | 'sort_column' => 'post_title',
54 | 'post_type' => 'page',
55 | 'post_status' => 'publish',
56 | );
57 | $pages = get_pages( $args );
58 |
59 | $list_of_pages = array();
60 |
61 | // Parse through the objects returned and add the key value pairs to the list_of_pages array
62 | foreach ( $pages as $page ) {
63 | $list_of_pages[ $page->post_title ] = $page->ID;
64 | }
65 |
66 | $params = array(
67 | array(
68 | 'type' => 'dropdown',
69 | 'heading' => _x( 'Page', 'backend', 'vc-elements-pt' ),
70 | 'param_name' => 'page',
71 | 'value' => $list_of_pages,
72 | ),
73 | array(
74 | 'type' => 'dropdown',
75 | 'heading' => _x( 'Layout', 'backend', 'vc-elements-pt' ),
76 | 'param_name' => 'layout',
77 | 'value' => array(
78 | _x( 'With big picture', 'backend', 'vc-elements-pt' ) => 'block',
79 | _x( 'With small picture, inline', 'backend', 'vc-elements-pt' ) => 'inline',
80 | ),
81 | ),
82 | array(
83 | 'type' => 'textfield',
84 | 'heading' => _x( 'Read more text', 'backend', 'vc-elements-pt' ),
85 | 'param_name' => 'read_more_text',
86 | 'value' => _x( 'Read more', 'backend', 'vc-elements-pt' ),
87 | ),
88 | );
89 |
90 | if ( $this->fields['tag'] ) {
91 | $params[] = array(
92 | 'type' => 'textfield',
93 | 'heading' => _x( 'Tag', 'backend', 'vc-elements-pt' ),
94 | 'param_name' => 'tag',
95 | );
96 | }
97 |
98 | vc_map( array(
99 | 'name' => _x( 'Featured Page', 'backend', 'vc-elements-pt' ),
100 | 'base' => $this->shortcode_name(),
101 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
102 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
103 | 'params' => $params,
104 | ) );
105 | }
106 | }
107 |
108 | // Initialize the class
109 | new PT_VC_Featured_Page;
110 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-icon-box.php:
--------------------------------------------------------------------------------
1 | '',
24 | 'text' => '',
25 | 'link' => '',
26 | 'new_tab' => '',
27 | 'icon' => 'fa fa-home',
28 | 'featured' => '',
29 | ), $atts );
30 |
31 | // Extract the icon class without the first 'fa' part
32 | $icon = explode( ' ', $atts['icon'] );
33 |
34 | $instance = array(
35 | 'title' => $atts['title'],
36 | 'text' => $atts['text'],
37 | 'btn_link' => $atts['link'],
38 | 'icon' => $icon[1],
39 | 'new_tab' => $atts['new_tab'],
40 | 'featured' => $atts['featured'],
41 | );
42 |
43 | ob_start();
44 | the_widget( 'PW_Icon_Box', $instance );
45 | return ob_get_clean();
46 | }
47 |
48 | // Overwrite the vc_map_shortcode function from the parent class
49 | public function vc_map_shortcode() {
50 |
51 | // Get the settings for the icon box widgets
52 | $this->fields = apply_filters( 'pw/icon_box_widget', array(
53 | 'featured_setting' => false,
54 | ) );
55 |
56 | $params = array(
57 | array(
58 | 'type' => 'textfield',
59 | 'holder' => 'div',
60 | 'heading' => _x( 'Title', 'backend', 'vc-elements-pt' ),
61 | 'param_name' => 'title',
62 | ),
63 | array(
64 | 'type' => 'textfield',
65 | 'heading' => _x( 'Text', 'backend', 'vc-elements-pt' ),
66 | 'param_name' => 'text',
67 | ),
68 | array(
69 | 'type' => 'textfield',
70 | 'heading' => _x( 'Link', 'backend', 'vc-elements-pt' ),
71 | 'description' => _x( 'URL to any page, optional.', 'backend', 'vc-elements-pt' ),
72 | 'param_name' => 'link',
73 | ),
74 | array(
75 | 'type' => 'checkbox',
76 | 'heading' => _x( 'Open link in new tab', 'backend', 'vc-elements-pt' ),
77 | 'param_name' => 'new_tab',
78 | ),
79 | array(
80 | 'type' => 'iconpicker',
81 | 'heading' => _x( 'Icon', 'backend', 'vc-elements-pt' ),
82 | 'param_name' => 'icon',
83 | 'value' => 'fa fa-home',
84 | 'description' => _x( 'Select icon from library.', 'backend', 'vc-elements-pt' ),
85 | 'settings' => array(
86 | 'emptyIcon' => false, // default true, display an "EMPTY" icon?
87 | 'iconsPerPage' => 100, // default 100, how many icons per/page to display
88 | ),
89 | ),
90 | );
91 |
92 | if ( $this->fields['featured_setting'] ) {
93 | $params[] = array(
94 | 'type' => 'checkbox',
95 | 'heading' => _x( 'Highlight this widget', 'backend', 'vc-elements-pt' ),
96 | 'param_name' => 'featured',
97 | );
98 | }
99 |
100 | vc_map( array(
101 | 'name' => _x( 'Icon Box', 'backend', 'vc-elements-pt' ),
102 | 'base' => $this->shortcode_name(),
103 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
104 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
105 | 'params' => $params,
106 | ) );
107 | }
108 | }
109 |
110 | // Initialize the class
111 | new PT_VC_Icon_Box;
112 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-latest-news.php:
--------------------------------------------------------------------------------
1 | max_post_number = 10;
20 | }
21 |
22 | // Overwrite the register_shortcode function from the parent class
23 | public function register_shortcode( $atts, $content = null ) {
24 | $atts = shortcode_atts( array(
25 | 'layout' => 'block',
26 | 'order_number' => 1,
27 | 'order_number_from' => 1,
28 | 'order_number_to' => 3,
29 | 'show_more_link' => '',
30 | ), $atts );
31 |
32 | $instance = array(
33 | 'type' => $atts['layout'],
34 | 'from' => absint( $atts['order_number'] ),
35 | 'to' => absint( $atts['order_number'] ),
36 | 'more_news' => $atts['show_more_link'],
37 | );
38 |
39 | // If the inline layout is selected then set the from and to variables
40 | if ( 'inline' === $atts['layout'] ) {
41 | $instance['from'] = absint( $atts['order_number_from'] );
42 | $instance['to'] = absint( $atts['order_number_to'] );
43 | }
44 |
45 | // Bound from and to between 1 and max_post_number
46 | $instance['from'] = PW_Functions::bound( $instance['from'], 1, $this->max_post_number );
47 | $instance['to'] = PW_Functions::bound( $instance['to'], 1, $this->max_post_number );
48 |
49 | // to can't be lower than from
50 | if ( $instance['from'] > $instance['to'] ) {
51 | $instance['to'] = $instance['from'];
52 | }
53 |
54 | ob_start();
55 | the_widget( 'PW_Latest_News', $instance );
56 | return ob_get_clean();
57 | }
58 |
59 | // Overwrite the vc_map_shortcode function from the parent class
60 | public function vc_map_shortcode() {
61 | vc_map( array(
62 | 'name' => _x( 'Latest News', 'backend', 'vc-elements-pt' ),
63 | 'base' => $this->shortcode_name(),
64 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
65 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
66 | 'params' => array(
67 | array(
68 | 'type' => 'dropdown',
69 | 'holder' => 'div',
70 | 'heading' => _x( 'Display type', 'backend', 'vc-elements-pt' ),
71 | 'param_name' => 'layout',
72 | 'value' => array(
73 | _x( 'Box (one post)', 'backend', 'vc-elements-pt' ) => 'block',
74 | _x( 'Inline (multiple posts)', 'backend', 'vc-elements-pt' ) => 'inline',
75 | ),
76 | ),
77 | array(
78 | 'type' => 'input_number',
79 | 'heading' => _x( 'Post order number', 'backend', 'vc-elements-pt' ),
80 | 'description' => _x( 'Input a number. Min: 1, Max: 10', 'backend', 'vc-elements-pt' ),
81 | 'param_name' => 'order_number',
82 | 'min' => 1,
83 | 'max' => $this->max_post_number,
84 | 'value' => 1,
85 | 'dependency' => array(
86 | 'element' => 'layout',
87 | 'value' => array( 'block' )
88 | ),
89 | ),
90 | array(
91 | 'type' => 'input_number',
92 | 'heading' => _x( 'Post order number for the start of the interval', 'backend', 'vc-elements-pt' ),
93 | 'description' => _x( 'Input a number. Min: 1, Max: 10', 'backend', 'vc-elements-pt' ),
94 | 'param_name' => 'order_number_from',
95 | 'min' => 1,
96 | 'max' => $this->max_post_number,
97 | 'value' => 1,
98 | 'dependency' => array(
99 | 'element' => 'layout',
100 | 'value' => array( 'inline' )
101 | ),
102 | ),
103 | array(
104 | 'type' => 'input_number',
105 | 'heading' => _x( 'Post order number for the end of the interval', 'backend', 'vc-elements-pt' ),
106 | 'description' => _x( 'Input a number. Min: 1, Max: 10', 'backend', 'vc-elements-pt' ),
107 | 'param_name' => 'order_number_to',
108 | 'min' => 1,
109 | 'max' => $this->max_post_number,
110 | 'value' => 3,
111 | 'dependency' => array(
112 | 'element' => 'layout',
113 | 'value' => array( 'inline' )
114 | ),
115 | ),
116 | array(
117 | 'type' => 'checkbox',
118 | 'heading' => _x( 'Show more news link', 'backend', 'vc-elements-pt' ),
119 | 'param_name' => 'show_more_link',
120 | ),
121 | )
122 | ) );
123 | }
124 | }
125 |
126 | // Initialize the class
127 | new PT_VC_Latest_News;
128 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-location.php:
--------------------------------------------------------------------------------
1 | __( 'London', 'vc-elements-pt' ),
23 | 'locationlatlng' => '51.507331,-0.127668',
24 | 'custompinimage' => '',
25 | ), $atts );
26 |
27 | // The PHP_EOL is added so that it can be used as a separator between multiple locations
28 | return PHP_EOL . json_encode( $atts );
29 | }
30 |
31 | // Overwrite the vc_map_shortcode function from the parent class
32 | public function vc_map_shortcode() {
33 | vc_map( array(
34 | 'name' => _x( 'Location', 'backend', 'vc-elements-pt' ),
35 | 'base' => $this->shortcode_name(),
36 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
37 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
38 | 'as_child' => array( 'only' => 'pt_vc_container_google_map' ),
39 | 'params' => array(
40 | array(
41 | 'type' => 'textfield',
42 | 'heading' => _x( 'Title of location', 'backend', 'vc-elements-pt' ),
43 | 'description' => _x( 'This is shown on the pin mouse hover', 'backend', 'vc-elements-pt' ),
44 | 'param_name' => 'title',
45 | 'value' => _x( 'London', 'backend', 'vc-elements-pt' ),
46 | ),
47 | array(
48 | 'type' => 'textfield',
49 | 'heading' => _x( 'Latitude and longitude of this location', 'backend', 'vc-elements-pt' ),
50 | 'description' => _x( 'Example: 51.507331,-0.127668', 'backend', 'vc-elements-pt' ),
51 | 'param_name' => 'locationlatlng',
52 | 'value' => '51.507331,-0.127668',
53 | ),
54 | array(
55 | 'type' => 'textfield',
56 | 'heading' => _x( 'Custom pin icon URL', 'backend', 'vc-elements-pt' ),
57 | 'description' => _x( 'Input the URL of the pin icon image', 'backend', 'vc-elements-pt' ),
58 | 'param_name' => 'custompinimage',
59 | ),
60 | )
61 | ) );
62 | }
63 | }
64 |
65 | // Initialize the class
66 | new PT_VC_Location;
67 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-opening-time.php:
--------------------------------------------------------------------------------
1 | '',
22 | 'days_hours' => 'opened|8:00|16:00,opened|11:00|19:00,opened|8:00|16:00,closed,opened|11:00|19:00,closed,closed',
23 | 'separator' => ' - ',
24 | 'closed' => __( 'CLOSED', 'vc-elements-pt' ),
25 | 'text_below' => '',
26 | ), $atts );
27 |
28 | $instance = array(
29 | 'title' => $atts['title'],
30 | 'separator' => $atts['separator'],
31 | 'closed_text' => $atts['closed'],
32 | 'additional_info' => $atts['text_below'],
33 | );
34 |
35 | $days = array( 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' );
36 |
37 | $lines = explode( PHP_EOL , $atts['days_hours'] );
38 |
39 | for ( $i = 0; $i < 7; $i++ ) {
40 | $line = ! empty( $lines[ $i ] ) ? explode( '|' , $lines[ $i ] ) : '';
41 | $instance[ $days[ $i ] . '_opened' ] = ( ! empty( $line[0] ) && 'opened' === $line[0] ) ? '1' : '';
42 | $instance[ $days[ $i ] . '_from' ] = ! empty( $line[1] ) ? wp_strip_all_tags( $line[1] ) : '';
43 | $instance[ $days[ $i ] . '_to' ] = ! empty( $line[2] ) ? wp_strip_all_tags( $line[2] ) : '';
44 | }
45 |
46 | ob_start();
47 | the_widget( 'PW_Opening_Time', $instance );
48 | return ob_get_clean();
49 | }
50 |
51 | // Overwrite the vc_map_shortcode function from the parent class
52 | public function vc_map_shortcode() {
53 | vc_map( array(
54 | 'name' => _x( 'Opening Time', 'backend', 'vc-elements-pt' ),
55 | 'base' => $this->shortcode_name(),
56 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
57 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
58 | 'params' => array(
59 | array(
60 | 'type' => 'textfield',
61 | 'holder' => 'div',
62 | 'heading' => _x( 'Title', 'backend', 'vc-elements-pt' ),
63 | 'param_name' => 'title',
64 | ),
65 | array(
66 | 'type' => 'lined_textarea',
67 | 'heading' => _x( 'Days and Hours', 'backend', 'vc-elements-pt' ),
68 | 'description' => _x( 'Enter values for opening times - opened or closed|opening time|closing time. Divide value sets with linebreak "Enter" (Example: opened|8:00|16:00).', 'backend', 'vc-elements-pt' ),
69 | 'param_name' => 'days_hours',
70 | 'rows' => '7',
71 | 'value' => 'opened|8:00|16:00,opened|11:00|19:00,opened|8:00|16:00,closed,opened|11:00|19:00,closed,closed',
72 | ),
73 | array(
74 | 'type' => 'textfield',
75 | 'heading' => _x( 'Separator between hours', 'backend', 'vc-elements-pt' ),
76 | 'param_name' => 'separator',
77 | 'value' => ' - ',
78 | ),
79 | array(
80 | 'type' => 'textfield',
81 | 'heading' => _x( 'Text used for closed days', 'backend', 'vc-elements-pt' ),
82 | 'param_name' => 'closed',
83 | 'value' => _x( 'CLOSED', 'backend', 'vc-elements-pt' ),
84 | ),
85 | array(
86 | 'type' => 'textfield',
87 | 'heading' => _x( 'Text below the timetable for additional info (for example lunch time)', 'backend', 'vc-elements-pt' ),
88 | 'param_name' => 'text_below',
89 | ),
90 | )
91 | ) );
92 | }
93 | }
94 |
95 | // Initialize the class
96 | new PT_VC_Opening_Time;
97 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-person-profile.php:
--------------------------------------------------------------------------------
1 | '',
22 | 'title' => '',
23 | 'image_url' => '',
24 | 'introduction' => '',
25 | 'new_tab' => '',
26 | 'social_links' => '',
27 | ), $atts );
28 |
29 | // Prepare social icons for the Person Profile widget
30 | $lines = explode( PHP_EOL , $atts['social_links'] );
31 | $social_icons = array();
32 |
33 | foreach ( $lines as $line ) {
34 | $split_line = explode( '|', $line );
35 | $tmp_array = array(
36 | 'link' => wp_strip_all_tags( $split_line[0] ),
37 | 'icon' => wp_strip_all_tags( $split_line[1] ),
38 | );
39 | $social_icons[] = $tmp_array;
40 | }
41 |
42 | $instance = array(
43 | 'name' => $atts['name'],
44 | 'tag' => $atts['title'],
45 | 'image' => $atts['image_url'],
46 | 'description' => $atts['introduction'],
47 | 'new_tab' => $atts['new_tab'],
48 | 'social_icons' => $social_icons,
49 | );
50 |
51 | ob_start();
52 | the_widget( 'PW_Person_Profile', $instance );
53 | return ob_get_clean();
54 | }
55 |
56 | // Overwrite the vc_map_shortcode function from the parent class
57 | public function vc_map_shortcode() {
58 | vc_map( array(
59 | 'name' => _x( 'Person Profile', 'backend', 'vc-elements-pt' ),
60 | 'base' => $this->shortcode_name(),
61 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
62 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
63 | 'params' => array(
64 | array(
65 | 'type' => 'textfield',
66 | 'holder' => 'div',
67 | 'heading' => _x( 'Name', 'backend', 'vc-elements-pt' ),
68 | 'param_name' => 'name',
69 | 'value' => esc_html__( 'Jeff Lopez', 'vc-elements-pt' ),
70 | ),
71 | array(
72 | 'type' => 'textfield',
73 | 'heading' => _x( 'Title', 'backend', 'vc-elements-pt' ),
74 | 'param_name' => 'title',
75 | 'value' => esc_html__( 'CEO and Founder', 'vc-elements-pt' ),
76 | ),
77 | array(
78 | 'type' => 'textfield',
79 | 'heading' => _x( 'Picture URL', 'backend', 'vc-elements-pt' ),
80 | 'param_name' => 'image_url',
81 | 'value' => 'http://xml-io.proteusthemes.com/legalpress/wp-content/uploads/sites/26/2015/06/110.jpg',
82 | ),
83 | array(
84 | 'type' => 'textarea',
85 | 'heading' => _x( 'Introduction', 'backend', 'vc-elements-pt' ),
86 | 'param_name' => 'introduction',
87 | 'value' => esc_html__( 'This is my bio...', 'vc-elements-pt' ),
88 | ),
89 | array(
90 | 'type' => 'checkbox',
91 | 'heading' => _x( 'Open link in new tab', 'backend', 'vc-elements-pt' ),
92 | 'param_name' => 'new_tab',
93 | ),
94 | array(
95 | 'type' => 'lined_textarea',
96 | 'heading' => _x( 'Social icons', 'backend', 'vc-elements-pt' ),
97 | 'description' => _x( 'Enter values for social links - URL|font awesome icon class name. Divide value sets with linebreak "Enter" (Example: https://www.facebook.com/ProteusThemes|fa-facebook-square).', 'backend', 'vc-elements-pt' ),
98 | 'param_name' => 'social_links',
99 | 'rows' => '5',
100 | 'value' => 'https://www.facebook.com/ProteusThemes|fa-facebook-square,https://www.linkedin.com|fa-linkedin-square,https://twitter.com/proteusthemes|fa-twitter-square,https://www.youtube.com/user/ProteusNetCompany/|fa-youtube-square',
101 | ),
102 | )
103 | ) );
104 | }
105 | }
106 |
107 | // Initialize the class
108 | new PT_VC_Person_Profile;
109 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-skype.php:
--------------------------------------------------------------------------------
1 | _x( 'Skype Call', 'backend', 'vc-elements-pt' ),
22 | 'username' => 'skype:echo1234',
23 | ), $atts );
24 |
25 | $instance = array(
26 | 'title' => $atts['title'],
27 | 'skype_username' => $atts['username'],
28 | );
29 |
30 | ob_start();
31 | the_widget( 'PW_Skype', $instance );
32 | return ob_get_clean();
33 | }
34 |
35 | // Overwrite the vc_map_shortcode function from the parent class
36 | public function vc_map_shortcode() {
37 | vc_map( array(
38 | 'name' => _x( 'Skype', 'backend', 'vc-elements-pt' ),
39 | 'base' => $this->shortcode_name(),
40 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
41 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
42 | 'params' => array(
43 | array(
44 | 'type' => 'textfield',
45 | 'holder' => 'div',
46 | 'heading' => _x( 'Title', 'backend', 'vc-elements-pt' ),
47 | 'param_name' => 'title',
48 | 'value' => _x( 'Skype Call', 'backend', 'vc-elements-pt' ),
49 | ),
50 | array(
51 | 'type' => 'textfield',
52 | 'heading' => _x( 'Skype username', 'backend', 'vc-elements-pt' ),
53 | 'description' => _x( 'Example: skype:your_skype_username_goes_here
or tel:your_phone_number
, if you want it to call your phone.', 'backend', 'vc-elements-pt' ),
54 | 'param_name' => 'username',
55 | 'value' => 'skype:echo1234',
56 | ),
57 | )
58 | ) );
59 | }
60 | }
61 |
62 | // Initialize the class
63 | new PT_VC_Skype;
64 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-social-icon.php:
--------------------------------------------------------------------------------
1 | '',
23 | 'icon' => 'fa fa-facebook',
24 | ), $atts );
25 |
26 | // Extract the icon class without the first 'fa' part
27 | $icon = explode( ' ', $atts['icon'] );
28 | $atts['icon'] = $icon[1];
29 |
30 | // The PHP_EOL is added so that it can be used as a separator between multiple counters
31 | return PHP_EOL . json_encode( $atts );
32 | }
33 |
34 | // Overwrite the vc_map_shortcode function from the parent class
35 | public function vc_map_shortcode() {
36 | vc_map( array(
37 | 'name' => _x( 'Social Icon', 'backend', 'vc-elements-pt' ),
38 | 'base' => $this->shortcode_name(),
39 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
40 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
41 | 'as_child' => array( 'only' => 'pt_vc_container_social_icons' ),
42 | 'params' => array(
43 | array(
44 | 'type' => 'textfield',
45 | 'heading' => _x( 'Link', 'backend', 'vc-elements-pt' ),
46 | 'param_name' => 'link',
47 | ),
48 | array(
49 | 'type' => 'iconpicker',
50 | 'heading' => _x( 'Icon', 'backend', 'vc-elements-pt' ),
51 | 'param_name' => 'icon',
52 | 'value' => 'fa fa-facebook',
53 | 'description' => _x( 'Select icon from library.', 'backend', 'vc-elements-pt' ),
54 | 'settings' => array(
55 | 'emptyIcon' => false,
56 | 'iconsPerPage' => 50,
57 | ),
58 | ),
59 | )
60 | ) );
61 | }
62 | }
63 |
64 | // Initialize the class
65 | new PT_VC_Social_Icon;
66 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-step.php:
--------------------------------------------------------------------------------
1 | '',
23 | 'item_content' => '',
24 | 'icon' => '',
25 | 'step' => '',
26 | ), $atts );
27 |
28 | // Extract the icon class without the first 'fa' part
29 | $icon = explode( ' ', $atts['icon'] );
30 | $atts['icon'] = $icon[1];
31 |
32 | $atts['content'] = $atts['item_content'];
33 |
34 | // The PHP_EOL is added so that it can be used as a separator between multiple accordion items
35 | return PHP_EOL . json_encode( $atts );
36 | }
37 |
38 | // Overwrite the vc_map_shortcode function from the parent class
39 | public function vc_map_shortcode() {
40 | vc_map( array(
41 | 'name' => _x( 'Step', 'backend', 'vc-elements-pt' ),
42 | 'base' => $this->shortcode_name(),
43 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
44 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
45 | 'as_child' => array( 'only' => 'pt_vc_container_steps' ),
46 | 'params' => array(
47 | array(
48 | 'type' => 'textfield',
49 | 'holder' => 'div',
50 | 'heading' => _x( 'Title', 'backend', 'vc-elements-pt' ),
51 | 'param_name' => 'title',
52 | ),
53 | array(
54 | 'type' => 'iconpicker',
55 | 'heading' => _x( 'Select icon', 'backend', 'vc-elements-pt' ),
56 | 'param_name' => 'icon',
57 | 'value' => 'fa fa-mobile',
58 | 'description' => _x( 'Select icon from library.', 'backend', 'vc-elements-pt' ),
59 | 'settings' => array(
60 | 'emptyIcon' => false,
61 | 'iconsPerPage' => 50,
62 | ),
63 | ),
64 | array(
65 | 'type' => 'textarea',
66 | 'heading' => _x( 'Content', 'backend', 'vc-elements-pt' ),
67 | 'param_name' => 'item_content',
68 | ),
69 | array(
70 | 'type' => 'textfield',
71 | 'heading' => _x( 'Step', 'backend', 'vc-elements-pt' ),
72 | 'param_name' => 'step',
73 | ),
74 | )
75 | ) );
76 | }
77 | }
78 |
79 | // Initialize the class
80 | new PT_VC_Step;
81 | }
--------------------------------------------------------------------------------
/vc-shortcodes/shortcodes/vc-testimonial.php:
--------------------------------------------------------------------------------
1 | '',
25 | 'author' => '',
26 | 'author_description' => '',
27 | 'author_avatar' => '',
28 | ), $atts );
29 |
30 | // Remove all HTML tags from the testimonial text
31 | $atts['quote'] = wp_strip_all_tags( $atts['quote'] );
32 | $atts['author_avatar'] = wp_get_attachment_url( $atts['author_avatar'] );
33 |
34 | // The PHP_EOL is added so that it can be used as a separator between multiple counters
35 | return PHP_EOL . json_encode( $atts );
36 | }
37 |
38 | // Overwrite the vc_map_shortcode function from the parent class
39 | public function vc_map_shortcode() {
40 |
41 | $this->fields = apply_filters( 'pw/testimonial_widget', array(
42 | 'rating' => true,
43 | 'author_description' => false,
44 | 'author_avatar' => false,
45 | 'number_of_testimonial_per_slide' => 2,
46 | 'bootstrap_version' => 3,
47 | ) );
48 |
49 | $params = array(
50 | array(
51 | 'type' => 'textarea',
52 | 'heading' => _x( 'Quote', 'backend', 'vc-elements-pt' ),
53 | 'param_name' => 'quote',
54 | ),
55 | array(
56 | 'type' => 'textfield',
57 | 'heading' => _x( 'Author', 'backend', 'vc-elements-pt' ),
58 | 'param_name' => 'author',
59 | ),
60 | );
61 |
62 | if ( $this->fields['author_description'] ) {
63 | $params[] = array(
64 | 'type' => 'textfield',
65 | 'heading' => _x( 'Author Description', 'backend', 'vc-elements-pt' ),
66 | 'param_name' => 'author_description',
67 | );
68 | }
69 |
70 | if ( $this->fields['author_avatar'] ) {
71 | $params[] = array(
72 | 'type' => 'attach_image',
73 | 'heading' => _x( 'Author Avatar', 'backend', 'vc-elements-pt' ),
74 | 'param_name' => 'author_avatar',
75 | );
76 | }
77 |
78 | vc_map( array(
79 | 'name' => _x( 'Testimonial', 'backend', 'vc-elements-pt' ),
80 | 'base' => $this->shortcode_name(),
81 | 'category' => _x( 'Content', 'backend', 'vc-elements-pt' ),
82 | 'icon' => get_template_directory_uri() . '/vendor/proteusthemes/visual-composer-elements/assets/images/pt.svg',
83 | 'as_child' => array( 'only' => 'pt_vc_container_testimonials' ),
84 | 'params' => $params
85 | ) );
86 | }
87 | }
88 |
89 | // Initialize the class
90 | new PT_VC_Testimonial;
91 | }
--------------------------------------------------------------------------------