Plugin Directory

Changeset 369599


Ignore:
Timestamp:
04/06/2011 03:23:07 PM (15 years ago)
Author:
DeannaS
Message:

Updating to 1.2 version for use with WP 3.1

Location:
wpmu-theme-usage-info/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wpmu-theme-usage-info/trunk/cets_theme_info.php

    r202244 r369599  
    99Description: WordPress plugin for letting site admins easily see what themes are actively used on their site
    1010
    11 Version: 1.1
    12 
    13 Author: Kevin Graeme & Deanna Schneider
     11Version: 1.2
     12
     13Author: Kevin Graeme & Deanna Schneider & Jason Lemahieu
    1414
    1515
     
    2727
    2828function cets_theme_info() {
    29    
    30 
    31     add_filter('theme_action_links', array(&$this, 'action_links'), 9, 2);
    32     add_action('admin_menu', array(&$this, 'theme_info_add_page'));
    33     add_action('switch_theme', array(&$this, 'on_switch_theme'));
    34    
    35     if ( in_array( basename($_SERVER['PHP_SELF']), array('themes.php') ))  {
    36            
    37             wp_enqueue_script('jquery');
    38             wp_enqueue_script('thickbox');
    39            
    40             // run the function to generate the theme blog list (this runs whenever the theme page reloads, but only regenerates the list if it's more than an hour old or not set yet)
    41             $gen_time = get_site_option('cets_theme_info_data_freshness');
    42 
    43    
    44             if ((time() - $gen_time) > 3600 || strlen($gen_time) == 0) {
    45                 $this->generate_theme_blog_list();
    46             }   
     29    global $wp_version;
     30   
     31    if ( version_compare( $wp_version, '3.0', '>=' ) ) {
     32        // Add the site admin config page
     33       
     34        if (function_exists('is_network_admin')) {
     35            //3.1+
     36            add_action('network_admin_menu', array(&$this, 'theme_info_add_page'));
     37        }
     38        else {
     39            //-3.1
     40            add_action('admin_menu', array(&$this, 'theme_info_add_page'));
     41        }
     42       
     43        add_filter('theme_action_links', array(&$this, 'action_links'), 9, 2);
     44        add_action('switch_theme', array(&$this, 'on_switch_theme'));
     45       
     46        if ( in_array( basename($_SERVER['PHP_SELF']), array('themes.php') ))  {
    4747               
    48         }
    49    
    50    
     48                wp_enqueue_script('jquery');
     49                wp_enqueue_script('thickbox');
     50               
     51                // run the function to generate the theme blog list (this runs whenever the theme page reloads, but only regenerates the list if it's more than an hour old or not set yet)
     52                $gen_time = get_site_option('cets_theme_info_data_freshness');
     53   
     54       
     55                if ((time() - $gen_time) > 3600 || strlen($gen_time) == 0) {
     56                    $this->generate_theme_blog_list();
     57                }   
     58                   
     59            }
     60       
     61    }
    5162    }
    5263
     
    157168    // Add a submenu
    158169    if(is_site_admin()) {
    159     $page=  add_submenu_page('wpmu-admin.php', 'Theme Usage Info', 'Theme Usage Info', 0, basename(__FILE__), array(&$this, 'theme_info_page'));
    160    
    161     }
     170       
     171       
     172        if (function_exists('is_network_admin')) {
     173            $page=  add_submenu_page('themes.php', 'Theme Usage Info', 'Theme Usage Info', 0, basename(__FILE__), array(&$this, 'theme_info_page'));
     174        }
     175        else{
     176            $page=  add_submenu_page('wpmu-admin.php', 'Theme Usage Info', 'Theme Usage Info', 0, basename(__FILE__), array(&$this, 'theme_info_page'));
     177        }
     178    }
     179   
     180   
     181   
    162182
    163183}
  • wpmu-theme-usage-info/trunk/readme.txt

    r260907 r369599  
    1 === WPMU Theme Info ===
    2 Contributors: DeannaS, kgraeme
     1=== WPMU Theme Info ===
     2Contributors: DeannaS, kgraeme, MadtownLems
    33Tags: WPMU, Wordpress Mu, Wordpress Multiuser, Theme Stats
    4 Requires at least: 2.7
    5 Tested up to: 3.0
     4Requires at least: 3.0
     5Tested up to: 3.1.1
    66Stable tag: trunk
    77
     
    1616* cets\_theme\_info folder - lib folder - tablesort.js
    1717
    18 WPMU has two ways to activate themes – either sitewide, or on a blog-by-blog basis. But, there’s no convenient way built-in to know which themes are actually being used, or by whom. This plugin addresses that issue by creating a “Theme Usage Info” sub-menu of the Site Admin menu. Included on the page are two tables of data – one of themes currently being used, and one of themes not currently being used. The currently used themes table provides information on how many blogs are using the theme, which blogs are using it, and whether or not the theme is currently activated site-wide. The table of unused themes provides information on whether the theme is currently activated sitewide.
     18WPMU has two ways to activate themes either sitewide, or on a blog-by-blog basis. But, there's no convenient way built-in to know which themes are actually being used, or by whom. This plugin addresses that issue by creating a "Theme Usage Info" sub-menu of the Site Admin menu. Included on the page are two tables of data - one of themes currently being used, and one of themes not currently being used. The currently used themes table provides information on how many blogs are using the theme, which blogs are using it, and whether or not the theme is currently activated site-wide. The table of unused themes provides information on whether the theme is currently activated sitewide.
    1919
    2020In addition, site admins can choose to provide this information to their users via a toggle on the administration page.
     
    4141
    4242== Changelog ==
    43 
    44431.1 Adding Show/Hide blogs on the administrative page.
Note: See TracChangeset for help on using the changeset viewer.