WordPress.org

Make WordPress Core

Changeset 17083


Ignore:
Timestamp:
12/20/2010 04:21:42 PM (10 years ago)
Author:
nacin
Message:

Clarify the _doing_it_wrong message for conditioanl tags. init prevents the fatal error, but the query still isn't run. Just drop the mention of a hook and we end up with better reasoning why this doesn't work to boot. see #14729.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/query.php

    r17068 r17083  
    144144
    145145    if ( ! isset( $wp_query ) ) {
    146         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     146        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    147147        return false;
    148148    }
     
    165165
    166166    if ( ! isset( $wp_query ) ) {
    167         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     167        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    168168        return false;
    169169    }
     
    185185
    186186    if ( ! isset( $wp_query ) ) {
    187         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     187        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    188188        return false;
    189189    }
     
    209209
    210210    if ( ! isset( $wp_query ) ) {
    211         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     211        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    212212        return false;
    213213    }
     
    233233
    234234    if ( ! isset( $wp_query ) ) {
    235         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     235        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    236236        return false;
    237237    }
     
    257257
    258258    if ( ! isset( $wp_query ) ) {
    259         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     259        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    260260        return false;
    261261    }
     
    286286
    287287    if ( ! isset( $wp_query ) ) {
    288         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     288        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    289289        return false;
    290290    }
     
    306306
    307307    if ( ! isset( $wp_query ) ) {
    308         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     308        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    309309        return false;
    310310    }
     
    326326
    327327    if ( ! isset( $wp_query ) ) {
    328         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     328        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    329329        return false;
    330330    }
     
    346346
    347347    if ( ! isset( $wp_query ) ) {
    348         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     348        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    349349        return false;
    350350    }
     
    367367
    368368    if ( ! isset( $wp_query ) ) {
    369         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     369        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    370370        return false;
    371371    }
     
    387387
    388388    if ( ! isset( $wp_query ) ) {
    389         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     389        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    390390        return false;
    391391    }
     
    417417
    418418    if ( ! isset( $wp_query ) ) {
    419         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     419        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    420420        return false;
    421421    }
     
    446446
    447447    if ( ! isset( $wp_query ) ) {
    448         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     448        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    449449        return false;
    450450    }
     
    466466
    467467    if ( ! isset( $wp_query ) ) {
    468         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     468        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    469469        return false;
    470470    }
     
    493493
    494494    if ( ! isset( $wp_query ) ) {
    495         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     495        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    496496        return false;
    497497    }
     
    513513
    514514    if ( ! isset( $wp_query ) ) {
    515         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     515        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    516516        return false;
    517517    }
     
    533533
    534534    if ( ! isset( $wp_query ) ) {
    535         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     535        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    536536        return false;
    537537    }
     
    553553
    554554    if ( ! isset( $wp_query ) ) {
    555         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     555        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    556556        return false;
    557557    }
     
    573573
    574574    if ( ! isset( $wp_query ) ) {
    575         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     575        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    576576        return false;
    577577    }
     
    602602
    603603    if ( ! isset( $wp_query ) ) {
    604         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     604        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    605605        return false;
    606606    }
     
    629629
    630630    if ( ! isset( $wp_query ) ) {
    631         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     631        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    632632        return false;
    633633    }
     
    649649
    650650    if ( ! isset( $wp_query ) ) {
    651         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     651        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    652652        return false;
    653653    }
     
    669669
    670670    if ( ! isset( $wp_query ) ) {
    671         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     671        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    672672        return false;
    673673    }
     
    689689
    690690    if ( ! isset( $wp_query ) ) {
    691         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     691        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    692692        return false;
    693693    }
     
    709709
    710710    if ( ! isset( $wp_query ) ) {
    711         _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the init hook. They always return false.' ), '3.1' );
     711        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1' );
    712712        return false;
    713713    }
Note: See TracChangeset for help on using the changeset viewer.