Start developing your plugins straight away with this WordPress Plugin Boilerplate. All the basics are already covered for you.
18
stars
15
forks
source link
Switch order of last two elseif statements in the autoload function #16
Open
seggev319 opened 8 years ago
In the main file (wordpress-plugin-boilerplate.php) @ line 393:
if ( strpos( $class, 'worker_reports_shortcode_' ) === 0 ) { $path = $this->plugin_path() . '/includes/classes/shortcodes/'; } else if ( strpos( $class, 'worker_reports_' ) === 0 ) { $path = $this->plugin_path() . '/includes/classes/'; } else if ( strpos( $class, 'worker_reports_admin' ) === 0 ) { $path = $this->plugin_path() . '/includes/admin/'; }
Sholuld be changed to:
if ( strpos( $class, 'worker_reports_shortcode_' ) === 0 ) { $path = $this->plugin_path() . '/includes/classes/shortcodes/'; } else if ( strpos( $class, 'worker_reports_admin' ) === 0 ) { $path = $this->plugin_path() . '/includes/admin/'; } else if ( strpos( $class, 'worker_reports_' ) === 0 ) { $path = $this->plugin_path() . '/includes/classes/'; }
Because the original second if statement will always apply instead of the third.