[wp-trac] [WordPress Trac] #45861: Global variable in plugin main file

WordPress Trac noreply at wordpress.org
Wed Jan 9 06:59:04 UTC 2019


#45861: Global variable in plugin main file
------------------------------------+------------------------------
 Reporter:  rilwis                  |       Owner:  (none)
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Plugins                 |     Version:
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |     Focuses:
------------------------------------+------------------------------

Comment (by rilwis):

 @mukesh27 Yes, using a function to include plugin files makes the
 variables available in the function scope only, which means they're not
 available in the global scope.

 Using `@return void` is a valid (it's recommended but not a must) since
 it's the recommended way to tell developers that the function does not
 return anything.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45861#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list