扩展现有数组输出

时间:2012-08-16 15:28:53

标签: php arrays append

我有这个代码,这是我用于我的wordpress主题的自定义幻灯片脚本:

$class = shortcode_atts( array('text_color' => '#ffffff', 'image' => '', 'video_vimeo' => '', 'video_youtube' => '', 'video_mp4' => '', 'video_ogg' => '', 'video_webm' => '', 'video_poster' => '', 'slide_desc' => '', 'slide_horizontal' => '', 'slide_fitscreen' => '', 'slide_noresize' => ''), $atts );

            if($class['slide_desc'] != ''){ $slide_desc = $class['slide_desc']; /* $slide_desc = htmlspecialchars_decode(str_replace("*", '"', $slide_desc)); */ $slide_desc = "title=\"".$slide_desc."\""; }
            if($class['text_color'] == '#ffffff'){ $text_color = 'text_white'; }else{ $text_color = 'text_black'; }
            //if($class['slide_desc'] != ''){ $slide_desc = '<div style="opacity: 1; display: block;" id="content"><div class="container_12"><div class="grid_9"><h1 class="page-title" style="margin-bottom: 25px;">'.$class['slide_desc'].'</h1></div></div>'; }
            if($class['image'] != ''){
                $image = $class['image'];
                if($class['slide_horizontal'] == 'true'){ $horizontal = 'slide_horizontal '; }else{ $horizontal = ''; }
                if($class['slide_horizontal'] == 'true' || $class['slide_fitscreen'] == 'true'){ $slide_fitscreen = 'slide_fitscreen'; }else{ $slide_fitscreen = ''; }
                return '<img class="myimage '.$text_color.' '.$horizontal.$slide_fitscreen.'" src="'.$image.'" alt="" '.$slide_desc.' />';

所以,在这个示例代码中,我想要做的是在每个图像上输出:<?php echo do_shortcode('[daisy]'); ?>,视频。

我不是很擅长php而且我觉得这很简单,但我不知道我需要在哪里以及如何将这段代码(<?php echo do_shortcode('[daisy]'); ?>)附加到每张幻灯片上。 任何提示,建议都是受欢迎的。

0 个答案:

没有答案