Make WordPress Core

Changeset 19450


Ignore:
Timestamp:
11/25/2011 05:15:28 AM (12 years ago)
Author:
nacin
Message:

Use class_exists() rather than is_admin() as otherwise the unit tests won't work without a WP_ADMIN hack. see #19342.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r19428 r19450  
    18071807 */
    18081808function convert_to_screen( $hook_name ) {
    1809     if ( ! is_admin() ) {
     1809    if ( ! class_exists( 'WP_Screen' ) ) {
    18101810        _doing_it_wrong( 'convert_to_screen(), add_meta_box()', __( "Likely direct inclusion of wp-admin/includes/template.php in order to use add_meta_box(). This is very wrong. Hook the add_meta_box() call into the add_meta_boxes action instead." ), '3.3' );
    18111811        return (object) array( 'id' => '_invalid', 'base' => '_are_belong_to_us' );
Note: See TracChangeset for help on using the changeset viewer.