Hi guys. I’m trying to find a way to parse the comments entered by a user. For example, if someone adds a comment to a post like:
“Hello, this is an example
[customtag]non-asci-characters-here[/customtag]”
I want to be able to parse the non ascii characters they wrote between the tags and perform some operations to them. For example, maybe every character needs to have a space inserted before/after it. Or I want to format them as table cells, etc..
I built my own wordpress theme, by reading the documentation, and I am using <?php comments_template();?> to call the default wordpress comment stuff. I just styled it in css. But I can’t figure out where to begin. I mean, I guess I could do the operations in JS when the user submits the reply form, but I think there must be a PhP way built into wordpress already. Thank you!
Please note that what I want to do is not simply bbcode. I want to be able to completely parse the text.
The topic ‘parsing users posted comments’ is closed to new replies.
(@somedude77)
9 years, 2 months ago
Hi guys. I’m trying to find a way to parse the comments entered by a user. For example, if someone adds a comment to a post like:
“Hello, this is an example
[customtag]non-asci-characters-here[/customtag]”
I want to be able to parse the non ascii characters they wrote between the tags and perform some operations to them. For example, maybe every character needs to have a space inserted before/after it. Or I want to format them as table cells, etc..
I built my own wordpress theme, by reading the documentation, and I am using <?php comments_template();?> to call the default wordpress comment stuff. I just styled it in css. But I can’t figure out where to begin. I mean, I guess I could do the operations in JS when the user submits the reply form, but I think there must be a PhP way built into wordpress already. Thank you!
Please note that what I want to do is not simply bbcode. I want to be able to completely parse the text.