WordPress.org

Plugin Directory

Changeset 721178


Ignore:
Timestamp:
06/01/13 01:57:39 (11 months ago)
Author:
georgestephanis
Message:

Account for Network Admin Themes page passing different arguments to the theme_action_links filter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • theme-downloader/trunk/theme-downloader.php

    r721163 r721178  
    1717        self::$instance = $this; 
    1818 
    19         add_filter( 'theme_action_links', array( $this, 'theme_action_links' ), 10, 2 ); 
     19        add_filter( 'theme_action_links', array( $this, 'theme_action_links' ), 10, 3 ); 
    2020        add_action( 'wp_ajax_download_theme', array( $this, 'wp_ajax_download_theme' ) ); 
    2121        add_action( 'admin_footer-themes.php', array( $this, 'admin_footer_themes_php' ) ); 
    2222    } 
    2323 
    24     function theme_action_links( $actions, $theme ) { 
     24    function theme_action_links( $actions, $theme, $ms_theme = null ) { 
     25        if( is_a( $ms_theme, 'WP_Theme' ) ) { 
     26            // The user is in the Network Admin panel, and it passes different arguments to the filter. 
     27            $theme = $ms_theme; 
     28        } 
    2529        if( current_user_can( 'edit_themes' ) && Theme_Downloader::can_zip() ) { 
    2630            $args = array( 
Note: See TracChangeset for help on using the changeset viewer.