My attachments are currently rewritten from
http://localhost/images/image-title using @Bainternet's answer here.
$new_rules['images/(\d*)$'] = 'index.php?attachment_id=$matches';
However, wordpress still refers to the link as the default
http://localhost/?attachment_id=3. Wordpress functions such as the_permalink, get_attachment_url, get_attachment_image_src, etc. all use the default format of
I am able to access the image as intended if I manually type in the rewritten format
How can I get wordpress to use my custom rewrite for the permalink especially on the admin page?
EDIT: reworded question for specificity and correctness:
How do I override
the_permalink to use the format
/images/image-title instead of
I can get image-title using
For anyone reading this question in the future, I found it best to use
$post->post_name for the link to insure uniqueness.