Make WordPress Core


Ignore:
Timestamp:
09/16/2015 07:24:51 PM (9 years ago)
Author:
boonebgorges
Message:

Throw a notice when an invalid tax is passed to wp_insert_post().

Props jdgrimes.
Fixes #25477.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post-functions.php

    r34242 r34248  
    32093209        foreach ( $postarr['tax_input'] as $taxonomy => $tags ) {
    32103210            $taxonomy_obj = get_taxonomy($taxonomy);
     3211            if ( ! $taxonomy_obj ) {
     3212                _doing_it_wrong( __FUNCTION__, sprintf( __( 'Invalid taxonomy: %s' ), $taxonomy ), '4.4.0' );
     3213                continue;
     3214            }
     3215
    32113216            // array = hierarchical, string = non-hierarchical.
    32123217            if ( is_array( $tags ) ) {
Note: See TracChangeset for help on using the changeset viewer.