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

    2010.09.27

    微软安全软件 Microsoft Security Essentials

    通过正版验证的Windows电脑用户,可以免…

  2. 没有图片

    2011.05.03

    25个黑色调网站 激发你的创造力

    我们都喜欢漂亮的网站设计样式,我对黑色调的网…

  3. 没有图片

    2009.07.12

    2008年度五十个国外最漂亮网站推荐

    08年的网页设计开始流行一些破旧的质感和一些…

  4. 2013.12.26

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

    在安装配置phpMyAdmin管理mysql…

  5. 2012.10.16

    WordPress日志投票/顶踩插件WTI Like Post

    很久没写技术文了,大家近来来我的博客是不是有…

  6. 没有图片

    2009.07.23

    金山毒霸通行证7月23日

    通行证:KSDA68592625 密码:78…

评论

还没有评论。