• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_staticize_emoji函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: wp_staticize_emoji_for_email

/**
 * Convert emoji in emails into static images.
 *
 * @since 4.2.0
 *
 * @param array $mail The email data array.
 * @return array The email data array, with emoji in the message staticized.
 */
function wp_staticize_emoji_for_email($mail)
{
    if (!isset($mail['message'])) {
        return $mail;
    }
    /*
     * We can only transform the emoji into images if it's a text/html email.
     * To do that, here's a cut down version of the same process that happens
     * in wp_mail() - get the Content-Type from the headers, if there is one,
     * then pass it through the wp_mail_content_type filter, in case a plugin
     * is handling changing the Content-Type.
     */
    $headers = array();
    if (isset($mail['headers'])) {
        if (is_array($mail['headers'])) {
            $headers = $mail['headers'];
        } else {
            $headers = explode("\n", str_replace("\r\n", "\n", $mail['headers']));
        }
    }
    foreach ($headers as $header) {
        if (strpos($header, ':') === false) {
            continue;
        }
        // Explode them out.
        list($name, $content) = explode(':', trim($header), 2);
        // Cleanup crew.
        $name = trim($name);
        $content = trim($content);
        if ('content-type' === strtolower($name)) {
            if (strpos($content, ';') !== false) {
                list($type, $charset) = explode(';', $content);
                $content_type = trim($type);
            } else {
                $content_type = trim($content);
            }
            break;
        }
    }
    // Set Content-Type if we don't have a content-type from the input headers.
    if (!isset($content_type)) {
        $content_type = 'text/plain';
    }
    /** This filter is documented in wp-includes/pluggable.php */
    $content_type = apply_filters('wp_mail_content_type', $content_type);
    if ('text/html' === $content_type) {
        $mail['message'] = wp_staticize_emoji($mail['message']);
    }
    return $mail;
}
开发者ID:zhoujiangyou,项目名称:WordPress,代码行数:58,代码来源:formatting.php


示例2: gwolle_gb_page_editor


//.........这里部分代码省略.........

								<div id="contentdiv" class="postbox" >
									<div class="handlediv"></div>
									<h3 class='hndle' title="<?php 
        esc_attr_e('Click to open or close', 'gwolle-gb');
        ?>
"><span><?php 
        _e('Guestbook entry', 'gwolle-gb');
        ?>
</span></h3>
									<div class="inside">
										<textarea rows="10" name="gwolle_gb_content" id="gwolle_gb_content" tabindex="1" placeholder="<?php 
        _e('Message', 'gwolle-gb');
        ?>
"><?php 
        echo gwolle_gb_sanitize_output($entry->get_content());
        ?>
</textarea>
										<?php 
        if (get_option('gwolle_gb-showLineBreaks', 'false') == 'false') {
            echo '<p>' . sprintf(__('Line breaks will not be visible to the visitors due to your <a href="%s">settings</a>.', 'gwolle-gb'), 'admin.php?page=' . GWOLLE_GB_FOLDER . '/settings.php') . '</p>';
        }
        $form_setting = gwolle_gb_get_setting('form');
        if (isset($form_setting['form_bbcode_enabled']) && $form_setting['form_bbcode_enabled'] === 'true') {
            wp_enqueue_script('markitup', plugins_url('../frontend/markitup/jquery.markitup.js', __FILE__), 'jquery', GWOLLE_GB_VER, false);
            wp_enqueue_script('markitup_set', plugins_url('../frontend/markitup/set.js', __FILE__), 'jquery', GWOLLE_GB_VER, false);
            wp_enqueue_style('gwolle_gb_markitup_css', plugins_url('../frontend/markitup/style.css', __FILE__), false, GWOLLE_GB_VER, 'screen');
            $dataToBePassed = array('bold' => __('Bold', 'gwolle-gb'), 'italic' => __('Italic', 'gwolle-gb'), 'bullet' => __('Bulleted List', 'gwolle-gb'), 'numeric' => __('Numeric List', 'gwolle-gb'), 'picture' => __('Picture', 'gwolle-gb'), 'source' => __('Source', 'gwolle-gb'), 'link' => __('Link', 'gwolle-gb'), 'linktext' => __('Your text to link...', 'gwolle-gb'), 'clean' => __('Clean', 'gwolle-gb'), 'emoji' => __('Emoji', 'gwolle-gb'));
            wp_localize_script('markitup_set', 'gwolle_gb_localize', $dataToBePassed);
            // Emoji symbols
            echo '<div class="gwolle_gb_emoji" style="display:none;">';
            $emoji = gwolle_gb_get_emoji();
            // make it into images for nice colors.
            if (function_exists('wp_staticize_emoji')) {
                $emoji = wp_staticize_emoji($emoji);
            }
            echo $emoji;
            echo '</div>';
        }
        ?>
									</div>
								</div>

								<div id="authordiv" class="postbox " >
									<div class="handlediv"></div>
									<h3 class='hndle' title="<?php 
        esc_attr_e('Click to open or close', 'gwolle-gb');
        ?>
"><span><?php 
        _e('Website', 'gwolle-gb');
        ?>
</span></h3>
									<div class="inside">
										<input type="url" name="gwolle_gb_author_website" tabindex="2" value="<?php 
        echo gwolle_gb_sanitize_output($entry->get_author_website());
        ?>
" id="author_website" placeholder="<?php 
        _e('Website', 'gwolle-gb');
        ?>
" />
										<p><?php 
        _e("Example: <code>http://www.example.com/</code>", 'gwolle-gb');
        ?>
</p>
									</div>
								</div>
开发者ID:RainGrid,项目名称:site,代码行数:67,代码来源:page-editor.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_statistics_date_range_calculator函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_startswith函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap