Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi,

    You should be able to use this kind of function in the functions.php file of your WordPress theme:

    function my_em_text_rewrites($translation, $orig, $domain) {
    	str_replace('locations','venues', $translation);
    	return $translation;
    }
    add_action ( 'gettext', 'my_em_text_rewrites', 1, 3 );

    The above will “translate” the word locations to venues.

    Thread Starter mrppp

    (@mrppp)

    OK had a good think on this.
    So looking at how things work I would like to be able to have:
    Events as gig venue i.e gigs where bands will play.
    Locations as “BANDS” i.e the name of the band.
    So I would have a band submit there band company in locations then add the event “gig venue” they will be playing at.

    So I guess I need all reference to location to be band and all reference to event to be gig venue would this work

    Does this make sense?

    Hiya,

    That would be possible using the method Caimin suggested above.

    Thanks,
    Phil

    Thread Starter mrppp

    (@mrppp)

    so like this

    function my_em_text_rewrites($translation, $orig, $domain) {
    	str_replace('locations','Band Name', $translation);
    	return $translation;
    }
    add_action ( 'gettext', 'my_em_text_rewrites', 1, 3 );
    
    <strong>then also add</strong>
    function my_em_text_rewrites($translation, $orig, $domain) {
    	str_replace('Events','Venue of Gig', $translation);
    	return $translation;
    }
    add_action ( 'gettext', 'my_em_text_rewrites', 1, 3 );

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Thread Starter mrppp

    (@mrppp)

    Oh SORRY!

    function my_em_text_rewrites($translation, $orig, $domain) {
    	str_replace('locations','BANDS', $translation);
    	return $translation;
    }
    add_action ( 'gettext', 'my_em_text_rewrites', 1, 3 );
    
    <strong>then also add</strong>
    function my_em_text_rewrites($translation, $orig, $domain) {
    	str_replace('Events','gig venue', $translation);
    	return $translation;
    }
    add_action ( 'gettext', 'my_em_text_rewrites', 1, 3 );

    Thread Starter mrppp

    (@mrppp)

    ok tried the code but makes no difference

    That should work – except you can’t have more than one function with same name, so you’d need to do something like this:

    function my_em_text_rewrites($translation, $orig, $domain) {
    	str_replace('locations','BANDS', $translation);
    	return $translation;
    }
    add_action ( 'gettext', 'my_em_text_rewrites', 1, 3 );
    
    function my_em_text_rewrites2($translation, $orig, $domain) {
    	str_replace('Events','gig venue', $translation);
    	return $translation;
    }
    add_action ( 'gettext', 'my_em_text_rewrites2', 1, 3 );

    You can see I’ve added a number to the end of the second function and then again in the add_action line where it’s called.

    Thread Starter mrppp

    (@mrppp)

    Thank you for your time.
    Have tried above but unless I am placing in wrong position in functions.php page or something else, nothing appears to change, the add event form for instance no change

    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    unfortunately this isn’t something we can help you with specifically, the code above is a starting point.

    one thing to consider above is capitalization, you porbably need a function for each variation. also, you may need to change formatting in the settings page.

    you’ll probably need to hire a developer for this sort of customization – https://jobs.wordpress.net

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘text’ is closed to new replies.