That link didn’t make it into your post. Could you add it or PM it to me?
My guess is that the plugin that creates the Amazon product box is using javascript or CSS to hide the edit links from non-admins. If so, the link won’t be hidden when the post is published to Discourse. I assume you are pubishing the full post to Discourse. If so, are you able to try publishing excerpts instead? To do this you would deselect the ‘Use Full Post Content’ option on the plugin’s Publishing options tab. You would then need to make sure that the embed truncate site setting is enabled on Discourse.
the admin-only links don’t appear when visiting the wp post as a guest.
(As a sidenote, the TOC (plugin generated) also appears in topic and is not working since the h2 id’s are stripped)
I realized that publishing excerpts would solve that issue, yet I prefer having full posts in forum topics.
Maybe we can find a workaround.
It links to my wp-admin product post type edit page
What’s also interesting that it seems that some shortcodes are “processed” in the topic, others are not
In this case the TOC and the product box shortcodes are parsed into the discours topic while the [tablepress] shortcode isn’t
Unless the user has the permissions to edit the post, it probably links to a page that displays something like “Sorry, you are not allowed to edit this item.”
You could try hiding the link with CSS on Discourse by targeting the value of the link’s href. You could also try removing the link by adding a function on WordPress that ties into the wp_discourse_excerpt filter. Parsing HTML with PHP is fairly complicated, so I’d try the CSS option first.
You can access the post before it is published to Discourse by adding a function like this to your theme’s functions.php file, or to a plugin:
add_filter( 'wp_discourse_excerpt', 'wpdc_custom_discourse_excerpt' );
function wpdc_custom_discourse_excerpt( $post ) {
// Make your changes to the post here.
return $post;
}