I have created a custom plugin that adds a rewrite rule so that a url like this
will resolve to the page 'listings'. That works great.
I also have removed the default WordPress canonical url and added my own to match the rewrite rule so then on that page the canonical url shows like
<link rel='canonical' href='http://domain.com/listings/property/123456' />
However when a social sharing plugin like AddToAny is installed and shows on that page, it doesn't grab the full url for sharing - instead just grabs the url of the WordPress page itself -- http://domain.com/listings
When I look at what they are doing in the code for that plugin they are making a call to get_permalink() for the page and using that for sharing.
Any ideas on ways to overcome this? I don't think dynamically setting the permalink will solve the problem - that would probably break the original rewrite rule. Perhaps there is another WordPress action that would be helpful?