There’s a filter ppp_preview_link in https://github.com/ocean90/public-post-preview/blob/2.7.0/public-post-preview.php#L281 which you can use to customize the preview link. But removing the nonce will break the preview becuase it’s a required argument.
Thread Starter
juriw
(@juriw)
But would it be acceptable to have a hard coded string instead of the generated nonce?
That’s currently not possible. The random nonce is one of the main functionality of the plugin.
Thread Starter
juriw
(@juriw)
That’s okay. How do I access the nonce in another plugin where I wanna list the preview links?
You can retrieve the full link with DS_Public_Post_Preview::get_preview_link( $post ). But you have to check first if public preview is actually enabled. You can do this with $enabled = in_array( $post->ID, get_option( 'public_post_preview', array() ), true );
Thread Starter
juriw
(@juriw)
It worked like a charm! Thank you!