芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/plugins/trx_utils/shortcodes/trx_optional/button.php
"square", "style" => "filled", "size" => "small", "icon" => "", "color" => "", "bg_color" => "", "color_preset" => "1", "link" => "", "target" => "", "align" => "", "rel" => "", "popup" => "no", // Common params "id" => "", "class" => "", "css" => "", "animation" => "", "width" => "", "height" => "", "top" => "", "bottom" => "", "left" => "", "right" => "" ), $atts))); $class .= ($class ? ' ' : '') . lorem_ipsum_books_media_store_get_css_position_as_classes($top, $right, $bottom, $left); $css .= lorem_ipsum_books_media_store_get_css_dimensions_from_values($width, $height) . ($color !== '' ? 'color:' . esc_attr($color) .';' : '') . ($bg_color !== '' ? 'background-color:' . esc_attr($bg_color) . '; border-color:'. esc_attr($bg_color) .';' : ''); if (lorem_ipsum_books_media_store_param_is_on($popup)) lorem_ipsum_books_media_store_enqueue_popup('magnific'); $output = '
' . do_shortcode($content) . '
'; return apply_filters('lorem_ipsum_books_media_store_shortcode_output', $output, 'trx_button', $atts, $content); } add_shortcode('trx_button', 'lorem_ipsum_books_media_store_sc_button'); } /* Register shortcode in the internal SC Builder -------------------------------------------------------------------- */ if ( !function_exists( 'lorem_ipsum_books_media_store_sc_button_reg_shortcodes' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list', 'lorem_ipsum_books_media_store_sc_button_reg_shortcodes'); function lorem_ipsum_books_media_store_sc_button_reg_shortcodes() { lorem_ipsum_books_media_store_sc_map("trx_button", array( "title" => esc_html__("Button", 'trx_utils'), "desc" => wp_kses_data( __("Button with link", 'trx_utils') ), "decorate" => false, "container" => true, "params" => array( "_content_" => array( "title" => esc_html__("Caption", 'trx_utils'), "desc" => wp_kses_data( __("Button caption", 'trx_utils') ), "value" => "", "type" => "text" ), "type" => array( "title" => esc_html__("Button's shape", 'trx_utils'), "desc" => wp_kses_data( __("Select button's shape", 'trx_utils') ), "value" => "square", "size" => "medium", "options" => array( 'square' => esc_html__('Square', 'trx_utils'), 'round' => esc_html__('Round', 'trx_utils') ), "type" => "hidden" //switch ), "style" => array( "title" => esc_html__("Button's style", 'trx_utils'), "desc" => wp_kses_data( __("Select button's style", 'trx_utils') ), "value" => "default", "dir" => "horizontal", "options" => array( 'filled' => esc_html__('Filled', 'trx_utils'), 'border' => esc_html__('Border', 'trx_utils') ), "type" => "checklist" ), "color_preset" => array( "title" => esc_html__("Color preset", 'trx_utils'), "desc" => wp_kses_data( __("Select color preset", 'trx_utils') ), "value" => "1", "options" => array( '1' => esc_html__('Color preset 1', 'trx_utils'), '2' => esc_html__('Color preset 2', 'trx_utils'), '3' => esc_html__('Color preset 3', 'trx_utils'), '4' => esc_html__('Color preset 4', 'trx_utils'), '5' => esc_html__('Color preset 5', 'trx_utils'), '6' => esc_html__('Color preset 6', 'trx_utils') ), "type" => "checklist" ), "size" => array( "title" => esc_html__("Button's size", 'trx_utils'), "desc" => wp_kses_data( __("Select button's size", 'trx_utils') ), "value" => "small", "dir" => "horizontal", "options" => array( 'small' => esc_html__('Small', 'trx_utils'), 'large' => esc_html__('Large', 'trx_utils') ), "type" => "checklist" ), "icon" => array( "title" => esc_html__("Button's icon", 'trx_utils'), "desc" => wp_kses_data( __('Select icon for the title from Fontello icons set', 'trx_utils') ), "value" => "", "type" => "icons", "options" => lorem_ipsum_books_media_store_get_sc_param('icons') ), "color" => array( "title" => esc_html__("Button's text color", 'trx_utils'), "desc" => wp_kses_data( __("Any color for button's caption", 'trx_utils') ), "std" => "", "value" => "", "type" => "hidden" //color ), "bg_color" => array( "title" => esc_html__("Button's backcolor", 'trx_utils'), "desc" => wp_kses_data( __("Any color for button's background", 'trx_utils') ), "value" => "", "type" => "hidden" //color ), "align" => array( "title" => esc_html__("Button's alignment", 'trx_utils'), "desc" => wp_kses_data( __("Align button to left, center or right", 'trx_utils') ), "value" => "none", "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( __("URL for link on button click", 'trx_utils') ), "divider" => true, "value" => "", "type" => "text" ), "target" => array( "title" => esc_html__("Link target", 'trx_utils'), "desc" => wp_kses_data( __("Target for link on button click", 'trx_utils') ), "dependency" => array( 'link' => array('not_empty') ), "value" => "", "type" => "text" ), "popup" => array( "title" => esc_html__("Open link in popup", 'trx_utils'), "desc" => wp_kses_data( __("Open link target in popup window", 'trx_utils') ), "dependency" => array( 'link' => array('not_empty') ), "value" => "no", "type" => "switch", "options" => lorem_ipsum_books_media_store_get_sc_param('yes_no') ), "rel" => array( "title" => esc_html__("Rel attribute", 'trx_utils'), "desc" => wp_kses_data( __("Rel attribute for button's link (if need)", 'trx_utils') ), "dependency" => array( 'link' => array('not_empty') ), "value" => "", "type" => "text" ), "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_button_reg_shortcodes_vc' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list_vc', 'lorem_ipsum_books_media_store_sc_button_reg_shortcodes_vc'); function lorem_ipsum_books_media_store_sc_button_reg_shortcodes_vc() { vc_map( array( "base" => "trx_button", "name" => esc_html__("Button", 'trx_utils'), "description" => wp_kses_data( __("Button with link", 'trx_utils') ), "category" => esc_html__('Content', 'trx_utils'), 'icon' => 'icon_trx_button', "class" => "trx_sc_single trx_sc_button", "content_element" => true, "is_container" => false, "show_settings_on_create" => true, "params" => array( array( "param_name" => "content", "heading" => esc_html__("Caption", 'trx_utils'), "description" => wp_kses_data( __("Button caption", 'trx_utils') ), "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "type", "heading" => esc_html__("Button's shape", 'trx_utils'), "description" => wp_kses_data( __("Select button's shape", 'trx_utils') ), "class" => "", "value" => array( esc_html__('Square', 'trx_utils') => 'square', esc_html__('Round', 'trx_utils') => 'round' ), "type" => "hidden" //dropdown ), array( "param_name" => "style", "heading" => esc_html__("Button's style", 'trx_utils'), "description" => wp_kses_data( __("Select button's style", 'trx_utils') ), "class" => "", "value" => array( esc_html__('Filled', 'trx_utils') => 'filled', esc_html__('Border', 'trx_utils') => 'border' ), "type" => "dropdown" ), array( "param_name" => "size", "heading" => esc_html__("Button's size", 'trx_utils'), "description" => wp_kses_data( __("Select button's size", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => array( esc_html__('Small', 'trx_utils') => 'small', esc_html__('Large', 'trx_utils') => 'large' ), "type" => "dropdown" ), array( "param_name" => "icon", "heading" => esc_html__("Button's icon", 'trx_utils'), "description" => wp_kses_data( __("Select icon for the title from Fontello icons set", 'trx_utils') ), "class" => "", "value" => lorem_ipsum_books_media_store_get_sc_param('icons'), "type" => "dropdown" ), array( "param_name" => "color_preset", "heading" => esc_html__("Color preset", 'trx_utils'), "description" => wp_kses_data( __("Select color preset", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => array( esc_html__('Color preset 1', 'trx_utils') => '1', esc_html__('Color preset 2', 'trx_utils') => '2', esc_html__('Color preset 3', 'trx_utils') => '3', esc_html__('Color preset 4', 'trx_utils') => '4', esc_html__('Color preset 5', 'trx_utils') => '5', esc_html__('Color preset 6', 'trx_utils') => '6' ), "type" => "dropdown" ), array( "param_name" => "color", "heading" => esc_html__("Button's text color", 'trx_utils'), "description" => wp_kses_data( __("Any color for button's caption", 'trx_utils') ), "class" => "", "value" => "", "type" => "hidden" //colorpicker ), array( "param_name" => "bg_color", "heading" => esc_html__("Button's backcolor", 'trx_utils'), "description" => wp_kses_data( __("Any color for button's background", 'trx_utils') ), "class" => "", "value" => "", "type" => "hidden" //colorpicker ), array( "param_name" => "align", "heading" => esc_html__("Button's alignment", 'trx_utils'), "description" => wp_kses_data( __("Align button to left, center or right", 'trx_utils') ), "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( __("URL for the link on button click", 'trx_utils') ), "class" => "", "group" => esc_html__('Link', 'trx_utils'), "value" => "", "type" => "textfield" ), array( "param_name" => "target", "heading" => esc_html__("Link target", 'trx_utils'), "description" => wp_kses_data( __("Target for the link on button click", 'trx_utils') ), "class" => "", "group" => esc_html__('Link', 'trx_utils'), "value" => "", "type" => "textfield" ), array( "param_name" => "popup", "heading" => esc_html__("Open link in popup", 'trx_utils'), "description" => wp_kses_data( __("Open link target in popup window", 'trx_utils') ), "class" => "", "group" => esc_html__('Link', 'trx_utils'), "value" => array(esc_html__('Open in popup', 'trx_utils') => 'yes'), "type" => "checkbox" ), array( "param_name" => "rel", "heading" => esc_html__("Rel attribute", 'trx_utils'), "description" => wp_kses_data( __("Rel attribute for the button's link (if need", 'trx_utils') ), "class" => "", "group" => esc_html__('Link', 'trx_utils'), "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('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') ), 'js_view' => 'VcTrxTextView' ) ); class WPBakeryShortCode_Trx_Button extends Lorem_Ipsum_Books_Media_Store_VC_ShortCodeSingle {} } } ?>