Regex in add_rewrite_tag not accepting OR operators?

I don’t know what’s wrong but I can suggest:

  • Use Rewrite Rules Inspector or similar to see where your %psubject% rule is and if its pattern ((option1|option2|option3)) has been added correctly.
  • Test http://example.com/somecategory/option1/this-is-the-post-title with the Inspector to see which rule matches.
  • Open http://example.com/somecategory/option1/this-is-the-post-title (when it shows home.php) with the Debug Bar plugin and look at Query String, Matched Rewrite Rule, and Matched Rewrite Query.

Leave a Comment