redacademy / hummingbird-fall-2017

1 stars 0 forks source link

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

Open rcass opened 6 years ago

rcass commented 6 years ago

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 commented 6 years ago

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

Lateworm commented 6 years ago

It's not working yet.

rcass commented 6 years ago

For wp-login?

rcass commented 6 years ago

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 commented 6 years ago

Removed!

rcass commented 6 years ago

Looks a lot cleaner 👍

rcass commented 6 years ago

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

https://github.com/redacademy/hummingbird-fall-2017/blob/edac7f1345cb73af004539d8b7bc157667eb5e03/themes/hummingbird/inc/extras.php#L53-L71

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