[wp-trac] [WordPress Trac] #32469: Create wp-include/views directory

WordPress Trac noreply at wordpress.org
Sat May 23 02:03:04 UTC 2015


#32469: Create wp-include/views directory
-------------------------+-----------------------------
 Reporter:  jacobsantos  |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:
 Severity:  normal       |   Keywords:
  Focuses:  template     |
-------------------------+-----------------------------
 HTML/JS/CSS is currently combined with PHP code. So, this is bad practice.

 I realize that this is currently used in the entire WordPress code base.
 Excepting themes, which are loaded on the front-end. Most of the view code
 is displayed on the admin I believe.

 Having views part of the PHP increases the function or method size and is
 confusing since some parts are evaluated after some parts of the view is
 displayed, so to process what the code is doing, you need to comprehend
 both the HTML output along with the PHP execution.

 Furthermore, doing this should allow for customizing even the hardcoded
 view code in functions and methods.

 I also propose a helper function that pulls in the views from wp-includes
 that could probably be extended later to include the current theme file
 matching the view file name.

 While **ABSPATH . 'wp-includes/views/{filename}.php'** would be simple, it
 wouldn't allow future modifications without again modifying all of the
 view paths. It should be done once and allow for the future modification
 of accepting another location for changing the views.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32469>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list