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

    2012.05.20

    Centos 服务器时间同步

    新装的服务器可能设置了错误的,需要调整时区并…

  2. 没有图片

    2010.09.27

    PowerPoint 2010 的功能和优点

    使用 Microsoft PowerPoin…

  3. 没有图片

    2013.05.03

    WordPress安全卫士:Wordfence Security

    近来我发现个问题,上传到空间里的主题经常被自…

  4. 没有图片

    2012.12.12

    WordPress 3.5 正式版发布 李思章博客升级

    本来只打算更新一下WordPress插件技术…

  5. 没有图片

    2009.10.20

    Zemanta 快速提高博客流量、排名

    这个就是用Zemanta插入的 Zemant…

  6. 没有图片

    2012.04.28

    WordPress自定义域使用技巧实例

    关于Wordpress自定义域的教程网络上已…

评论

还没有评论。