Do I need to flush rewrite rules when creating new user if using custom author rewrite rules?

Yes, you should flush rewrite rules in this case, because you add rules for every author based on his nicename. To be more precise, you should flush them after any author changes his nicename also. And you do this using author_rewrite_rules hook, which is fired in wp_rewrite_rules() only when there are no rules in database. … Read more

Custom Post Type won’t Register

“movie-special-features” is longer than 20 chars. If you enable debug, you will get a message, these names are not allowed longer than 20 cars. Reference: https://codex.wordpress.org/Function_Reference/register_post_type You can enable the debug mode in you wp-config.php with define( ‘WP_DEBUG’, true ); Reference: https://codex.wordpress.org/WP_DEBUG

Rewrite WordPress URL to show CPT meta field data

The post type query var is the same as the post type slug by default. Untested, but this should work- function custom_rewrite_basic() { add_rewrite_rule( ‘^books/([^/]+)/([0-9]+)/([^/]+)/?’, ‘index.php?books=$matches[1]&chapter=$matches[2]’, ‘top’ ); } add_action(‘init’, ‘custom_rewrite_basic’); $matches[3] will contain the chapter slug, but if you don’t need that to retrieve the chapter, then you don’t have to set it. Rewrite … Read more

Rewrite rule to prettify two $_GET variables while in a new endpoint from a page

I think you are using endpoints incorrectly. When a endopoint is created, a new rewrite rule is created using a query var with the same name of the endpoint; its value is taken from the string that follows the endpoint definition. So, if you register “my-endpoint” and build this URL: /page-slug/my-endpoint/123/some-string The endpoint is passed … Read more