Last active
May 10, 2020 10:25
-
-
Save Oscar-Abad-Folgueira/e434664ca9c7d8dc3f9ad215964263b6 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/** | |
* @snippet Comprobar si el post tiene asignado el término "action" de la taxonomía "hook-type" | |
* para asignar una clase css u otra. | |
* @author Oscar Abad Folgueira | |
* @author_url https://www.oscarabadfolgueira.com | |
* @snippet_url https://www.oscarabadfolgueira.com/comprobar-si-un-post-tiene-asignado-un-termino-de-una-taxonomia-en-wordpress/ | |
*/ | |
$hook_css_class = ''; | |
if (has_term( 'action', 'hook-type' )) { | |
$hook_css_class = "is-action-hook"; | |
} else { | |
$hook_css_class = "is-filter-hook"; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment