WordPress.org

Forums

Events Manager
[resolved] Conditional Placeholder for Custom Attributes (2 posts)

  1. cawo88
    Member
    Posted 1 year ago #

    I have created a custom attributes to allow my event to display 'No sign up required' or 'sign up required'

    here is my php code
    <p class="signup"><?php echo $EM_Event->output('#_ATT{Sign up}{No sign up required|Sign up required}'); ?></p>

    How would I write a custom function to find out if a user has selected option A (No sign up required) or B (Sign up required)? so I change the color of the p tag by concatenating a class name (yes) after the signup class.

    e.g.
    If a user selected option A the class name yes will be added in the p tag like this.
    <p class="signup yes"><?php echo $EM_Event->output('#_ATT{Sign up}{No sign up required|Sign up required}'); ?></p>

    https://wordpress.org/plugins/events-manager/

  2. angelo
    NetWebLogic Support
    Posted 1 year ago #

    you can hook into em_event_save filter and then check event attribute $EM_Event->event_attributes if empty or not.

    http://wp-events-plugin.com/tutorials/saving-custom-event-information/
    http://snippets.webaware.com.au/snippets/events-manager-conditional-placeholders-for-custom-attributes/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic