Change all instances of 'Events' to 'Classes' – Solution doesn't work

Home Forums Calendar Products Events Calendar PRO Change all instances of 'Events' to 'Classes' – Solution doesn't work

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #790141
    yearntolearn
    Participant

    The solution provided here https://theeventscalendar.com/support/documentation/changing-the-word-events-to-something-else/ does not work as you end up with ‘Classs’ rather than ‘Classes’ and so on.
    The solution only works on words where the plural is not formed by adding an ‘es’

    #790379
    codeink
    Participant

    Experiencing the same issue.

    #791653
    Barry
    Member

    I’m sorry to hear that. Are you using it “as is” or have you modified it at all (if you modified it, can you share your modified code via Pastebin, Gist or some similar service)?

    Certainly when testing locally it seems to work as expected. Are there any specific areas you’re finding it does not cover?

    #791662
    codeink
    Participant

    Site title (in browser), navigation links in particular are two areas I remember off the top of my head. They show as “Classs” instead of “Classes”. Using the code “as is” with the swapping of words only (Class / Classes)

    #791800
    Barry
    Member

    Hi!


    @codeink
    : can you share a URL pointing me to an example where this fails to work as expected in the browser title (or tell me more specifically which views this fails on)? If you prefer to open a new thread – which will allow you to share your URL in confidence – definitely feel free to do so.

    Re navigation links, if you mean custom links within a regular WordPress nav menu then you would need to update this manually – those are not translated (nor in fact are any custom links).

    They show as “Classs” instead of “Classes”.

    So it sounds like you may need to refine your str_replace() code a little – best I can tell there is no similar situation with the original snippet.

    Please feel free to share your modifications via Pastebin/Gist and I’ll take a quick look – but please do remember we provide things like this snippet as a starting point and if you need to tailor it to your own situation that’s normally something you need to drive forward.


    @yearntolearn
    : how are you getting on here?

    #792412
    yearntolearn
    Participant

    Hi Barry,

    The code was not modified at all apart from replacing the instances of Meeting, Meetings, meeting & meetings that appeared in th code snipped with Class, Classes, class and classes. As i mentioned, the solution ONLY works on words where the plural is not formed by adding an ‘es’

    #792414
    yearntolearn
    Participant

    This reply is private.

    #792516
    Barry
    Member

    OK – so can you try changing the order of each array such that plurals are converted first of all?

    Otherwise, “Events” will be converted to “Classs” – leaving a dangling “s” as you’ve noticed.

    #792722
    yearntolearn
    Participant

    The don’t call you Clever Pete for nothing!

    #793428
    Barry
    Member

    Hah! Happy to help 🙂

    I’ll go ahead and close this thread – but if anything else crops up please do just create new threads as needed.

    Thanks again!

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Change all instances of 'Events' to 'Classes' – Solution doesn't work’ is closed to new replies.