Created
October 23, 2013 09:41
-
-
Save guzuri/7115596 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 | |
//IDの取得 | |
echo get_term_by('slug',$term,$taxonomy)->term_id; | |
//名前の取得 | |
echo get_term_by('slug',$term,$taxonomy)->name; | |
//URLの取得 | |
echo get_term_link($term,$taxonomy); | |
/* | |
$taxonomy = タクソノミー名 | |
$term = スラッグ名 | |
*/ | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment