I'm attempting to modify existing rewrite rules generated by WordPress in order to override the default rewrite rules generated.
I'm using the filter hook rewrite_rules_array
to obtain an array of existing rewrite rules.
While sifting through the rewrite rules array, there are rewrite rules containing $
in the array value.
After replacing a set of array key/value pairs, PHP is interpreting the suffix text of the array value containing $
as a PHP variable.
For example: &feed=$matches[1]
.
When I'm done with my modifications and dump the array, everywhere with $matches[1]
just appears blank.
My question is: How can I get &feed=$matches[1]
to output as &feed=$matches[1]
in my array value instead of outputting like &feed=
?
Both my array keys and array values of the modified rewrite rules are contained within double quotes.