Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions.php: What is this code for? #10

Open
rcass opened this issue Dec 14, 2017 · 7 comments
Open

Functions.php: What is this code for? #10

rcass opened this issue Dec 14, 2017 · 7 comments

Comments

@rcass
Copy link

rcass commented Dec 14, 2017

Noticed this:

// SIGN IN PAGE (PASSWORD IS SHOWING. NEEDS TO BE FIXED)
// http://smallenvelop.com/how-to-get-password-fields-in-contact-form-7/
function cfp($atts, $content = null) {
	extract(shortcode_atts(array( "id" => "", "title" => "", "pwd" => "" ), $atts));

	if(empty($id) || empty($title)) return "";

	$cf7 = do_shortcode('[contact-form-7 404 "Not Found"]');

	$pwd = explode(',', $pwd);
	foreach($pwd as $p) {
			$p = trim($p);

			$cf7 = preg_replace('/<input type="text" name="' . $p . '"/usi', '<input type="password" name="' . $p . '"', $cf7);
	}

	return $cf7;
}
add_shortcode('cfp', 'cfp');

Just wondering what you are trying to achieve with this 🤔

@Lateworm
Copy link
Collaborator

We're trying to create a password field where each character typed is rendered as a dot instead of actually showing the password.

@Lateworm
Copy link
Collaborator

It's not working yet.

@rcass
Copy link
Author

rcass commented Dec 15, 2017

For wp-login?

@rcass
Copy link
Author

rcass commented Dec 15, 2017

Oh, if this is for the 'sign in' page, that is something we are not building at all. Sorry, if that wasn't clear, Hamdy asked Jim and I about this the other day. Basically when someone clicks sign in it is going to lead to a whole separate application.

Basically the link in the menu, at this point, should lead no where, since we do not have a link to their application.

@hamdyfarah13
Copy link
Collaborator

Removed!

@rcass
Copy link
Author

rcass commented Dec 21, 2017

Looks a lot cleaner 👍

@rcass
Copy link
Author

rcass commented Dec 21, 2017

Hmmm... I noticed this code was just moved to inc/extras.php 👎

// SIGN IN PAGE (PASSWORD IS SHOWING. NEEDS TO BE FIXED)
// http://smallenvelop.com/how-to-get-password-fields-in-contact-form-7/
function cfp($atts, $content = null) {
extract(shortcode_atts(array( "id" => "", "title" => "", "pwd" => "" ), $atts));
if(empty($id) || empty($title)) return "";
$cf7 = do_shortcode('[contact-form-7 404 "Not Found"]');
$pwd = explode(',', $pwd);
foreach($pwd as $p) {
$p = trim($p);
$cf7 = preg_replace('/<input type="text" name="' . $p . '"/usi', '<input type="password" name="' . $p . '"', $cf7);
}
return $cf7;
}
add_shortcode('cfp', 'cfp');

What is the reasoning for keeping this? I think this code should be removed to avoid future confusion.

@rcass rcass reopened this Dec 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants