Could you give me an example of when you’d need to use %post_slug%? Are there services expecting you to send only the slug, and not the full URL?
Could you also let me know how you’d filter the process_request function? If you’re building a custom sharing button that requires a custom process_request function, it might be easier to just build a custom plugin for that sharing service. Here is an example:
https://ww.wp.xz.cn/plugins/mwp-sharing-jetpack/
If you have “WP Post to PDF Enhanced” plugin installed, you need %post_slug%.
See als this topic: WP Post to PDF Enhanced
Using Jetpack sharebar
sharing url will be: %post_url%?format=pdf
To make this work now. I changed $url = str_replace( ‘%post_url%’, rawurlencode( $this->get_share_url( $post->ID ) ), $url );
in jetpack/modules/sharedaddy/sharing-sources.php
to: $url = str_replace( ‘%post_url%’, $this->get_share_url( $post->ID ), $url );
so there i need the use of the filter
Thanks for the extra details!
There is no such filter at the moment, but until we add one, you could use this little plugin I just created:
http://i.wpne.ws/cCu2
It will add a new “PDF” option to the list of available services in Settings > Sharing.
Let me know how it goes!
Great! Works like a charm.
Thank you very much for your effort.