Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I change the word “wanna” with a plugin?


  • chrishajer
    Participant

    @chrishajer

    There are a couple place where bbPress uses the word “wanna” as in “are you sure you wanna do that”. I’d like to change that to something more professional, like “want to” but I don’t want to change the core. How can I accomplish that with a plugin?

    Using bbPress Alpha trunk (but this “wanna” wording has existed for a long time, maybe back to 0.73). The word wanna can be found in these files:

    ./bb-includes/js/topic.js
    ./bb-includes/functions.bb-script-loader.php
    ./bb-includes/functions.bb-script-loader.php
    ./bb-includes/functions.bb-template.php
    ./bb-includes/functions.bb-template.php

    Thank you.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You can create a function to remove wanna and add something new. This is an example that Ipstenu provided in another thread;

    // This sets closed lable to read as 'read only' instead of 'closed'
    remove_filter('bb_topic_labels', 'bb_closed_label');
    function my_closed_label( $label ) {
    global $topic;
    if ( '0' === $topic->topic_open )
    return sprintf(__('[Read Only] %s'), $label);
    return $label;
    }
    add_filter('bb_topic_labels', 'my_closed_label');

    1 You find the function where “wanna” is.

    2 Next, you copy/paste the function between remove/add filter lines of the code above.

    3 Modify the copy-pasted function; change “wanna” for “want to”

    4 Then, rename that function with a new name, ie “no_wanna”

    5 Change accordingly the remove/add lines

    6 Finally, place the whole code in a plugin or a functions.php in the template folder.

    Another option is probably using a language file but I don’t know if you can set an english-english file.


    chrishajer
    Participant

    @chrishajer

    The language file is an interesting idea. I’ve done that in the past with WordPress to change terminology. Thanks also for posting the way to do it with a plugin. I will try one of those two options.

    Thanks.

    chris, add that code to your functions.php in your theme folder. No plugins needed.


    _ck_
    Participant

    @_ck_

    Uh, you are talking about text in the core?

    Not possible to change via a plugin.

    Only thing you could do is use the language translation filters and do an “english to english” translation of the phrases you want to change. Note that it adds some overhead but I guess everything in bbPress does.

    There is one other scary method you could use and that would be to capture php’s output buffering and change it on the fly. That would be an extremely ugly workaround.

    Uh, you are talking about text in the core?

    Not possible to change via a plugin.

    Why not? In another thread Sam suggested to do so. I have stuff that I need to change in functions.bb-template.php and functions.bb-template.php and functions.bb-core.php. So far I’ve been editing these files but It should be more convenient to do the changes with a plugin/functions.php


    chrishajer
    Participant

    @chrishajer

    I knew this was going to be a good discussion :-)


    _ck_
    Participant

    @_ck_

    I guess I should have added the word CURRENTLY.

    Not CURRENTLY possible to change via a plugin.

    But you won’t see them do it via a plugin at any time anyway.

    Translation hooks can already do it, it’s just a pain to do.

    Right now there is only one person working on the bbPress core and I wouldn’t go distracting him with stuff like this when there is plenty of far more serious work to be done.

    Right now there is only one person working on the bbPress core and I wouldn’t go distracting him with stuff like this when there is plenty of far more serious work to be done.

    I get lost. What does Sam have to do with all of this? The one who is going to produce the plugin for himself is the one that is interested in the plugin.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar