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.11.25

    感恩节礼物:老鹰主机黑色星期五优惠码

    一直在期待着老鹰主机的黑色星期五优惠码,今天…

  2. 没有图片

    2010.04.20

    DedeCMS 5.6 正式版发布

    今天午饭后,闲着没事,就打开DedeCMS官…

  3. 2014.11.21

    一段代码屏蔽谷歌字体,加载WordPress后台加载速度

    自谷歌服务被天朝屏蔽了之后,WordPres…

  4. 没有图片

    2010.09.27

    Excel 2010 的功能和优点

    使用 Microsoft Excel 201…

  5. 没有图片

    2009.10.24

    无评不博!为你的评论框添加漂亮的图片背景

    在《为你的WordPress博客添加版权声明…

  6. 2013.09.10

    大前端WordPress D8主题优化之:缩略图裁切

    大前端浩子同学的新WordPress主题D8…

评论

还没有评论。