esc_html__("Text rotator", "keydesign"), "description" => esc_html__("Simple shortcode to rotate your texts.", "keydesign"), "base" => "tek_textrotator", "class" => "", "icon" => plugins_url('assets/element_icons/text-rotator.png', dirname(__FILE__)), "category" => esc_html__("KeyDesign Elements", "keydesign"), "params" => array( array( "type" => "param_group", "class" => "", "heading" => esc_html__("Text fields", "keydesign"), "value" => "", "param_name" => "tr_text_fields", "params" => array( array( "type" => "textfield", "heading" => __("Single item","keydesign"), "param_name" => "tr_text_item", "description" =>"", "admin_label" => true, ), ), ), array( "type" => "dropdown", "class" => "", "heading" => esc_html__("Text align","keydesign"), "param_name" => "tr_text_align", "value" => array( "Left" => "text-left", "Center" => "text-center", "Right" => "text-right", ), "save_always" => true, "description" => esc_html__("Select text align.", "keydesign"), ), array( "type" => "colorpicker", "class" => "", "heading" => esc_html__("Text color", "keydesign"), "param_name" => "tr_text_color", "value" => "", "description" => esc_html__("Select text color. If none selected, the default theme color will be used.", "keydesign"), ), array( "type" => "textfield", "class" => "", "heading" => esc_html__("Font size", "keydesign"), "param_name" => "tr_font_size", "value" => "", "description" => esc_html__("Enter text font size. (eg. 20px, 2em, 2rem)", "keydesign"), ), array( "type" => "dropdown", "class" => "", "heading" => esc_html__("Animation speed","keydesign"), "param_name" => "tr_speed", "value" => array( "Default (1s until the next word show)" => "", "Slow (2s)" => "slow-text-rotator", "Slower (3s)" => "slower-text-rotator", ), "save_always" => true, "description" => esc_html__("Select animation speed.", "keydesign"), ), array( "type" => "textfield", "class" => "", "heading" => esc_html__("Extra class name", "keydesign"), "param_name" => "tr_extra_class", "value" => "", "description" => esc_html__("If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.", "keydesign"), "group" => esc_html__( "Extras", "keydesign" ), ), ) )); } } // Render the element on front-end public function kd_textrotator_shrt($atts, $content = null) { extract(shortcode_atts(array( 'tr_text_fields' => '', 'tr_text_align' => '', 'tr_text_color' => '', 'tr_font_size' => '', 'tr_speed' => '', 'tr_extra_class' => '', ), $atts)); $text_rotator_container = $kd_rotator_id = $i = $j = $output = $item_increment_class = $last_elem_class = $last_elem_style = $numItems = ''; $kd_rotator_id = "kd-rotatorid-".uniqid(); $output .= '