I am trying to solve a rewrite problem but don't fully understand how to read the below code.
I believe the event/industry/(.+)/?$'
is stating the format I want in my new url after rewritten, which should be example.com/event/industry/someterm/
And this part appears to be the parameter. => 'index.php?post_type=eg_event&industry=' . $wp_rewrite->preg_index(1)
Is this a correct understanding?
What is telling this code what value to place in my new url where this is: (.+)/?$'
Is it the $wp_rewrite->preg_index(1)
and what exactly does the preg_index(1)
mean?
$new_rules = array(
'event/industry/(.+)/?$' => 'index.php?post_type=eg_event&industry=' . $wp_rewrite->preg_index(1)
);
$wp_rewrite->rules = $new_rules + $wp_rewrite->rules;
}
Any assistance you can provide with helping me understand the logic above it much appreciated.