Created
May 9, 2013 15:48
-
-
Save billerickson/5548314 to your computer and use it in GitHub Desktop.
Example of wp_list_pluck().
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 | |
$tags = get_the_terms( get_the_ID(), 'post_tag' ); | |
$tags = wp_list_pluck( $tags, 'slug' ); | |
if( in_array( 'freebies', $tags ) ) | |
echo 'This is a freebie!'; | |
// More info: http://codex.wordpress.org/Function_Reference/wp_list_pluck |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So handy.