芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/plugins/trx_utils/shortcodes/trx_basic/line.php
"", "color" => "", "title" => "", "position" => "", "image" => "", "repeat" => "no", // Common params "id" => "", "class" => "", "animation" => "", "css" => "", "width" => "", "height" => "", "top" => "", "bottom" => "", "left" => "", "right" => "" ), $atts))); if (empty($style)) $style = 'solid'; if (empty($position)) $position = 'center center'; $class .= ($class ? ' ' : '') . lorem_ipsum_books_media_store_get_css_position_as_classes($top, $right, $bottom, $left); $block_height = ''; if ($style=='image' && !empty($image)) { if ($image > 0) { $attach = wp_get_attachment_image_src( $image, 'full' ); if (isset($attach[0]) && $attach[0]!='') $image = $attach[0]; } $attr = lorem_ipsum_books_media_store_getimagesize($image); if (is_array($attr) && $attr[1] > 0) $block_height = $attr[1]; } else if (!empty($title) && empty($height) && !in_array($position, array('left center', 'center center', 'right center'))) { $block_height = '1.5em'; } $border_pos = in_array($position, array('left top', 'center top', 'right top')) ? 'bottom' : 'top'; $css .= lorem_ipsum_books_media_store_get_css_dimensions_from_values($width, $block_height) . ($style=='image' && !empty($image) ? ( 'background-image: url(' . esc_url($image) . ');' . (lorem_ipsum_books_media_store_param_is_on($repeat) ? 'background-repeat: repeat-x;' : '') ) : ( ($height !='' ? 'border-'.esc_attr($border_pos).'-width:' . esc_attr(lorem_ipsum_books_media_store_prepare_css_value($height)) . ';' : '') . ($style != '' ? 'border-'.esc_attr($border_pos).'-style:' . esc_attr($style) . ';' : '') . ($color != '' ? 'border-'.esc_attr($border_pos).'-color:' . esc_attr($color) . ';' : '') ) ); $output = '
' . (!empty($title) ? '
' . trim($title) . '
' : '') . '
'; return apply_filters('lorem_ipsum_books_media_store_shortcode_output', $output, 'trx_line', $atts, $content); } add_shortcode('trx_line', 'lorem_ipsum_books_media_store_sc_line'); } /* Register shortcode in the internal SC Builder -------------------------------------------------------------------- */ if ( !function_exists( 'lorem_ipsum_books_media_store_sc_line_reg_shortcodes' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list', 'lorem_ipsum_books_media_store_sc_line_reg_shortcodes'); function lorem_ipsum_books_media_store_sc_line_reg_shortcodes() { lorem_ipsum_books_media_store_sc_map("trx_line", array( "title" => esc_html__("Line", 'trx_utils'), "desc" => wp_kses_data( __("Insert Line into your post (page)", 'trx_utils') ), "decorate" => false, "container" => false, "params" => array( "style" => array( "title" => esc_html__("Style", 'trx_utils'), "desc" => wp_kses_data( __("Line style", 'trx_utils') ), "value" => "solid", "dir" => "horizontal", "options" => lorem_ipsum_books_media_store_get_list_line_styles(), "type" => "checklist" ), "image" => array( "title" => esc_html__("Image as separator", 'trx_utils'), "desc" => wp_kses_data( __("Select or upload image or write URL from other site to use it as separator", 'trx_utils') ), "readonly" => false, "dependency" => array( 'style' => array('image') ), "value" => "", "type" => "media" ), "repeat" => array( "title" => esc_html__("Repeat image", 'trx_utils'), "desc" => wp_kses_data( __("To repeat an image or to show single picture", 'trx_utils') ), "dependency" => array( 'style' => array('image') ), "value" => "no", "type" => "switch", "options" => lorem_ipsum_books_media_store_get_sc_param('yes_no') ), "color" => array( "title" => esc_html__("Color", 'trx_utils'), "desc" => wp_kses_data( __("Line color", 'trx_utils') ), "dependency" => array( 'style' => array('solid', 'dashed', 'dotted', 'double') ), "value" => "", "type" => "color" ), "title" => array( "title" => esc_html__("Title", 'trx_utils'), "desc" => wp_kses_data( __("Title that is going to be placed in the center of the line (if not empty)", 'trx_utils') ), "value" => "", "type" => "text" ), "position" => array( "title" => esc_html__("Title position", 'trx_utils'), "desc" => wp_kses_data( __("Title position", 'trx_utils') ), "dependency" => array( 'title' => array('not_empty') ), "value" => "center center", "options" => lorem_ipsum_books_media_store_get_list_bg_image_positions(), "type" => "select" ), "width" => lorem_ipsum_books_media_store_shortcodes_width(), "height" => lorem_ipsum_books_media_store_shortcodes_height(), "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'), "animation" => lorem_ipsum_books_media_store_get_sc_param('animation'), "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_line_reg_shortcodes_vc' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list_vc', 'lorem_ipsum_books_media_store_sc_line_reg_shortcodes_vc'); function lorem_ipsum_books_media_store_sc_line_reg_shortcodes_vc() { vc_map( array( "base" => "trx_line", "name" => esc_html__("Line", 'trx_utils'), "description" => wp_kses_data( __("Insert line (delimiter)", 'trx_utils') ), "category" => esc_html__('Content', 'trx_utils'), "class" => "trx_sc_single trx_sc_line", 'icon' => 'icon_trx_line', "content_element" => true, "is_container" => false, "show_settings_on_create" => true, "params" => array( array( "param_name" => "style", "heading" => esc_html__("Style", 'trx_utils'), "description" => wp_kses_data( __("Line style", 'trx_utils') ), "admin_label" => true, "class" => "", "std" => "solid", "value" => array_flip(lorem_ipsum_books_media_store_get_list_line_styles()), "type" => "dropdown" ), array( "param_name" => "image", "heading" => esc_html__("Image as separator", 'trx_utils'), "description" => wp_kses_data( __("Select or upload image or write URL from other site to use it as separator", 'trx_utils') ), 'dependency' => array( 'element' => 'style', 'value' => array('image') ), "class" => "", "value" => "", "type" => "attach_image" ), array( "param_name" => "repeat", "heading" => esc_html__("Repeat image", 'trx_utils'), "description" => wp_kses_data( __("To repeat an image or to show single picture", 'trx_utils') ), 'dependency' => array( 'element' => 'style', 'value' => array('image') ), "class" => "", "value" => array("Repeat image" => "yes" ), "type" => "checkbox" ), array( "param_name" => "color", "heading" => esc_html__("Line color", 'trx_utils'), "description" => wp_kses_data( __("Line color", 'trx_utils') ), 'dependency' => array( 'element' => 'style', 'value' => array('solid','dotted','dashed','double') ), "class" => "", "value" => "", "type" => "colorpicker" ), array( "param_name" => "title", "heading" => esc_html__("Title", 'trx_utils'), "description" => wp_kses_data( __("Title that is going to be placed in the center of the line (if not empty)", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "position", "heading" => esc_html__("Title position", 'trx_utils'), "description" => wp_kses_data( __("Title position", 'trx_utils') ), "admin_label" => true, "class" => "", "std" => "center center", "value" => array_flip(lorem_ipsum_books_media_store_get_list_bg_image_positions()), "type" => "dropdown" ), 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('animation'), lorem_ipsum_books_media_store_get_vc_param('css'), lorem_ipsum_books_media_store_vc_width(), lorem_ipsum_books_media_store_vc_height(), 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_Line extends Lorem_Ipsum_Books_Media_Store_VC_ShortCodeSingle {} } } ?>