Пример #1
0
function cimy_uef_register_css()
{
    global $cuef_css_webpath;
    if (!cimy_uef_is_register_page()) {
        return;
    }
    wp_register_style("cimy_uef_register", $cuef_css_webpath . "/cimy_uef_register.css", false, false);
    wp_enqueue_style("cimy_uef_register");
    wp_register_style("cimy_uef_register_nousername", $cuef_css_webpath . "/cimy_uef_register_nousername.css", false, false);
    if (!is_multisite()) {
        $options = cimy_get_options();
        if (!in_array("username", $options["wp_hidden_fields"])) {
            wp_enqueue_style("cimy_uef_register_nousername");
        }
        if (in_array("password", $options["wp_hidden_fields"])) {
            // this CSS will hide the label "A password will be e-mailed to you."
            wp_register_style("cimy_uef_register_nopasswordlabel", $cuef_css_webpath . "/cimy_uef_register_nopasswordlabel.css", false, false);
            wp_enqueue_style("cimy_uef_register_nopasswordlabel");
        }
    }
    cimy_uef_init_javascripts("show_in_reg");
    // needed till they fix this bug: http://core.trac.wordpress.org/ticket/17916#comment:18
    wp_print_styles();
}
function cimy_uef_validate_username($valid, $username)
{
    $options = cimy_get_options();
    if (!in_array("username", $options["wp_hidden_fields"]) && empty($username) && cimy_uef_is_register_page()) {
        return true;
    }
    return $valid;
}