Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #42578
    Anonymous
    Inactive

    I really love the new permalink feature.

    To make it just perfect, I have a suggestion:

    Adding ‘user_trailingslashit’ to ’eme_event_url’ and ’eme_location_url’, as it will only add a triling slash if the blog is configured to use it

    Best/

    Andy

    E.g.:

    function eme_event_url($event) {

    global $wp_rewrite;

    if ($event != ”) {

    $the_link = $event;

    } else {

    if (isset($wp_rewrite) && $wp_rewrite->using_permalinks()) {

    $name=eme_permalink_convert(__(“events”,’eme’)).$event.”/”.eme_permalink_convert($event);

    $the_link = trailingslashit(site_url()).$name;

    } else {

    $events_page_link = eme_get_events_page(true, false);

    if (stristr ( $events_page_link, “?” ))

    $joiner = “&”;

    else

    $joiner = “?”;

    $the_link = $events_page_link.$joiner.”event_id=”.$event;

    }

    }

    return user_trailingslashit($the_link);

    }

    function eme_location_url($location) {

    global $wp_rewrite;

    if (isset($wp_rewrite) && $wp_rewrite->using_permalinks()) {

    $name=eme_permalink_convert(__(“locations”,’eme’)).$location.”/”.eme_permalink_convert($location);

    $the_link = trailingslashit(site_url()).$name;

    } else {

    $events_page_link = eme_get_events_page(true, false);

    if (stristr ( $events_page_link, “?” ))

    $joiner = “&”;

    else

    $joiner = “?”;

    $the_link = $events_page_link.$joiner.”location_id=”.$location;

    }

    return user_trailingslashit($the_link);

    }

    #46994
    Franky
    Keymaster

    I’ll take it into consideration, but the place where you use “user_trailingslashit” is wrong, because it also might add a “/” if no seo is used. The correct thing would be:

    $the_link = trailingslashit(site_url()).user_trailingslashit($name);

    #46995
    Anonymous
    Inactive

    That’s right …my bad 🙂

    #46996
    Anonymous
    Inactive

    I agree with andymax’s suggestion. Not only would it speed page loading by eliminating wasted data packet transmissions back and forth between visitor web browsers and servers, it also would eliminate thousands of server log entries per website per day due to user and bot redirects. Even websites that have no human visitors typically have thousands of bot page accesses per day and redirects bloat server logs by doubling the number of log entries.

    #46997
    Franky
    Keymaster

    admintiger: we are talking about “user_trailingslashit”, where the trailing slash only gets added if the user has defined this in his permalink setup.

    #46998
    Anonymous
    Inactive

    Sorry, I had misunderstood!

    #46999
    Franky
    Keymaster

    no prob, but I still like your feedback on this one 🙂

    #47000
    Anonymous
    Inactive

    If I now understand correctly, EME would terminate URL’s with slashes if a user specifies that WordPress permalinks have a form something like this:

    /%post_id%/%postname%/

    But not if they specify something like this:

    /%post_id%/%postname%

    It seems reasonable to follow the slash convention specified for WordPress links. However, as stated before, trailing slashes should be specified.

    #47001
    Franky
    Keymaster

    yup, that’s the reasoning behind user_trailingslashit.

    #47002
    Franky
    Keymaster

    done in trunk

Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.
Scroll to Top