[wp-trac] [WordPress Trac] #15853: Plugin Development: Inconsistent file include sources.

WordPress Trac wp-trac at lists.automattic.com
Thu Dec 16 23:09:42 UTC 2010


#15853: Plugin Development: Inconsistent file include sources.
--------------------------+-----------------------------
 Reporter:  sterlo        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.0.3
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 Story: I was building a plugin and created an options page.
 Here are the relevant functions:

 In the constructor:
 {{{
 add_action( 'admin_menu' , array( &$this , 'add_menu' ) , 1 );
 }}}

 In the function:

 {{{
 add_options_page( 'XXX_options' , 'XXX' , 'manage_options' , 'XXX_options'
 , array( &$this , 'options' ) );
 }}}

 In the other function:

 {{{
 include( 'options.php' );
 }}}

 Results: Instead of including /wp-content/plugins/myplugin/options.php it
 includes /wp-admin/options.php

 If I change the include path to this:

 {{{
 include( 'afolderinmyplugin/options.php' );
 }}}

 Then it now pulls from /wp-
 content/plugins/myplugin/afolderinmyplugin/options.php

 Seems like inconsistent functionality to me and should probably be fixed.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15853>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list