芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/plugins/trx_utils/shortcodes/trx_basic/audio.php
"", "author" => "", "image" => "", "mp3" => '', "wav" => '', "src" => '', "url" => '', "align" => '', "controls" => "", "autoplay" => "", "frame" => "on", // Common params "id" => "", "class" => "", "css" => "", "animation" => "", "width" => '', "height" => '', "top" => "", "bottom" => "", "left" => "", "right" => "" ), $atts))); $css .= lorem_ipsum_books_media_store_get_css_dimensions_from_values($width, $height); $width = lorem_ipsum_books_media_store_prepare_css_value($width); $height = lorem_ipsum_books_media_store_prepare_css_value($height); if ($src=='' && $url=='' && isset($atts[0])) { $src = $atts[0]; } if ($src=='') { if ($url) $src = $url; else if ($mp3) $src = $mp3; else if ($wav) $src = $wav; } if ($image > 0) { $attach = wp_get_attachment_image_src( $image, 'full' ); if (isset($attach[0]) && $attach[0]!='') $image = $attach[0]; } $class .= ($class ? ' ' : '') . lorem_ipsum_books_media_store_get_css_position_as_classes($top, $right, $bottom, $left); $data = ($title != '' ? ' data-title="'.esc_attr($title).'"' : '') . ($author != '' ? ' data-author="'.esc_attr($author).'"' : '') . ($image != '' ? ' data-image="'.esc_url($image).'"' : '') . ($align && $align!='none' ? ' data-align="'.esc_attr($align).'"' : '') . (!lorem_ipsum_books_media_store_param_is_off($animation) ? ' data-animation="'.esc_attr(lorem_ipsum_books_media_store_get_animation_classes($animation)).'"' : ''); $audio = '
'; if ( lorem_ipsum_books_media_store_get_custom_option('substitute_audio')=='no') { if (lorem_ipsum_books_media_store_param_is_on($frame)) { $audio = lorem_ipsum_books_media_store_get_audio_frame($audio, $image, $s); } } else { if ((isset($_GET['vc_editable']) && $_GET['vc_editable']=='true') && (isset($_POST['action']) && $_POST['action']=='vc_load_shortcode')) { $audio = lorem_ipsum_books_media_store_substitute_audio($audio, false); } } if (lorem_ipsum_books_media_store_get_theme_option('use_mediaelement')=='yes') wp_enqueue_script('wp-mediaelement'); return apply_filters('lorem_ipsum_books_media_store_shortcode_output', $audio, 'trx_audio', $atts, $content); } add_shortcode("trx_audio", "lorem_ipsum_books_media_store_sc_audio"); } /* Register shortcode in the internal SC Builder -------------------------------------------------------------------- */ if ( !function_exists( 'lorem_ipsum_books_media_store_sc_audio_reg_shortcodes' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list', 'lorem_ipsum_books_media_store_sc_audio_reg_shortcodes'); function lorem_ipsum_books_media_store_sc_audio_reg_shortcodes() { lorem_ipsum_books_media_store_sc_map("trx_audio", array( "title" => esc_html__("Audio", 'trx_utils'), "desc" => wp_kses_data( __("Insert audio player", 'trx_utils') ), "decorate" => false, "container" => false, "params" => array( "url" => array( "title" => esc_html__("URL for audio file", 'trx_utils'), "desc" => wp_kses_data( __("URL for audio file", 'trx_utils') ), "readonly" => false, "value" => "", "type" => "media", "before" => array( 'title' => esc_html__('Choose audio', 'trx_utils'), 'action' => 'media_upload', 'type' => 'audio', 'multiple' => false, 'linked_field' => '', 'captions' => array( 'choose' => esc_html__('Choose audio file', 'trx_utils'), 'update' => esc_html__('Select audio file', 'trx_utils') ) ), "after" => array( 'icon' => 'icon-cancel', 'action' => 'media_reset' ) ), "image" => array( "title" => esc_html__("Cover image", 'trx_utils'), "desc" => wp_kses_data( __("Select or upload image or write URL from other site for audio cover", 'trx_utils') ), "readonly" => false, "value" => "", "type" => "media" ), "title" => array( "title" => esc_html__("Title", 'trx_utils'), "desc" => wp_kses_data( __("Title of the audio file", 'trx_utils') ), "divider" => true, "value" => "", "type" => "text" ), "author" => array( "title" => esc_html__("Author", 'trx_utils'), "desc" => wp_kses_data( __("Author of the audio file", 'trx_utils') ), "value" => "", "type" => "text" ), "controls" => array( "title" => esc_html__("Show controls", 'trx_utils'), "desc" => wp_kses_data( __("Show controls in audio player", 'trx_utils') ), "divider" => true, "size" => "medium", "value" => "show", "type" => "switch", "options" => lorem_ipsum_books_media_store_get_sc_param('show_hide') ), "autoplay" => array( "title" => esc_html__("Autoplay audio", 'trx_utils'), "desc" => wp_kses_data( __("Autoplay audio on page load", 'trx_utils') ), "value" => "off", "type" => "switch", "options" => lorem_ipsum_books_media_store_get_sc_param('on_off') ), "align" => array( "title" => esc_html__("Align", 'trx_utils'), "desc" => wp_kses_data( __("Select block alignment", 'trx_utils') ), "value" => "none", "type" => "checklist", "dir" => "horizontal", "options" => lorem_ipsum_books_media_store_get_sc_param('align') ), "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_audio_reg_shortcodes_vc' ) ) { //add_action('lorem_ipsum_books_media_store_action_shortcodes_list_vc', 'lorem_ipsum_books_media_store_sc_audio_reg_shortcodes_vc'); function lorem_ipsum_books_media_store_sc_audio_reg_shortcodes_vc() { vc_map( array( "base" => "trx_audio", "name" => esc_html__("Audio", 'trx_utils'), "description" => wp_kses_data( __("Insert audio player", 'trx_utils') ), "category" => esc_html__('Content', 'trx_utils'), 'icon' => 'icon_trx_audio', "class" => "trx_sc_single trx_sc_audio", "content_element" => true, "is_container" => false, "show_settings_on_create" => true, "params" => array( array( "param_name" => "url", "heading" => esc_html__("URL for audio file", 'trx_utils'), "description" => wp_kses_data( __("Put here URL for audio file", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "image", "heading" => esc_html__("Cover image", 'trx_utils'), "description" => wp_kses_data( __("Select or upload image or write URL from other site for audio cover", 'trx_utils') ), "class" => "", "value" => "", "type" => "attach_image" ), array( "param_name" => "title", "heading" => esc_html__("Title", 'trx_utils'), "description" => wp_kses_data( __("Title of the audio file", 'trx_utils') ), "admin_label" => true, "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "author", "heading" => esc_html__("Author", 'trx_utils'), "description" => wp_kses_data( __("Author of the audio file", 'trx_utils') ), "class" => "", "value" => "", "type" => "textfield" ), array( "param_name" => "controls", "heading" => esc_html__("Controls", 'trx_utils'), "description" => wp_kses_data( __("Show/hide controls", 'trx_utils') ), "class" => "", "value" => array("Hide controls" => "hide" ), "type" => "checkbox" ), array( "param_name" => "autoplay", "heading" => esc_html__("Autoplay", 'trx_utils'), "description" => wp_kses_data( __("Autoplay audio on page load", 'trx_utils') ), "class" => "", "value" => array("Autoplay" => "on" ), "type" => "checkbox" ), array( "param_name" => "align", "heading" => esc_html__("Alignment", 'trx_utils'), "description" => wp_kses_data( __("Select block alignment", 'trx_utils') ), "class" => "", "value" => array_flip(lorem_ipsum_books_media_store_get_sc_param('align')), "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_Audio extends Lorem_Ipsum_Books_Media_Store_VC_ShortCodeSingle {} } } ?>