Title: [Plugin: Events Manager] Display by Attribute
Last modified: August 20, 2016

---

# [Plugin: Events Manager] Display by Attribute

 *  [Lee Rickler](https://wordpress.org/support/users/bigbadboy/)
 * (@bigbadboy)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/)
 * I am trying to only show events according to attribute – is this possible?
 * Example:
    I add a new attribute – ‘Assigned to’ I add a name (current logged 
   in username) to the ‘Assigned to’ field in the event form
 * So, I assign an event to Bob, Bob logs in and now he can see only that event.
 * How can I show events where that “assigned to’ username matches the logged in
   username?
 * [http://wordpress.org/extend/plugins/events-manager/](http://wordpress.org/extend/plugins/events-manager/)

Viewing 15 replies - 1 through 15 (of 24 total)

1 [2](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/page/2/?output_format=md)

 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/#post-2318910)
 * not possible atm, but you can use general arguments to filter events by owner
   [http://wp-events-plugin.com/documentation/event-search-attributes/](http://wp-events-plugin.com/documentation/event-search-attributes/)
   and using shortcodes [http://wp-events-plugin.com/documentation/shortcodes/](http://wp-events-plugin.com/documentation/shortcodes/)
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/#post-2318920)
 * could be done, but you’d have to code this yourself, I advise you also check 
   the tutorials here: wp-events-plugin.com/tutorials/
 *  Thread Starter [Lee Rickler](https://wordpress.org/support/users/bigbadboy/)
 * (@bigbadboy)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/#post-2318930)
 * I changed things around a little bit and came up with this which looks for the
   owner of the event and checks that against the logged in user.
 * So, if you have events ‘owned’ by you and you’re logged in you’ll only see those
   events:
 * `<?php echo do_shortcode('[events_list category="8" owner="' . $current_user-
   >ID . '"]'); ?>`
 * Oh .. and trust me, I spent most of yesterday trawling through the very comprehensive
   support files!
 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/#post-2318932)
 * thanks for sharing…
 *  Thread Starter [Lee Rickler](https://wordpress.org/support/users/bigbadboy/)
 * (@bigbadboy)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/#post-2318951)
 * Apologies for changing this to unresolved – I thought it was but obviously I 
   spoke too soon!
    The above works in the instance of narrowing by owner – I need
   to drill down to only display by attribute.
 * For example, if the attribute is:
    `#_ATT{Assigned to}` how would I use that 
   in this:
 * `<?php echo do_shortcode('[events_list category="8" owner="' . $current_user-
   >ID . '"]'); ?>`
 * I tried
 * `<?php echo do_shortcode('[events_list category="8" att="' . $current_user->ID.'"]');?
   >`
 * and
 * `<?php echo do_shortcode('[events_list category="8" #_ATT{Assigned to}"' . $current_user-
   >ID . '"]'); ?>`
 * but nothing is working.
 *  [manderson143](https://wordpress.org/support/users/manderson143/)
 * (@manderson143)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/#post-2318956)
 * I’m not familiar with this plugin, but I’m wondering if there is a place in the
   code where it states who created this event. Meaning, if you as the admin create
   the event.. can you then go to that particular event and change the name of the“
   owner”? Is there such a place to do this on each event?
 * Sorry if this isn’t a solution, was just thinking of ways the “event” would document
   who “created” it.
 * And if this is a possibility, then this is certainly a plugin I may be interested
   in implementing!
 *  Thread Starter [Lee Rickler](https://wordpress.org/support/users/bigbadboy/)
 * (@bigbadboy)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/#post-2318957)
 * [@manderson143](https://wordpress.org/support/users/manderson143/) – Agreed –
   I’ve spent the last few days pondering the different ways of displaying and selecting
   the events.
 * Filtering by attribute seems the only real way as their are so many permutations:
   
   John can create an event, assign the event to someone else, but not own it Jack
   can create an event and own it, not assign it to anyone except, perhaps, himself
   Jill can create an event and take full ownership, assigned to all functions etc
 * This plugin is awesomely powerful … I just need to push it/ myself a bit and 
   it’ll be even more awesomer!
 * BTW – yes, you can change the ‘owner’ – The owner panel is on the right side 
   of the ‘create an event’ page and imports all your members.
    So … I can create
   an event but assign you as the owner.
 *  [manderson143](https://wordpress.org/support/users/manderson143/)
 * (@manderson143)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/#post-2318962)
 * I do have to apologize.. I AM familiar with it, in fact I’m using it, but as 
   the CALENDAR.. (was thinking the plugin I was using had “calendar” in it’s name..
   silly me!)..
 * Hmmm.. I get what you are trying to do and what a benefit .. So.. there needs
   to be a way to have the plugin display according to “assigned” field and not “
   own” field, right?
 * So what you are asking if it can do, would be greatly beneficial for anyone using
   this plugin..
 * OK.. I’m thinking of a way it might be done, but I have to figure out how to 
   write it down legibly.. I’ll be back! 😉
 *  Thread Starter [Lee Rickler](https://wordpress.org/support/users/bigbadboy/)
 * (@bigbadboy)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/#post-2318963)
 * Essentially, yes.
 * All I’m trying to do is use an added attribute, in my case ATT{Assigned to}, 
   in the shortcode.
 * Pushing it further I want to match the ‘assigned to’ attribute to the logged 
   in user – effectively only showing the logged in user events that have been assigned
   to him.
 *  [manderson143](https://wordpress.org/support/users/manderson143/)
 * (@manderson143)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/#post-2318964)
 * I have a site that I created where USER1 would get his log in information and
   the first page he sees is HIS login page. And then he’ll be able to go to whichever
   pages I have listed on his page.
 * So that part of it I have working.. I can get the exact plugin I used if you 
   need that.
 * Still thinking how to create USER1’s page and a USER2’s page and still allow 
   for anyone to assign an event to them.
 * May need a “calendar” page of their own that will let them only see theirs somehow(
   I know..that’s what you’re trying to do.. just had to say it out loud, sorta!
   😉 )
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/#post-2318984)
 * warning, don’t use the attributes for searching (i.e. SQL)! since they’re stored
   in one field as a serialized array, it wouldn’t serve you well in this respect
 * the only time I’d recommend filtering by attribute is when looping events in 
   PHP and checking the $EM_Event->attributes array before displaying the event.
 * if you want a field like ‘assigned to’, I’d recommend adding a custom attribute
   as per our tutorial : [http://wp-events-plugin.com/tutorials/](http://wp-events-plugin.com/tutorials/)
 * also, instead of do_shortcode, use something like `EM_Events::output(array('owner'
   =>get_current_user_id()))`, more powerful
 *  Thread Starter [Lee Rickler](https://wordpress.org/support/users/bigbadboy/)
 * (@bigbadboy)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/#post-2318985)
 * Marcus – I’ve read the tuts many times, thanks!
 * And thanks on the warning – A few changes I need to make I think.
 *  Thread Starter [Lee Rickler](https://wordpress.org/support/users/bigbadboy/)
 * (@bigbadboy)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/#post-2318987)
 * EDIT: Reading the files in further depth – How can I include/ exclude a specific
   category from the results:
 * I thought this would do it but, I’m not 100% sure I got it right:
    Include: `
   EM_Events::get(array('owner'=>$bp->displayed_user->id, 'category'=>8));`
 * Exclude:
    `EM_Events::get(array('owner'=>$bp->displayed_user->id, 'category'=
   >-8));`
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/#post-2319004)
 * we don’t have an exclude option, just include (which you got right)
 * to exclude you could put a commma seperated string of category IDs minus the 
   ones you don’t want.
 *  Thread Starter [Lee Rickler](https://wordpress.org/support/users/bigbadboy/)
 * (@bigbadboy)
 * [14 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/#post-2319013)
 * Looking good Marcus.
    I sent an email via your site – not sure if you got it.

Viewing 15 replies - 1 through 15 (of 24 total)

1 [2](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/page/2/?output_format=md)

The topic ‘[Plugin: Events Manager] Display by Attribute’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=3550347)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 24 replies
 * 7 participants
 * Last reply from: [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/plugin-events-manager-display-by-attribute/page/2/#post-2319109)
 * Status: not resolved