• Members tried to alert the rank of change (contributor) to (writer) by adding the following code to the file functions.php:

    function user_role_update( $user_id, $new_role ) {
            $site_url = get_bloginfo('wpurl');
            $user_info = get_userdata( $user_id );
            $to = $user_info->user_email;
            $subject = "Role changed: ".$site_url."";
            $message = "Hello " .$user_info->display_name . " تمّ تغيير رتبتك في موقع".$site_url.", الرتبة الجديدة هي " . $new_role;
            wp_mail($to, $subject, $message);
    }
    add_action( 'set_user_role', 'user_role_update', 10, 2);

    Attempting to enter the site as usual, I was surprised:
    http://www.ar-wp.com/wp-content/uploads/2015/05/%D9%84%D9%82%D8%B7%D8%A9-%D8%A7%D9%84%D8%B4%D8%A7%D8%B4%D8%A9-32.png

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

The topic ‘my website crashes due to Add code’ is closed to new replies.