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

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

1

  不知道是不是官方的问题,去掉这个提醒也很简单。

  1. 找到文件:
    路径:网站根目录/admin/index.php 文件
  2. 确定代码位置:
    将134行到151行代码删除或注释掉即可
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    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