Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_ajax_add_user [ WordPress Function ]

wp_ajax_add_user ( $action )
Defined at:



No description yet.

Source


<?php
function wp_ajax_add_user$action ) {
    global 
$wp_list_table;
    if ( empty( 
$action ) )
        
$action 'add-user';

    
check_ajax_referer$action );
    if ( ! 
current_user_can('create_users') )
        
wp_die( -);
    if ( ! 
$user_id edit_user() ) {
        
wp_die);
    } elseif ( 
is_wp_error$user_id ) ) {
        
$x = new WP_Ajax_Response( array(
            
'what' => 'user',
            
'id' => $user_id
        
) );
        
$x->send();
    }
    
$user_object = new WP_User$user_id );

    
$wp_list_table _get_list_table('WP_Users_List_Table');

    
$x = new WP_Ajax_Response( array(
        
'what' => 'user',
        
'id' => $user_id,
        
'data' => $wp_list_table->single_row$user_object''$user_object->roles[0] ),
        
'supplemental' => array(
            
'show-link' => sprintf(__'User <a href="#%s">%s</a> added' ), "user-$user_id"$user_object->user_login),
            
'role' => $user_object->roles[0]
        )
    ) );
    
$x->send();
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics