WordPress.org

Ready to get started?Download WordPress

Forums

WP Category Permalink
[resolved] Error in JS-File (4 posts)

  1. fuchsws
    Member
    Posted 1 year ago #

    there is an error in the JS file adding the BOLD-Tag to the selected category in the article list view. it replaces sometimes, if the category slug is the same as the category title, the link parameter (/wp-admin/edit.php?category_name=<b>slug</b>) instead of the title.

    quickfix to "wp-category-permalink.js" Line 68:
    categoriesHtml = categoriesHtml.replace('>'+category+'<', '><b>' + category + '</b><');

    http://wordpress.org/extend/plugins/wp-category-permalink/

  2. Jordy Meow
    Member
    Plugin Author

    Posted 1 year ago #

    Done, I will apply this in the next release. Thanks a lot!

  3. stefazbagien
    Member
    Posted 11 months ago #

    Hi. The error still exists if the Alo EasyMail Newsletter plugin is installed and you are on the newsletter list page.
    Error is thrown at line 70:
    content = content.replace('>'+category+'<', '><b>' + categoryWithHtml + '</b><');
    The message is: Uncaught TypeError: Cannot call method 'replace' of undefined.
    For me it looks like on the page exists element with class "column-scategory_permalink", but there is no element with class "column-categories", and content is undefined - see line 69:
    var content = jQuery(this).children('.column-categories').html();

    Can you please take a look? Thanks!

  4. stefazbagien
    Member
    Posted 11 months ago #

    I forgot to post my proposal of changes. My code is:

    var content = jQuery(this).children('.column-categories').html();
    if (content) {
    content = content.replace('>'+category+'<', '><b>' + categoryWithHtml + '</b><');
    jQuery(this).children('.column-categories').html(content);
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.