• 欢迎访问奇跡の海网站,本站不上传任何资源,所有资源均来自于网络,欢迎加入奇跡の海~! QQ群
  • 本站下载资源为网络上收集整理而来,并且以计算机技术研究交流为目的,版权归原作者所有,仅供大家参考,学习,不存在任何商业目的与商业用途.

WordPress多主题内置代码分享

WordPress 奇跡の海 2个月前 (12-17) 13次浏览 0个评论 扫描二维码

更新的文章添加保存外链图片按钮

/**
 * Name : fo_submit_box
 *
 * Description:对于发布,更新的文章添加保存外链图片按钮
 *
 * from http://www.frontopen.com && http://aijava.cn
 */
add_action( 'submitpost_box', 'fo_submit_box');
function fo_submit_box(  ){
    echo '<div id="fo_side-sortables" class="meta-box-sortables ui-sortable">';
    echo '<div id="fo_submit_box" class="postbox ">';
    echo '<div class="handlediv" title="点击以切换"><br></div>';
    echo '<h3 class="hndle"><span>[MrR]扩展功能</span></h3>';
    echo '<div class="inside"><div class="submitbox">';
    echo '  <div style="padding: 10px 10px 0;text-align: left;"><label class="selectit" title="对于防盗链的图片表示不保存,自己动手哈!"><input type="checkbox" name="FO_saveImg" value="true" title="勾选此项,自动保存非本站的远程图片"/>保存外链图片</label></div>';
    echo '  <div style="padding: 10px 10px 0;text-align: left;"><label class="selectit" title="慎用此功能,重要文章才勾选嘛,以免引起读者反感哈"><input type="checkbox" name="FO_emaill_report_user" value="true" title="勾选此项,将邮件通知博客所有评论者"/>邮件通知博客所有评论者</label></div>';
    echo '  <div style="padding: 10px 10px 0;text-align: right;"><a href="http://www.banghui.org/guestbook" target="_bank" title="有什么问题可以反馈下,毕竟辛苦搞的">问题反馈</a></div>';
    echo '</div></div>';
    echo '</div>';
    echo '</div>';
}

自动保存非本站的远程图片

/**
 * Name : fo_auto_save_post_image
 *
 * Description:自动保存非本站的远程图片(对于拒绝访问的图片不会做操作)
 *
 * from http://www.frontopen.com && http://aijava.cn
 */
add_action('publish_post', 'fo_auto_save_post_image');
function fo_auto_save_post_image($post_ID) {
 
    //如果未勾选保存远程图片,不进行任何操作
    if($_POST['FO_saveImg'] != 'true'){
        return;
    }
 
    $reg = '/<img[^>]+src=[\'"]([^\'"]+)[\'"][^>]*>/i';
    $temp1 = array();
    $temp2 = array();
    remove_action('publish_post', 'fo_auto_save_post_image');
    $body = get_post($post_ID);
    preg_match_all($reg, $body->post_content, $temp1);
    if (!empty($temp1)) {
        $temp2 = array_unique($temp1[1]);
    }
    if (!empty($temp2)) {
        foreach ($temp2 as $k => $v) {
            if (!strpos($v, $_SERVER['HTTP_HOST']) === false) {
                unset($temp2[$k]);
            }
        }
    }
    class hatmore
    {
        public $pid = '';
        public $imgoldurl = array();
        public $imgnewurl = array();
        public function upload()
        {
            foreach ($this->imgoldurl as $v) {
                if (!preg_match('/^([^\'"]+)(\\.[a-z]{3,4})$\\b/i', $v)) {
                    $v .= '.png';
                }
 
                preg_match("/^(http:\/\/)?([^\/]+)/i", $v, $matches);
                $refer = $matches[2];
                //伪造来源
                $pkwall = array(
                            'user-agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0',
                            'headers' => array('Referer'=>$refer,'Host'=>$refer)
                          );
                $get = wp_remote_get($v, $pkwall);
                $type = wp_remote_retrieve_header($get, 'content-type');
 
                //如果文件远程下载不成功,访问被拒绝,不进行数据库操作,平且删除本地文件
                if($get[response] == 200){
                    $mirror = wp_upload_bits(rawurldecode(basename($v)), '', wp_remote_retrieve_body($get));
                    $attachment = array('post_title' => basename($v), 'post_mime_type' => $type);
                    $attach_id = wp_insert_attachment($attachment, $mirror['file'], $this->pid);
                    $attach_data = wp_generate_attachment_metadata($attach_id, $v);
                    $status = wp_update_attachment_metadata($attach_id, $attach_data);
                    set_post_thumbnail($this - pid, $attach_id);
                    $this->imgnewurl[] = $mirror['url'];
                }else{
                    //表示不更新附件信息
                    $this->imgnewurl[] = $v;
                }
            }
        }
    }
    $img = new hatmore();
    $img->pid = $post_ID;
    $img->imgoldurl = $temp2;
    if (!empty($img->imgoldurl)) {
        $img->upload();
        if(!empty($img->imgnewurl)){
            $tag = array_combine($img->imgoldurl, $img->imgnewurl);
            $newbody = strtr($body->post_content, $tag);
            wp_update_post(array('ID' => $post_ID, 'post_content' => $newbody));
        }
    }
    add_action('publish_post', 'fo_auto_save_post_image');
}

发表新文章时邮件通知用户

/**
 * Name : fo_emaill_report_users
 *
 * Description:发表新文章时邮件通知用户
 *
 * from http://www.frontopen.com && http://aijava.cn
 */
add_action( 'publish_post', 'fo_emaill_report_users' );
function fo_emaill_report_users($post_ID)
{
    //如果未勾选保存远程图片,不进行任何操作
    if($_POST['FO_emaill_report_user'] != 'true'){
        return;
    }
 
    //修订版本不通知,以免滥用
    if( wp_is_post_revision($post_ID) ){
        return;
    }
 
    //获取wp数据操作类
    global $wpdb;
    // 读数据库,获取所有用户的email
    $wp_user_emails = $wpdb->get_results("SELECT DISTINCT comment_author, comment_author_email FROM $wpdb->comments WHERE TRIM(comment_author_email) IS NOT NULL AND TRIM(comment_author_email) != ''");
 
    // 获取博客名称
    $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
    // 获取博客URL
    $blogurl = get_bloginfo("siteurl");
 
    //文章链接
    $post_link = get_permalink($post_ID);
    //文章标题$post -> post_title
    $post_title = strip_tags($_POST['post_title']);
    //文章内容$post->post_content
    $post_content = strip_tags($_POST['post_content']);
    //文章摘要
    $output = preg_replace('/^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,0}((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,200}).*/s','\1',$post_content).'......';
 
    //邮件头,以免乱码
    $message_headers = "Content-Type: text/html; charset=\"utf-8\"\n";
    // 邮件标题
    $subject = '《'.$blogname.'》有新文章发表了,速来围观。';
 
    foreach ( $wp_user_emails as $wp_user_email )
    {
        // 邮件内容
        $message = '
            <div style="MARGIN-RIGHT: auto; MARGIN-LEFT: auto;">
            <strong style="line-height: 1.5; font-family:Microsoft YaHei;">
            亲爱的'.$wp_user_email->comment_author.':
            </strong>
            <p style="FONT-SIZE: 14px; PADDING-TOP: 6px">
                您曾经来访过的博客《'.$blogname.'》有新文章发表了,小伙伴都去围观了,就差您了。
            </p>
            <p style="FONT-SIZE: 14px; PADDING-TOP: 6px">
                文章标题:<a title="'.$post_title.'" href="'.$post_link.'" target="_top">'.$post_title.'</a>
                <br/>
                文章摘要:'.$output.'
            </p>
            <p style="FONT-SIZE: 14px; PADDING-TOP: 6px">
                您可以点击链接
                <a href="'.$blogurl.'" style="line-height: 1.5;">'.$blogname.'</a>
                >
                <a title="'.$post_title.'" href="'.$post_link.'" target="_top">'.$post_title.'</a>
                详细查看
            </p>
            <p style="font-size: 14px; padding-top: 6px; text-align: left;">
                <span style="line-height: 1.5; color: rgb(153, 153, 153);">
                来自:
                </span>
                <a href="'.$blogurl.'" style="line-height: 1.5;">'.$blogname.'</a>
            </p>
            <div style="font-size: 12px; border-top-color: rgb(204, 204, 204); border-top-width: 1px; border-top-style: solid; height: 35px; width: 500px; color: rgb(102, 102, 102); line-height: 35px; background-color: rgb(245, 245, 245);">
                该邮件为系统发送邮件,请勿直接回复!如有打扰,请向博主留言反映。灰常感谢您的阅读!
            </div>
            </div>';
 
        wp_mail($wp_user_email->comment_author_email, $subject, $message, $message_headers);
    }
}

自动为文章与评论的图片添加alt与title

/**
 * Name : fo_image_alt_tag
 *
 * Description:自动为文章与评论的图片添加alt与title
 *
 * from http://www.frontopen.com && http://aijava.cn
 */
add_filter('the_content', 'fo_image_alt_tag'); //文章中的图片添加上alt
add_filter('comment_text', 'fo_image_alt_tag');//评论中的图片添加上alt
function fo_image_alt_tag($content){
    //非后端页面操作
    if( !is_admin() ) {
        //全局量
        global $post;
        //文章标题
        $post_title = $post -> post_title;
        // 获取博客名称
        $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
        //获取文章图片数目
        $num = preg_match_all( '/<img.*?>/i', $content, $matches );
 
        $temp = '*@@##@@*';
        for( $i = 1; $i <= $num; $i++ ) {
            // Get original title and alt
            preg_match( '/<img.*?>/', $content, $match_img );
            $img = isset( $match_img[0] ) ? $match_img[0] : '';
 
            preg_match( '/<img.*?title=[\"\'](.*?)[\"\'].*?>/', $img, $match_title );
            $title = isset( $match_title[1] ) ? $match_title[1] : '';
 
            preg_match( '/<img.*?alt=[\"\'](.*?)[\"\'].*?>/', $img, $match_alt );
            $alt = isset( $match_alt[1] ) ? $match_alt[1] : '';
 
            // 清空文章图片title与alt
            if( $title )
                $content = preg_replace( '/(<img.*?) title=["\'].*?["\']/i', '${1}', $content, 1 );
            if( $alt )
                $content = preg_replace( '/(<img.*?) alt=["\'].*?["\']/i','${1}', $content, 1 );
 
            //设置文章图片title与alt
            $title = $post_title.' - '.$blogname.' - '.$i;
            $alt = $post_title.' - '.$blogname.' - '.$i;
 
            // 构建替换目标
            $replace = '<' . $temp . ' title="' . $title . '" alt="' . $alt . '"';
            $content = preg_replace( '/<img/i', $replace, $content, 1 );
        }
 
        $content = str_replace( $temp, 'img', $content );
    }
    return $content;
}
 

移除自动保存和修订版本

/**
 * Name: fo_disable_autosave
 *
 * 移除自动保存和修订版本
 *
 * from http://www.frontopen.com && http://aijava.cn
 */
/*add_action('wp_print_scripts','fo_disable_autosave' );
remove_action('pre_post_update','wp_save_post_revision' );
function fo_disable_autosave() {
    wp_deregister_script('autosave');
}*/

邮件相关

/************************************邮件相关****************************/
/**
 * Name: fo_new_from_name
 *
 * Description: 修改 WordPress 通过 mail() 函数发送的邮件的默认发件人与发件邮箱。
 *
 * from http://www.frontopen.com && http://aijava.cn
 */
add_filter('wp_mail_from_name', 'fo_new_from_name');
function fo_new_from_name($email){
    $wp_from_name = get_option('blogname');
    return $wp_from_name;
}
add_filter('wp_mail_from', 'new_from_email');
function new_from_email($email) {
    $wp_from_email = get_option('admin_email');
    return $wp_from_email;
}

文章系统增强

/*

///////////////////////////////////////////////////////////////////////////////
文章系统增强
////////////////////////////////////////////////////////////////////////////////
 */
/**关闭离线编辑器接口    */
if(git_get_option('mrr_unxmlrpc')){
    function mrr_remove_xmlrpc(){
        remove_action( 'wp_head', 'rsd_link' );
        remove_action( 'wp_head', 'wlwmanifest_link' );
        add_filter( 'xmlrpc_enabled', '__return_false' );}
    add_action( 'after_setup_theme', 'mrr_remove_xmlrpc' );
   //禁用WordPress的XML-RPC离线发布功能
    add_filter('xmlrpc_enabled', '__return_false');}
 
//增强编辑器开始
if(git_get_option('mrr_addbtn')){
function add_editor_buttons($buttons) {
        $buttons[] = 'fontselect';
        $buttons[] = 'fontsizeselect';
        $buttons[] = 'cleanup';
        $buttons[] = 'styleselect';
        $buttons[] = 'hr';
        $buttons[] = 'del';
        $buttons[] = 'sub';
        $buttons[] = 'sup';
        $buttons[] = 'copy';
        $buttons[] = 'paste';
        $buttons[] = 'cut';
        $buttons[] = 'undo';
        $buttons[] = 'image';
        $buttons[] = 'anchor';
        $buttons[] = 'backcolor';
        $buttons[] = 'wp_page';
        $buttons[] = 'charmap';
        return $buttons;}
add_filter("mce_buttons_3", "add_editor_buttons");}
 
/*为编辑器增加选择中文字体功能*/
if(git_get_option('mrr_addfont')){
    function custum_fontfamily($initArray){
       $initArray['font_formats'] = "微软雅黑='微软雅黑';宋体='宋体';黑体='黑体';仿宋='仿宋';楷体='楷体';隶书='隶书';幼圆='幼圆';Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';";
       return $initArray;}
    add_filter('tiny_mce_before_init', 'custum_fontfamily');}
 
/*编辑器字号功能*/
if(git_get_option('mrr_addfontsize')){
    function customize_text_sizes($initArray){
       $initArray['fontsize_formats'] = "9px 10px 11px 12px 13px 14px 16px 18px 20px 22px 24px 26px 28px 30px 32px 36px 42px 48px";
       return $initArray;
    }
    add_filter('tiny_mce_before_init', 'customize_text_sizes');}
 

为WordPress文章发布按钮添加确认对话框

/*为WordPress文章发布按钮添加确认对话框*/
if(git_get_option('mrr_addpublishok')){
    $c_message = '确认发布文章?';
    function confirm_publish(){
    global $c_message;
    echo '<script type="text/javascript"><!--
    var publish = document.getElementById("publish");
    if (publish !== null) publish.onclick = function(){
        return confirm("'.$c_message.'");
    };
    // --></script>';
    }
add_action('admin_footer', 'confirm_publish');}

删除文章时删除图片附件

/*删除文章时删除图片附件*/
if(git_get_option('mrr_delattachments')){
    function delete_post_and_attachments($post_ID) {
    global $wpdb;
    /*删除特色图片 */
    $thumbnails = $wpdb->get_results( "SELECT * FROM $wpdb->postmeta WHERE meta_key = '_thumbnail_id' AND post_id = $post_ID" );
    foreach ( $thumbnails as $thumbnail ) {
    wp_delete_attachment( $thumbnail->meta_value, true );
    }
    /*删除图片附件 */
    $attachments = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_parent = $post_ID AND post_type = 'attachment'" );
    foreach ( $attachments as $attachment ) {
    wp_delete_attachment( $attachment->ID, true );
    }
    $wpdb->query( "DELETE FROM $wpdb->postmeta WHERE meta_key = '_thumbnail_id' AND post_id = $post_ID" );
    }
    add_action('before_delete_post', 'delete_post_and_attachments');}
 

文章的网址URL自动生成超链接

/*让 WordPress 文章的网址URL自动生成超链接 */
if(git_get_option('mrr_makeurl')){
add_filter('the_content', 'make_clickable');}

WordPress后台文章列表按更新时间排序

/* WordPress后台文章列表按更新时间排序 */
if(git_get_option('mrr_postorder')){
    function ludou_set_post_order_in_admin( $wp_query ) {
    if ( is_admin() ) {
    $wp_query->set( 'orderby', 'modified' );
    /* 如果要将最新修改的文章排在后面,可将DESC改成ASC*/
    $wp_query->set( 'order', 'DESC' );
    }
    }
    add_filter('pre_get_posts', 'ludou_set_post_order_in_admin' );}

禁止缩略图

//禁止缩略图
 
if(git_get_option('mrr_unimagesize')){
    function v13_remove_image_size($sizes) {
               unset( $sizes['small'] );
               unset( $sizes['medium'] );
               unset( $sizes['large'] );
               return $sizes;
        }
add_filter('image_size_names_choose', 'v13_remove_image_size');}
 

给RSS添加缩略图

 //给RSS添加缩略图
if(git_get_option('mrr_addrssthumb')){
 function rss_post_thumbnail($content) {
global$post;
if(has_post_thumbnail($post->ID)) {
$content = '<p>' . get_the_post_thumbnail($post->ID) .
 '</p>' . get_the_content();
 }
return$content;
 }
 add_filter('the_excerpt_rss', 'rss_post_thumbnail');
 add_filter('the_content_feed', 'rss_post_thumbnail');}

编辑器载入主题的style.css

//编辑器载入主题的style.css
function dmeng_theme_add_editor_styles() {
add_editor_style('style.css');
}
add_action( 'init', 'dmeng_theme_add_editor_styles' );

wordpress优化增强

/*
 
///////////////////////////////////////////////////////////////////////////////
wordpress优化增强
////////////////////////////////////////////////////////////////////////////////
 */
 
/*删除后台多余的模块*/
if(git_get_option('mrr_undashboard')){
    function example_remove_dashboard_widgets() {
        global $wp_meta_boxes;
        /*以下这一行<a href="http://www.seaomc.com/archives/tag/dm" title="查看更多关于代码的文章" target="_blank">代码</a>将删除 &quot;快速发布&quot; 模块*/
        unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
        /*以下这一行<a href="http://www.seaomc.com/archives/tag/dm" title="查看更多关于代码的文章" target="_blank">代码</a>将删除 &quot;引入链接&quot; 模块*/
        unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
        /*以下这一行<a href="http://www.seaomc.com/archives/tag/dm" title="查看更多关于代码的文章" target="_blank">代码</a>将删除 &quot;插件&quot; 模块*/
        unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
        /*以下这一行<a href="http://www.seaomc.com/archives/tag/dm" title="查看更多关于代码的文章" target="_blank">代码</a>将删除 &quot;近期评论&quot; 模块*/
        unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
        /*以下这一行<a href="http://www.seaomc.com/archives/tag/dm" title="查看更多关于代码的文章" target="_blank">代码</a>将删除 &quot;近期草稿&quot; 模块*/
        unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
        /*以下这一行<a href="http://www.seaomc.com/archives/tag/dm" title="查看更多关于代码的文章" target="_blank">代码</a>将删除 &quot;WordPress 开发日志&quot; 模块*/
        unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
        /*以下这一行代码将删除 &quot;其它 WordPress 新闻&quot; 模块*/
        unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
        /*以下这一行代码将删除 &quot;概况&quot; 模块*/
        unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
    }
add_action('wp_dashboard_setup', 'example_remove_dashboard_widgets' );}
 
/*移除顶部工具栏上的WordPress Logo*/
if(git_get_option('mrr_unwplogo')){
    function remove_wp_logo() {
        global $wp_admin_bar;
        $wp_admin_bar-&gt;remove_menu('wp-logo');
    }
    add_action( 'wp_before_admin_bar_render', 'remove_wp_logo' );}
 
//登录跳转页面
 
 
function my_login_redirect($redirect_to, $request){
    $redirect_to = git_get_option('mrr_loginjump');
if( empty( $redirect_to ) || $redirect_to == 'wp-admin/' || $redirect_to == admin_url() )
return home_url();
else
return $redirect_to;
}
add_filter(&quot;login_redirect&quot;, &quot;my_login_redirect&quot;, 10, 3);
 
/* 注销后返回首页 */
function auto_redirect_after_logout(){
        $logout_url = git_get_option('mrr_logoutjump');
        if( empty( $logout_url ) || $logout_url == 'wp-admin/' || $logout_url == admin_url() )
        wp_redirect(home_url());
        else
         wp_redirect( $logout_url );//返回首页
        exit();}
add_action('wp_logout','auto_redirect_after_logout');
 
if (git_get_option('mrr_googleapis')){
    function new_filter_style_init( $src ) {
        $src = preg_replace( '/([a-z]+?)\\.googleapis\\.com/', '$1.useso.com', $src );
        return $src;
        }
        add_filter( 'script_loader_src', 'new_filter_style_init' );
        add_filter( 'style_loader_src', 'new_filter_style_init' );}
 
//移除WordPress版本号
//
if (git_get_option('mrr_unversion')){
function complete_version_removal() {
    return '';
}
add_filter('the_generator', 'complete_version_removal');}
 
 
//仅对管理员用户显示顶部工具栏
if (git_get_option('mrr_adminbar')){
if ( !current_user_can( 'manage_options' ) ) {
    remove_action( 'init', '_wp_admin_bar_init' );
}
//仅在后台显示顶部工具栏
if ( is_admin() ) {
    remove_action( 'init', '_wp_admin_bar_init' );}
}
 
 
 
function dmeng_check_authentication($username){
//~ 用 | 分割用户名,且 | 前后不留空格
$black_list = git_get_option('mrr_regblack');//黑名单
if( !empty($black_list) ){
$black_list = explode('|', $black_list);
if( in_array($username, $black_list) ){
wp_die( __( '该用户名已被系统保留,不能用于注册或登录!', 'dmeng' ), '', array( 'back_link'=&gt;true ) );
}
}
}
add_action ('register_post' , 'dmeng_check_authentication');//禁止注册
 
/* 搜索结果排除所有页面*/
// if(git_get_option('mrr_searchfilter')){
//     function search_filter_page($query) {
//         if ($query-&gt;is_search) {
//             $query-&gt;set('post_type', 'post');
//         }
//         return $query;
//     }
//     add_filter('pre_get_posts','search_filter_page');}
 
/*搜索结果只有一篇文章时自动跳转到文章*/
if(git_get_option('mrr_searchonly')){
    add_action('template_redirect', 'redirect_single_post');
    function redirect_single_post() {
        if (is_search()) {
            global $wp_query;
            if ($wp_query-&gt;post_count == 1 &amp;&amp; $wp_query-&gt;max_num_pages == 1) {
                wp_redirect( get_permalink( $wp_query-&gt;posts['0']-&gt;ID ) );
                exit;
            }}}}
 
/* 高亮显示搜索关键词*/
/* ------------------- */
if(git_get_option('mrr_searchlight')){
    function search_word_replace($buffer){
        if(is_search()){
            $arr = explode(&quot; &quot;, get_search_query());
            $arr = array_unique($arr);
            foreach($arr as $v)
                if($v)
                    $buffer = preg_replace(&quot;/(&quot;.$v.&quot;)/i&quot;, &quot;&lt;span style=\&quot;background-color:#ff0;\&quot;&gt;&lt;strong&gt;$1&lt;/strong&gt;&lt;/span&gt;&quot;, $buffer);
        }
        return $buffer;
    }
    add_filter(&quot;the_title&quot;, &quot;search_word_replace&quot;, 200);
    add_filter(&quot;the_excerpt&quot;, &quot;search_word_replace&quot;, 200);
    add_filter(&quot;the_content&quot;, &quot;search_word_replace&quot;, 200);}
 
?&gt;

版权声明:本站所有文章和资源使用BY-NC-SA协议授权发布 , 转载应当以相同方式注明文章来自“SeaOMC.COM->WordPress多主题内置代码分享!在下边可以分享本文哦!
喜欢 (0)
[]
分享 (0)
奇跡の海
关于作者:
一个WordPress菜鸟!
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址