如何更改$ network?

时间:2014-09-26 02:38:44

标签: php

我试图添加4个不同阵列的链接,但我不知道该怎么做。它目前设置如下:

foreach ($this->buttons as $network => $options) {
        if ($this->options['show'][$network]) {
            /*** Apply Shortcodes */
            $shortcodes = array(
                '[site_name]',
                '[permalink]',
                '[post_title]',
                '[post_image_url]',
                '[title_encode]'
                );
            $shortcode_values = array(
                $site_name,
                $permalink,
                $post_title,
                $post_image_url,
                $title_encode
                );
            $widget = str_replace($shortcodes,$shortcode_values,$options['widget']);

            $to_return .= '
        <div class="spyr_sliding_share_button spyr_sb_' . $network . '">
            <a href="#" class="icon icon-' . $network . '"><span>' . $options['name'] . '</span></a>
            <div class="spyr_sb_inner">' . $widget . '</div>
            </div>';
            }
        }

但不是应用这个:

<div class="spyr_sliding_share_button spyr_sb_' . $network . '">
            <a href="#" class="icon icon-' . $network . '"><span>' . $options['name'] . '</span></a>
            <div class="spyr_sb_inner">' . $widget . '</div>
            </div>';

对于所有4个阵列,我想为每个阵列设置不同的设置。 4个阵列都是社交媒体图标,我试图将Facebook图标从此<a href="#"更改为此<a href="https://www.facebook.com/sharer/sharer.php?u=http://boasish.com/data-url=%22%5Bpermalink%5D%22%20data-text=%22%5Bpost_title%5D/"

0 个答案:

没有答案