• Resolved bobjgarrett

    (@bobjgarrett)


    I need to get a custom field into PHP as part of an event-list page so I can interrogate it in an if/then.
    I can display it using #_ATT{Race} but getting it into a PHP variable is eluding me.
    I thought it should be get_post_meta($EM_Event->output, “Race”, true) but this does not work.
    What am I doing wrong?

Viewing 2 replies - 16 through 17 (of 17 total)
  • Thread Starter bobjgarrett

    (@bobjgarrett)

    I have now identified that the same thing happens with other shortcodes in Event Manager such as #_EVENTNAME. If you use dho_shortcode to get its value into a variable then echo the variable then it has the correct value, but if you echo the length of the variable then it is the length of the shortcode name.
    I do not understand how this can be.

    Thread Starter bobjgarrett

    (@bobjgarrett)

    Further testing shows that in my page I can create shortcodes which work correctly (ie their content when echoed is consistent with their length), while the Event Manager shortcodes are not.
    Clearly there is something about the Event Manager generated shortcodes which I do not understand. Can you explain?

Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘Get Custom Fields into PHP’ is closed to new replies.