Do not pass FALSE as second parameter in variable class_exists() checks

Because these are generally plugin-provided, we want plugins to be
able to use autoloaders.

fixes #20523

git-svn-id: https://develop.svn.wordpress.org/trunk@35749 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2015-11-30 04:14:31 +00:00
parent 6565b3e423
commit baa1da6c57
4 changed files with 4 additions and 4 deletions

View File

@ -1196,7 +1196,7 @@ function wp_ajax_add_menu_item() {
/** This filter is documented in wp-admin/includes/nav-menu.php */ /** This filter is documented in wp-admin/includes/nav-menu.php */
$walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $_POST['menu'] ); $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $_POST['menu'] );
if ( ! class_exists( $walker_class_name, false ) ) if ( ! class_exists( $walker_class_name ) )
wp_die( 0 ); wp_die( 0 );
if ( ! empty( $menu_items ) ) { if ( ! empty( $menu_items ) ) {

View File

@ -866,7 +866,7 @@ function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_own
if ( ! $method ) if ( ! $method )
return false; return false;
if ( ! class_exists( "WP_Filesystem_$method", false ) ) { if ( ! class_exists( "WP_Filesystem_$method" ) ) {
/** /**
* Filter the path for a specific filesystem method class file. * Filter the path for a specific filesystem method class file.

View File

@ -899,7 +899,7 @@ function wp_get_nav_menu_to_edit( $menu_id = 0 ) {
*/ */
$walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id ); $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id );
if ( class_exists( $walker_class_name, false ) ) { if ( class_exists( $walker_class_name ) ) {
$walker = new $walker_class_name; $walker = new $walker_class_name;
} else { } else {
return new WP_Error( 'menu_walker_not_exist', return new WP_Error( 'menu_walker_not_exist',

View File

@ -39,7 +39,7 @@ function _wp_admin_bar_init() {
* @param string $wp_admin_bar_class Admin bar class to use. Default 'WP_Admin_Bar'. * @param string $wp_admin_bar_class Admin bar class to use. Default 'WP_Admin_Bar'.
*/ */
$admin_bar_class = apply_filters( 'wp_admin_bar_class', 'WP_Admin_Bar' ); $admin_bar_class = apply_filters( 'wp_admin_bar_class', 'WP_Admin_Bar' );
if ( class_exists( $admin_bar_class, false ) ) if ( class_exists( $admin_bar_class ) )
$wp_admin_bar = new $admin_bar_class; $wp_admin_bar = new $admin_bar_class;
else else
return false; return false;