Skip to content

Instantly share code, notes, and snippets.

@DrewAPicture
Last active December 14, 2015 13:48
Show Gist options
  • Save DrewAPicture/5095532 to your computer and use it in GitHub Desktop.
Save DrewAPicture/5095532 to your computer and use it in GitHub Desktop.
Too "clever" for core? It's the battle of that one multi-line condition that forces curly braces.
<?php
if ( is_tax() )
$title = get_taxonomy( get_queried_object()->taxonomy )->labels->singular_name;
elseif ( something else )
vs
if ( is_tax() ) {
$term = get_queried_object();
$tax = get_taxonomy( $term->taxonomy );
$title = $tax->labels->singular_name;
} elseif ( something else ) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment