latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Changing WordPress text in the login page

Home Forums Community Forum Unofficial Extensions/Hacks Changing WordPress text in the login page

This topic contains 2 replies, has 2 voices. Last updated by  Eduan 3 years, 11 months ago.

Topic Author Topic
Posted: Wednesday Jul 25th, 2012 at 11:30 am #20206
Eduan
Username: Eduan
Moderator

Hello everyone,

I have needed to post this hack a couple of times, so I decided to just make a post here.

What it does:

It basically changes some text that you would have to hack WordPress itself to change. So for example the submit button, you may want to change it from “Register” to “Submit” or “Sign up”, so this hack allows you to do this easily.

How to install:

Make a PHP file named “text-replacing-hack.php” (without the quotes) and inside it put the following code:

<?php
if(strpos($_SERVER['REQUEST_URI'], '/wp-login.php') === TRUE) { // Change the condition so that it points to the page in which you want to change the text
	add_filter('gettext', 'my_translations', 10, 3);
	
	function my_translations($translated, $original, $domain) {
		if($original === 'Register') // Change this so that it reflects the text you want to translate
			$translated = 'Submit'; // Change this so that it reflects the text you want to replace it with

		return $translated;
	}
}

Now, make sure you put this file in a folder named “mu-plugins”, it stands for Must-use Plugins, this folder must go under wp-content/mu-plugins.

So the structure should be wp-content/mu-plugins/text-replacing-hack.php.

Hope this helps people. :)

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Saturday Jan 19th, 2013 at 8:13 pm #38355
John Hart
Username: struth

Nice work, (Bookmarked)

Thanks for sharing.

Posted: Sunday Jan 20th, 2013 at 2:38 pm #38457
Eduan
Username: Eduan
Moderator

Glad it’s helpful. :)

Just for future reference, this post in my website is gonna get updated if anything changes, while this one isn’t, just an FYI: http://eduantech.com/2012/08/wordpress-text-replacing-hack/

– Eduan

Viewing 2 replies - 1 through 2 (of 2 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.