WPの予約語でハマる

この世界では「100%ロジックは正しい」との信念を持っていても、遭遇してしまうトラップがある。

そのひとつが予約語だ。

エラーメッセージのないエラーなので発見が遅れる。

結論から言って、次のスラッグはあらゆる場面で使ってはいけない。

  • attachment
  • attachment_id
  • author
  • author_name
  • calendar
  • cat
  • category
  • category__and
  • category__in
  • category__not_in
  • category_name
  • comments_per_page
  • comments_popup
  • customize_messenger_channel
  • customized
  • cpage
  • day
  • debug
  • error
  • exact
  • feed
  • fields
  • hour
  • link_category
  • m
  • minute
  • monthnum
  • more
  • name
  • nav_menu
  • nonce
  • nopaging
  • offset
  • order
  • orderby
  • p
  • page
  • page_id
  • paged
  • pagename
  • pb
  • perm
  • post
  • post__in
  • post__not_in
  • post_format
  • post_mime_type
  • post_status
  • post_tag
  • post_type
  • posts
  • posts_per_archive_page
  • posts_per_page
  • preview
  • robots
  • s
  • search
  • second
  • sentence
  • showposts
  • static
  • subpost
  • subpost_id
  • tag
  • tag__and
  • tag__in
  • tag__not_in
  • tag_id
  • tag_slug__and
  • tag_slug__in
  • taxonomy
  • tb
  • term
  • theme
  • type
  • w
  • withcomments
  • withoutcomments
  • year
自分は’year’ でハマったが、ぐぐってみると同じタームでハマった人が続出しているようで、微笑ましい(?)
それ以外で危険なのがthemeくらいかな。
最悪、全ページ閲覧不可になってしまうこともあるので要注意!。
http://wpdocs.osdn.jp/%E9%96%A2%E6%95%B0%E3%83%AA%E3%83%95%E3%82%A1%E3%83%AC%E3%83%B3%E3%82%B9/register_taxonomy#.E4.BA.88.E7.B4.84.E8.AA.9E

 

コメント

タイトルとURLをコピーしました