Typecho 正式版去除后台更新提醒

Typecho 如今终于更新,最新版为1.2.0,分为开发版和正式版。由于许多主题用开发版会有报错等问题,许多小伙伴都用的正式版,但是正式版更新到官方最新版还是会有更新提醒,如图

图片[1] - Typecho 正式版去除后台更新提醒 - 云晓晨CatchYXC
不知道是不是官方的问题。

去掉这个提醒也很简单,

1.找到文件:

路径:网站根目录/admin/index.php 文件

2.确定代码位置:

将134行到151行代码删除或注释掉即可

        function applyUpdate(update) {
            if (update.available) {
                $('<div class="update-check message error"><p>'
                    + '<?php _e('您当前使用的版本是 %s'); ?>'.replace('%s', update.current) + '<br />'
                    + '<strong><a href="' + update.link + '" target="_blank">'
                    + '<?php _e('官方最新版本是 %s'); ?>'.replace('%s', update.latest) + '</a></strong></p></div>')
                    .insertAfter('.typecho-page-title').effect('highlight');
            }
        }

        if (!!update) {
            applyUpdate($.parseJSON(update));
        } else {
            $.get('<?php $options->index('/action/ajax?do=checkVersion'); ?>', function (o, status, resp) {
                applyUpdate(o);
                cache.setItem('update', resp.responseText);
            }, 'json');
        }

完成之后效果

图片[2] - Typecho 正式版去除后台更新提醒 - 云晓晨CatchYXC
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 共1条
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片