| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- /*------------------------------------------------------*/
- /* taskereasy Heading
- /*------------------------------------------------------*/
- vc_map(array(
- "name" => esc_html__("Heading", 'taskereasy'),
- "base" => "taskereasy_text_heading",
- 'icon' => get_template_directory_uri() . '/assets/images/favicon-icon/shortcode-icon.png',
- "class" => "",
- "description" => esc_html__("Add taskereasy Text Heading", 'taskereasy'),
- "category" => esc_html__('Taskereasy Shortcodes', 'taskereasy'),
- "params" => array(
- array(
- "type" => "textfield",
- "heading" => esc_html__("Title", 'taskereasy'),
- "param_name" => "title",
- ),
- array(
- "type" => "textarea_safe",
- "heading" => esc_html__("Subtitle", 'taskereasy'),
- "param_name" => "subtext",
- ),
- array(
- 'type' => 'dropdown',
- 'heading' => esc_html__( 'Show Text', 'taskereasy' ),
- 'param_name' => 'align',
- 'value' => array('Center' => 1, 'Left' => 2),
- ),
- array(
- 'type' => 'css_editor',
- 'heading' => esc_html__( 'CSS', 'taskereasy' ),
- 'param_name' => 'custom_design',
- 'group' => esc_html__( 'Design options', 'taskereasy' ),
- )
- )
- ));
- add_shortcode( 'taskereasy_text_heading', function($atts, $content = null) {
- extract(shortcode_atts(array(
- 'title' => '',
- 'subtext' => '',
- 'align' => '',
- 'custom_design' => '',
- ), $atts));
- $class = ($align==2)?'section-header-left':'text-center';
- $custom_design = vc_shortcode_custom_css_class( $custom_design, ' ' );
- $output = '';
- $output .='
- <div class="'.esc_attr($custom_design).' section-header '.$class.'">
- <h3 class="section-title">'.html_entity_decode(vc_value_from_safe($title, true)).'</h3>';
- if( $subtext != '' ) {
- $output .= '<p class="section-subtitle">' . html_entity_decode(vc_value_from_safe($subtext, true)) . '</p>';
- }
- $output .='
- </div>
- ';
- return $output;
- });
|