Skip to content

Instantly share code, notes, and snippets.

@styledev
Last active December 15, 2015 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save styledev/5278527 to your computer and use it in GitHub Desktop.
Save styledev/5278527 to your computer and use it in GitHub Desktop.
This function is a temporary fix for this wp-core bug: http://core.trac.wordpress.org/ticket/18614
function wordpress_fix_bug( $wp_query ) {
// The function below is a temporary fix for this bug: http://core.trac.wordpress.org/ticket/18614
if ( $wp_query->is_post_type_archive && $wp_query->is_tax ) {
global $post_type_obj;
$wp_query->is_tax = false;
$post_type_obj = get_queried_object();
if (empty($post_type_obj->labels)) {
$post_type_obj->labels = new stdClass();
$post_type_obj->labels->name = 'dev/hack to fix WordPress Bug';
}
}
}add_action( 'parse_query', 'wordpress_fix_bug' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment