X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/5964d2279dc52bdfe105f9bfa17e04337d47a3fa..c55863f11e8589bf8d4a5698bf15752406654f1c:/wp-admin/themes.php diff --git a/wp-admin/themes.php b/wp-admin/themes.php index 7852a721..edb0cad9 100644 --- a/wp-admin/themes.php +++ b/wp-admin/themes.php @@ -7,13 +7,15 @@ */ /** WordPress Administration Bootstrap */ -require_once('./admin.php'); +require_once( dirname( __FILE__ ) . '/admin.php' ); if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') ) wp_die( __( 'Cheatin’ uh?' ) ); $wp_list_table = _get_list_table('WP_Themes_List_Table'); +$_SERVER['REQUEST_URI'] = remove_query_arg( array( 's', 'features', '_ajax_fetch_list_nonce', '_wp_http_referer', 'paged' ), $_SERVER['REQUEST_URI'] ); + if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) { if ( 'activate' == $_GET['action'] ) { check_admin_referer('switch-theme_' . $_GET['stylesheet']); @@ -54,7 +56,7 @@ if ( current_user_can( 'install_themes' ) ) { if ( is_multisite() ) { $help_install = '

' . __('Installing themes on Multisite can only be done from the Network Admin section.') . '

'; } else { - $help_install = '

' . sprintf( __('If you would like to see more themes to choose from, click on the “Install Themes” tab and you will be able to browse or search for additional themes from the WordPress.org Theme Directory. Themes in the WordPress.org Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they’re free!'), 'http://wordpress.org/extend/themes/' ) . '

'; + $help_install = '

' . sprintf( __('If you would like to see more themes to choose from, click on the “Install Themes” tab and you will be able to browse or search for additional themes from the WordPress.org Theme Directory. Themes in the WordPress.org Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they’re free!'), 'http://wordpress.org/themes/' ) . '

'; } get_current_screen()->add_help_tab( array( @@ -91,7 +93,7 @@ get_current_screen()->set_help_sidebar( wp_enqueue_script( 'theme' ); wp_enqueue_script( 'customize-loader' ); -require_once('./admin-header.php'); +require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
display('Na display('Name'); ?> +errors() && ( ! is_multisite() || current_user_can( 'manage_network_themes' ) ) ) { + echo '

' . sprintf( __( 'ERROR: %s' ), $ct->errors()->get_error_message() ) . '

'; +} + +// Certain error codes are less fatal than others. We can still display theme information in most cases. +if ( ! $ct->errors() || ( 1 == count( $ct->errors()->get_error_codes() ) + && in_array( $ct->errors()->get_error_code(), array( 'theme_no_parent', 'theme_parent_invalid', 'theme_no_index' ) ) ) ) : ?> +

'; - require( './admin-footer.php' ); + require( ABSPATH . 'wp-admin/admin-footer.php' ); exit; } ?> @@ -292,11 +305,9 @@ if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_ + " . $broken_theme->get('Name') ." " . $broken_theme->errors()->get_error_message() . " "; @@ -308,4 +319,4 @@ if ( ! is_multisite() && current_user_can('edit_themes') && $broken_themes = wp_ ?>
- +