/
vc.config.php
127 lines (105 loc) · 4.07 KB
/
vc.config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<?php
// In theme/resources/config/vc.config.php
return [
/*
|--------------------------------------------------------------------------
| VC Support
|--------------------------------------------------------------------------
|
| Tell the Service Provider which original VC Components to retain and support
|
*/
'support' => [
'vc_row',
'vc_row_inner',
'vc_column',
'vc_column_inner',
'vc_column_text',
'vc_single_image',
'vc_tta_accordion',
'vc_tta_section',
'vc_section',
'gravityform',
],
/*
|--------------------------------------------------------------------------
| VC Reset
|--------------------------------------------------------------------------
|
| Tell the Service Provider what to reset with Vc
|
*/
'reset_shortcodes' => true,
'reset_styles' => true,
/*
|--------------------------------------------------------------------------
| VC Params
|--------------------------------------------------------------------------
|
| Tell the Service Provider of any params (fields) you would like to add to
| existing components
|
*/
'params' => [
[
'type' => 'dropdown',
'heading' => 'Style',
'param_name' => 'style',
'value' => array( 'one', 'two', 'three' ),
'description' => __( 'New style attribute', 'my-text-domain' ),
'shortcodes' => [
'vc_section',
'vc_column'
]
]
],
/*
|--------------------------------------------------------------------------
| VC Replace
|--------------------------------------------------------------------------
|
| Tell the Service Provider which classnames to replace on rows and columns,
| replace must be an array, replace callback must be a closure
|
*/
'replace' => [
'vc_row-fluid' => 'o-grid--edge',
'vc_row' => 'o-grid',
'wpb_row' => '',
'vc_inner' => '',
'wpb_column' => 'o-grid__item',
'vc_column_container' => '',
'/vc_col-xs-(\d{1,2})/' => 'u-size-$1',
'/vc_col-sm-(\d{1,2})/' => 'u-size-$1@m',
'/vc_col-md-(\d{1,2})/' => 'u-size-$1@l',
'/vc_col-lg-(\d{1,2})/' => 'u-size-$1@xl'
],
'replace_callback' => function( $class, $tag, $atts, $replace ) {
if ( $tag == 'vc_row' || $tag == 'vc_row_inner' ) {
$classname = ! empty( $replace['vc_row'] ) ? $replace['vc_row'] : 'o-grid';
$classname .= ! empty( $atts['full_width'] ) ? ( ! empty( $replace['vc_row-fluid'] ) ? $replace['vc_row-fluid'] : ' o-grid--edge' ) : '';
$class = str_replace( 'vc_row-fluid', $classname, $class );
$class = str_replace( array('vc_row', 'wpb_row', 'vc_inner'), array('', '', ''), $class );
}
if ( $tag == 'vc_column' || $tag == 'vc_column_inner' ) {
$class = str_replace( 'wpb_column vc_column_container', ! empty( $replace['wpb_column'] ) ? $replace['wpb_column'] : 'o-grid__item', $class );
$class = preg_replace( '/vc_col-xs-(\d{1,2})/', ! empty( $replace['/vc_col-xs-(\d{1,2})/'] ) ? $replace['/vc_col-xs-(\d{1,2})/'] : 'u-size-$1', $class );
$class = preg_replace( '/vc_col-sm-(\d{1,2})/', ! empty( $replace['/vc_col-sm-(\d{1,2})/'] ) ? $replace['/vc_col-xs-(\d{1,2})/'] : 'u-size-$1@m', $class );
$class = preg_replace( '/vc_col-md-(\d{1,2})/', ! empty( $replace['/vc_col-md-(\d{1,2})/'] ) ? $replace['/vc_col-xs-(\d{1,2})/'] : 'u-size-$1@l', $class );
$class = preg_replace( '/vc_col-lg-(\d{1,2})/', ! empty( $replace['/vc_col-lg-(\d{1,2})/'] ) ? $replace['/vc_col-xs-(\d{1,2})/'] : 'u-size-$1@xl', $class );
}
return $class;
},
/*
|--------------------------------------------------------------------------
| VC View Path
|--------------------------------------------------------------------------
|
| Tell the Server Provider where to find original VC view files that you
| want to override
|
| ~/theme/resources/views/vc/
|
*/
'vc_path' => resources_path('views/vc')
];