芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/plugins/trx_utils/shortcodes/trx_optional/icon.php
"", "color" => "", "bg_color" => "", "bg_shape" => "", "font_size" => "", "font_weight" => "", "align" => "", "link" => "", // Common params "id" => "", "class" => "", "css" => "", "top" => "", "bottom" => "", "left" => "", "right" => "" ), $atts))); $class .= ($class ? ' ' : '') . lorem_ipsum_books_media_store_get_css_position_as_classes($top, $right, $bottom, $left); $css2 = ($font_weight != '' && !lorem_ipsum_books_media_store_is_inherit_option($font_weight) ? 'font-weight:'. esc_attr($font_weight).';' : '') . ($font_size != '' ? 'font-size:' . esc_attr(lorem_ipsum_books_media_store_prepare_css_value($font_size)) . '; line-height: ' . (!$bg_shape || lorem_ipsum_books_media_store_param_is_inherit($bg_shape) ? '1' : '1.2') . 'em;' : '') . ($color != '' ? 'color:'.esc_attr($color).';' : '') . ($bg_color != '' ? 'background-color:'.esc_attr($bg_color).';border-color:'.esc_attr($bg_color).';' : '') ; $output = $icon!='' ? ($link ? '
' .($link ? '
' : '') : ''; return apply_filters('lorem_ipsum_books_media_store_shortcode_output', $output, 'trx_icon', $atts, $content); } add_shortcode('trx_icon', 'lorem_ipsum_books_media_store_sc_icon'); } /* Register shortcode in the internal SC Builder -------------------------------------------------------------------- */ if ( !function_exists( 'lorem_ipsum_books_media_store_sc_icon_reg_shortcodes' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list', 'lorem_ipsum_books_media_store_sc_icon_reg_shortcodes'); function lorem_ipsum_books_media_store_sc_icon_reg_shortcodes() { lorem_ipsum_books_media_store_sc_map("trx_icon", array( "title" => esc_html__("Icon", 'trx_utils'), "desc" => wp_kses_data( __("Insert icon", 'trx_utils') ), "decorate" => false, "container" => false, "params" => array( "icon" => array( "title" => esc_html__('Icon', 'trx_utils'), "desc" => wp_kses_data( __('Select font icon from the Fontello icons set', 'trx_utils') ), "value" => "", "type" => "icons", "options" => lorem_ipsum_books_media_store_get_sc_param('icons') ), "color" => array( "title" => esc_html__("Icon's color", 'trx_utils'), "desc" => wp_kses_data( __("Icon's color", 'trx_utils') ), "dependency" => array( 'icon' => array('not_empty') ), "value" => "", "type" => "color" ), "bg_shape" => array( "title" => esc_html__("Background shape", 'trx_utils'), "desc" => wp_kses_data( __("Shape of the icon background", 'trx_utils') ), "dependency" => array( 'icon' => array('not_empty') ), "value" => "none", "type" => "radio", "options" => array( 'none' => esc_html__('None', 'trx_utils'), 'round' => esc_html__('Round', 'trx_utils'), 'square' => esc_html__('Square', 'trx_utils') ) ), "bg_color" => array( "title" => esc_html__("Icon's background color", 'trx_utils'), "desc" => wp_kses_data( __("Icon's background color", 'trx_utils') ), "dependency" => array( 'icon' => array('not_empty'), 'background' => array('round','square') ), "value" => "", "type" => "color" ), "font_size" => array( "title" => esc_html__("Font size", 'trx_utils'), "desc" => wp_kses_data( __("Icon's font size", 'trx_utils') ), "dependency" => array( 'icon' => array('not_empty') ), "value" => "", "type" => "spinner", "min" => 8, "max" => 240 ), "font_weight" => array( "title" => esc_html__("Font weight", 'trx_utils'), "desc" => wp_kses_data( __("Icon font weight", 'trx_utils') ), "dependency" => array( 'icon' => array('not_empty') ), "value" => "", "type" => "select", "size" => "medium", "options" => array( '100' => esc_html__('Thin (100)', 'trx_utils'), '300' => esc_html__('Light (300)', 'trx_utils'), '400' => esc_html__('Normal (400)', 'trx_utils'), '700' => esc_html__('Bold (700)', 'trx_utils') ) ), "align" => array( "title" => esc_html__("Alignment", 'trx_utils'), "desc" => wp_kses_data( __("Icon text alignment", 'trx_utils') ), "dependency" => array( 'icon' => array('not_empty') ), "value" => "", "type" => "checklist", "dir" => "horizontal", "options" => lorem_ipsum_books_media_store_get_sc_param('align') ), "link" => array( "title" => esc_html__("Link URL", 'trx_utils'), "desc" => wp_kses_data( __("Link URL from this icon (if not empty)", 'trx_utils') ), "value" => "", "type" => "text" ), "top" => lorem_ipsum_books_media_store_get_sc_param('top'), "bottom" => lorem_ipsum_books_media_store_get_sc_param('bottom'), "left" => lorem_ipsum_books_media_store_get_sc_param('left'), "right" => lorem_ipsum_books_media_store_get_sc_param('right'), "id" => lorem_ipsum_books_media_store_get_sc_param('id'), "class" => lorem_ipsum_books_media_store_get_sc_param('class'), "css" => lorem_ipsum_books_media_store_get_sc_param('css') ) )); } } /* Register shortcode in the VC Builder -------------------------------------------------------------------- */ if ( !function_exists( 'lorem_ipsum_books_media_store_sc_icon_reg_shortcodes_vc' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list_vc', 'lorem_ipsum_books_media_store_sc_icon_reg_shortcodes_vc'); function lorem_ipsum_books_media_store_sc_icon_reg_shortcodes_vc() { vc_map( array( "base" => "trx_icon", "name" => esc_html__("Icon", 'trx_utils'), "description" => wp_kses_data( __("Insert the icon", 'trx_utils') ), "category" => esc_html__('Content', 'trx_utils'), 'icon' => 'icon_trx_icon', "class" => "trx_sc_single trx_sc_icon", "content_element" => true, "is_container" => false, "show_settings_on_create" => true, "params" => array( array( "param_name" => "icon", "heading" => esc_html__("Icon", 'trx_utils'), "description" => wp_kses_data( __("Select icon class from Fontello icons set", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => lorem_ipsum_books_media_store_get_sc_param('icons'), "type" => "dropdown" ), array( "param_name" => "color", "heading" => esc_html__("Text color", 'trx_utils'), "description" => wp_kses_data( __("Icon's color", 'trx_utils') ), "class" => "", "value" => "", "type" => "colorpicker" ), array( "param_name" => "bg_color", "heading" => esc_html__("Background color", 'trx_utils'), "description" => wp_kses_data( __("Background color for the icon", 'trx_utils') ), "class" => "", "value" => "", "type" => "colorpicker" ), array( "param_name" => "bg_shape", "heading" => esc_html__("Background shape", 'trx_utils'), "description" => wp_kses_data( __("Shape of the icon background", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => array( esc_html__('None', 'trx_utils') => 'none', esc_html__('Round', 'trx_utils') => 'round', esc_html__('Square', 'trx_utils') => 'square' ), "type" => "dropdown" ), array( "param_name" => "font_size", "heading" => esc_html__("Font size", 'trx_utils'), "description" => wp_kses_data( __("Icon's font size", 'trx_utils') ), "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "font_weight", "heading" => esc_html__("Font weight", 'trx_utils'), "description" => wp_kses_data( __("Icon's font weight", 'trx_utils') ), "class" => "", "value" => array( esc_html__('Default', 'trx_utils') => 'inherit', esc_html__('Thin (100)', 'trx_utils') => '100', esc_html__('Light (300)', 'trx_utils') => '300', esc_html__('Normal (400)', 'trx_utils') => '400', esc_html__('Bold (700)', 'trx_utils') => '700' ), "type" => "dropdown" ), array( "param_name" => "align", "heading" => esc_html__("Icon's alignment", 'trx_utils'), "description" => wp_kses_data( __("Align icon to left, center or right", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => array_flip(lorem_ipsum_books_media_store_get_sc_param('align')), "type" => "dropdown" ), array( "param_name" => "link", "heading" => esc_html__("Link URL", 'trx_utils'), "description" => wp_kses_data( __("Link URL from this icon (if not empty)", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => "", "type" => "textfield" ), lorem_ipsum_books_media_store_get_vc_param('id'), lorem_ipsum_books_media_store_get_vc_param('class'), lorem_ipsum_books_media_store_get_vc_param('css'), lorem_ipsum_books_media_store_get_vc_param('margin_top'), lorem_ipsum_books_media_store_get_vc_param('margin_bottom'), lorem_ipsum_books_media_store_get_vc_param('margin_left'), lorem_ipsum_books_media_store_get_vc_param('margin_right') ), ) ); class WPBakeryShortCode_Trx_Icon extends Lorem_Ipsum_Books_Media_Store_VC_ShortCodeSingle {} } } ?>