hi,
can you give further info? e.g. is this using events list? also, please see this previous post – http://wordpress.org/support/topic/plugin-events-manager-php-in-formats?replies=15
No, that doesnt help me very much.
I have added a custom field/attribute:
#_ATT{artist}{Artist 1|Artist 2|Artist 3}
Then when I am on the page for Artist 1, I want to show the events for Artist 1.
This is what I ended up doing because I was not getting the results I wanted any other way. Can you let me know if there is a better way to do this?
[Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]
at the moment we don’t implement this sort of search, you’d have to create this yourself by overriding the template files.
How would I even begin to do something like that?
can you re-post your snippet using http://wordpress.pastebin.com/?
thx
you might want to try creating custom placeholder which will handle your custom attributes instead of using the above snippet.
e.g.
add_action('em_event_output_condition', 'my_em_has_attribute_event_output_condition', 1, 4);
function my_em_has_attribute_event_output_condition($replacement, $condition, $match, $EM_Event){
if( is_object($EM_Event) && preg_match('/^has_attribute$/',$condition, $matches) ){
if( !in_array($args['hide_event'],$EM_Event->event_attributes) && !empty($EM_Event->event_attributes['hide_event']) ){
$replacement = preg_replace("/\{\/?$condition\}/", '', $match);
}else{ $replacement = ''; }
}
return $replacement;
}
btw, hide_event is an event attribute
Is this documented anywhere so I can read up a little more on a explanation of the use of hide_event? I dont understand what condition has to be met to add the hide_event attribute. And is this only saving the hide_event attribute to the current object?
I guess Im missing something. Is the attribute added in the plugin or in the code? Seems like the conditional placeholder example is looking for has_style which I suspect has been added to a field.
Is your hide_event example adding the hide_event attribute or setting it?
Is it possible for me to dynamicly add attributes to a custom field? Like if I have a custom field for users and when new users are added to the site a user attribute is added to the user custom field?
My example hide_event is an event attribute which I set in Settings > general > event attribute and that conditional placeholder will do something like {has_attribute}#_ATT{display_url}{/has_attribute}
yes, its possible http://codex.wordpress.org/Custom_Fields then you can hook up to the new user registration http://codex.wordpress.org/Plugin_API/Action_Reference