[wp-trac] Re: [WordPress Trac] #4787: PHP files in wp-content/plugins unconditionnaly take over their Dashboard homonyms

WordPress Trac wp-trac at lists.automattic.com
Tue Aug 21 12:34:56 GMT 2007


#4787: PHP files in wp-content/plugins unconditionnaly take over their Dashboard
homonyms
-------------------------------------------------+--------------------------
 Reporter:  Ozh                                  |        Owner:  anonymous  
     Type:  defect                               |       Status:  new        
 Priority:  normal                               |    Milestone:  2.3 (trunk)
Component:  Administration                       |      Version:             
 Severity:  normal                               |   Resolution:             
 Keywords:  dashboard plugin override has-patch  |  
-------------------------------------------------+--------------------------
Comment (by DD32):

 > If this is a feature (allow a plugin to take over a Dashboard page),
 which might be cool after all, then before letting it doing so, we need to
 check that the file is an activated plugin.

 That can be accomplished via hooks at present(in 2.2+ at least), ie, to
 take over the plugins.php page:

 {{{
 add_action('load-plugins.php', 'override_plugins_page');
 function override_plugins_page($arg = ''){
         global $wpdb,$menu,$submenu;
         include('my-plugins-file.php');
         exit; //To prevent the default plugins.php file running.
 }
 }}}

 Given it can be done via a hook, i dont see the need to manually override
 via a file in wp-content/plugins/, It may be a route which some plugins
 presently do, but most plugins that have mutliple files place their files
 within a single folder in the plugins directory to keep everything clean
 and organised, I only see plugins with multiple files wanting to take the
 route of replacing admin pages completely(Due to the complexity they would
 generally be)

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4787#comment:1>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list