Last active
December 14, 2015 13:48
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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