WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Set the name of the event contact person as WP user profile link (18 posts)

  1. Audee
    Member
    Posted 2 years ago #

    Is there any way to set the name of the event contact person as in the
    #_CONTACTNAME placeholder to WordPress user profile link?

    Just thinking so it will be possible for the visitors to track any events made by certain (the same) WP user.

    Thanks!

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 2 years ago #

    There's alot of tutorials here that can help you do that http://wp-events-plugin.com/tutorials/

    Also you can add action and filter hooks to do that.

  3. Audee
    Member
    Posted 2 years ago #

    Hello agelonwl,

    I forgot which Events Manager version that I was using, and that now I already upgraded to Event Manager Extended, this User profile link/URL setting is actually possible with certain placeholders #_CONTACTPROFILELINK & #_CONTACTPROFILEURL but unfortunately only when BuddyPress enabled.

    Thank you for the help!

  4. agelonwl
    Member
    Posted 2 years ago #

    Events Manager and Events Manager Extended are two different plugins.

  5. Audee
    Member
    Posted 2 years ago #

    I have tried them both. It's not that different from the look. Only the 'extended' version is improved with more features.

    I can not upgrade from Events Manager (EM) to Events Manager Extended (EME) it is true. So what I said previously was my mistake. I needed to disable/un-installed the EM in order to run the EME plugin.

  6. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    extended isn't an improved version of EM, EME is based of EM 2.x whereas EM has been rewritten a few times since then.

    due to the fact the EME uses some EM code, it conflicts, so you can't activate both together.

    hopefully Franky will change the name soon to avoid confusion.

  7. Audee
    Member
    Posted 2 years ago #

    EME is not an improved version of EM ~ but EME is based of EM.

    ~ noted!

  8. jnz31
    Member
    Posted 2 years ago #

    so why do you have to enable buddypress to link to the authors page of an event..??
    or could this be solved on another route?

  9. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    could be solved by another route, e.g. with a shortcode like [events_list owner=x]

  10. jnz31
    Member
    Posted 2 years ago #

    hi marcus, thanks for the quick reply

    could you get a bit more specific, please?
    i tried
    <a href="[events_list owner=#_CONTACTUSERNAME]">#_CONTACTUSERNAME</a>
    but that pulls out a list (guess you picked the wrong shortcode)
    so i tried [event owner=#_CONTACTUSERNAME] but that wouldnt pull out a link or anything similar neather.. so i searched a bit more but i couldnt find any proper combination / value.

    thx

  11. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    where are you trying to do this? you can't use placeholders within a shortcode.

    what you're doing there is listing events, not building a link. x in my example assumes you know the user you're generating the list for.

    BP automatically has an author/member section, so it's easy for EM to set up and hook into. You probably want to build a user profile page somehow and output the events with this sort of shortcode or the equivalent php e.g.

    echo EM_Events::output(array('owner'=>x));

    where x is the user id.

  12. jnz31
    Member
    Posted 2 years ago #

    hi marcus

    thanks for your help.

    im inside of the settings of EM. on the Default single event format i want to pull out a link to the author of the event. each event author is also an wp-author on the page and posts its very own events..

  13. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    well, if you check your author url structure, you could create a normal html link and use #_CONTACTUSERNAME as the username, e.g.

    yoursite.com/members/#_CONTACTUSERNAME/

  14. jnz31
    Member
    Posted 2 years ago #

    but that would pull out the username, not the users slug.
    i have a user called "Ben 51", its slug is ben-51, and your solution would pull out yoursite.com/members/Ben 51/ what would end up in 404.

  15. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    Have you tried the other placeholders here - http://wp-events-plugin.com/documentation/placeholders/

    Are you sure you're using the above placeholder? this shouldn't be a full name, it should show the actual username.

    if your user urls use slugs and not usernames within the url, ylu'd have to make your own placeholder e.g. http://wp-events-plugin.com/tutorials/create-a-custom-placeholder-for-event-formatting/

  16. jnz31
    Member
    Posted 2 years ago #

    user_name != user_nicename ;)

    thanks marcus for pushing me in the right direction. here is my filter that replaces #_JNZCONTACTURL

    add_filter('em_event_output_placeholder','jnz_author_url',1,3);
    function jnz_author_url($replace, $EM_Event, $result){
    	global $wp_query, $wp_rewrite;
    	switch( $result ){
    		case '#_JNZCONTACTURL':
    			$replace = $EM_Event->contact->user_nicename;
    	}
    	return $replace;
    }

    remember: this "only" pulls out the slug, not the complete url

    best
    jnz

  17. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    thanks for sharing your solution

  18. jnz31
    Member
    Posted 2 years ago #

    update (for EM 5.1.3):
    place this code into your functions.php

    the placeholder is called #_JNZCONTACTURL

    add_filter('em_event_output_placeholder','jnz_author_url',1,3);
    function jnz_author_url($replace, $EM_Event, $result){
    	global $wp_query, $wp_rewrite;
    	switch( $result ){
    		case '#_JNZCONTACTURL':
    			$replace = get_the_author_meta( 'user_nicename', $EM_Event->event_owner );
    	}
    	return $replace;
    }

    please note: this only pulls out the author slug, not any "authors" or whatever custom URL structure..

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic