Events Manager
[resolved] EM_URI and domain mapping (request with small patch) (5 posts)

  1. Fee
    Posted 2 years ago #


    there's a very small issue with domain mapping on multisite: The "all events" link in the events widget links the original domain (like subdomain.domain.com) not the mapped domain (like otherdomain.com). This happens because the EM_URI is defined before the domain mapping definings are added to get_permalink.

    Here are two solutions, could you please integrate one of them in the next version?

    solution 1 (I prefer this because it would adjust other maybe wrong links, too):
    change em_get_link in em-template-tags.php (line 175): Don't use here the constant but the get_permalink (because this is called after domain mapping):

    function em_get_link( $text = '' ) {
    	$text = ($text == '') ? get_option ( "dbem_events_page_title" ) : $text;
    	$text = ($text == '') ? __('Events','dbem') : $text; //In case options aren't there....
    	return '<a href="'.esc_url(get_permalink(get_option("dbem_events_page"))).'" title="'.esc_attr($text).'">'.esc_html($text).'</a>';

    solution 2:
    change the all-events link only direct in the widgets/em-events.php



  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    Hi Fee,

    Will look into this, but chances are it'll probably have to be for the following update, not the next one, as EM_URI is used everywhere and I'd like to push out an update asap.

  3. Fee
    Posted 2 years ago #

    Hi Marcus,

    thanks for your quick reply. I'm facing more domain mapping issues at the moment, so my suggestions maybe aren't the best yet. Some more time is good.

    But looking through your code, I found another thing: is_main_blog() is used in some places, e.g. em_load_event()
    This function is deprecated, please replace with is_main_site()
    (if it isn't part of your update yet)

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    it wasn't but it will be now :) thanks for spotting that, didn't realize it got depreciated

  5. Fee
    Posted 2 years ago #

    Hi Marcus,
    Domain Mapping (by incsub) has been updated now, so I could face these issues better. I'm not sure if the issues now still rely on Domain Mapping.
    I've opened a new thread because I think Domain Mapping issue is solved.
    If someone is facing Domain mapping issues here (with the plugin by wpmudev/incsub) you'll find a solution here: wpmuDev forums

Topic Closed

This topic has been closed to new replies.

About this Plugin

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

About this Topic