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

    2009.07.27

    Dreamweaver CS4 数码教室 PDF电子书

    本书内容有:Dreamweaver CS3的…

  2. 2013.12.26

    phpMyAdmin “缺少 mcrypt 扩展。请检查 PHP 配置。”解决办法

    在安装配置phpMyAdmin管理mysql…

  3. 没有图片

    2012.09.28

    让谷歌拼音输入法支持五笔输入法

    这标题算是标题党了,谷歌官方是没有发布五笔输…

  4. 没有图片

    2012.12.19

    WordPress循环调用分类及分类下文章标题

    WordPress各种调用都已经很熟悉了,但…

  5. 没有图片

    2012.11.23

    Windows Server 2012 上安装 IIS 8 图文教程

    今天弄了台机器,下载了 Windows Se…

  6. 没有图片

    2009.09.14

    36个经典的JQuery导航菜单演示+下载

    现在很多网站或博客上都流行使用JQuery菜…

评论

还没有评论。