Created
November 24, 2012 14:36
-
-
Save ShinichiNishikawa/4139916 to your computer and use it in GitHub Desktop.
こっちでよかった。カテゴリ/タクソノミをGETで受け取った時のバリデーション。Validate GET values against cattegories / taxonomies the site has.
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 | |
// category の場合 | |
$what = get_term_by( 'name', $_GET['what'], 'category', 'ARRAY_A' ); | |
// district というタクソノミの場合 | |
$where = get_term_by( 'name', $_GET['where'], 'district', 'ARRAY_A' ); | |
// https://gist.github.com/4139337 これが長い方 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment