Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action(
- 'vc_before_init',
- function () {
- vc_map(
- array(
- 'name' => esc_html__( 'JNews FAQ', 'jnews' ),
- 'base' => 'custom_jnews_faq',
- 'category' => esc_html__( 'JNews', 'jnews' ),
- 'icon' => 'vc_icon-vc-accordion',
- 'params' => array(
- array(
- 'type' => 'param_group',
- 'heading' => esc_html__( 'FAQ Lists', 'jnews' ),
- 'param_name' => 'faqLists',
- 'description' => esc_html__( "List of FAQ item's.", 'jnews' ),
- 'params' => array(
- array(
- 'type' => 'textarea',
- 'heading' => esc_html__( 'Question', 'jnews' ),
- 'param_name' => 'question',
- 'description' => esc_html__( 'Insert your FAQ Question.', 'jnews' ),
- ),
- array(
- 'type' => 'textarea_html',
- 'heading' => esc_html__( 'Answer', 'jnews' ),
- 'param_name' => 'answer',
- 'description' => esc_html__( 'Insert your FAQ Answer.', 'jnews' ),
- ),
- ),
- 'value' => urlencode(
- json_encode(
- array(
- array(
- 'question' => 'Lorem ipsum dolor sit amet',
- 'answer' => 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit...',
- ),
- array(
- 'question' => 'Far far away, behind the word mountains',
- 'answer' => 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit...',
- ),
- array(
- 'question' => 'The quick, brown fox jumps over a lazy dog',
- 'answer' => 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit...',
- ),
- )
- )
- ),
- ),
- array(
- 'type' => 'checkbox',
- 'heading' => esc_html__( 'Hide on Frontend', 'jnews' ),
- 'param_name' => 'hideFrontend',
- 'description' => esc_html__( 'Enable this option if you only want to display this FAQ on FAQs Page Schema.', 'jnews' ),
- ),
- array(
- 'type' => 'dropdown',
- 'heading' => esc_html__( 'Style', 'jnews' ),
- 'param_name' => 'faqStyle',
- 'value' => array(
- esc_html__( 'Style 1', 'jnews' ) => 'style-1',
- esc_html__( 'Style 2', 'jnews' ) => 'style-2',
- esc_html__( 'Style 3', 'jnews' ) => 'style-3',
- esc_html__( 'Style 4', 'jnews' ) => 'style-4',
- esc_html__( 'Style 5', 'jnews' ) => 'style-5',
- ),
- 'description' => esc_html__( 'Choose your FAQ style.', 'jnews' ),
- ),
- array(
- 'type' => 'colorpicker',
- 'heading' => esc_html__( 'Question Color', 'jnews' ),
- 'param_name' => 'questionColor',
- ),
- array(
- 'type' => 'colorpicker',
- 'heading' => esc_html__( 'Answer Color', 'jnews' ),
- 'param_name' => 'answerColor',
- ),
- array(
- 'type' => 'colorpicker',
- 'heading' => esc_html__( 'Icon Color', 'jnews' ),
- 'param_name' => 'iconColor',
- ),
- array(
- 'type' => 'colorpicker',
- 'heading' => esc_html__( 'Background Color', 'jnews' ),
- 'param_name' => 'faqBackground',
- ),
- array(
- 'type' => 'colorpicker',
- 'heading' => esc_html__( 'Border Color', 'jnews' ),
- 'param_name' => 'faqBorder',
- ),
- ),
- )
- );
- }
- );
- add_shortcode( 'custom_jnews_faq', 'render_jnews_faq' );
- function render_jnews_faq( $atts, $content = null ) {
- error_log( 'custom_jnews_faq--------' );
- error_log( print_r( $atts, true ) );
- return '';
- // Parse atts, param group json decode, generate HTML output
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement