当前位置: 首页>>代码示例>>PHP>>正文


PHP antispambot函数代码示例

本文整理汇总了PHP中antispambot函数的典型用法代码示例。如果您正苦于以下问题:PHP antispambot函数的具体用法?PHP antispambot怎么用?PHP antispambot使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了antispambot函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: widget

    /**
     * Output the HTML for this widget.
     *
     * @param array $args     An array of standard parameters for widgets in this theme.
     * @param array $instance An array of settings for this widget instance.
     */
    public function widget($args, $instance)
    {
        $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
        $text = empty($instance['text']) ? '' : $instance['text'];
        $order = empty($instance['order']) ? array() : explode(' ', $instance['order']);
        echo $args['before_widget'];
        if (!empty($title)) {
            echo $args['before_title'] . $title . $args['after_title'];
        }
        ?>
		<div class="text"><?php 
        echo wpautop($text);
        ?>
</div>
		<?php 
        $items = $this->get_social_net_items();
        $icons = array('email' => 'fa-envelope-o', 'facebook' => 'fa-facebook', 'twitter' => 'fa-twitter', 'google_plus' => 'fa-google-plus', 'youtube' => 'fa-youtube', 'vimeo' => 'fa-vimeo-square', 'instagram' => 'fa-instagram', 'pinterest' => 'fa-pinterest', 'vk' => 'fa-vk');
        echo '<ul class="links">';
        foreach ($order as $item) {
            if (!empty($items[$item])) {
                $item_name = $items[$item];
                if (empty($instance[$item])) {
                    continue;
                }
                $href = 'email' == $item ? 'mailto:' . esc_attr(antispambot($instance[$item])) : esc_url($instance[$item]);
                $icon_name = isset($icons[$item]) ? $icons[$item] : '';
                echo '<li><a href="' . $href . '" title="' . $item_name . '" target="_blank"><i class="fa ' . $icon_name . '"></i></a></li>';
            }
        }
        echo '</ul>';
        echo $args['after_widget'];
    }
开发者ID:jeffreycai,项目名称:ct21,代码行数:38,代码来源:widgets.php

示例2: widget

 /**  
  * Front-end display of widget.
  *
  * @see WP_Widget::widget()
  *
  * @param array $args     Widget arguments.
  * @param array $instance Saved values from database.
  */
 public function widget($args, $instance)
 {
     extract($args);
     $title = apply_filters('widget_title', $instance['title']);
     $street = $instance['street'];
     $city = $instance['city'];
     $postCode = $instance['postCode'];
     $phone = $instance['phone'];
     $email = $instance['email'];
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     $address = '';
     if ('' != $street || '' != $phone || '' != $email) {
         $address .= '<div class="site-info vcard">';
         if ('' != $street || '' != $city || '' != $postcode) {
             $address .= '<p class="adr">';
             $address .= '<span class="street-address">' . esc_html($street) . '</span>';
             $address .= '<span class="region">' . esc_html($city) . '</span>';
             $address .= '<span class="postal-code">' . esc_html($postCode) . '</span>';
             $address .= '</p>';
         }
         if ('' != $phone) {
             $address .= '<span class="tel">' . esc_html($phone) . '</span>';
         }
         if ('' != $email) {
             $address .= '<span class="email"><a href="mailto:' . antispambot(esc_html($email)) . '" target="_blank">' . antispambot(esc_html($email)) . '</a></span>';
         }
         $address .= '<div>';
     }
     echo $address;
     echo $after_widget;
 }
开发者ID:psflannery,项目名称:seventeen_functionality,代码行数:42,代码来源:contact-widget.php

示例3: bigblank_hide_email

function bigblank_hide_email($atts, $content = null)
{
    if (!is_email($content)) {
        return;
    }
    return '<a href="mailto:' . antispambot($content) . '">' . antispambot($content) . '</a>';
}
开发者ID:victorknust,项目名称:BigBlankTheme,代码行数:7,代码来源:shortcodes.php

示例4: seventeen_hide_email_shortcode

function seventeen_hide_email_shortcode($atts, $content = null)
{
    if (!is_email($content)) {
        return;
    }
    return '<a href="mailto:' . antispambot($content) . '">' . antispambot($content) . '</a>';
}
开发者ID:psflannery,项目名称:seventeen_functionality,代码行数:7,代码来源:shortcodes.php

示例5: ground_emailbot

function ground_emailbot($atts, $content = null)
{
    if (!is_email($content)) {
        return;
    }
    return '<a href="mailto:' . antispambot($content) . '" class="mail" >' . antispambot($content) . '</a>';
}
开发者ID:naeemnur,项目名称:ground,代码行数:7,代码来源:shortcode.php

示例6: scd_secure_mail

function scd_secure_mail($atts)
{
    extract(shortcode_atts(array("mailto" => '', "txt" => ''), $atts));
    $mailto = antispambot($mailto);
    $txt = antispambot($txt);
    return '<a href="mailto:' . $mailto . '">' . $txt . '</a>';
}
开发者ID:benkongfc,项目名称:projectFit,代码行数:7,代码来源:shortcodes.php

示例7: emailbot_ssc

function emailbot_ssc($attr)
{
    extract(shortcode_atts(array('address' => ''), $attr));
    $email = '<a class="email_link" href="mailto:' . antispambot($attr['address']) . '" title="Send Us An Email" target="_blank">';
    $email .= antispambot($attr['address']);
    $email .= '</a>';
    return $email;
}
开发者ID:norcross,项目名称:norcross_v4,代码行数:8,代码来源:rkv-shortcodes.php

示例8: Grafik_Shortcode_BlurEmail_Callback

function Grafik_Shortcode_BlurEmail_Callback($atts)
{
    global $GRAFIK_ID;
    $a = shortcode_atts(array('mailbox' => '', 'link' => 'true', 'text' => '', 'class' => '', 'id' => ''), $atts);
    if (empty($a['mailbox'])) {
        return null;
    }
    return '<span class="theme-bluremail' . (empty($a['class']) ? null : ' ' . $a['class']) . '"' . (empty($a['id']) ? null : ' id="' . $a['id'] . '"') . '>' . ($a['link'] == 'true' ? '<a href="' . antispambot('mailto://' . $a['mailbox']) . '">' : null) . antispambot(empty($a['text']) ? $a['mailbox'] : $a['text']) . ($a['link'] == 'true' ? '</a>' : null) . '</span>';
}
开发者ID:GrafikMatthew,项目名称:Grafik-Engine-Alpha,代码行数:9,代码来源:BlurEmail.php

示例9: media_contact_shortcode_func

/**
 *
 * Experts media contact shortcode
 *
 * Puts the contact details for media inquiries on the experts pages. 
 * Means that if updated needed, just happens here and will automatically update each expert page.
 *
 */
function media_contact_shortcode_func($atts)
{
    $output = "<div itemscope itemtype=\"http://schema.org/Person\">";
    $output .= "\t<h3 itemprop=\"name\">Judy Augsburger</h3>";
    $output .= "<p><a itemprop=\"email\" href=\"" . antispambot("mailto:judy_augsburger@hmc.edu") . "\">" . antispambot("judy_augsburger@hmc.edu") . "</a><br /><a itemprop=\"telephone\" href=\"tel:+19096070713\">909.607.0713</a></p>\n";
    $output .= "</div>";
    return $output;
    // Send it out
}
开发者ID:hmcmathcomp,项目名称:wpdev-hmc-edu,代码行数:17,代码来源:functions.php

示例10: antispambot_shortcode_handler

function antispambot_shortcode_handler($atts, $content = '')
{
    extract(shortcode_atts(array('link' => '1'), $atts));
    if ($link) {
        return '<a href="mailto:' . antispambot($content, 1) . '" title="mail to ' . antispambot($content, 0) . '">' . antispambot($content, 0) . '</a>';
    } else {
        return antispambot($content, 0);
    }
}
开发者ID:KasaiDot,项目名称:zanblog,代码行数:9,代码来源:shortcodes.php

示例11: msdlab_mailto_function

function msdlab_mailto_function($atts, $content)
{
    extract(shortcode_atts(array('email' => ''), $atts));
    $content = trim($content);
    if ($email == '' && preg_match('|[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}|i', $content, $matches)) {
        $email = $matches[0];
    }
    $email = antispambot($email);
    return '<a href="mailto:' . $email . '">' . $content . '</a>';
}
开发者ID:foxydot,项目名称:daretocare,代码行数:10,代码来源:shortcodes.php

示例12: email_encode_function

/**
 *
 * Email encode shortcode
 *
 * Encodes email addresses using antispambot() WP function
 *
 * Usage: Enclose text email address with tags: [email]example@hmc.edu[/email]
 *
 *
*/
function email_encode_function($atts, $content)
{
    extract(shortcode_atts(array('ownline' => 'false'), $atts));
    if ($ownline == 'true') {
        $output = '<p><a href="' . antispambot("mailto:" . $content) . '">' . antispambot($content) . '</a></p>';
    } else {
        $output = '<a href="' . antispambot("mailto:" . $content) . '">' . antispambot($content) . '</a>';
    }
    return $output;
}
开发者ID:hmcmathcomp,项目名称:wpdev-hmc-edu,代码行数:20,代码来源:shortcodes.php

示例13: mk_header_toolbar_contact

 function mk_header_toolbar_contact()
 {
     global $mk_options;
     if (!empty($mk_options['header_toolbar_phone'])) {
         echo '<span class="header-toolbar-contact"><i class="mk-moon-phone-3"></i>' . stripslashes($mk_options['header_toolbar_phone']) . '</span>';
     }
     if (!empty($mk_options['header_toolbar_email'])) {
         echo '<span class="header-toolbar-contact"><i class="mk-moon-envelop"></i><a href="mailto:' . antispambot($mk_options['header_toolbar_email']) . '">' . antispambot($mk_options['header_toolbar_email']) . '</a></span>';
     }
 }
开发者ID:namleduc,项目名称:thqc,代码行数:10,代码来源:header.php

示例14: my_social_media_icons

function my_social_media_icons()
{
    $social_sites = my_customizer_social_media_array();
    foreach ($social_sites as $social_site) {
        if (strlen(get_theme_mod($social_site)) > 0) {
            $active_sites[] = $social_site;
        }
    }
    if (!empty($active_sites)) {
        echo "<ul class='social-icons'>";
        foreach ($active_sites as $active_site) {
            $class = 'fa fa-' . $active_site;
            if ($active_site == 'email') {
                ?>
                <li>
                    <a class="email" target="_blank"
                       href="mailto:<?php 
                echo antispambot(is_email(get_theme_mod($active_site)));
                ?>
">
                        <span class="fa fa-envelope" title="<?php 
                _e('email icon', 'text-domain');
                ?>
"></span>
                    </a>
                </li>
            <?php 
            } else {
                ?>
                <li>
                    <a class="<?php 
                echo $active_site;
                ?>
" target="_blank"
                       href="<?php 
                echo esc_url(get_theme_mod($active_site));
                ?>
">
                        <span class="<?php 
                echo esc_attr($class);
                ?>
"
                              title="<?php 
                printf(__('%s icon', 'text-domain'), $active_site);
                ?>
"></span>
                    </a>
                </li>
                <?php 
            }
        }
        echo "</ul>";
    }
}
开发者ID:YuriyChaban,项目名称:GH-Frontend-5,代码行数:54,代码来源:functions.php

示例15: my_social_media_icons

function my_social_media_icons()
{
    $social_sites = my_customizer_social_media_array();
    /* any inputs that aren't empty are stored in $active_sites array */
    foreach ($social_sites as $social_site) {
        if (strlen(get_theme_mod($social_site)) > 0) {
            $active_sites[] = $social_site;
        }
    }
    /* for each active social site, add it as a list item */
    if (!empty($active_sites)) {
        echo "<ul class='social-media-icons'>";
        foreach ($active_sites as $active_site) {
            /* setup the class */
            $class = 'fa fa-' . $active_site;
            if ($active_site == 'email') {
                ?>
                    <li>
                        <a class="email" target="_blank" href="mailto:<?php 
                echo antispambot(is_email(get_theme_mod($active_site)));
                ?>
">
                            <i class="fa fa-envelope" title="<?php 
                _e('email icon', 'text-domain');
                ?>
"></i>
                        </a>
                    </li>
                <?php 
            } else {
                ?>
                    <li>
                        <a class="<?php 
                echo $active_site;
                ?>
" target="_blank" href="<?php 
                echo esc_url(get_theme_mod($active_site));
                ?>
">
                            <i class="<?php 
                echo esc_attr($class);
                ?>
" title="<?php 
                printf(__('%s icon', 'text-domain'), $active_site);
                ?>
"></i>
                        </a>
                    </li>
                <?php 
            }
        }
        echo "</ul>";
    }
}
开发者ID:cph,项目名称:ilc,代码行数:54,代码来源:customizer.php


注:本文中的antispambot函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。