WordPress Multisite 显示站点ID

WordPress Multisite 后台看不到各站点的ID,通过本插件可以实现鼠标放在站点上时,显示站点ID,插件代码:

    < ?php
    /*
    Plugin Name: Show Site ID
    Description: Show Site ID
    Version: 0.1
    Author: Ipstenu
    Author URI: http://www.ipstenu.org/
    This plugin is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    This plugin is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    */
    function siteid_columns($column, $blog_id) {
    global $wpdb;
    if ( $column == 'site_id' ) {
    echo $blog_id;
    }
    return $value;
    }
    // Add in a column header
    function site_id($columns) {
    $columns['site_id'] = __('ID', 'site_id');
    return $columns;
    }
    add_filter( 'wpmu_blogs_columns', 'site_id' );
    add_action('manage_sites_custom_column', 'siteid_columns', 10, 3);
    add_action('manage_blogs_custom_column', 'siteid_columns', 10, 3);
    ?> 

新建个wpmulsiteid.php文件,把代码复制到文件中,上传到插件目录,启用即可。

思章老师

认准了方向,就要勇敢地走下去,十年磨一剑,我相信,只要坚持,一切都有可能。

相关日志

  1. 没有图片

    2011.06.08

    卡巴斯基发布Anti-Virus 与 Internet Security 2012

    大家熟悉的老牌杀毒软件卡巴斯基 Anti-V…

  2. 没有图片

    2014.01.20

    MacBook Pro 安装 Windows 8.1 双语教程

    中文翻译教程: 用bootcamp来创建一个…

  3. 没有图片

    2011.11.16

    MT主机博客在页脚添加MT Logo标志

    大家看到很多在使用MT主机的博客的页脚位置都…

  4. 没有图片

    2010.09.16

    腾讯社区开放平台

    自从新浪出现开放平台之后,百度也接着开放了,…

  5. 没有图片

    2018.11.22

    phpStudy 升级 MySQL 到最新版 MySQL 8.0

    在阿里香港服务器折腾两天宝塔,因为服务器配置…

  6. 2013.12.20

    Office 2013 激活教程(自用|临时分享)

    本篇文章纯是为了记录自己的 Office 2…

评论

还没有评论。