WordPress.org

Ready to get started?Download WordPress

Forums

Remove slug from custom post type
Last character stripped when using suffix (1 post)

  1. Raul Illana
    Member
    Posted 2 years ago #

    Hi, I got the last character stripped when using a suffix.

    So, if we have a slug something and a suffix html, we end up with an url like somethin.html.

    I'm using /%postname%.html globally.

    I hope this can be solved changing line 124 and 125 of file remove-slug-custom-post-type.php:
    if (!empty($suffix)) $permalink = substr($permalink, 0, -1) . ".{$suffix}";

    To:

    if( !empty($suffix) )
    if( substr($permalink, -1) == '/' )
    $permalink = substr($permalink, 0, -1) .'.'. $suffix;
    else $permalink = $permalink .'.'. $suffix;

    Best. :)

    http://wordpress.org/extend/plugins/remove-slug-from-custom-post-type/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic