Site logo

Archived topic

How to add shortcode into GP comment field

9 replies · Started by Michal on May 8, 2018

Viewing posts 1–10 of 10

Hello,

I am wondering how can I add a country shortcode from geoip plugin (https://pl.wordpress.org/plugins/geoip-detect/) into GP comment field.

[geoip_detect2 property="country"]

From what I noticed comment field has to be a wysiwyg field (not text as it is by default). Is there any other way to do this? By custom php function or so?

Regards,
Michal

I don't want to have the same shortcode in each comment on my website man;)

I am unclear as to what you need. How is it decided what shortcode goes in which comment?

Imagine I am the user which want to write a following comment:

Hello,
My name is Alex. I came from [geoip_detect2 property="country"] and would ike to introduce myself further.

Blablabla
Cheers

That's what I want to achieve. The shortcode from above works (show visitor's country) on wysiwyg (posts, pages) but not inside comments.

So if the comments field did accept the shortcode are you expecting users to add that shortcode themselves?

NO, Administrator will do that

Hi Michal you may want to look at an alternative method as opening up the comments field to add html can pose a risk to the site or other users with spam content. You may want to investigate a plugin like this:

https://wordpress.org/plugins/simple-location/

Hi Michal, sorry i wasn't of much assistance, somethings are lost in translation. I am glad you have found a working solution.

This archived topic is closed to new replies.