Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ok I am fairly new to wordpress and PHP but here is what I did which requires my users who sign up to have @gmail.com in their email address.

    Edit your fuctions-formatting.php file in you wp-includes folder like the following.

    Here is the original block of code.


    function is_email($user_email) {
    $chars = "/^([a-z0-9+_]|\-|\.)+@(([a-z0-9_]|\-)+\.)+[a-z]{2,6}$/i";
    if(strstr($user_email, '@') && strstr($user_email, '.')) {
    if (preg_match($chars, $user_email)) {
    return true;
    } else {
    return false;
    }
    } else {
    return false;
    }
    }

    Here is the edited block.


    function is_email($user_email) {
    $chars = "/^([a-z0-9+_]|\-|\.)+@(([a-z0-9_]|\-)+\.)+[a-z]{2,6}$/i";
    if(strstr($user_email, '@gmail') && strstr($user_email, '.com')) {
    if (preg_match($chars, $user_email)) {
    return true;
    } else {
    return false;
    }
    } else {
    return false;
    }
    }

    That should do it. I do not know how allow only two or three, but I think you were only looking to limit it to one.

    Thread Starter gazotem

    (@gazotem)

    I want to allow Author 1 to post to the Category “Author 1” and below, not its parent category “Main”. userextra Is what I have been using to set up what categories are allowed and denied in regards to specific users.

    Ill try to make it more clear.

    1st Category -> Sub Category 1 -> Sub-Sub Category 1.

    I want Author 1 to be denied posting abilities to 1st Category but enabled to post to Sub Category 1 and below.

    userextra allows me for each user to say which categories they can post to, but I believe it is only the Parent categories that it takes into consideration.

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