Nghiên cứu cách lấy dữ liệu và ghi dữ liệu của widget text (ok)
Last updated
Was this helpful?
Last updated
Was this helpful?
Dư liệu được ghi vào bảng wp_options
Trong file js_composer\include\classes\shortcodes\vc-column.php
echo '<pre>';
var_export($this->settings);
echo '</pre>';
Result:
<?php
[
'name' => 'Column',
'icon' => 'icon-wpb-row',
'is_container' => true,
'content_element' => false,
'description' => 'Place content elements inside the column',
'params' => [
0 => [
'type' => 'checkbox',
'heading' => 'Use video background?',
'param_name' => 'video_bg',
'description' => 'If checked, video will be used as row background.',
'value' =>
[
'Yes' => 'yes',
],
],
1 =>
[
'type' => 'textfield',
'heading' => 'YouTube link',
'param_name' => 'video_bg_url',
'value' => 'https://www.youtube.com/watch?v=lMJXxhRFO1k',
'description' => 'Add YouTube link.',
'dependency' => [
'element' => 'video_bg',
'not_empty' => true,
],
],
2 =>
[
'type' => 'dropdown',
'heading' => 'Parallax',
'param_name' => 'video_bg_parallax',
'value' =>
[
'None' => '',
'Simple' => 'content-moving',
'With fade' => 'content-moving-fade',
],
'description' => 'Add parallax type background for row.',
'dependency' => [
'element' => 'video_bg',
'not_empty' => true,
],
],
3 =>
[
'type' => 'dropdown',
'heading' => 'Parallax',
'param_name' => 'parallax',
'value' =>
[
'None' => '',
'Simple' => 'content-moving',
'With fade' => 'content-moving-fade',
],
'description' => 'Add parallax type background for row (Note: If no image is specified, parallax will use background image from Design Options).',
'dependency' =>
[
'element' => 'video_bg',
'is_empty' => true,
],
],
4 => [
'type' => 'attach_image',
'heading' => 'Image',
'param_name' => 'parallax_image',
'value' => '',
'description' => 'Select image from media library.',
'dependency' =>
[
'element' => 'parallax',
'not_empty' => true,
],
],
5 =>
[
'type' => 'textfield',
'heading' => 'Parallax speed',
'param_name' => 'parallax_speed_video',
'value' => '1.5',
'description' => 'Enter parallax speed ratio (Note: Default value is 1.5, min value is 1)',
'dependency' => [
'element' => 'video_bg_parallax',
'not_empty' => true,
],
],
6 =>
[
'type' => 'textfield',
'heading' => 'Parallax speed',
'param_name' => 'parallax_speed_bg',
'value' => '1.5',
'description' => 'Enter parallax speed ratio (Note: Default value is 1.5, min value is 1)',
'dependency' =>
[
'element' => 'parallax',
'not_empty' => true,
],
],
7 =>
[
'type' => 'animation_style',
'heading' => 'CSS Animation',
'param_name' => 'css_animation',
'admin_label' => false,
'value' => '',
'settings' =>
[
'type' => 'in',
'custom' =>
[
0 => [
'label' => 'Default',
'values' =>
[
'Top to bottom' => 'top-to-bottom',
'Bottom to top' => 'bottom-to-top',
'Left to right' => 'left-to-right',
'Right to left' => 'right-to-left',
'Appear from center' => 'appear',
],
],
],
],
'description' => 'Select type of animation for element to be animated when it "enters" the browsers viewport (Note: works only in modern browsers).',
],
8 =>
[
'type' => 'el_id',
'heading' => 'Element ID',
'param_name' => 'el_id',
'description' => 'Enter element ID (Note: make sure it is unique and valid according to w3c specification).',
],
9 =>
[
'type' => 'textfield',
'heading' => 'Extra class name',
'param_name' => 'el_class',
'description' => 'Style particular content element differently - add a class name and refer to it in custom CSS.',
],
10 =>
[
'type' => 'css_editor',
'heading' => 'CSS box',
'param_name' => 'css',
'group' => 'Design Options',
],
11 =>
[
'type' => 'dropdown',
'heading' => 'Width',
'param_name' => 'width',
'value' =>
[
'1 column - 1/12' => '1/12',
'2 columns - 1/6' => '1/6',
'3 columns - 1/4' => '1/4',
'4 columns - 1/3' => '1/3',
'5 columns - 5/12' => '5/12',
'6 columns - 1/2' => '1/2',
'7 columns - 7/12' => '7/12',
'8 columns - 2/3' => '2/3',
'9 columns - 3/4' => '3/4',
'10 columns - 5/6' => '5/6',
'11 columns - 11/12' => '11/12',
'12 columns - 1/1' => '1/1',
'20% - 1/5' => '1/5',
'40% - 2/5' => '2/5',
'60% - 3/5' => '3/5',
'80% - 4/5' => '4/5',
],
'group' => 'Responsive Options',
'description' => 'Select column width.',
'std' => '1/1',
],
12 =>
[
'type' => 'column_offset',
'heading' => 'Responsiveness',
'param_name' => 'offset',
'group' => 'Responsive Options',
'description' => 'Adjust column for different screen sizes. Control width, offset and visibility settings.',
],
],
'js_view' => 'VcColumnView',
'base' => 'vc_column',
'_category_ids' => [],
]