芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/plugins/trx_utils/shortcodes/trx_basic/image.php
"", "align" => "", "shape" => "square", "hover" => "no", "src" => "", "url" => "", "icon" => "", "link" => "", // Common params "id" => "", "class" => "", "animation" => "", "css" => "", "top" => "", "bottom" => "", "left" => "", "right" => "", "width" => "", "height" => "" ), $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); $src = $src!='' ? $src : $url; if ($src > 0) { $attach = wp_get_attachment_image_src( $src, 'full' ); if (isset($attach[0]) && $attach[0]!='') $src = $attach[0]; } if (!empty($width) || !empty($height)) { $w = !empty($width) && strlen(intval($width)) == strlen($width) ? $width : null; $h = !empty($height) && strlen(intval($height)) == strlen($height) ? $height : null; if ($w || $h) $src = lorem_ipsum_books_media_store_get_resized_image_url($src, $w, $h); } if (trim($link)) lorem_ipsum_books_media_store_enqueue_popup(); $output = empty($src) ? '' : ('
' . (trim($link) ? '
' : '') . '
' . (trim($link) ? '
' : '') . (trim($title) || trim($icon) ? '
' . ($title) . '
' : '') . '
'); return apply_filters('lorem_ipsum_books_media_store_shortcode_output', $output, 'trx_image', $atts, $content); } add_shortcode('trx_image', 'lorem_ipsum_books_media_store_sc_image'); } /* Register shortcode in the internal SC Builder -------------------------------------------------------------------- */ if ( !function_exists( 'lorem_ipsum_books_media_store_sc_image_reg_shortcodes' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list', 'lorem_ipsum_books_media_store_sc_image_reg_shortcodes'); function lorem_ipsum_books_media_store_sc_image_reg_shortcodes() { lorem_ipsum_books_media_store_sc_map("trx_image", array( "title" => esc_html__("Image", 'trx_utils'), "desc" => wp_kses_data( __("Insert image into your post (page)", 'trx_utils') ), "decorate" => false, "container" => false, "params" => array( "url" => array( "title" => esc_html__("URL for image file", 'trx_utils'), "desc" => wp_kses_data( __("Select or upload image or write URL from other site", 'trx_utils') ), "readonly" => false, "value" => "", "type" => "media", "before" => array( 'sizes' => true // If you want allow user select thumb size for image. Otherwise, thumb size is ignored - image fullsize used ) ), "title" => array( "title" => esc_html__("Title", 'trx_utils'), "desc" => wp_kses_data( __("Image title (if need)", 'trx_utils') ), "value" => "", "type" => "text" ), "icon" => array( "title" => esc_html__("Icon before title", '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') ), "align" => array( "title" => esc_html__("Float image", 'trx_utils'), "desc" => wp_kses_data( __("Float image to left or right side", 'trx_utils') ), "value" => "", "type" => "checklist", "dir" => "horizontal", "options" => lorem_ipsum_books_media_store_get_sc_param('align') ), "shape" => array( "title" => esc_html__("Image Shape", 'trx_utils'), "desc" => wp_kses_data( __("Shape of the image: square (rectangle) or round", 'trx_utils') ), "value" => "square", "type" => "checklist", "dir" => "horizontal", "options" => array( "square" => esc_html__('Square', 'trx_utils'), "round" => esc_html__('Round', 'trx_utils') ) ), "link" => array( "title" => esc_html__("Link", 'trx_utils'), "desc" => wp_kses_data( __("The link URL from the image", 'trx_utils') ), "value" => "", "type" => "text" ), "hover" => array( "title" => esc_html__("Hover effect", 'trx_utils'), "desc" => wp_kses_data( __("Enable hover effect", 'trx_utils') ), "value" => "no", "dependency" => array( 'link' => array('not_empty') ), "type" => "switch", "options" => lorem_ipsum_books_media_store_get_sc_param('yes_no') ), "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_image_reg_shortcodes_vc' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list_vc', 'lorem_ipsum_books_media_store_sc_image_reg_shortcodes_vc'); function lorem_ipsum_books_media_store_sc_image_reg_shortcodes_vc() { vc_map( array( "base" => "trx_image", "name" => esc_html__("Image", 'trx_utils'), "description" => wp_kses_data( __("Insert image", 'trx_utils') ), "category" => esc_html__('Content', 'trx_utils'), 'icon' => 'icon_trx_image', "class" => "trx_sc_single trx_sc_image", "content_element" => true, "is_container" => false, "show_settings_on_create" => true, "params" => array( array( "param_name" => "url", "heading" => esc_html__("Select image", 'trx_utils'), "description" => wp_kses_data( __("Select image from library", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => "", "type" => "attach_image" ), array( "param_name" => "align", "heading" => esc_html__("Image alignment", 'trx_utils'), "description" => wp_kses_data( __("Align image to left or right side", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => array_flip(lorem_ipsum_books_media_store_get_sc_param('align')), "type" => "dropdown" ), array( "param_name" => "shape", "heading" => esc_html__("Image shape", 'trx_utils'), "description" => wp_kses_data( __("Shape of the image: square or round", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => array( esc_html__('Square', 'trx_utils') => 'square', esc_html__('Round', 'trx_utils') => 'round' ), "type" => "dropdown" ), array( "param_name" => "title", "heading" => esc_html__("Title", 'trx_utils'), "description" => wp_kses_data( __("Image's title", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "icon", "heading" => esc_html__("Title'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" => "link", "heading" => esc_html__("Link", 'trx_utils'), "description" => wp_kses_data( __("The link URL from the image", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "hover", "heading" => esc_html__("Hover effect", 'trx_utils'), "description" => wp_kses_data( __("Enable hover effect", 'trx_utils') ), "class" => "", "std" => "no", "admin_label" => true, "value" => array(esc_html__('Yes', 'trx_utils') => 'yes'), 'dependency' => array( 'element' => 'link', 'not_empty' => true ), "type" => "checkbox" ), 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_Image extends Lorem_Ipsum_Books_Media_Store_VC_ShortCodeSingle {} } } ?>