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. 没有图片

    2013.12.23

    NewsPlus V1.0.7 WordPress新闻杂志主题汉化版发布

    NewsPlus 主题是一个杂志、新闻、门户…

  2. 没有图片

    2012.11.19

    萌芽主机一周年,旗下MT主机限时活动开始!

    庆祝萌芽主机健康运营一周年,感谢一年来朋友们…

  3. 没有图片

    2009.07.08

    Antivirus Plugin for WordPress,WordPress杀毒插件

    今天逛了一些国外网站,很多老外站长对Word…

  4. 没有图片

    2013.08.28

    WordPress主题 NewsPlus 安装使用教程

    很多朋友都在使用我发布的原版汉化作品 New…

  5. 没有图片

    2009.07.10

    挖掘BBPress 论坛插件资源

    前几天安装了BBPress论坛系统,体验起来…

  6. 没有图片

    2009.07.06

    饭否 WordPress 插件 Fanfou Tools

    这个是fanfou.com的Wordpres…

评论

还没有评论。