I have this (straight-forward) code in a plugin:
add_filter('query_vars', 'emailpost_query_vars');
function emailpost_query_vars($public_query_vars) {
$public_query_vars[] = "yep_newemailpost";
return $public_query_vars;
}
add_filter('generate_rewrite_rules', 'emailpost_rewrite');
function emailpost_rewrite($wp_rewrite) {
$wp_rewrite->rules = array_merge(array('newemailpost?$' => 'index.php?yep_newemailpost=y'), $wp_rewrite->rules);
}
(The reason the rewriter does not seem to do much is that the purpose of this rule is to allow a separate script to posting a file to this script by HTTP and have it processed by the plugin.)
Everything works, EXCEPT that the HTTP return status code is always 404.
The plugin is returning content and I can't see any reason for the 404 to be there.
A coworker said he had that problem but it disappeared by itself (which I find very unlikely).
Anyone know what to do about this or even where I should be looking?