Support

Home Forums Event Espresso Premium Checkbox Answer Commas

Checkbox Answer Commas

Posted: December 9, 2013 at 4:02 pm

Viewing 2 reply threads


Cody Hageman

December 9, 2013 at 4:02 pm

I need to create an option for my checkboxes that has a comma in it but since commas are used to determine a new option I am running to issues. I found this topic https://eventespresso.com/topic/comma-in-checkbox-value/ but when I put & #44; (minus the space) in my field it keeps showing up as & #044; (minus the space) in my answer. Is there any other way to escape the comma?

  • This topic was modified 10 years, 11 months ago by Cody Hageman.


Josh

  • Support Staff

December 9, 2013 at 6:36 pm

Likely not. What you can do is make use of WordPress’s “the_content” filter and build a little comma “shortcode” of sorts. Here’s something you can add to your custom file add-on’s custom_functions.php file or in a custom snippet plugin

add_filter ( 'the_content', 'who_cares_about_an_oxford_comma', 11 );

function who_cares_about_an_oxford_comma ( $content ) {
	$base = '{comma}';
	$replace = ',';
	$content = str_replace( $base, $replace, $content );
	return $content;
}

So where ever you need a comma to be displayed within a question, you type {comma} and it will display as a comma on the event registration form.


Cody Hageman

December 10, 2013 at 7:28 am

Thank you! This worked perfectly.

Viewing 2 reply threads

The support post ‘Checkbox Answer Commas’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso